stephen-hqxu / superterrainplus

SuperTerrain+: A real-time procedural 3D infinite terrain engine with geographical features and photorealistic rendering.
MIT License
12 stars 1 forks source link

HDR for sky rendering #33

Closed stephen-hqxu closed 2 years ago

stephen-hqxu commented 2 years ago

With atmoshperic scattering, the color of the sky can easily go beyond the standard range [0.0, 1.0], so the sun is very large and bright.

image

Consider doing HDR rendering with exposure correction like:


uniform float Exposure;

FragColor = vec4(pow(1.0f - exp(-Exposure * atmosphere(...)), vec3(1.0f / 2.2f)), 1.0f);
stephen-hqxu commented 2 years ago

Done

The screenshot is taken with the same sun elevation angle. With the help of filmic HDR tone mapping and gamma correction, the sunlight looks much smoother.

image