SHADERLAMP

  • #10, by yoyanWednesday, 03. June 2015, 23:36 9 years ago
    the target pos is defined in shaderlamp...no?.
    shaderLamp(index, type, position, "targetpos", falloff, ambient, diffuse, diffusefactor, exponent, cutoff).
    I do not get it working. The lamp turn .. :-(.

    Newbie

    32 Posts


  • #11, by yoyanWednesday, 03. June 2015, 23:42 9 years ago
    i dont know how to do what you tell me. "light[0].targetpos". thanks for all.

    Newbie

    32 Posts

  • #12, by yoyanWednesday, 03. June 2015, 23:52 9 years ago
    AFRLme I have my gpu drivers updated, and not working. i only want a static light, like a streetlamp, maybe I'm complicating things.. thanks guys.

    Newbie

    32 Posts

  • #13, by SimonSThursday, 04. June 2015, 00:10 9 years ago
    I meant it like that:

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

    Thread Captain

    1580 Posts

  • #14, by yoyanThursday, 04. June 2015, 01:26 9 years ago
    ok guys work! wink. Thanks you very much! smile. Cheers!.

    Newbie

    32 Posts

  • #15, by yoyanThursday, 04. June 2015, 01:42 9 years ago
    now, I retrieve my previous question. When i put a shaderlamp in a scene.. and all rest of scene is black. ¿why?..

    I try to put 2 shaderlamp in the scene with diferent values of intensite. But when one shaderlamp is activate the other one switch off.. I can use two or three shaderlamp simultaneously in the same scene?? I dont want all rest of scene is completely black.thanks again. wink.

    Newbie

    32 Posts

  • #16, by afrlmeThursday, 04. June 2015, 02:10 9 years ago
    You have to specify the amount of light sources in each scene.
    shaderActivateLighting(3) -- enable 3 light sources (light index starts at 0)
    
    -- light source 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(scrollfix(field("{x=500,y=500}"))), 0))
    
    -- light source 2
    shaderLamp(1, 0,{1000,900,1}, {900,0,0}, {0.001,0.000001,0},{0.0003,0,0.001},{1,1,1},0.5,30, 0)
    bind("light2", "lights[1].targetpos", point(inverty(scrollfix(field("{x=1000,y=900}"))), 0))
    
    -- light source 3
    shaderLamp(2, 0,{100,700,1}, {900,0,0}, {0.001,0.000001,0},{0.0003,0,0.001},{1,1,1},0.5,30, 0)
    bind("light3", "lights[2].targetpos", point(inverty(scrollfix(field("{x=100,y=700}"))), 0))
    

    ... I think.

    Imperator

    7278 Posts

  • #17, by yoyanThursday, 04. June 2015, 14:39 9 years ago
    yes! Now all work! Thanks a lots again guys. smile

    Newbie

    32 Posts

  • #18, by YarekFriday, 25. December 2015, 21:55 8 years ago
    Hi there!

    I know this is an old post but I've been having problems with this for a few days already and I don't know how to proceed.

    My problem is simple if I put a shaderLamp and I have a big room that needs scroll the light moves when the screen scrolls and I don't want that to happen. I think it's the same problem that was asked here but the solution given don't seem to work for me or I'm just doing something wrong.

    Could you please tell me how to do this?

    Thank you in advance for your time and dedication.

    Newbie

    10 Posts

  • #19, by afrlmeFriday, 25. December 2015, 23:05 8 years ago
    I believe Simon said that shaders aren't working 100% correctly right now anyway. Might be better to lay off the shaders until he's created a new shader toolkit script (unless it's the internal engine code that's buggy - not sure).

    As for the movement... I guess it's based on the current viewport. You may need to get the current scrollposition coordinates & then offset it as needed to the absolute x, y coordinates that you want to place it at, maybe create a loop too to make sure it constantly makes sure that it is positioned correctly.

    Imperator

    7278 Posts

  • #20, by SimonSFriday, 25. December 2015, 23:16 8 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

    1580 Posts