Browse Source

Add toLinearSpace override for float (may be needed in nme)

Popov72 5 năm trước cách đây
mục cha
commit
c4ca019476
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      src/Shaders/ShadersInclude/helperFunctions.fx

+ 5 - 0
src/Shaders/ShadersInclude/helperFunctions.fx

@@ -43,6 +43,11 @@ mat3 inverseMat3(mat3 inMatrix) {
               b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;
 }
 
+float toLinearSpace(float color)
+{
+    return pow(color, LinearEncodePowerApprox);
+}
+
 vec3 toLinearSpace(vec3 color)
 {
     return pow(color, vec3(LinearEncodePowerApprox));