feat(draw): add gradient to the ambient fog term based on the angular distance to the sun
This commit is contained in:
parent
f6912b7a1d
commit
94ab95ce8d
@ -158,6 +158,13 @@ void main() {
|
|||||||
|
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
|
// add gradient
|
||||||
|
vec3 sunDir = normalize(vec3(0., -1., -1.));
|
||||||
|
float bright = dot(sunDir, normalize(viewcentricWorldPosition.xyz));
|
||||||
|
fogColorFactor *= bright * 0.5 + 1.0;
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
gl_FragColor = texture2D(colorTexture, texCoord);
|
gl_FragColor = texture2D(colorTexture, texCoord);
|
||||||
#if !LINEAR_FRAMEBUFFER
|
#if !LINEAR_FRAMEBUFFER
|
||||||
gl_FragColor.xyz *= gl_FragColor.xyz; // linearize
|
gl_FragColor.xyz *= gl_FragColor.xyz; // linearize
|
||||||
|
Loading…
x
Reference in New Issue
Block a user