Shaders Manual / Tutorial ?

  • #1, by davide-berardiThursday, 31. May 2018, 22:26 2 years ago
    Hey guys, I've been looking for a manual / tutorial on how to use shaders in V5 with no success. Does anyone have links or suggestions?

    Thank you!

    Davide

    Newbie

    8 Posts


  • #2, by stroncisSaturday, 09. June 2018, 12:08 2 years ago
    Bread and butter: https://www.visionaire-studio.com/luadocs/

    Additionaly you just can enter keyword shader in forum LINK or wiki search fields.

    Though i doubt, that wiki is up to date.

    P.S.: weird, cannot add second link as LINK https://wiki.visionaire-tracker.net/index.php?title=Special%...

    Newbie

    42 Posts

  • #3, by afrlmeSaturday, 09. June 2018, 12:29 2 years ago
    There's a bunch of shader stuff & examples on the luadocs page, but it doesn't really explain how to use or write custom shaders. I think if you want to write custom shaders then you will likely have to use google to find some places to learn GLSL.

    Imperator

    6770 Posts

  • #4, by davide-berardiSaturday, 09. June 2018, 19:10 2 years ago
    Thanks guys. I had thought that shaders would work like particle effects, where there was no scripting needed. I guess I was wrong. Appreciate the help!

    Newbie

    8 Posts

  • #5, by afrlmeSaturday, 09. June 2018, 19:43 2 years ago
    Thanks guys. I had thought that shaders would work like particle effects, where there was no scripting needed. I guess I was wrong. Appreciate the help!
    No, unfortunately not, but maybe down the line Simon might implement some basic shaders that can be applied & tweaked with action parts like they have in Construct 2 - it would be nice for those of us that aren't familiar with GLSL. Oh well... here's hoping, eh? wink

    Imperator

    6770 Posts

  • #6, by stothewSaturday, 16. June 2018, 11:10 2 years ago
    at least a snippet how to bind the "ready ones" e.g. from shadertoolkit10 to single Objects would be nice.

    I found an old example but it did not work in V5. On the hole screen they work well.


    What i tried so far:
    local eff="ripple1" -- effect name

    -- the following lines are to make sure the shader is compiled,
    -- a shader is mini program, that needs to be compiled to use it

    shaderAddEffect(eff)
    shaderRemoveEffect(eff)

    -- this is a standard setting, the shader has a variable that is called strength, we set that to 1

    shader_effects[eff].num.strength=1

    -- also for any animation inside the shader, it needs the time,
    -- so we bind the variable time in the shader to our time

    bind(eff, "time", field("shader_iTime"))

    shaderSetOptions({{shader = shader_effects[eff].num(), comp_dst=5, comp_src=4 }}, 1)

    -- simplest thing of them, set the object "target_object" to the effect channel 1
    Scenes.stadtpark_see.Objects.gfx_see_wasser.ShaderSet = 1
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    and
    local eff = "ripple1"
    local obj = "gfx_see_wasser"

    shaderRemoveEffect(eff)
    shaderAddEffect(eff)

    bind(eff, "time", field("getTime()*0.001"))

    shader_effects[eff] = { shader = Shaders[eff].Compiled }

    Objects[obj].ShaderSet = shader_effects[eff].num.num
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    has anybody a working example?

    Forum Fan

    122 Posts

  • #7, by davide-berardiSaturday, 16. June 2018, 20:02 2 years ago
    @AFRLme: that would be nice! Together with a nice tutorial on the audio system smile

    Newbie

    8 Posts

  • #8, by stroncisTuesday, 19. June 2018, 12:35 2 years ago
    Thanks guys. I had thought that shaders would work like particle effects, where there was no scripting needed. I guess I was wrong. Appreciate the help!
    There are two shader creation/editing options for less/non code savvy users.

    One is something like visual node editing interface (f.e. Unity native Shader Graph or plugin Amplify), which is very complex thing to achieve and it's not reasonable for Visionaire to do.

    Second option is prebuild shaders (like ShaderToolkit for Visionaire), but integrated in game development platform GUI. Now this is in scope of features we can ask and hope for. Going further from this idea, it would lead to user custom shaders as plugins with bindings to custom GUI, easily shared in Visionaire community.

    Newbie

    42 Posts

Write post