瀏覽代碼

[examples] Fix PBR and Shadowmap example shaders for GLSL 1.20 (#4167)

* 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
pull/4175/head
CDM15y 10 月之前
committed by GitHub
父節點
當前提交
2d94d8d06d
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: B5690EEEBB952194
共有 2 個文件被更改,包括 10 次插入14 次删除
  1. +7
    -9
      examples/shaders/resources/shaders/glsl120/pbr.fs
  2. +3
    -5
      examples/shaders/resources/shaders/glsl120/shadowmap.fs

+ 7
- 9
examples/shaders/resources/shaders/glsl120/pbr.fs 查看文件

@ -1,7 +1,5 @@
#version 120
precision mediump float;
#define MAX_LIGHTS 4
#define LIGHT_DIRECTIONAL 0
#define LIGHT_POINT 1
@ -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
@ -153,4 +151,4 @@ void main()
gl_FragColor = vec4(color,1.0);
}
}

+ 3
- 5
examples/shaders/resources/shaders/glsl120/shadowmap.fs 查看文件

@ -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;

Loading…
取消
儲存