• Hey! Guest! The 37th GMC Jam will take place between May 28th, 12:00 UTC and June 1st, 12:00 UTC. Why not join in! Click here to find out more!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

HTML5 Firefox issue

siread

Member
My game is working fine on Chrome, Edge and was ok on Firefox until a recent Firefox update. Now the error "Could not compile vertex shader" appears when the game starts:
1584629573782.png

I'm only using one shader (adapted from Sean's I think):
GML:
//
// Simple passthrough vertex shader
//
attribute vec3 in_Position;                  // (x,y,z)
//attribute vec3 in_Normal;                  // (x,y,z)     unused in this shader.
attribute vec4 in_Colour;                    // (r,g,b,a)
attribute vec2 in_TextureCoord;              // (u,v)

varying vec2 v_vTexcoord;
varying vec4 v_vColour;

void main()
{
    vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0);
    gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
    
    v_vColour = in_Colour;
    v_vTexcoord = in_TextureCoord;
}
Code:
varying vec2 v_vTexcoord;

uniform vec3 colorHelmet;
uniform vec3 colorShirt;
uniform vec3 colorShirt_b;
uniform vec3 colorPants;
uniform vec3 colorPants_b;
uniform vec3 colorSkin;
uniform vec3 colorCleats;

uniform vec3 replaceHelmet;
uniform vec3 replaceShirt;
uniform vec3 replaceShirt_b;
uniform vec3 replacePants;
uniform vec3 replacePants_b;
uniform vec3 replaceSkin;
uniform vec3 replaceCleats;

void main()
{
    vec4 pixel = texture2D( gm_BaseTexture, v_vTexcoord );
    vec3 eps = vec3(0.009, 0.009, 0.009);

    if( all( greaterThanEqual(pixel, vec4(colorHelmet - eps, 1.0)) ) && all( lessThanEqual(pixel, vec4(colorHelmet + eps, 1.0)) ) )
        pixel = vec4(replaceHelmet, 1.0);
    
    if( all( greaterThanEqual(pixel, vec4(colorShirt - eps, 1.0)) ) && all( lessThanEqual(pixel, vec4(colorShirt + eps, 1.0)) ) )
        pixel = vec4(replaceShirt, 1.0);
        
    if( all( greaterThanEqual(pixel, vec4(colorShirt_b - eps, 1.0)) ) && all( lessThanEqual(pixel, vec4(colorShirt_b + eps, 1.0)) ) )
        pixel = vec4(replaceShirt_b, 1.0);
        
    if( all( greaterThanEqual(pixel, vec4(colorPants - eps, 1.0)) ) && all( lessThanEqual(pixel, vec4(colorPants + eps, 1.0)) ) )
        pixel = vec4(replacePants, 1.0);
        
    if( all( greaterThanEqual(pixel, vec4(colorPants_b - eps, 1.0)) ) && all( lessThanEqual(pixel, vec4(colorPants_b + eps, 1.0)) ) )
        pixel = vec4(replacePants_b, 1.0);
        
    if( all( greaterThanEqual(pixel, vec4(colorSkin - eps, 1.0)) ) && all( lessThanEqual(pixel, vec4(colorSkin + eps, 1.0)) ) )
        pixel = vec4(replaceSkin, 1.0);
        
    if( all( greaterThanEqual(pixel, vec4(colorCleats - eps, 1.0)) ) && all( lessThanEqual(pixel, vec4(colorCleats + eps, 1.0)) ) )
        pixel = vec4(replaceCleats, 1.0);

    gl_FragColor = pixel;
}
Any ideas?
 

Ricardo

Member
It is a Firefox 74.0 known bug. It was corrected already and the fix is scheduled for Firefox 75.
It's hard to say if there's something we can do on our side as a workaround.
 
Top