浏览代码

Fix color space issue with checkerboard shader

/main
Peter Bay Bastian 7 年前
当前提交
c32f3531
共有 1 个文件被更改,包括 9 次插入6 次删除
  1. 15
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Resources/Shaders/Checkerboard.shader

15
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Resources/Shaders/Checkerboard.shader


#include "UnityCG.cginc"
static const float rows = 32;
static const float columns = 32;
static const float4 col1 = float4(32.0/255.0, 32.0/255.0, 32.0/255.0, 1.0);
static const float4 col2 = float4(42.0/255.0, 42.0/255.0, 42.0/255.0, 1.0);
static const float rows = 24;
static const float columns = 24;
float3 col1 = float3(32.0/255.0, 32.0/255.0, 32.0/255.0);
float3 col2 = float3(42.0/255.0, 42.0/255.0, 42.0/255.0);
if (!IsGammaSpace()) {
col1 = GammaToLinearSpace(col1);
col2 = GammaToLinearSpace(col2);
}
return lerp(col1, col2, step(fmod(total, 2.0), 0.5));
return float4(lerp(col1, col2, step(fmod(total, 2.0), 0.5)), 1.0);
}
ENDCG
}
正在加载...
取消
保存