SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SHIII Mods Workshop
Forget password? Reset here

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 02-23-07, 09:14 AM   #1
WernerSobe
Commodore
 
Join Date: Jul 2006
Posts: 625
Downloads: 5
Uploads: 0
Default moonlight effect solution - theretical

Hi guys.

Ive tried to render moonlight in my environment mod in the past but i couldnt synchronise it to the moon so ive given up someday. Im still trying to find a solution so i want to share my findings with other moders and hope to ignite someones idea.

the theory:

- neither the moon nor the sun is rendered dynamic.
there are just three kinds of static light effects.
1. being ambient light wich covers 360°
2. being sun direct light wich covers 115° towards the sun
3. being sun reflect light wich covers 55° on the opposite to direct light.

- the color and intensity for each light effect at different daytime and weather are controlled in env\Env_Colorsxxx.dat

- sun reflect light effect is almost unused. It is overshined by ambient light during the day and it is gone at night. You can however increase its brightness at night and turn it into beautiful directional moon light effect, you can even make it appear only at clear nights.

now the problem:

sun reflect light is synchronised with the sun. Of course you dont see the sun at night but it is there, its just invisible. The moon follows its own orbit which is very different to the sun ones so the moonlight does not match to the moon itself.

my conclusion:

there must be a hard-coded formula (which i didnt found yet) that describes the orbit of the sun and another one for the moon orbit. I think there is one more for the stars.

the sun orbit formula controlls the direction of light effects, the sky texture, sky reflection texture and the sun bitmap itself. While the moon orbit formula controlls just the moon bitmap.

the trick is to find where the sun reflect color is tied to the sun orbit and connect it to the moon orbit. The process itself shouldnt be hard but i just cant find that place.

thoughts? ideas?
WernerSobe is offline   Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:41 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.