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

Turn off shaderlamp.

  • #1, by yoyan 11 years ago Zitieren
    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! :-).
  • #2, by afrlme 11 years ago Zitieren
    try...
    shaderActivateLighting(0)
    

    ... it's essentially the same as off as you are declaring 0 light sources.
  • #3, by yoyan 11 years ago Zitieren
    Yes, I have tried it and it doesnt work. The scene go black..
  • #4, by SimonS 11 years ago Zitieren
    You need to use:
    shaderDeactivateLighting()
    
  • #5, by yoyan 11 years ago Zitieren
    If use shaderDeactivateLighting() the shadereffects stop work. as a said in my open post. why?.. thanks! wink
  • #6, by SimonS 11 years ago Zitieren
    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.
  • #7, by yoyan 11 years ago Zitieren
    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! :-).
  • #8, by yoyan 11 years ago Zitieren
    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.
  • #9, by afrlme 11 years ago Zitieren
    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.
  • #10, by SimonS 11 years ago Zitieren
    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.
  • #11, by yoyan 11 years ago Zitieren
    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.