Selaa lähdekoodia

fixing normal material with image processing

Benjamin Guignabert 4 vuotta sitten
vanhempi
commit
319d411e05

+ 4 - 0
materialsLibrary/src/normal/normal.fragment.fx

@@ -97,4 +97,8 @@ void main(void) {
 #include<fogFragment>
 
 	gl_FragColor = color;
+
+#ifdef IMAGEPROCESSINGPOSTPROCESS
+	gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(2.2));
+#endif
 }

+ 3 - 0
materialsLibrary/src/normal/normalMaterial.ts

@@ -80,6 +80,7 @@ class NormalMaterialDefines extends MaterialDefines {
     public BonesPerMesh = 0;
     public INSTANCES = false;
     public LIGHTING = false;
+    public IMAGEPROCESSINGPOSTPROCESS = false;
 
     constructor() {
         super();
@@ -195,6 +196,8 @@ export class NormalMaterial extends PushMaterial {
                 fallbacks.addCPUSkinningFallback(0, mesh);
             }
 
+            defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;
+
             //Attributes
             var attribs = [VertexBuffer.PositionKind];
 

+ 3 - 0
src/Shaders/ShadersInclude/linearTransform.fx

@@ -0,0 +1,3 @@
+#ifdef IMAGEPROCESSINGPOSTPROCESS
+	gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(2.2));
+#endif