Issues.00105 - lordmundi/wikidoctest GitHub Wiki
00105: need a way to force sun nodes to face EARTH
Summary: need a way to force sun nodes to face EARTH
Created: 2008–09–09 16:39
Status: Released
Category: Request
From: frankie
Version: 2.0
Released_In: 2.1
Description:
currently, the two sun nodes are modelled as infinite light sources with a dir. The earth and planet stuff is all lit from the PLANET2_SUN node which is used to get a light direction.
To make the light sources for models and planets agree, the sun nodes need to be positioned with PLANET2_SUN and then have their dir set to point to the NULL frame. (I think NULL would be better than the EARTH since people can choose to be earth centered, moon centered, vehicle centered, etc.)
Comments
frankie July 28, 2008, at 09:32 PM: I'm not sure the best way to do this. A few ideas:
- Use a control node to get the position of PLANET2_SUN with respect to NULL. Take the output of the control node in a tcl script and negate it then use it to set the light direction of the two sun nodes.
- planet2 is already getting a vector from PLANET2 to something to get a direction vector for lighting. We could expose a tcl command to query it for the direction and then set the sun node directions in a tcl script.
- We could convert the sun nodes to point light sources. From what I understand, Brad has already tried this and it is not feasible, but I'll put it down for completeness just in case I am mistaken.
frankie July 29, 2008, at 10:51 AM: I suppose another option would be to let planet2 set the light direction in the plugin. It has the info, and we wouldn't want to set the light dir if planet2 wasn't running.
brad October 16, 2008, at 11:00 AM: Implemented this. The lighting from the sun is now computed inside of dsp_planet2 and communicated to other plugins (ie dsp_speedtest2) via a process attached data structure "DSP_PLANET2_SUN" which is now defined in the dsp_planet2.h header file. The new feature eliminates the need for explicitly defining a light node for the sun if you are runing dsp_planet2 and dsp_speedtest2 together, this was done outside of the normal scenegraph node tree because the lighting vector and light color/intensity could be different in different viewports depending on where the camera for each viewport was located. For instance if you had a camera in one viewport looking at the launch pad during the day and another in orbit on the night side of the earth the lighting from the sun is completely different. Also dsp_planet2 correctly computes light occlusion from planetary bodies as well as color shifting due to atmosphere effects.
Associated Commits
| commit | 665a43ca809be958f96b2484726c8913a2662a13
link6 |
||
| Author: | Frank Graffagnino
|
| Date: | Thu Dec 11 16:37:43 2008 -0600
|
| Message: | [@Issue 00104 00105 and 00112: Fixed lens flare stuff and lighting upgrades
This includes the planet2 lighting upgrade, the lens flare bug fix, and the missing textures that were missing from the original lens flare stuff. @] |
Affected Files:
configs/speedy.cfg | 274 ++++++++++++++++++++++++++++±--
plugin_Linux_FC3/dsp_planet2.so | Bin 305482 -> 314507 bytes
plugin_Linux_FC3/dsp_session.so | Bin 0 -> 163232 bytes
plugin_Linux_FC3/dsp_speedtest2.so | Bin 361482 -> 392991 bytes
shaders/bmpmap.fs | 15 ±
shaders/bmpmap.vs | 3 ±
shaders/earth_cloud.fs | 45 ++±--
shaders/earth_cloud_bmp.fs | 57 +++++++
shaders/earth_cloud_shadow.fs | 28 +±-
shaders/earth_ground.fs | 46 ++±--
shaders/earth_ground2.fs | 59 +++++++
shaders/earth_ground_city_cloud.fs | 89 +++++++++++
shaders/earth_ground_cloud.fs | 77 ++++±---
shaders/lighting.fs | 12 ±
shaders/moon_alhat_bmp_safety.fs | 66 ++++++++
shaders/moon_alhat_bmp_safety_before.fs | 66 ++++++++
shaders/solid.fs | 6 ±
shaders/texbmpmap.fs | 16 ±
shaders/texmap.fs | 8 ±
19 files changed, 731 insertions(+), 136 deletions(-)