Fix GLES shader precision issues

This commit is contained in:
sfan5 2024-04-03 19:17:14 +02:00
parent 0ea1ec31fc
commit c15f4b89d1
7 changed files with 15 additions and 20 deletions

View File

@ -1,7 +1,7 @@
uniform vec4 fogColor;
uniform lowp vec4 fogColor;
uniform float fogDistance;
uniform float fogShadingParameter;
varying vec3 eyeVec;
varying highp vec3 eyeVec;
varying lowp vec4 varColor;

View File

@ -1,8 +1,8 @@
uniform vec4 emissiveColor;
uniform lowp vec4 emissiveColor;
varying lowp vec4 varColor;
varying vec3 eyeVec;
varying highp vec3 eyeVec;
void main(void)
{

View File

@ -1,13 +1,13 @@
uniform sampler2D baseTexture;
uniform vec3 dayLight;
uniform vec4 fogColor;
uniform lowp vec4 fogColor;
uniform float fogDistance;
uniform float fogShadingParameter;
uniform vec3 eyePosition;
// The cameraOffset is the current center of the visible world.
uniform vec3 cameraOffset;
uniform highp vec3 cameraOffset;
uniform float animationTimer;
#ifdef ENABLE_DYNAMIC_SHADOWS
// shadow texture
@ -44,11 +44,8 @@ varying mediump vec2 varTexCoord;
#else
centroid varying vec2 varTexCoord;
#endif
varying vec3 eyeVec;
varying highp vec3 eyeVec;
varying float nightRatio;
varying vec3 tsEyeVec;
varying vec3 lightVec;
varying vec3 tsLightVec;
#ifdef ENABLE_DYNAMIC_SHADOWS

View File

@ -4,7 +4,7 @@ uniform vec3 dayLight;
uniform vec3 eyePosition;
// The cameraOffset is the current center of the visible world.
uniform vec3 cameraOffset;
uniform highp vec3 cameraOffset;
uniform float animationTimer;
varying vec3 vNormal;
@ -44,7 +44,7 @@ centroid varying vec2 varTexCoord;
varying float area_enable_parallax;
varying vec3 eyeVec;
varying highp vec3 eyeVec;
varying float nightRatio;
// Color of the light emitted by the light sources.
const vec3 artificialLight = vec3(1.04, 1.04, 1.04);

View File

@ -1,13 +1,13 @@
uniform sampler2D baseTexture;
uniform vec3 dayLight;
uniform vec4 fogColor;
uniform lowp vec4 fogColor;
uniform float fogDistance;
uniform float fogShadingParameter;
uniform vec3 eyePosition;
// The cameraOffset is the current center of the visible world.
uniform vec3 cameraOffset;
uniform highp vec3 cameraOffset;
uniform float animationTimer;
#ifdef ENABLE_DYNAMIC_SHADOWS
// shadow texture
@ -44,7 +44,7 @@ varying mediump vec2 varTexCoord;
#else
centroid varying vec2 varTexCoord;
#endif
varying vec3 eyeVec;
varying highp vec3 eyeVec;
varying float nightRatio;
varying float vIDiff;

View File

@ -2,9 +2,7 @@ uniform mat4 mWorld;
uniform vec3 dayLight;
uniform vec3 eyePosition;
uniform float animationTimer;
uniform vec4 emissiveColor;
uniform vec3 cameraOffset;
uniform lowp vec4 emissiveColor;
varying vec3 vNormal;
varying vec3 vPosition;
@ -33,7 +31,7 @@ centroid varying vec2 varTexCoord;
varying float perspective_factor;
#endif
varying vec3 eyeVec;
varying highp vec3 eyeVec;
varying float nightRatio;
// Color of the light emitted by the light sources.
const vec3 artificialLight = vec3(1.04, 1.04, 1.04);

View File

@ -1,4 +1,4 @@
uniform vec4 emissiveColor;
uniform lowp vec4 emissiveColor;
void main(void)
{