我如何优化它(这是一个我的世界着色器)

问题描述 投票:0回答:1
#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;它破坏了我的帧频,我该如何优化呢?

c glsl
1个回答
0
投票

尝试

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

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

#define RGBA16 1
#define gcolorFormat RGBA16
© www.soinside.com 2019 - 2024. All rights reserved.