0029528: Visualization, TKOpenGl - allow defining sRGB textures
[occt.git] / src / Shaders / PathtraceBase.fs
index 8dfe1af..1c79915 100644 (file)
@@ -703,12 +703,15 @@ vec3 IntersectLight (in SRay theRay, in int theDepth, in float theHitDistance, o
   {
     if (theDepth + uSphereMapForBack == 0) // view ray and map is hidden
     {
-      aTotalRadiance = pow (BackgroundColor().rgb, vec3 (2.f));
+      aTotalRadiance = BackgroundColor().rgb;
     }
     else
     {
-      aTotalRadiance = pow (FetchEnvironment (Latlong (theRay.Direct)).rgb, vec3 (2.f));
+      aTotalRadiance = FetchEnvironment (Latlong (theRay.Direct)).rgb;
     }
+  #ifdef THE_SHIFT_sRGB
+    aTotalRadiance = pow (aTotalRadiance, vec3 (2.f));
+  #endif
   }
   
   return aTotalRadiance;