Fix imposter shader compilation on web
@@ -9,12 +9,12 @@ layout (location = 1) out vec4 out_normal;
void main()
{
- float layer = no_views * t;
+ float layer = float(no_views) * t;
vec4 color0 = texture(tex, vec3(uv, floor(layer)));
vec4 color1 = texture(tex, vec3(uv, int(ceil(layer)) % no_views));
vec4 color = mix(color0, color1, fract(layer));
- vec4 normal0 = texture(tex, vec3(uv, no_views + floor(layer)));
- vec4 normal1 = texture(tex, vec3(uv, no_views + int(ceil(layer)) % no_views));
+ vec4 normal0 = texture(tex, vec3(uv, float(no_views) + floor(layer)));
+ vec4 normal1 = texture(tex, vec3(uv, float(no_views + int(ceil(layer)) % no_views)));
vec4 normal = mix(normal0, normal1, fract(layer));
if(color0.a < 0.01 && normal0.a < 0.01 || color1.a < 0.01 && normal1.a < 0.01) { // No diffuse or specular intensity. Test depth instead? Dithering?
discard;
