Browse Source

Merge pull request #3803 from TrevorDev/clampDefaultFragmentToAvoidUnderflow

set negative color values to 0 to avoid underflow when msaa is applie…
David Catuhe 7 years ago
parent
commit
dc6e36096d
2 changed files with 2 additions and 2 deletions
  1. 1 1
      dist/preview release/what's new.md
  2. 1 1
      src/Shaders/default.fragment.fx

+ 1 - 1
dist/preview release/what's new.md

@@ -80,7 +80,7 @@
 - Support depth maps for multiple active cameras for post processes like depth of field ([trevordev](https://github.com/trevordev))
 - Integrates depth texture support in the engine ([sebavan](https://github.com/sebavan))
 - NPM package now has a dependency system, updated during build. ([RaananW](https://github.com/RaananW))
-- Default pipeline will use webGL 2.0 anti aliasing by default if supported, webVR post processing will render to eye texture size ([trevordev](https://github.com/trevordev))
+- Default pipeline will use webGL 2.0 anti aliasing by default if supported, default fragment shader will clamp negative values to avoid underflow, webVR post processing will render to eye texture size ([trevordev](https://github.com/trevordev))
 
 ## Bug fixes
 

+ 1 - 1
src/Shaders/default.fragment.fx

@@ -418,7 +418,7 @@ void main(void) {
 #endif
 
 #define CUSTOM_FRAGMENT_BEFORE_FOG
-
+color.rgb = max(color.rgb, 0.);
 #include<logDepthFragment>
 #include<fogFragment>