【发布时间】:2020-12-24 06:40:00
【问题描述】:
我正在尝试使用双源混合实现文本子像素。
https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_blend_func_extended.txt
layout(location = 0, index = 0) out vec4 fragColor;
layout(location = 0, index = 1) out vec4 srcColor1;
void main()
{
vec4 scolor0;
vec4 scolor1;
// some calulcations
fragColor = scolor0;
srcColor1 = scolor1;
}
它工作正常。 但现在我想写到另一个渲染目标 喜欢
layout(location = 0, index = 0) out vec4 fragColor;
layout(location = 0, index = 1) out vec4 srcColor1;
layout(location = 1) out uvec4 myMRT;
我尝试更改 location = 1 或 location = 2 但无论哪种情况,我都会收到此链接错误
错误:片段着色器在偏移处的程序集编译错误
错误:使用双源输出时颜色输出过多
在双源混合的情况下使用 MRT 的最佳方式是什么?
【问题讨论】: