qq526843006

顶点颜色(插槽)传入顶点着色器的时候会进行REMOVEGAMMA操作吗?
float4 vertexColor : COLOR;
在自定义Spine着色器中
我是否需要在顶点着色器中使用GammaToLinearSpace(vertexColor.rgb)操作来获得正确的结果?

---

我当前在Unity Linear Color Space Workflow下
qq526843006
  • 帖子: 7

Harald

是的,您需要在顶点着色器中执行顶点颜色的伽玛到线性空间转换。

如果您启用了“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);
头像
Harald

Harri
  • 帖子: 4174


回到 中国Spine用户