#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);
}
我添加后 常量 int RGBA16 = 1; const int gcolorFormat = RGBA16; 它破坏了我的帧速率我该如何优化?
最佳答案
尝试
const int RGBA16 = 1;
const int gcolorFormat = 1;
如果这仍然神秘地破坏了你的帧速率,只需使用 #define 即可。
#define RGBA16 1
#define gcolorFormat RGBA16
关于c - 我该如何优化它(这是一个我的世界着色器),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59588364/