Write UINT RenderTarget

Write UINT RenderTarget

在OpenGLES的官方扩展GL_EXT_fragment_shading_rate_attachment中要求attachment的格式必须为R8_UI

如果要通过Shader填充其内容,如果填充0~1的值则会发生结果不正确。正确方式如下:

1
2
3
4
5
6
7
8
void WriteUintPS(
FScreenVertexOutput Input,
out uint4 OutColor : SV_Target0
)
{
uint testValue = 128u;
OutColor = uint4(testValue,testValue,testValue,testValue);
}

要点:

  • SV_Target0的类型须声明为uint4
  • 最终填充的值应为0~255内的整数值
character wrinkle color grading

Comments

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×