Skip to content

Commit

Permalink
[examples] Fix PBR and Shadowmap example shaders for GLSL 1.20 (#4167)
Browse files Browse the repository at this point in the history
* Update pbr.fs

remove presicion mediump float because it is for GLES, and not desktop GL

* Fix shadowmap.fs

also suffers the same problem as pbr.fs
  • Loading branch information
CDM15y committed Jul 20, 2024
1 parent aa70d32 commit 2d94d8d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
16 changes: 7 additions & 9 deletions examples/shaders/resources/shaders/glsl120/pbr.fs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#version 120

precision mediump float;

#define MAX_LIGHTS 4
#define LIGHT_DIRECTIONAL 0
#define LIGHT_POINT 1
Expand All @@ -17,12 +15,12 @@ struct Light {
};

// Input vertex attributes (from vertex shader)
varying in vec3 fragPosition;
varying in vec2 fragTexCoord;
varying in vec4 fragColor;
varying in vec3 fragNormal;
varying in vec4 shadowPos;
varying in mat3 TBN;
varying vec3 fragPosition;
varying vec2 fragTexCoord;
varying vec4 fragColor;
varying vec3 fragNormal;
varying vec4 shadowPos;
varying mat3 TBN;


// Input uniform values
Expand Down Expand Up @@ -153,4 +151,4 @@ void main()

gl_FragColor = vec4(color,1.0);

}
}
8 changes: 3 additions & 5 deletions examples/shaders/resources/shaders/glsl120/shadowmap.fs
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#version 120

precision mediump float;

// This shader is based on the basic lighting shader
// This only supports one light, which is directional, and it (of course) supports shadows

// Input vertex attributes (from vertex shader)
varying in vec3 fragPosition;
varying in vec2 fragTexCoord;
varying vec3 fragPosition;
varying vec2 fragTexCoord;
//varying in vec4 fragColor;
varying in vec3 fragNormal;
varying vec3 fragNormal;

// Input uniform values
uniform sampler2D texture0;
Expand Down

0 comments on commit 2d94d8d

Please sign in to comment.