SHADERLAMP

  • #20, by SimonSFriday, 25. December 2015, 23:16 9 years ago
    The shadertoolkit works fine, only just not always like some guys like it.

    shaderLamp(0, 0,{500,500,1}, {900,0,0}, {0.001,0.000001,0},{0.0003,0,0.001},{1,1,1},0.5,30, 0)
    bind("light1", "lights[0].targetpos", point(inverty(scrollfix(field("{x=500,y=500}"))), 0))
    


    The second line scrolls the light, remove it to not scroll the light.

    Thread Captain

    1581 Posts


  • #21, by YarekSaturday, 26. December 2015, 18:57 9 years ago
    Hello!

    First of all thank you both for your answers.

    I've tried this with and without the second line and for me it does exactly the same and it always gets scrolled.

    shaderLamp(0, 0,{500,500,1}, {900,0,0}, {0.001,0.000001,0},{0.0003,0,0.001},{1,1,1},0.5,30, 0)
    bind("light1", "lights[0].targetpos", point(inverty(scrollfix(field("{x=500,y=500}"))), 0))
    
    


    I know the shadertoolkit works fine and to be honest it's amazing but I'm a bit lost right now about this.

    I've been trying these days what you suggest AFRLme but I didn't seem to get it working. I'll give it another try.

    Thanks for your suggestions guys if I can solve this I will let you know what was happening and if you have any new ideas that would be awesome.

    Newbie

    10 Posts

  • #22, by SimonSSaturday, 26. December 2015, 19:32 9 years ago
    Okay, so the binding has already happened, you can do it like this:

    Don't scroll:
    shaderLamp(0, 0,{500,500,1}, {900,0,0}, {0.001,0.000001,0},{0.0003,0,0.001},{1,1,1},0.5,30, 0)
    bind("light1", "lights[0].targetpos", point(inverty(field("{x=500,y=500}")), 0))
    


    Scroll:
    shaderLamp(0, 0,{500,500,1}, {900,0,0}, {0.001,0.000001,0},{0.0003,0,0.001},{1,1,1},0.5,30, 0)
    bind("light1", "lights[0].targetpos", point(inverty(scrollfix(field("{x=500,y=500}"))), 0))
    


    Difference is the scrollfix().

    Thread Captain

    1581 Posts

  • #23, by YarekSaturday, 26. December 2015, 19:59 9 years ago
    Thank you SimonS

    I've tried this and the result is exactly the same for me.

    I'm starting to think that the bind line doesn't work at all. Do I need something special to use it? I mean, maybe I need a special definition script or something like that?

    Thank you a lot.

    Newbie

    10 Posts

  • #24, by afrlmeSaturday, 26. December 2015, 20:46 9 years ago
    Did you replace the shader toolkit script with the latest one Simon added to the wiki after the release of the current public build of Visionaire Studio?

    Imperator

    7278 Posts

  • #25, by YarekSaturday, 26. December 2015, 21:02 9 years ago
    I'm starting to feel a bit stupid but this might actually be the problem.

    I'm using version 0.8.9 which one is the one I need?

    Newbie

    10 Posts

  • #26, by SimonSSaturday, 26. December 2015, 21:51 9 years ago
    Is an error in the messages.log ?
    I think you are maybe overriding the bind somewhere else, also note that this is saved into savegames, so your savegames will restore older versions.

    Thread Captain

    1581 Posts

  • #27, by YarekTuesday, 29. December 2015, 17:16 9 years ago
    Ok first of all sorry for the late reply.

    I have family here and I haven't been able to be in the PC until now.

    I use Shader Toolkit 0.8.9 and Visionaire Editor 4.2

    I have tried to use Visionaire Editor 4.2.5 and Shader Toolkit 0.9 and my PC crashes every time I try to print log.

    In ST 0.8.9 and VE 4.2 if I print log I get this:

    17:04:36: [string "ShaderToolkit old"]:1823: invalid value (nil) at index 1 in table for 'concat'
    17:04:36: stack traceback:
    	[string "LightSueñoPasillo1"]:54: in function <[string "LightSueñoPasillo1"]:52>
    	[C]: in function 'DataDumper'
    	[string "ShaderToolkit old"]:1823: in function 'bind'
    	[string "LightSueñoPasillo1"]:10: in function <[string "LightSueñoPasillo1"]:1>
    	[C]: in function 'xpcall'
    	[string "LightSueñoPasillo1"]:1: in main chunk
    17:04:36: no uniform pass in shader
    


    This makes reference to this:

     bind("light1", "lights[0].targetpos", point(inverty(field("{x=500,y=500}")), 0))
    


    It looks like light1 doesn't exist. Could that be the problem?

    Thank you for your time.

    Newbie

    10 Posts

  • #28, by SimonSTuesday, 29. December 2015, 18:04 9 years ago
    Did you activate the lighting via
    shaderActivateLighting(1)
    

    ?

    Thread Captain

    1581 Posts

  • #29, by YarekTuesday, 29. December 2015, 18:23 9 years ago
    Yes I'm testing now with just this:

    shaderActivateLighting(1)
    shaderLamp(0, 0,{500,500,1}, {900,0,0}, {0.001,0.000001,0},{0.0003,0,0.001},{1,1,1},0.5,30, 0)
    bind("light1", "lights[0].targetpos", point(inverty(field("{x=500,y=500}")), 0))
    game.ShaderExclude = eShaderExcludeInterfaces
    


    And the log looks exactly as what I posted before.

    Newbie

    10 Posts

  • #30, by SimonSTuesday, 29. December 2015, 19:15 9 years ago
    Could you show me the results of
    print(DataDumper(point(inverty(field("{x=500,y=500}")), 0)))
    

    ?

    Thread Captain

    1581 Posts