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:
I'm only using one shader (adapted from Sean's I think):
Any ideas?
Retro Bowl
Retro Bowl is the perfect game for the armchair quarterback to finally prove a point. Presented in a glorious retro style, the game has simple roster managemen...
www.kongregate.com
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;
}