Altering Sun Light on the fly
by Thomas Shaw · in Torque Game Engine · 07/13/2005 (5:21 am) · 7 replies
I have a level that is divided into two seprate halves. The middle part of the map is seprated by a cave. I want one side of the cave to be sunny and bright and the other to be dark and dismal. Is there anway to change the ambient and diffuse sun color on the fly?
I really don't know if this is even possible since the engine has to relight the scene for color changes to affects thing like the terrain and I want this to be seamless.
If this isn't possible using good old fashion TGE then woud the synapse lighting pack make this possible, or would there be similar issues?
Thanks
I really don't know if this is even possible since the engine has to relight the scene for color changes to affects thing like the terrain and I want this to be seamless.
If this isn't possible using good old fashion TGE then woud the synapse lighting pack make this possible, or would there be similar issues?
Thanks
#2
Maybe you can implement alpha channel support for interior textures (the Lighting Pack comes with that too, but you'll have to activate it at compile time), and place a huge interior on the sky, to block the sun where you want darkness. Apply a 100% transparent texture to it, and you'll see through it, but it'll still cast shadows.
07/13/2005 (9:14 am)
No, he want two different light settings for two areas of the terrain. Maybe you could zero the sun's direction values and use a point light, far, far away. But you still have to find a way to not let that light leak into the other half of the level.Maybe you can implement alpha channel support for interior textures (the Lighting Pack comes with that too, but you'll have to activate it at compile time), and place a huge interior on the sky, to block the sun where you want darkness. Apply a 100% transparent texture to it, and you'll see through it, but it'll still cast shadows.
#3
If this is possible there is one problem...I really need perciptation in each of the two areas and as far as I know perciptation is disabled inside dif objects...
Is this the case, and if so is there a way around it?
07/13/2005 (9:20 pm)
What if I had 3 giant dif cubes with transparent textures on them...or just simple textured them like a sky box and then just used point lights for each "room"...If this is possible there is one problem...I really need perciptation in each of the two areas and as far as I know perciptation is disabled inside dif objects...
Is this the case, and if so is there a way around it?
#4
07/13/2005 (9:55 pm)
When you are about to leave the cave, load the dark and dismal level.
#5
07/13/2005 (10:06 pm)
Problem is that my project is multiplayer only. I can't really afford to having players just hang up while things load. I want this to all be in real time and it's worth any ammount of complexity.
#6
Instead of syncing up the client's time to the server and keeping all players at the same "day light" you could alter the client side of things to take into account where the player is and make it "night" or "day" for the player. So when they walk through the cave day becomes night or night becomes day for the client along. Sure on the client side all the world is now night, but if you setup the world such that the player can't see into to the other side they wouldn't know the difference.
The other thought I had was place a slightly transpartent GUI over the full screen on the dark side. That might work. The RPGDialog has a very small screen shot with a transparent GUI that sort of shows what I am talking about.
Just some ideas. I haven't tried any of them.
07/14/2005 (3:42 am)
Have you looked at the Day night cycles with seasonsInstead of syncing up the client's time to the server and keeping all players at the same "day light" you could alter the client side of things to take into account where the player is and make it "night" or "day" for the player. So when they walk through the cave day becomes night or night becomes day for the client along. Sure on the client side all the world is now night, but if you setup the world such that the player can't see into to the other side they wouldn't know the difference.
The other thought I had was place a slightly transpartent GUI over the full screen on the dark side. That might work. The RPGDialog has a very small screen shot with a transparent GUI that sort of shows what I am talking about.
Just some ideas. I haven't tried any of them.
#7
07/14/2005 (12:18 pm)
Oh cool, this is exactly what I wanted to do. It only really matters whats going on on the clients side since this doesn't affect gameplay. Thanks
Torque Owner Jesse Motes