License from €75
DE EN FR ES IT CZ

Shader Toolkit Effects not Working properly in 5.0RC2

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  1. · 9 years ago
    Hi all,

    Been struggling the last days with getting the Shader Toolkit Effects like warp1,ripple1, etc... to work on 5.0RC2 with no success.

    As a base start, i am using a nice test .ved by user 'unreal', see relevant post. The ved is NOT working in 5.0RC2 even when i replace the shader toolkit with latest version 0.95.

    See attached the updated ved with the 0.95 shader toolkit version, feel free to test it; if you manage to get it working on 5.0RC2 will buy u some beers razz

    Need your assistance to figure this out, thanks!




  2. Working on a game?

    The free version covers up to 25 scenes per project. For more scenes and to sell your game, you need a license. Forum readers get the Indie Bundle 15 % off with the code FORUM15: €84.15 instead of €99, valid until 31 Dec 2026.

    Get 15 % off Try it for free
  3. · 9 years ago
    Well, I cannot give you an easy Solution, but I can tell from looking at the new Shadertoolkit that it does not actually include the several Shaders inside the Script -- which makes Sense, because in Vis5 that does not work anymore. Strangely, I know that shaderBlur() still works fine, so I have no Idea how that works exactly (is it not Part of the Shader-Toolkit??). But if these Shaders you want do not work anymore, then go to the old Shadertoolkit-Script, look for the Areas which are huge Piles of different-looking Code inside of Strings, and copy those Parts into separate Shaders (in the Editor's new "Shader"-Category), and change the Codes until you get no Error-Messages at the Bottom anymore (I guess that is easier said than done, seems like most People on the Forum haven't looked much into GLSL-Coding, and I am also but a mere Amateur). Once you have done that, you can call the Shader with a Script very similar to how it worked in Vis4:
    local eff = "NAME_OF_THE_SHADER"
    
    shader_effects[eff] = { shader = Shaders[eff].Compiled }
    
    shaderAddEffect(eff)

    All of that might seem as of little Use if you do not know GLSL, but I personally tend to say that People should use their own Shaders if they can, it's actually kind of fun -- connects Coding, which I do not like so much, with creating visual Art, which I enjoy.
  4. · 9 years ago
    Thanks for the reply; well have managed to get all these effects working, but not on a specific object yet. The calling code suggested before in the forum doesn't seem to work any more:

    for example:
    local eff="ripple2"
    shaderAddEffect(eff) 
    shaderRemoveEffect(eff)
    shader_effects[eff].num.strength=1 
    bind(eff, "time", field("shader_iTime")) 
    
    shaderSetOptions({{shader = shader_effects[eff].num(), comp_dst=50, comp_src=4 }}, 1) 
    Objects.'object name'.ShaderSet = 1

    shaderRemoveEffect(eff) is VERY weird here and causes black screen. If it is commented out the effect is shown. (why we remove the effect here???)

    shader_effects[eff].num.strength=1
    bind(eff, "time", field("shader_iTime"))

    Above maybe not needed?? Because they are already included in shaderAddEffect(eff) function!

    local eff = "NAME_OF_THE_SHADER"

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

    shaderAddEffect(eff)
    Above sounds interesting, but how you can apply the effect to an object only?
  5. · 9 years ago
    The syntax for binding to object has changed because the shaderset numbers were clunky.


    Instead of 
    shaderSetOptions({{shader = shader_effects[eff].num(), comp_dst=5, comp_src=4 }}, 2)
    
    Objects.Water.ShaderSet = 2
    

    it's now:
    Objects.Water.ShaderSet = shader_effects[eff].num()
  6. · 9 years ago
    That was it , thanks so much! Had missed this part of the docs.

    Have checked all effects and they are working ok, except:

    ripple1
    ripple2
    highlight

    I have also noticed a 'light1' effect in the shader but doesn't seem to do anything.

    How can i remove an effect from an object? I guess it is not wise for performance purposes to leave an effect on an object forever, so i need to be able to detach an effect when leaving the scene.
  7. · 9 years ago
    Simple. smile
    shaderRemoveEffect(eff)
  8. · 9 years ago
    Yes i guess so,

    But!

    Let's say we have an effect assign to two objects, and i want to remove the effect from one object only?
  9. · 9 years ago
    I don't know of a specific Command for that, but you could, when removing the Effect, reiterate its Addition to the Opject you want it to keep. But I can see how that might be a little janky, and a Chore (depending on the Amount of Objects).

    Maybe Simon can anwer whether or not a Shader applied to an Object in a different Scene will still influence Performance in any Way at all (because if not, then why bother?), because you and I can only guess.
    (Well actually, I could apply some reeeally heavy Shader to something and check that Way... maybe I should try that out...)
  10. · 9 years ago
    (Well actually, I could apply some reeeally heavy Shader to something and check that Way... maybe I should try that out...)

    That would be nice (and easy i guess using the in-game dev console to check the system recources)
  11. · 9 years ago
    If the object is not shown, it wastes no performance. If you want to remove the effect do:

    Objects.Water.ShaderSet = -1
  12. · 9 years ago
    Thanks Simon, that is very useful to know. smile

    And yes, I just checked, as I said, and it is just like Simon says.

This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.

New thread

Really delete this post?