Visionaire SHADER ToolKit for Visionaire Studio 5 Beta

  • #1, by lorenzoSaturday, 11. February 2017, 21:03 4 years ago
    Hello

    I would like to know if the shaders toolkit will be available under visionaire studio vers. 5 final. I try to use it under vers. 5 beta but nothing happen and often the system crash.

    thank you in advance

    Lorenzo

    Newbie

    3 Posts


  • #2, by PaupasiaSaturday, 11. February 2017, 21:42 4 years ago
    Hi Lorenzo,
    the old shader toolkit is not working with Visionaire 5, the script must be updated and they are working on it grin

    Forum Fan

    165 Posts

  • #3, by lorenzoSaturday, 11. February 2017, 22:20 4 years ago
    Hi Lorenzo,
    the old shader toolkit is not working with Visionaire 5, the script must be updated and they are working on it grin

    Thank you!

    Newbie

    3 Posts

  • #4, by SimonSSunday, 12. February 2017, 01:39 4 years ago
    The new shaderscript is here: http://rollaprint.de/vs/shaderscript9.lua

    Thread Captain

    1383 Posts

  • #5, by PaupasiaSunday, 12. February 2017, 02:20 4 years ago
    Great! You are a lightning! grin
    Just one question. The scipt to exclude interfaces/menu and to use them with scene objects remain the same?
    I mean:
    <b>This:</b>

    game.GameShaderExclude = eShaderExcludeInterfaces -- stops shader effects from affecting interfaces, texts &; mouse cursors etc.

    and this one:

    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"))

    --[[ that is tricky, it contains the settings for something we could call "effect channel",
    like in an audio mixer, send to channel 1 or such.
    So we say use the shader "eff" and composition method 5 and 4, list of methods here:

    0 GL_ZERO
    1 GL_ONE
    2 GL_SRC_COLOR
    3 GL_ONE_MINUS_SRC_COLOR
    4 GL_SRC_ALPHA
    5 GL_ONE_MINUS_SRC_ALPHA
    6 GL_DST_ALPHA
    7 GL_ONE_MINUS_DST_ALPHA
    8 GL_DST_COLOR
    9 GL_ONE_MINUS_DST_COLOR
    10 GL_SRC_ALPHA_SATURATE
    the comp dst means what of the destination goes into the equation
    and comp src the same for source.
    So we use the alpha channel of the source image (GL_SRC_ALPHA)
    and for the destination the inverse (GL_ONE_MINUS_SRC_ALPHA).
    Destination means our surface, source is the image we are drawing.
    If we use GL_ONE, GL_ONE you will see that image is like blended
    onto the surface because the colors are added.
    ]]

    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

    Objects.sea.ShaderSet = 1
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53

    Forum Fan

    165 Posts

  • #6, by SimonSSunday, 12. February 2017, 12:51 4 years ago
    Most remains the same. I only changed the way ShaderSet works. You don't need shaderSetOptions anymore, but just:
    Objects.Water.ShaderSet = shader_effects[eff].num()
    1

    Thread Captain

    1383 Posts

  • #7, by PaupasiaSunday, 12. February 2017, 13:58 4 years ago
    Thanks a lot Simon! grin

    Forum Fan

    165 Posts

Write post