Login / Registrieren
DE EN FR ES IT CZ
Zurück Nach oben

SHADERLAMP

  • #20, by SimonS 11 years ago Zitieren
    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.
  • #21, by Yarek 11 years ago Zitieren
    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.
  • #22, by SimonS 11 years ago Zitieren
    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().
  • #23, by Yarek 11 years ago Zitieren
    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.
  • #24, by afrlme 11 years ago Zitieren
    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?
  • #25, by Yarek 11 years ago Zitieren
    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?
  • #26, by SimonS 11 years ago Zitieren
    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.
  • #27, by Yarek 11 years ago Zitieren
    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.
  • #28, by SimonS 11 years ago Zitieren
    Did you activate the lighting via
    shaderActivateLighting(1)
    

    ?
  • #29, by Yarek 11 years ago Zitieren
    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.
  • #30, by SimonS 11 years ago Zitieren
    Could you show me the results of
    print(DataDumper(point(inverty(field("{x=500,y=500}")), 0)))
    

    ?