mirror of
https://github.com/lubosz/overte.git
synced 2025-04-17 00:57:44 +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
|
||||
|
||||
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
|
||||
color = pow(color, vec3(2.2));
|
||||
// Protect from NaNs and negative values
|
||||
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);
|
||||
|
||||
// FIXME: scribe does not yet scrub out else statements
|
||||
|
|
Loading…
Reference in a new issue