Login / Registrieren
DE EN FR ES IT CZ
Zurück Nach oben

Custom shader

  • #1, by stroncis 9 years ago Zitieren
    Hi,

    i'm trying to add custom shader, but to no avail. I tried concatenate with basic_fsh from shader toolkit, then tried to add full fragment shader (with declarations, not just main() method), all attempts fruitless.

    This must work, as i understand, because adding directly to shader_effects object, but it doesn't:
    shader_effects.solid = {shader = basic_fsh..[[
      void main() { 
        gl_FragColor = vec4(0.0, 0.7, 0.0, 1.0);
      }
    ]]}

    But this works:
    shader_effects.test = {shader = "sht_ascii.bin"}
    Though it's shader from shader toolkit and it would surprise me, if it didn't work. As i have no access to these *.bin files (which are compiled with the game and i haven't figured how this works exactly), can't compare their content with my code and figure it by myself.

    (RC0, free, latest shader toolkit from http://rollaprint.de/vs/shaderscript9.lua)

    Where's the catch?
    Thank You


    P.S.: If you copy/paste block of code, visionaire adds trailing spaces at end of each line, which accumulates with each new copy/paste.

    P.P.S.: If you will delete or comment out line with gl_FragColor in shader editor - Visionaire will crash. It can be avoided by first adding one more gl_FragColor and then commenting or deleting another.
  • #2, by afrlme 9 years ago Zitieren
    Are you using the new RC[0]? There's a new section for creating custom shaders available via the buttons on the main menu. Don't ask me how it works though as I have no clue - I'm afraid you will have to wait for Simon to provide you with an answer/example.
  • #3, by stroncis 9 years ago Zitieren
    I have no clue, how these new shaders can be incorporated, so tried the way i understand it must work, after reading into shader toolkit source. It's no hurry, i'll wait for SimonS comments, as i can see, he's getting now a lot of questions and bugs to hunt.

    Accessing it this way doesn't work:
    shader_effects.test = { shader = Shaders.rc_zero_shader }
  • #4, by afrlme 9 years ago Zitieren
    I have no clue, how these new shaders can be incorporated, so tryed the way i understand it must work, after reading into shader toolkit source. It's no hurry, i'll wait for SimonS comments, as i can see, he's getting now a lot of questions and bugs to hunt.

    Accessing it this way doesn't work:
    shader_effects["test"]= {shader=Shaders.rc_zero_shader}
    Aye, I'm surprised he's not drowning underneath the amount of questions & bug reports we all keep posting. razz

  • #5, by stroncis 9 years ago Zitieren
    Aye, I'm surprised he's not drowning underneath the amount of questions & bug reports we all keep posting. razz

    I think it's something to do with Immanuel Kant and "Ordnung muss sein".

  • #6, by afrlme 9 years ago Zitieren
    Aye, I'm surprised he's not drowning underneath the amount of questions & bug reports we all keep posting. razz

    I think it's something to do with Immanuel Kant and "Ordnung muss sein".

    I had to look up both the name & translate the German quote you wrote on account of not being German. I vaguely recognized the last name, but no idea from where. Maybe I've heard it on a TV/movie or mentioned in some book I've read or something...

  • #7, by stroncis 9 years ago Zitieren
    Aye, I'm surprised he's not drowning underneath the amount of questions & bug reports we all keep posting. razz

    I think it's something to do with Immanuel Kant and "Ordnung muss sein".

    I had to look up both the name & translate the German quote you wrote on account of not being German. I vaguely recognized the last name, but no idea from where. Maybe I've heard it on a TV/movie or mentioned in some book I've read or something...

    Ah, ok. Immanuel Kant is known not just as philosopher, but also for his punctuality (stories like "his neighboors set their clocks by Kant"). Germans are known for these traits - punctuality and order. So, my point being, that SimonS copes with such amount of bugs and questions thanks to that.

  • #8, by afrlme 9 years ago Zitieren
    haha... I think it's probably just a ton of coffee & not much sleep! grin
  • #9, by SimonS 9 years ago Zitieren
    Well I don't drink so much coffee. It's basically just order, I have tons of lists and I prioritize them.

    You can find some starting info for shaders here: http://www.visionaire-studio.com/luadocs/#shaders
  • #10, by afrlme 9 years ago Zitieren
    Well I don't drink so much coffee. It's basically just order, I have tons of lists and I prioritize them.

    You can find some starting info for shaders here: http://www.visionaire-studio.com/luadocs/#shaders
    Thanks for taking the elusive mystery out of it mate! You shall henceforth no longer be known as Simon the Sorcerer! :shakeshark:

  • #11, by stroncis 9 years ago Zitieren
    You can find some starting info for shaders here: http://www.visionaire-studio.com/luadocs/#shaders

    Thank You! And this is very good resource, i must say.

    P.S.: and maybe someone will find useful reference for GLSL to HLSL https://docs.microsoft.com/en-us/windows/uwp/gaming/glsl-to-...