- Изменено
顶点颜色(插槽)传入顶点着色器的时候会进行REMOVEGAMMA操作吗
顶点颜色(插槽)传入顶点着色器的时候会进行REMOVEGAMMA操作吗?
float4 vertexColor : COLOR;
在自定义Spine着色器中
我是否需要在顶点着色器中使用GammaToLinearSpace(vertexColor.rgb)操作来获得正确的结果?
我当前在Unity Linear Color Space Workflow下
是的,您需要在顶点着色器中执行顶点颜色的伽玛到线性空间转换。
如果您启用了“PMA 顶点颜色”,您还需要确保正确处理此问题,如 Spine-Skeleton.shader : line 61
使用Spine-Common.cginc
中提供的PMAGammaToTargetSpace
:
#include "CGIncludes/Spine-Common.cginc"
...
o.vertexColor = PMAGammaToTargetSpace(v.vertexColor);
Yes, you need to perform gamma to linear space conversion of the vertex color in your vertex shader.
If you have PMA Vertex Color
enabled, you also need to make sure to handle this correctly, like in the Spine-Skeleton.shader : line 61
via PMAGammaToTargetSpace
provided in Spine-Common.cginc
:
#include "CGIncludes/Spine-Common.cginc"
...
o.vertexColor = PMAGammaToTargetSpace(v.vertexColor);