瀏覽代碼

Update gbuffer.fs for GLES3

pull/4706/head
MikiZX1 11 月之前
committed by GitHub
父節點
當前提交
8e7e9feb64
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: B5690EEEBB952194
共有 1 個文件被更改,包括 6 次插入4 次删除
  1. +6
    -4
      examples/shaders/resources/shaders/glsl100/gbuffer.fs

+ 6
- 4
examples/shaders/resources/shaders/glsl100/gbuffer.fs 查看文件

@ -11,8 +11,10 @@ in vec2 fragTexCoord;
in vec3 fragNormal;
in vec4 fragColor;
uniform sampler2D diffuseTexture;
uniform sampler2D specularTexture;
uniform vec4 colDiffuse;
uniform sampler2D texture0;
uniform sampler2D texture1;
void main() {
// store the fragment position vector in the first gbuffer texture
@ -20,7 +22,7 @@ void main() {
// also store the per-fragment normals into the gbuffer
gNormal = vec4(normalize(fragNormal),1.0);
// and the diffuse per-fragment color
gAlbedoSpec.rgb = texture(diffuseTexture, fragTexCoord).rgb;
gAlbedoSpec.rgb = texture(texture0, fragTexCoord).rgb * colDiffuse.rgb;
// store specular intensity in gAlbedoSpec's alpha component
gAlbedoSpec.a = texture(specularTexture, fragTexCoord).r;
gAlbedoSpec.a = pow(texture(texture1, fragTexCoord).r*1.6,16.0);
}

Loading…
取消
儲存