Fix shaders on some GPUs
This commit is contained in:
@@ -21,14 +21,16 @@ const float e = 2.718281828459;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;
|
||||
float enable_bumpmapping = enableBumpmapping;
|
||||
|
||||
vec3 color;
|
||||
vec2 uv = gl_TexCoord[0].st;
|
||||
|
||||
#ifdef NORMALS
|
||||
float height;
|
||||
vec2 tsEye = vec2(tsEyeVec.x,-tsEyeVec.y);
|
||||
|
||||
float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;
|
||||
float enable_bumpmapping = enableBumpmapping;
|
||||
|
||||
if ((enableParallaxOcclusion == 1.0) && (use_normalmap > 0.0)) {
|
||||
float map_height = texture2D(normalTexture, uv).a;
|
||||
if (map_height < 1.0){
|
||||
@@ -49,6 +51,9 @@ void main (void)
|
||||
} else {
|
||||
color = texture2D(baseTexture, uv).rgb;
|
||||
}
|
||||
#else
|
||||
color = texture2D(baseTexture, uv).rgb;
|
||||
#endif
|
||||
|
||||
float alpha = texture2D(baseTexture, uv).a;
|
||||
vec4 col = vec4(color.r, color.g, color.b, alpha);
|
||||
|
@@ -18,12 +18,13 @@ const float e = 2.718281828459;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;
|
||||
float enable_bumpmapping = enableBumpmapping;
|
||||
|
||||
vec3 color;
|
||||
vec2 uv = gl_TexCoord[0].st;
|
||||
|
||||
#ifdef NORMALS
|
||||
float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;
|
||||
float enable_bumpmapping = enableBumpmapping;
|
||||
|
||||
if ((enable_bumpmapping == 1.0) && (use_normalmap > 0.0)) {
|
||||
vec3 base = texture2D(baseTexture, uv).rgb;
|
||||
vec3 vVec = normalize(eyeVec);
|
||||
@@ -36,6 +37,9 @@ void main (void)
|
||||
} else {
|
||||
color = texture2D(baseTexture, uv).rgb;
|
||||
}
|
||||
#else
|
||||
color = texture2D(baseTexture, uv).rgb;
|
||||
#endif
|
||||
|
||||
float alpha = texture2D(baseTexture, uv).a;
|
||||
vec4 col = vec4(color.r, color.g, color.b, alpha);
|
||||
|
@@ -17,11 +17,12 @@ const float e = 2.718281828459;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;
|
||||
float enable_bumpmapping = enableBumpmapping;
|
||||
|
||||
vec3 color;
|
||||
vec2 uv = gl_TexCoord[0].st;
|
||||
|
||||
#ifdef NORMALS
|
||||
float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;
|
||||
float enable_bumpmapping = enableBumpmapping;
|
||||
|
||||
if ((enable_bumpmapping == 1.0) && (use_normalmap > 0.0)) {
|
||||
vec3 base = texture2D(baseTexture, uv).rgb;
|
||||
@@ -35,6 +36,9 @@ void main (void)
|
||||
} else {
|
||||
color = texture2D(baseTexture, uv).rgb;
|
||||
}
|
||||
#else
|
||||
color = texture2D(baseTexture, uv).rgb;
|
||||
#endif
|
||||
|
||||
float alpha = gl_Color.a;
|
||||
vec4 col = vec4(color.r, color.g, color.b, alpha);
|
||||
|
@@ -17,11 +17,12 @@ const float e = 2.718281828459;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;
|
||||
float enable_bumpmapping = enableBumpmapping;
|
||||
|
||||
vec3 color;
|
||||
vec2 uv = gl_TexCoord[0].st;
|
||||
|
||||
#ifdef NORMALS
|
||||
float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;
|
||||
float enable_bumpmapping = enableBumpmapping;
|
||||
|
||||
if ((enable_bumpmapping == 1.0) && (use_normalmap > 0.0)) {
|
||||
vec3 base = texture2D(baseTexture, uv).rgb;
|
||||
@@ -35,6 +36,9 @@ void main (void)
|
||||
} else {
|
||||
color = texture2D(baseTexture, uv).rgb;
|
||||
}
|
||||
#else
|
||||
color = texture2D(baseTexture, uv).rgb;
|
||||
#endif
|
||||
|
||||
float alpha = texture2D(baseTexture, uv).a;
|
||||
vec4 col = vec4(color.r, color.g, color.b, alpha);
|
||||
|
@@ -23,14 +23,16 @@ const float e = 2.718281828459;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;
|
||||
float enable_bumpmapping = enableBumpmapping;
|
||||
|
||||
vec3 color;
|
||||
vec2 uv = gl_TexCoord[0].st;
|
||||
|
||||
#ifdef NORMALS
|
||||
float height;
|
||||
vec2 tsEye = vec2(tsEyeVec.x,-tsEyeVec.y);
|
||||
|
||||
float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;
|
||||
float enable_bumpmapping = enableBumpmapping;
|
||||
|
||||
if ((enableParallaxOcclusion == 1.0) && (use_normalmap > 0.0)) {
|
||||
float map_height = texture2D(normalTexture, uv).a;
|
||||
if (map_height < 1.0){
|
||||
@@ -69,6 +71,9 @@ void main (void)
|
||||
} else {
|
||||
color = texture2D(baseTexture, uv).rgb;
|
||||
}
|
||||
#else
|
||||
color = texture2D(baseTexture, uv).rgb;
|
||||
#endif
|
||||
|
||||
float alpha = texture2D(baseTexture, uv).a;
|
||||
vec4 col = vec4(color.r, color.g, color.b, alpha);
|
||||
|
Reference in New Issue
Block a user