0029528: Visualization, TKOpenGl - allow defining sRGB textures
[occt.git] / src / Shaders / Shaders_PathtraceBase_fs.pxx
index f33cc5b..bf84c5a 100644 (file)
@@ -706,12 +706,15 @@ static const char Shaders_PathtraceBase_fs[] =
   "  {\n"
   "    if (theDepth + uSphereMapForBack == 0) // view ray and map is hidden\n"
   "    {\n"
-  "      aTotalRadiance = pow (BackgroundColor().rgb, vec3 (2.f));\n"
+  "      aTotalRadiance = BackgroundColor().rgb;\n"
   "    }\n"
   "    else\n"
   "    {\n"
-  "      aTotalRadiance = pow (FetchEnvironment (Latlong (theRay.Direct)).rgb, vec3 (2.f));\n"
+  "      aTotalRadiance = FetchEnvironment (Latlong (theRay.Direct)).rgb;\n"
   "    }\n"
+  "  #ifdef THE_SHIFT_sRGB\n"
+  "    aTotalRadiance = pow (aTotalRadiance, vec3 (2.f));\n"
+  "  #endif\n"
   "  }\n"
   "  \n"
   "  return aTotalRadiance;\n"