Skip to content

Commit

Permalink
Update gbuffer.fs for GLES3
Browse files Browse the repository at this point in the history
  • Loading branch information
MikiZX1 authored Jan 18, 2025
1 parent 80f6582 commit 8e7e9fe
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions examples/shaders/resources/shaders/glsl100/gbuffer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ 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
gPosition = vec4(fragPosition,1.0);
// 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);
}

0 comments on commit 8e7e9fe

Please sign in to comment.