ebruneton / precomputed_atmospheric_scattering

This project provides a new implementation of our EGSR 2008 paper "Precomputed Atmospheric Scattering".
BSD 3-Clause "New" or "Revised" License
908 stars 120 forks source link

Where to place diffuse color. #11

Closed stavenko closed 7 years ago

stavenko commented 7 years ago

Hello.

How to correctly mix diffuse color of planet underneath atmosphere? I assume, there is something like

vec4 groundDiffuseColor = texture(screenspaceRenderedPlanet, uv);

In my shader. How to mix them with ground_radiance?

ebruneton commented 7 years ago

You should replace kGroundAlbedo with groundDiffuseColor in

ground_radiance = kGroundAlbedo (1.0 / PI) ( sun_irradiance GetSunVisibility(point, sun_direction) + sky_irradiance GetSkyVisibility(point));

(in demo.glsl). groundDiffuseColor should be an albedo (i.e. fraction of incident light which is reflected, between 0 and 1).