mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 17:49:27 +02:00
Protected procedural skyboxes from NaNs and negative values returned by procedural shader
This commit is contained in:
parent
9e462e777c
commit
ff88911f93
1 changed files with 5 additions and 2 deletions
|
@ -35,8 +35,11 @@ void main(void) {
|
||||||
#ifdef PROCEDURAL
|
#ifdef PROCEDURAL
|
||||||
|
|
||||||
vec3 color = getSkyboxColor();
|
vec3 color = getSkyboxColor();
|
||||||
// Procedural Shaders are expected to be Gamma corrected so let's bring back the RGB in linear space for the rest of the pipeline
|
// Protect from NaNs and negative values
|
||||||
color = pow(color, vec3(2.2));
|
color = mix(color, vec3(0), isnan(color));
|
||||||
|
color = max(color, vec3(0));
|
||||||
|
// Procedural Shaders are expected to be Gamma corrected so let's bring back the RGB in linear space for the rest of the pipeline
|
||||||
|
color = pow(color, vec3(2.2));
|
||||||
_fragColor = vec4(color, 0.0);
|
_fragColor = vec4(color, 0.0);
|
||||||
|
|
||||||
// FIXME: scribe does not yet scrub out else statements
|
// FIXME: scribe does not yet scrub out else statements
|
||||||
|
|
Loading…
Reference in a new issue