Shader Toolkit and Load/Save

  • #1, by PykeTuesday, 07. October 2014, 02:15 10 years ago
    With the Shader Toolkit active, loading a game causes that loaded game to be completely whited out from the start. Interfaces aren't included in the shaders, and are also excluded from being 'whited out'.

    When the game is run without the Shader Toolkit, Load/Save works perfectly.

    Currently using 4.1, Build 1177

    I can give you guys the dump if needed - but Im pretty sure its something with the shaders! Ill take a look at a way to work around it tomorrow. wink

    Newbie

    59 Posts


  • #2, by SimonSThursday, 09. October 2014, 13:28 10 years ago
    I have updated the script, http://wiki.visionaire-tracker.net/wiki/Shader_(CMS) (the lua file link is not updated yet). The syntax of bind has changed, instead of
    bind(shader_effects["light1"].num,
    

    it's now only:
    bind("light1", 
    

    I haven't found a way to save them. So you must restore them somewhere like in "start of scene".

    Thread Captain

    1580 Posts

  • #3, by afrlmeThursday, 09. October 2014, 13:50 10 years ago
    maybe store somethings in values or tables that will be stored in game save & then return the saved settings based on the values or table values? I think that should work.

    something like:
    v_light_amt = amount of active lights
    v_light_1 = {from = {parameters}, to {parameters}}
    etc...
    add active effects into a table & so on & so on.
    Contrast, lightness, saturation etc are easier because you can store those values in your config.ini file if you were to use the read/write config.ini script for saving/restoring your menu options like Daedalic do with their games.

    @ Simon: is the new bind syntax valid in current public build or in the upcoming release/build?

    Imperator

    7278 Posts

  • #4, by SimonSThursday, 09. October 2014, 14:11 10 years ago
    the bind syntax is exclusive to the shader toolkit. I'm talking about that I can't save the bindings because they are closures, the rest is saved by lua variables.

    Thread Captain

    1580 Posts

  • #5, by afrlmeThursday, 09. October 2014, 15:01 10 years ago
    if he adds the light settings into tables then he can do a for loop on scene start to restore the settings if table contains data & if not then execute them as normal.

    Imperator

    7278 Posts

  • #6, by PykeTuesday, 14. October 2014, 12:57 10 years ago
    Added the new script, and the new bind. Now when I call any lighting it whites out the screen as before.

    
    shaderActivate(light1)
    
    bind("light1", num, "lights[0].position", point(inverty(scrollfix(offset(field("game.CurrentCharacter.Position"),{10,-50}))), 15))
    bind("light1", num, "lights[0].targetpos", point(inverty(cursor), 50))
    bind("light1", num, "lights[1].position", point(inverty(scrollfix(offset(field("game.CurrentCharacter.Position"),{100,100}))), 
    factor(dist(offset(field("game.CurrentCharacter.Position"),{0, 500}), cursor), 600)))
    
    shaderLamp(0, 0, {900,500,1}, {0,900,10}, {0.01,0.0000001,0}, {0,0,0}, {1,1,1}, 1, 90, 0)
    shaderLamp(1, 1, {1000,50,1}, {0,0,1}, {0.01,0.0,0.0000001}, {2,2,2}, {2,2,2}, 1)
    
    

    Newbie

    59 Posts

  • #7, by PykeTuesday, 14. October 2014, 14:05 10 years ago
    If I disable all the shaders and call of them from a saved game it causes the screen to be completely whited out.

    I've bound a key to turn them on and off, and if I call the script to turn them on from a game that's been saved with the shaders it whites the screen out.

    I think its something to do with running the shader script as a definition script from the get go - but trying to run it as an execution script and then calling the shaders afterwards doesn't seem to work at all?

    Newbie

    59 Posts

  • #8, by SimonSTuesday, 14. October 2014, 14:56 10 years ago
    The code you've written is wrong, correct would be this:
    shaderActivateLighting(2)
    
    bind("light1", "lights[0].position", point(inverty(scrollfix(offset(field("game.CurrentCharacter.Position"),{10,-50}))), 15))
    bind("light1", "lights[0].targetpos", point(inverty(cursor), 50))
    bind("light1", "lights[1].position", point(inverty(scrollfix(offset(field("game.CurrentCharacter.Position"),{100,100}))), 
    factor(dist(offset(field("game.CurrentCharacter.Position"),{0, 500}), cursor), 600)))
    
    shaderLamp(0, 0, {900,500,1}, {0,900,10}, {0.01,0.0000001,0}, {0,0,0}, {1,1,1}, 1, 90, 0)
    shaderLamp(1, 1, {1000,50,1}, {0,0,1}, {0.01,0.0,0.0000001}, {2,2,2}, {2,2,2}, 1)
    

    I've tested most cases, maybe there are some other calls anywhere else ?

    Thread Captain

    1580 Posts

  • #9, by PykeWednesday, 15. October 2014, 17:14 10 years ago
    OK - New problems. grin

    The 'white out' is fixed, and I already have the systems in place to reapply the shader effects....

    BUT! None of the shaders are animated. They apply, but don't have any sort of motion/update. For example, if I apply the lighting it just makes the screen black, or when I apply the ripple effect it warps the screen just once, with the normal games motion happening 'underneath' the effect.

    shaderAddEffect("tv1") just makes the screen grey scale (no noise or static) etc.

    Newbie

    59 Posts

  • #10, by afrlmeWednesday, 15. October 2014, 17:32 10 years ago
    It's the current shader toolkit script Chris. It's returning loads of errors for me too.

    tv1 desaturates screen & adds 1 pass of noise/old movie fx
    tv2 makes screen somewhat dark
    tv3 & tv4 1 pass then stays that way
    etc...

    shaderGlow seems to work but kept returning a warning/error.

    Not tried the rest yet.

    Imperator

    7278 Posts

  • #11, by PykeWednesday, 15. October 2014, 17:47 10 years ago
    Blur works.

    Newbie

    59 Posts