From 8e7e9feb64f4bec1f030264502e9e977c2d0a9bf Mon Sep 17 00:00:00 2001 From: MikiZX1 <161243635+MikiZX1@users.noreply.github.com> Date: Sat, 18 Jan 2025 17:40:54 +0100 Subject: [PATCH] Update gbuffer.fs for GLES3 --- examples/shaders/resources/shaders/glsl100/gbuffer.fs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/shaders/resources/shaders/glsl100/gbuffer.fs b/examples/shaders/resources/shaders/glsl100/gbuffer.fs index f6e31357982d..f18c965618f4 100644 --- a/examples/shaders/resources/shaders/glsl100/gbuffer.fs +++ b/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); }