• What is your GameDev Story?

Archived

This topic is now archived and is closed to further replies.

Problem implementing cloud-color paper in FAQ

This topic is 5539 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

I recently implemented the most realistic cloud coloring paper found in the FAQ here (A Practical Analytic Model for Daylight). While my implementation of the paper looks extremely realistic, i have a problem at the top of the skydome where three distinct changes in color appear. I'm not sure what is happening here, but any tips would be helpful. At different times of day the lines become more distinguished, however they are always extremely bothersome. Any help would be appreciated. My guess is that there is some problem with my atan2(dome[vertice].x, dome[vertice].z) calculations of the phi angle near the top of the skydome. Possibly a loss of accuracy due to my use of floats. Here is a picture of the problem at the most visible time of day (during the end of a sunset). EDIT: Can't seem to upload pictures that everybody can link to. Tried geocities, but it only worked for me. Any reccomendations? --===LITHIC===-- --===WWW.Decimation.TK===-- [edited by - Lithic on November 16, 2003 7:56:54 PM]

Share on other sites
hmm... On further thought the problem could also be with how i calculate gamma (the angle between the sun vector and the view vector) I use two angles to calculate it: phi, the angle from the zenith, and theta, the angle west of south.

gamma = SQRT(SQR(ABS(thetaView - thetaSun)) + SQR(ABS(phiView - phiSun)));

--===LITHIC===--
--===WWW.Decimation.TK===--

[edited by - Lithic on November 16, 2003 7:38:00 PM]

Share on other sites
Nobody replied, but thanks anyways. It appears that i cannot find the angle between those vectors using the pythagorean theorem with their angles. I just converted the angles from the sun position into a normalized x/y/z using some trig and then found the angle between the vectors using:

acos(dotproduct/crossproduct)

looks pretty nice =)

--===LITHIC===--
--===WWW.Decimation.TK===--

• What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 14
• 14
• 45
• 22
• 27
• Forum Statistics

• Total Topics
634044
• Total Posts
3015211
×