Dynamic lights?

  • #1, by UraalWednesday, 27. January 2016, 17:11 8 years ago
    Heyas,

    As a long time Visionaire-Studio user I was wondering if there's a plan at some point to implement a light-system where multiple light sources could affect each other? Or maybe it can already be done in some way I haven't yet discovered? What I basically want to do is: the torch player is carrying emits light to the surroundings instead of preset lighting areas that affect character instead. I uploaded couple examples too and the first picture is closer to what I am after.

    Newbie

    93 Posts


  • #2, by afrlmeWednesday, 27. January 2016, 17:36 8 years ago
    Can't you use the openGL shader?

    Imperator

    7278 Posts

  • #3, by AkcayKaraazmakWednesday, 27. January 2016, 20:37 8 years ago
    @Lee Can we blink the whole screen with openGL shader kit? Making the scene dark and light again n again like voltage goes down and up?

    Great Poster

    440 Posts

  • #4, by afrlmeWednesday, 27. January 2016, 21:58 8 years ago
    Yep. Technically you can do that without the openGL shader also by using the scene brightness value & the to() tweening function.
    -- fade current scene brightness over 1000ms to a random value between 0 & 20 (0 = black, 100 = default)
    game.CurrentScene:to(1000, {SceneBrightness = math.random(0, 20)}, easeQuintIn)
    

    ... it would be possible to generate random pause value too between each pass by creating a variable to store the random value then assigning that value to a vs value which you can link to a pause action part, that way you could get a dynamically unique lighting flicker each time you called the action block. wink

    Simon would be the person to ask about sorting out the lighting with the openGL shader though.

    P.S: if you enable lighting with openGL then it works like real lighting (minus shadows) in that it lights up whatever is inside of the light radius & then the further you get to the edge of the radius or the further outside of the radius the darker things will get. It's also possible to overlap lighting, which should look similar to what Simon_ASA has in his first screenshot (above).

    Imperator

    7278 Posts

  • #5, by AkcayKaraazmakThursday, 28. January 2016, 07:37 8 years ago
    Thank you so much Lee smile I'll give it a try

    Great Poster

    440 Posts

  • #6, by AkcayKaraazmakThursday, 28. January 2016, 21:48 8 years ago
    Hello Lee, it worked but just once. I want to blink whole scene for 2-3 seconds. Could u please help on that mate ?smile

    Great Poster

    440 Posts

  • #7, by MachtnixThursday, 28. January 2016, 22:27 8 years ago
    Use a counter value and start a loop, maybe?

    Thread Captain

    1097 Posts

  • #8, by AkcayKaraazmakThursday, 28. January 2016, 22:59 8 years ago
    I wanted to use a "for loop" or something like that but not sure how to do it in vis scripting smile

    Great Poster

    440 Posts

  • #9, by afrlmeFriday, 29. January 2016, 00:23 8 years ago
    Better to use the jump to x action part for time sensitive loops as there is no method for delaying loops with Lua script, well not in VS anyway.

    What Machtnix just said is more or less correct.

    1. create a called by other action block.

    2. create a value & name it something like "loop_amt".

    3. inside of the called by other action you created add some actions along the lines of these...

    if value 'loop_amt' is greater than 0
    execute a script > (add the line for fading to scene brightness to black)
    pause for x time (whatever delay value you set in script above)
    execute a script > (line for restoring scene brightness)
    pause for x time (whatever delay value you set in script above)
    jump to action part #1


    4. just call the called by other action block whenever you want to trigger the blink. make sure you set the "loop_amt" value before calling it though, that way you can specify the amount of times it should loop.

    P.S: remember what I mentioned earlier about using math.random() / random values for creating more dynamic approaches to things. You could create random delay values, random brightness values, random loop amounts, etc. All sorts of things can be done by generating random values. wink

    Imperator

    7278 Posts

  • #10, by AkcayKaraazmakFriday, 29. January 2016, 09:23 8 years ago
    Thank you so much Lee! smile

    Great Poster

    440 Posts