LightScene function problems and shadow update
by Joe Sulewski · in Torque Game Engine · 01/10/2005 (10:23 am) · 6 replies
I need to relight my scene to help reflect different times of the day. This works by hand in the mission editor where I can change the elevation and ambience for the sun object then choose Relight scene from the menu.
To make this user friendly I built a dialog with presets that allows me to have the sun move. The sun moves just fine but when I call
lightScene("",forceAlways);
the changes are not reflected in the engine. The console shows that it's relighting the scene and writing a new ml file but it doesn't update the shadows.
This is the same function called by the menu in the mission editor but it doesn't work for me. What am I doing wrong? Is there something I need to do to reflect the change?
Try it for yourself in the console. Find the sun object and set the elevation to a new value and call. For example
1350.elevation=35;
lightScene("",forceAlways);
It will do the work but not show the changes.
Heres the other odd thing. If you set the values with the console then go to the mission editor and choose relight scene it won't work. But if you change the elevation of the sun but make it the same value then hit apply and then relight the scene it works. So what is the apply button doing that makes it work? I've looked at the C++ code but I didn't notice anything special.
Any help will be greatly appreciated.
To make this user friendly I built a dialog with presets that allows me to have the sun move. The sun moves just fine but when I call
lightScene("",forceAlways);
the changes are not reflected in the engine. The console shows that it's relighting the scene and writing a new ml file but it doesn't update the shadows.
This is the same function called by the menu in the mission editor but it doesn't work for me. What am I doing wrong? Is there something I need to do to reflect the change?
Try it for yourself in the console. Find the sun object and set the elevation to a new value and call. For example
1350.elevation=35;
lightScene("",forceAlways);
It will do the work but not show the changes.
Heres the other odd thing. If you set the values with the console then go to the mission editor and choose relight scene it won't work. But if you change the elevation of the sun but make it the same value then hit apply and then relight the scene it works. So what is the apply button doing that makes it work? I've looked at the C++ code but I didn't notice anything special.
Any help will be greatly appreciated.
About the author
#2
For right not it seems like overkill for what I want but in the end this is probably something I would like to have.
I noticed you implemented this yourself. Does it work with multiple clients? It appears some people are having problems with it. I appreciate your experience with it.
Thanks
01/10/2005 (10:44 am)
Steven,For right not it seems like overkill for what I want but in the end this is probably something I would like to have.
I noticed you implemented this yourself. Does it work with multiple clients? It appears some people are having problems with it. I appreciate your experience with it.
Thanks
#3
It's a relatively trivial matter to synch up all the clients to an authoritiative game time system heartbeat, we just haven't worried about it yet.
01/10/2005 (10:54 am)
The only issue we have with this resource is that we haven't (yet) implemented a server-centric time impulse management system, so the "time of day" (and therefore the lighting of the outdoor scene) always starts at (roughly) 6 AM for the client when they log in, and proceeds from there.It's a relatively trivial matter to synch up all the clients to an authoritiative game time system heartbeat, we just haven't worried about it yet.
#4
For right not it seems like overkill for what I want but in the end this is probably something I would like to have.
I noticed you implemented this yourself. Does it work with multiple clients? It appears some people are having problems with it. I appreciate your experience with it.
Thanks
01/10/2005 (12:52 pm)
Steven,For right not it seems like overkill for what I want but in the end this is probably something I would like to have.
I noticed you implemented this yourself. Does it work with multiple clients? It appears some people are having problems with it. I appreciate your experience with it.
Thanks
#5
12/27/2005 (11:42 am)
I have a simillar problem where I want the host of a game to simply set day or night then broadcast to the clients to force a relight. I want to change the ambient and color of the sun but can't figure how to get the sun object. The day/night resource is overkill for me as well since I only want 2 settings.
#6
12/31/2005 (2:34 pm)
Have you tried using script to get it and pass it into some C++ code?
Torque 3D Owner Stephen Zepp