Archived

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

deks

"Rendering Outdoor Light Scattering in Real Time" light scattering implementation

Recommended Posts

deks    209
Hi, I already implemented light scattering as described in ATI''s "Rendering Outdoor Light Scattering in Real Time" by Preetham & Hoffman, but the results aren''t what I want at sunrise/sunset. So I''m trying to implement what''s described in "A Practical Analytic Model for Daylight" by Preetham, Shirley & Smits but I encounter some problems. First, I have to compute FinalColor = OriginalColor * Fex + Lin where Fex is extinction and Lin is in in scattered light. Here''s what I understand to compute Fex from that paper: Fex = e^-K*(H-u(s)) K = -(B0/a*cosA) cosA = angle of v vector (see figure 4) H = e^-(a*h0) h0 = altitude of viewer a = exponential altitude decay B0 = scattering coeficient at earth surface u(s) = e^-(a*(h0+s*cosO)) s = distance from viewer And now... the questions! Q1. How to compute v (see figure 4)? Is it simply the sun''s position equivalent on a perpendicular axis of rotation? Q2. Equation 10 is used to compute Lin. But what is B1, B2, H1 and H2? Q3. Where to plug wavelength in these equations? Q4. How does this paper relates to ATI''s "Rendering Outdoor Light Scattering in Real Time" by Preetham & Hoffman? Q5. Does someone have screenshots of "A Practical Analytic Model for Daylight" model working (expecially at sunrise/sunset)? Q6. Is this solution good? Anyone have suggestions for a more realistic sky coloring model? Thanks for any help, Jean-Francois Dube

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
quote:
Original post by deks
Q1. How to compute v (see figure 4)? Is it simply the sun''s position equivalent on a perpendicular axis of rotation?


v points in the direction of what you are trying to draw.

quote:
Q2. Equation 10 is used to compute Lin. But what is B1, B2, H1 and H2?


This is explained in the paper. For example H is defined on p.14, as e^{-\alpha h_0}. \alpha is specified in appendix 4 for the two cases. \beta is given in appendix 3.

quote:
Q3. Where to plug wavelength in these equations?


Everywhere you see a \lambda (a number of places).

quote:
Q4. How does this paper relates to ATI''s "Rendering Outdoor Light Scattering in Real Time" by Preetham & Hoffman?


Good question. The "real time" paper focuses on the aerial perspective model. While it can be used to give values for the sky, these are not very accurate. The "practical" paper focuses on the sky color. Basically, any implementation should use the sky color from the "practical" paper, and combine it with aerial perspective from either paper.

quote:
Q5. Does someone have screenshots of "A Practical Analytic Model for Daylight" model working (expecially at sunrise/sunset)?


I believe there are one or two other threads in this forum where full sequences of the model have been displayed.

quote:
Q6. Is this solution good? Anyone have suggestions for a more realistic sky coloring model?


I think it is quite good. Sunrise is probably still not perfect, especially immediately at or before sunrise -- but it isn''t meant to model the night sky. Outside and around urban areas, you might want to vary turbidity, and this will be most noticable when the sun is low.

Share this post


Link to post
Share on other sites