#version 120

#extension GL_EXT_gpu_shader4 : enable

varying vec4 texcoord;

uniform sampler2D gcolor;
uniform sampler2D gnormal;
uniform sampler2D gdepth;

const int RGBA16 = 1;
const int gcolorFormat = RGBA16;

void main(){
    vec3 finalComposite = texture2D(gcolor, texcoord.st).rgb;
    vec3 finalCompositeNormal = texture2D(gnormal, texcoord.st).rgb;
    vec3 finalCompositeDepth = texture2D(gdepth, texcoord.st).rgb;

    gl_FragData[0] = vec4(finalComposite, 1.0);
    gl_FragData[1] = vec4(finalCompositeNormal, 1.0);
    gl_FragData[2] = vec4(finalCompositeDepth, 1.0);
}


在我添加之后
const int RGBA16 = 1;
const int gcolorFormat = RGBA16;
它破坏了我的帧频,我该如何优化呢?

最佳答案

尝试

const int RGBA16 = 1;
const int gcolorFormat = 1;


如果那仍然神秘地破坏了您的帧速率,请改用#define。

#define RGBA16 1
#define gcolorFormat RGBA16

10-07 18:51