Turn off shaderlamp.

  • #1, by yoyanSunday, 14. June 2015, 15:20 9 years ago
    Hi, guys. My question its simple. I have 3 shaderlamp in a scene. When change the scene, i want restore values sahaderlamp, i mean I want turn off the lamps.(To doing this I use this "shaderDeactivateLighting()" ) but I use In the next scene (shaderAddEffect"highlight" ).. And if use "shaderDeactivateLighting()" "highlight"effect dont work. Any solution? witch is the easy way to turn off shaderlamps? Thanks guys! :-).

    Newbie

    32 Posts


  • #2, by afrlmeSunday, 14. June 2015, 15:56 9 years ago
    try...
    shaderActivateLighting(0)
    

    ... it's essentially the same as off as you are declaring 0 light sources.

    Imperator

    7278 Posts

  • #3, by yoyanSunday, 14. June 2015, 21:18 9 years ago
    Yes, I have tried it and it doesnt work. The scene go black..

    Newbie

    32 Posts

  • #4, by SimonSMonday, 15. June 2015, 00:14 9 years ago
    You need to use:
    shaderDeactivateLighting()
    

    Thread Captain

    1580 Posts

  • #5, by yoyanMonday, 15. June 2015, 00:36 9 years ago
    If use shaderDeactivateLighting() the shadereffects stop work. as a said in my open post. why?.. thanks! wink

    Newbie

    32 Posts

  • #6, by SimonSMonday, 15. June 2015, 00:45 9 years ago
    Sorry, I didn't read carefully enough. I'm not quite sure, what's the problem. Could you post your messages.log ? I can't reproduce that here. Maybe you have a typo or something like that.

    Thread Captain

    1580 Posts

  • #7, by yoyanMonday, 15. June 2015, 21:42 9 years ago
    Ok. I can use shaderDeactivateLighting() and everything work correctly. But the effects "edgeglow" and "highlight" Doesnt Work if use before shaderDeactivateLighting(), I think maybe this happend because this specifically effect use lights, i dont know. Thanks for everything! :-).

    Newbie

    32 Posts

  • #8, by yoyanWednesday, 17. June 2015, 20:25 9 years ago
    Simons i dont know how find messages.log. I dont have. I will try to write what I have:


    Scene 1:

    Actions:
    "at beginning of scene"

    shaderAddEffect("tv1")


    "at end of scene":

    shaderRemoveEffect("tv1")


    Scene 2 :
    Actions:
    "at beginning of scene" :

    shaderActivateLighting(2)


    shaderLamp(0, 0,{900,1300,1}, {0,100,100}, {0.001,0.000001,0},{0,0,0},{1,1,1},2,0.1, 0)
    bind("light1", "lights[0].targetpos", point(inverty(scrollfix(field("{x=1000,y=200}"))), 0))


    shaderLamp(1, 0,{2000,1000,1}, {0,100,100}, {0.001,0.000001,0},{0,0,0.001,0001},{1,1,1},0.5,30, 0)
    bind("light2", "lights[1].targetpos", point(inverty(scrollfix(field("{x=1000,y=900}"))), 0))

    "at end of scene":

    shaderDeactivateLighting()


    when I back to the scene 1 the shadereffects never work fine. Work half. It dont work good. Please this part is important..What I dont do good?. Thanks for everithing smile.

    Newbie

    32 Posts

  • #9, by afrlmeWednesday, 17. June 2015, 20:57 9 years ago
    To find your message.log location:

    1. run game via vs editor.

    2. press TAB key to open up the developers console.

    3. type: exec print(localAppDir), then press ENTER.

    4. Now type: print log, then press ENTER to display the log.

    5. Locate one of the lines in the log which says something like: c:/users/... & that will be the folder in which your log files & save games etc are being stored.

    Imperator

    7278 Posts

  • #10, by SimonSWednesday, 17. June 2015, 21:09 9 years ago
    bind("light2", "lights[1].targetpos", point(inverty(scrollfix(field("{x=1000,y=900}"))), 0))
    

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


    "light1" is the name of the shader, you can't change this. The light id is in lights[0] etc.

    And it's working.

    Thread Captain

    1580 Posts

  • #11, by yoyanThursday, 18. June 2015, 16:48 9 years ago
    Omg! Im stupid! Thanks Simons!.
    and thanks afrlm to explain how find my .log.

    You can explain more details about developer console please.
    For what it importan use it. Can you explain useful uses? Thanks for everything! you are of great help. smile.

    Newbie

    32 Posts