Skip to content

Commit a1dfb70

Browse files
committed
glsl: fix int/float type mismatch
Some GL ES drivers running under GL4ES may be very picky about typing and GL4ES still has to implement casting.
1 parent 677656a commit a1dfb70

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/engine/renderer/glsl_source/fogEquation_fp.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3434

3535
float FogGradientFunction(float k, float t)
3636
{
37-
return 1 - exp(-k * t);
37+
return 1.0 - exp(-k * t);
3838
}
3939

4040
float FogGradientAntiderivative(float k, float t)

src/engine/renderer/glsl_source/fog_fp.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void main()
124124

125125
float s = distInFog * GetFogGradientModifier(u_FogGradient.y, t0, t1) * u_FogGradient.x;
126126

127-
vec4 color = vec4(1, 1, 1, GetFogAlpha(s));
127+
vec4 color = vec4(1.0, 1.0, 1.0, GetFogAlpha(s));
128128

129129
outputColor = UnpackColor( u_Color ) * color;
130130
}

src/engine/renderer/glsl_source/vertexAnimation_vp.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void VertexAnimation_P_N( vec3 fromPosition, vec3 toPosition,
4141
vec3 toNormal = QuatTransVec( toQTangent, vec3( 0.0, 0.0, 1.0 ) );
4242

4343
position.xyz = 512.0 * mix(fromPosition, toPosition, frac);
44-
position.w = 1;
44+
position.w = 1.0;
4545

4646
normal = normalize(mix(fromNormal, toNormal, frac));
4747
}
@@ -58,7 +58,7 @@ void VertexFetch(out vec4 position,
5858
QTangentToLocalBasis( attr_QTangent2, toLB );
5959

6060
position.xyz = 512.0 * mix(attr_Position, attr_Position2, u_VertexInterpolation);
61-
position.w = 1;
61+
position.w = 1.0;
6262

6363
LB.normal = normalize(mix(fromLB.normal, toLB.normal, u_VertexInterpolation));
6464
LB.tangent = normalize(mix(fromLB.tangent, toLB.tangent, u_VertexInterpolation));

0 commit comments

Comments
 (0)