Closed Bug 621007 Opened 9 years ago Closed 8 years ago

webgl in beta 8 doesn't render anything

Categories

(Core :: Canvas: WebGL, defect)

x86
Windows Vista
defect
Not set

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jykng, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows NT 6.0; WOW64; rv:2.0b8) Gecko/20100101 Firefox/4.0b8
Build Identifier: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:2.0b8) Gecko/20100101 Firefox/4.0b8

With beta 8 I can no longer see anything rendered in the webGL examples such as the ones at http://www.ibiblio.org/e-notes/webgl/webgl.htm, in places that were previously working in beta 7.

I'm using a NVidia 9500GS, with the most recent drivers on 64-bit vista.  I have webgl.enabled_for_all_sites set to true.

Trying the demo on the main beta page: http://videos-cdn.mozilla.net/serv/mozhacks/flight-of-the-navigator/

I get the following:

Could not initialise shader vert(attribute vec3 aVertex;
attribute vec2 aTex;
varying vec2 vTex;
void main(void)
{
vTex = aTex;
vec4 vPos = vec4(aVertex.xyz,1.0);
gl_Position = vPos;
}
), frag(#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D srcTex;
varying vec2 vTex;
void main(void)
{
gl_FragColor = texture2D(srcTex, vTex);
}
)

Could not initialise shader vert(attribute vec3 aVertex;
attribute vec2 aTex;
varying vec2 vTex;
void main(void)
{
vTex = aTex;
vec4 vPos = vec4(aVertex.xyz,1.0);
gl_Position = vPos;
}
), frag(#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D srcTex;
uniform vec3 texel_ofs;
varying vec2 vTex;
vec3 rangeValHDR(vec3 src)
{
return (src.r>0.90||src.g>0.90||src.b>0.90)?(src):vec3(0.0,0.0,0.0);
}
vec4 hdrSample(float rad)
{
vec3 accum;
float radb = rad*0.707106781;
accum =  rangeValHDR(texture2D(srcTex, vec2(vTex.s+texel_ofs.x*rad,  vTex.t)).rgb);
accum += rangeValHDR(texture2D(srcTex, vec2(vTex.s, 				 vTex.t+texel_ofs.y*rad)).rgb);
accum += rangeValHDR(texture2D(srcTex, vec2(vTex.s-texel_ofs.x*rad,  vTex.t)).rgb);
accum += rangeValHDR(texture2D(srcTex, vec2(vTex.s, 				 vTex.t-texel_ofs.y*rad)).rgb);
accum += rangeValHDR(texture2D(srcTex, vec2(vTex.s+texel_ofs.x*radb, vTex.t+texel_ofs.y*radb)).rgb);
accum += rangeValHDR(texture2D(srcTex, vec2(vTex.s-texel_ofs.x*radb, vTex.t-texel_ofs.y*radb)).rgb);
accum += rangeValHDR(texture2D(srcTex, vec2(vTex.s+texel_ofs.x*radb, vTex.t-texel_ofs.y*radb)).rgb);
accum += rangeValHDR(texture2D(srcTex, vec2(vTex.s-texel_ofs.x*radb, vTex.t+texel_ofs.y*radb)).rgb);
accum /= 8.0;
return vec4(accum,1.0);
}
void main(void)
{
vec4 color;
color = hdrSample(2.0);
color += hdrSample(4.0);
color += hdrSample(6.0);
gl_FragColor = color/2.0;
}
)

Could not initialise shader vert(attribute vec3 aVertex;
attribute vec2 aTex;
varying vec2 vTex;
void main(void)
{
vTex = aTex;
vec4 vPos = vec4(aVertex.xyz,1.0);
gl_Position = vPos;
}
), frag(#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D srcTex;
varying vec2 vTex;
uniform float opacity;
void main(void)
{
gl_FragColor = vec4(texture2D(srcTex, vTex).rgb, opacity);
}
)

Could not initialise shader vert(#define hasColorMap 1
#define hasSpecularMap 0
#define hasNormalMap 0
#define hasBumpMap 0
#define hasReflectMap 0
#define hasEnvSphereMap 0
#define hasAmbientMap 0
#define hasAlphaMap 0
#define hasAlpha 0
#define lightPoint 0
#define lightDirectional 0
#define lightSpot 0
#define lightArea 0

	attribute vec3 aVertexPosition;
	attribute vec3 aNormal;
	attribute vec2 aTextureCoord;

	uniform mat4 uMVMatrix;
	uniform mat4 uPMatrix;
	uniform mat4 uOMatrix;
	
	varying vec2 vTextureCoord;
	varying vec3 vNormal;
	varying vec4 vPosition;

#if hasEnvSphereMap
#if hasNormalMap
	varying vec3 u;
#else
	varying vec2 vEnvTextureCoord;
#endif
#endif

#if lightDirectional
	uniform vec3 lDir;
	varying vec3 lightDir;
#endif

varying vec3 camPos;
	
#if hasBumpMap
	varying vec3 eyeVec; 
#endif

void main(void) 
{
	mat4 uMVOMatrix = uMVMatrix * uOMatrix;
	mat4 uMVPMatrix = uPMatrix * uMVMatrix;
	
	
	vPosition = uMVOMatrix * vec4(aVertexPosition, 1.0);

	camPos.xyz = -(uMVMatrix * vec4(0.0,0.0,0.0,1.0)).xyz;//-vPosition.xyz;
	
	gl_Position = uPMatrix * vPosition;
	
	vTextureCoord = aTextureCoord;

	vNormal = normalize((uMVOMatrix * vec4(aNormal,0.0)).xyz); 

#if lightDirectional
	lightDir = normalize((uMVMatrix * vec4(lDir,0.0)).xyz);
#endif

#if hasEnvSphereMap
#if hasNormalMap
 	u = normalize( vPosition ).xyz;
 #else
	vec3 u = normalize( vec3(uMVMatrix * vec4(vPosition.xyz,1.0)) );
	vec3 r = reflect( vPosition.xyz - camPos, v_n );
	float m = 2.0 * sqrt( r.x*r.x + r.y*r.y + (r.z+1.0)*(r.z+1.0) );
	vEnvTextureCoord.s = r.x/m + 0.5;
	vEnvTextureCoord.t = r.y/m + 0.5;
#endif
#endif


#if hasBumpMap
	vec3 tangent;
	vec3 binormal;

	vec3 c1 = cross( aNormal, vec3(0.0, 0.0, 1.0) );
	vec3 c2 = cross( aNormal, vec3(0.0, 1.0, 0.0) );

	if( length(c1)>length(c2) )
	{
		tangent = c1;
	}
	else
	{
		tangent = c2;
	}

	tangent = normalize(tangent);

	binormal = cross(aNormal, tangent);
	binormal = normalize(binormal);

	mat3 TBNMatrix = mat3( (vec3 (uMVOMatrix * vec4 (tangent, 0.0))), (vec3 (uMVOMatrix * vec4 (binormal, 0.0))), (vec3 (uMVOMatrix * vec4 (aNormal, 0.0))));
	eyeVec = vec3(uMVOMatrix * vec4(aVertexPosition,1.0)) * TBNMatrix;
#endif
}), frag(#define hasColorMap 1
#define hasSpecularMap 0
#define hasNormalMap 0
#define hasBumpMap 0
#define hasReflectMap 0
#define hasEnvSphereMap 0
#define hasAmbientMap 0
#define hasAlphaMap 0
#define hasAlpha 0
#define lightPoint 0
#define lightDirectional 0
#define lightSpot 0
#define lightArea 0

#ifdef GL_ES
precision highp float;
#endif

uniform vec3 mDiff;
uniform vec3 mColor;
uniform vec3 mAmb;

varying vec3 vNormal;
varying vec2 vTextureCoord;
varying vec3 o_norm;

#if hasColorMap
	uniform sampler2D colorMap;
#endif

#if hasBumpMap
	varying vec3 eyeVec; 
	// varying vec3 u;
	uniform sampler2D bumpMap;
#endif


#if hasEnvSphereMap
	uniform sampler2D envSphereMap;
//	uniform float envAmount;
#if hasNormalMap
 	varying vec3 u;
#else
	varying vec2 vEnvTextureCoord;
#endif
#endif

#if hasNormalMap
	uniform sampler2D normalMap;
#endif

#if hasAlpha
	uniform float mAlpha;
#endif

#if hasAmbientMap
	uniform sampler2D ambientMap;
#endif

#if hasSpecularMap
	uniform sampler2D specularMap;
#endif

#if hasAlphaMap
	uniform sampler2D alphaMap;
#endif

uniform mat4 uMVMatrix;
uniform mat4 uPMatrix;
uniform mat4 uOMatrix;


#if lightPoint||lightDirectional||lightSpot||lightArea
	uniform vec3 lDiff;
	uniform vec3 lSpec;
	uniform float lInt;
	uniform float lDist;
	uniform vec3 lAmb;
	uniform vec3 lPos;

	uniform vec3 mSpec;
	uniform float mShine;
#endif

#if lightDirectional||lightSpot||lightArea
	uniform vec3 lDir;
#endif

#if lightDirectional
	varying vec3 lightDir;
#endif

varying vec3 camPos;
varying vec4 vPosition;

void main(void) 
{
	vec3 n;
	vec3 view_norm;
	vec4 color;
	
#if hasBumpMap
  float height = texture2D(bumpMap, vTextureCoord.xy).r;  
  float v = (height) * 0.05 - 0.04; // * scale and - bias 
  vec3 eye = normalize(eyeVec); 
  vec2 texCoord = vTextureCoord.xy + (eye.xy * v);
#else
	vec2 texCoord = vTextureCoord;
#endif


#if hasNormalMap
 		vec3 bumpNorm = vec3(texture2D(normalMap, texCoord));

#if hasEnvSphereMap
		view_norm = normalize(((bumpNorm-0.5)*2.0));
#endif
		bumpNorm = (uMVMatrix * vec4(normalize(((bumpNorm-0.5))),0.0)).xyz; 
		
		n = normalize(normalize(vNormal)+normalize(bumpNorm)/1.5);
		
#else
		n = normalize(vNormal);
		view_norm = (uPMatrix * vec4(n,0)).xyz;
#endif


#if hasColorMap
	color = vec4(mColor*texture2D(colorMap, vec2(texCoord.s, texCoord.t)).rgb,1.0);
#else
	color = vec4(mColor,1.0);
#endif

float envAmount = 0.6;

#if hasEnvSphereMap
#if hasNormalMap
	vec3 r = reflect( u, view_norm );
	float m = 2.0 * sqrt( r.x*r.x + r.y*r.y + (r.z+1.0)*(r.z+1.0) );

	vec3 coord;
	coord.s = r.x/m + 0.5;
	coord.t = r.y/m + 0.5;
	
	// #if hasReflectionMap
	// 	color += texture2D( envSphereMap, coord.st) * texture2D( reflectionMap, texCoord);
	// #else
		color = color*(1.0-envAmount) + texture2D( envSphereMap, coord.st) * envAmount;//envAmount;
	// #endif

#else
	// #if hasReflectionMap
	// 	color += texture2D( envSphereMap, gl_TexCoord[1].st) * texture2D( reflectionMap, texCoord);
	// #else
	 	color = color*(1.0-envAmount) + texture2D( envSphereMap, vEnvTextureCoord)*envAmount;
	// #endif
#endif

#endif


#if lightPoint
	vec3 halfV,viewV,ldir;
	float NdotL,NdotHV;

	vec3 lightPos = lPos;
	vec3 lightDir = lPos-vPosition.xyz;
//	vec3 halfVector = normalize(lightDir-camPos);
	float dist = length(lightDir);

	// compute the dot product between normal and normalized lightdir 
	NdotL = max(dot(n,normalize(lightDir)),0.0);

	vec3 lit = lAmb;

	if (NdotL > 0.0) 
	{
		// basic diffuse
		float distSqr = dot(lightDir, lightDir);
		float att = clamp(((lDist-dist)/lDist)*lInt, 0.0, lInt);			
//		color.rgb = att * (lDiff * NdotL);
		
		lit = att * NdotL * lDiff;

		// specular highlight
		// halfV = normalize(halfVector);
		// NdotHV = max(dot(n,halfV),0.0);
		// color += att * specVal * lSpec * pow(NdotHV,1.0);
	}
	
	color.rgb *= lit;
#endif





#if lightDirectional

	float NdotL,NdotHV;

//	vec3 lightDir;
	vec3 halfVector;
	vec3 lit = lAmb;

//	lightDir = normalize(lDir);
	halfVector = normalize(normalize(camPos)+normalize(lightDir));

	NdotL = max(dot(n,lightDir),0.0);

	if (NdotL > 0.0) 
	{
		lit += lInt * mDiff * lDiff * NdotL;		

		NdotHV = max(dot(n, halfVector),0.0);

		#if hasSpecularMap
			vec3 spec2 = lSpec * texture2D(specularMap, vec2(texCoord.s, texCoord.t)).rgb * pow(NdotHV,mShine);
		#else
			vec3 spec2 = lSpec * mSpec * pow(NdotHV,mShine);
		
		#endif

		lit += spec2;

		color.rgb *= lit;

		color.rgb += (spec2 + spec2*color.rgb)/2.0;
	}
	else
	{
		color.rgb *= lit;
	}


#endif

#if hasAlpha
#if hasAlphaMap
	color.a = texture2D(alphaMap, texCoord).r;
#else
	color.a = mAlpha;
#endif
#else
	color.a = 1.0;
#endif

#if hasAmbientMap
	color.rgb += mAmb+texture2D(ambientMap, texCoord).rgb;							
#else
	color.rgb += mAmb;
#endif


	gl_FragColor = color;

//gl_FragColor = vec4(1.0,0.0,1.0,0.0);

})

Could not initialise shader vert(#define hasColorMap 0
#define hasSpecularMap 0
#define hasNormalMap 0
#define hasBumpMap 0
#define hasReflectMap 0
#define hasEnvSphereMap 0
#define hasAmbientMap 0
#define hasAlphaMap 0
#define hasAlpha 0
#define lightPoint 0
#define lightDirectional 1
#define lightSpot 0
#define lightArea 0

	attribute vec3 aVertexPosition;
	attribute vec3 aNormal;
	attribute vec2 aTextureCoord;

	uniform mat4 uMVMatrix;
	uniform mat4 uPMatrix;
	uniform mat4 uOMatrix;
	
	varying vec2 vTextureCoord;
	varying vec3 vNormal;
	varying vec4 vPosition;

#if hasEnvSphereMap
#if hasNormalMap
	varying vec3 u;
#else
	varying vec2 vEnvTextureCoord;
#endif
#endif

#if lightDirectional
	uniform vec3 lDir;
	varying vec3 lightDir;
#endif

varying vec3 camPos;
	
#if hasBumpMap
	varying vec3 eyeVec; 
#endif

void main(void) 
{
	mat4 uMVOMatrix = uMVMatrix * uOMatrix;
	mat4 uMVPMatrix = uPMatrix * uMVMatrix;
	
	
	vPosition = uMVOMatrix * vec4(aVertexPosition, 1.0);

	camPos.xyz = -(uMVMatrix * vec4(0.0,0.0,0.0,1.0)).xyz;//-vPosition.xyz;
	
	gl_Position = uPMatrix * vPosition;
	
	vTextureCoord = aTextureCoord;

	vNormal = normalize((uMVOMatrix * vec4(aNormal,0.0)).xyz); 

#if lightDirectional
	lightDir = normalize((uMVMatrix * vec4(lDir,0.0)).xyz);
#endif

#if hasEnvSphereMap
#if hasNormalMap
 	u = normalize( vPosition ).xyz;
 #else
	vec3 u = normalize( vec3(uMVMatrix * vec4(vPosition.xyz,1.0)) );
	vec3 r = reflect( vPosition.xyz - camPos, v_n );
	float m = 2.0 * sqrt( r.x*r.x + r.y*r.y + (r.z+1.0)*(r.z+1.0) );
	vEnvTextureCoord.s = r.x/m + 0.5;
	vEnvTextureCoord.t = r.y/m + 0.5;
#endif
#endif


#if hasBumpMap
	vec3 tangent;
	vec3 binormal;

	vec3 c1 = cross( aNormal, vec3(0.0, 0.0, 1.0) );
	vec3 c2 = cross( aNormal, vec3(0.0, 1.0, 0.0) );

	if( length(c1)>length(c2) )
	{
		tangent = c1;
	}
	else
	{
		tangent = c2;
	}

	tangent = normalize(tangent);

	binormal = cross(aNormal, tangent);
	binormal = normalize(binormal);

	mat3 TBNMatrix = mat3( (vec3 (uMVOMatrix * vec4 (tangent, 0.0))), (vec3 (uMVOMatrix * vec4 (binormal, 0.0))), (vec3 (uMVOMatrix * vec4 (aNormal, 0.0))));
	eyeVec = vec3(uMVOMatrix * vec4(aVertexPosition,1.0)) * TBNMatrix;
#endif
}), frag(#define hasColorMap 0
#define hasSpecularMap 0
#define hasNormalMap 0
#define hasBumpMap 0
#define hasReflectMap 0
#define hasEnvSphereMap 0
#define hasAmbientMap 0
#define hasAlphaMap 0
#define hasAlpha 0
#define lightPoint 0
#define lightDirectional 1
#define lightSpot 0
#define lightArea 0

#ifdef GL_ES
precision highp float;
#endif

uniform vec3 mDiff;
uniform vec3 mColor;
uniform vec3 mAmb;

varying vec3 vNormal;
varying vec2 vTextureCoord;
varying vec3 o_norm;

#if hasColorMap
	uniform sampler2D colorMap;
#endif

#if hasBumpMap
	varying vec3 eyeVec; 
	// varying vec3 u;
	uniform sampler2D bumpMap;
#endif


#if hasEnvSphereMap
	uniform sampler2D envSphereMap;
//	uniform float envAmount;
#if hasNormalMap
 	varying vec3 u;
#else
	varying vec2 vEnvTextureCoord;
#endif
#endif

#if hasNormalMap
	uniform sampler2D normalMap;
#endif

#if hasAlpha
	uniform float mAlpha;
#endif

#if hasAmbientMap
	uniform sampler2D ambientMap;
#endif

#if hasSpecularMap
	uniform sampler2D specularMap;
#endif

#if hasAlphaMap
	uniform sampler2D alphaMap;
#endif

uniform mat4 uMVMatrix;
uniform mat4 uPMatrix;
uniform mat4 uOMatrix;


#if lightPoint||lightDirectional||lightSpot||lightArea
	uniform vec3 lDiff;
	uniform vec3 lSpec;
	uniform float lInt;
	uniform float lDist;
	uniform vec3 lAmb;
	uniform vec3 lPos;

	uniform vec3 mSpec;
	uniform float mShine;
#endif

#if lightDirectional||lightSpot||lightArea
	uniform vec3 lDir;
#endif

#if lightDirectional
	varying vec3 lightDir;
#endif

varying vec3 camPos;
varying vec4 vPosition;

void main(void) 
{
	vec3 n;
	vec3 view_norm;
	vec4 color;
	
#if hasBumpMap
  float height = texture2D(bumpMap, vTextureCoord.xy).r;  
  float v = (height) * 0.05 - 0.04; // * scale and - bias 
  vec3 eye = normalize(eyeVec); 
  vec2 texCoord = vTextureCoord.xy + (eye.xy * v);
#else
	vec2 texCoord = vTextureCoord;
#endif


#if hasNormalMap
 		vec3 bumpNorm = vec3(texture2D(normalMap, texCoord));

#if hasEnvSphereMap
		view_norm = normalize(((bumpNorm-0.5)*2.0));
#endif
		bumpNorm = (uMVMatrix * vec4(normalize(((bumpNorm-0.5))),0.0)).xyz; 
		
		n = normalize(normalize(vNormal)+normalize(bumpNorm)/1.5);
		
#else
		n = normalize(vNormal);
		view_norm = (uPMatrix * vec4(n,0)).xyz;
#endif


#if hasColorMap
	color = vec4(mColor*texture2D(colorMap, vec2(texCoord.s, texCoord.t)).rgb,1.0);
#else
	color = vec4(mColor,1.0);
#endif

float envAmount = 0.6;

#if hasEnvSphereMap
#if hasNormalMap
	vec3 r = reflect( u, view_norm );
	float m = 2.0 * sqrt( r.x*r.x + r.y*r.y + (r.z+1.0)*(r.z+1.0) );

	vec3 coord;
	coord.s = r.x/m + 0.5;
	coord.t = r.y/m + 0.5;
	
	// #if hasReflectionMap
	// 	color += texture2D( envSphereMap, coord.st) * texture2D( reflectionMap, texCoord);
	// #else
		color = color*(1.0-envAmount) + texture2D( envSphereMap, coord.st) * envAmount;//envAmount;
	// #endif

#else
	// #if hasReflectionMap
	// 	color += texture2D( envSphereMap, gl_TexCoord[1].st) * texture2D( reflectionMap, texCoord);
	// #else
	 	color = color*(1.0-envAmount) + texture2D( envSphereMap, vEnvTextureCoord)*envAmount;
	// #endif
#endif

#endif


#if lightPoint
	vec3 halfV,viewV,ldir;
	float NdotL,NdotHV;

	vec3 lightPos = lPos;
	vec3 lightDir = lPos-vPosition.xyz;
//	vec3 halfVector = normalize(lightDir-camPos);
	float dist = length(lightDir);

	// compute the dot product between normal and normalized lightdir 
	NdotL = max(dot(n,normalize(lightDir)),0.0);

	vec3 lit = lAmb;

	if (NdotL > 0.0) 
	{
		// basic diffuse
		float distSqr = dot(lightDir, lightDir);
		float att = clamp(((lDist-dist)/lDist)*lInt, 0.0, lInt);			
//		color.rgb = att * (lDiff * NdotL);
		
		lit = att * NdotL * lDiff;

		// specular highlight
		// halfV = normalize(halfVector);
		// NdotHV = max(dot(n,halfV),0.0);
		// color += att * specVal * lSpec * pow(NdotHV,1.0);
	}
	
	color.rgb *= lit;
#endif





#if lightDirectional

	float NdotL,NdotHV;

//	vec3 lightDir;
	vec3 halfVector;
	vec3 lit = lAmb;

//	lightDir = normalize(lDir);
	halfVector = normalize(normalize(camPos)+normalize(lightDir));

	NdotL = max(dot(n,lightDir),0.0);

	if (NdotL > 0.0) 
	{
		lit += lInt * mDiff * lDiff * NdotL;		

		NdotHV = max(dot(n, halfVector),0.0);

		#if hasSpecularMap
			vec3 spec2 = lSpec * texture2D(specularMap, vec2(texCoord.s, texCoord.t)).rgb * pow(NdotHV,mShine);
		#else
			vec3 spec2 = lSpec * mSpec * pow(NdotHV,mShine);
		
		#endif

		lit += spec2;

		color.rgb *= lit;

		color.rgb += (spec2 + spec2*color.rgb)/2.0;
	}
	else
	{
		color.rgb *= lit;
	}


#endif

#if hasAlpha
#if hasAlphaMap
	color.a = texture2D(alphaMap, texCoord).r;
#else
	color.a = mAlpha;
#endif
#else
	color.a = 1.0;
#endif

#if hasAmbientMap
	color.rgb += mAmb+texture2D(ambientMap, texCoord).rgb;							
#else
	color.rgb += mAmb;
#endif


	gl_FragColor = color;

//gl_FragColor = vec4(1.0,0.0,1.0,0.0);

})

Reproducible: Always

Actual Results:  
Nothing appears in most of the examples except the background

Expected Results:  
There should be a 3d object somewhere.
I set the verbose messages to true, and I get the following warning in the error console:

Warning: WebGL: UseProgram: program was not linked successfully
Please post your Graphics Info from about:support (Bottom).
Severity: major → normal
Component: General → Canvas: WebGL
Product: Firefox → Core
QA Contact: general → canvas.webgl
I am experiencing exactly the same issues - same errors on the same demo, and it worked fine on Beta 7 and now fails on Beta 8. Here is my Graphics Info:

  Graphics

        Adapter Description
        NVIDIA GeForce 8600M GT

        Vendor ID
        10de

        Device ID
        0407

        Adapter RAM
        256

        Adapter Drivers
        nvd3dum nvwgf2um,nvwgf2um

        Driver Version
        8.17.12.6099

        Driver Date
        10-16-2010

        Direct2D Enabled
        true

        DirectWrite Enabled
        true

      GPU Accelerated Windows
      1/1 Direct3D 10

Was not able to solve the problem with a clean profile, driver update, or by turning hardware acceleration on and off.
ANGLE requires the latest DirectX Runtimes to be installed. Download, extract to a folder, run DXSetup.exe.

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=3b170b25-abab-4bc3-ae91-50ceb6d8fa8d

The other alternative is to use native Nvidia OpenGL drivers which is faster, about:config, right-click, new, boolean, webgl.prefer_gl and set to True.
Why we need to update DirectX? It should choose automatically the GL driver and falls back if it is not available to DirectX.

I tested Chrome 10 without updating DirectX and it works fine, while the latest Minefield nightly fails.
(In reply to comment #5)
> Why we need to update DirectX? It should choose automatically the GL driver and
> falls back if it is not available to DirectX.

Correct, there's no need to set webgl.prefer_gl.  It shold use the GL drivers directly.

> I tested Chrome 10 without updating DirectX and it works fine, while the latest
> Minefield nightly fails.

Chrome is shipping the DirectX libraries needed directly along with Chrome.  We're working on it.
(In reply to comment #0)
> User-Agent:       Mozilla/5.0 (Windows NT 6.0; WOW64; rv:2.0b8) Gecko/20100101
> Firefox/4.0b8

Oh.  You're running the 64-bit build.  This build is unsupported, and WebGL is disabled due to the shader translater not currently being built in 64-bit windows.  It's not a high priority to fix because 64-bit windows isn't a supported config -- install the 32-bit Firefox.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 616918
WOW64 (Windows 32 on Windows 64) in the useragent means the 32bit build.

This is a 64bit UA:

Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.0b9pre) Gecko/20101224 Firefox/4.0b9pre
Also, Firefox/4.0b8 is a beta release (not nightly), of which there is no 64bit version available at all.
Ah, I was confused; didn't realize we were putting WOW64 in the UA (can never remember whether WOW64 meant 32-bit or not).  In that case, I've no idea why you're not seeing GL content..  however, have you tried something simple, such as http://people.mozilla.com/~vladimir/webgl/examples/gles2book/ch2-hello-triangle.html ?  If that renders a triangle, there's something else going on.
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: DUPLICATE → ---
similar problem for me with win vista (32bit) using latest-trunk
manually setting webgl.prefer_gl works though (I did not try updating DirectX)

about:config says:
  Graphics

        Adapter Description
        NVIDIA GeForce 9600M GT

        Vendor ID
        10de

        Device ID
        0649

        Adapter RAM
        512

        Adapter Drivers
        nvd3dum nvwgf2um,nvwgf2um

        Driver Version
        8.17.12.6099

        Driver Date
        10-16-2010

        Direct2D Enabled
        true

        DirectWrite Enabled
        true

        WebGL Renderer
        TransGaming Inc. -- ANGLE -- OpenGL ES 2.0 (git-devel Jan 12 2011 04:24:03)

        GPU Accelerated Windows
        2/2 Direct3D 10


error console output from:
- Flight of the Navigator:
Error: uncaught exception: Error linking shaders.

- Link from comment #10 (I do not see the triangle):
Error: uncaught exception: [Exception... "Could not convert JavaScript argument arg 0 [nsIDOMWebGLRenderingContext.deleteProgram]"  nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame :: http://people.mozilla.com/~vladimir/webgl/examples/gles2book/ch2-hello-triangle.html :: init :: line 110"  data: no]
With beta 9 it's still failing whenever the function webglvar.useProgram(v) is called in those demos, and WebGL is still having problems rendering.  I assume that beta 9 never had any changes in this regard when dealing with WebGL.

With that triangle example one of the errors is also the same:

Error: uncaught exception: [Exception... "Could not convert JavaScript argument arg 0 [nsIDOMWebGLRenderingContext.deleteProgram]"  nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame :: http://people.mozilla.com/~vladimir/webgl/examples/gles2book/ch2-hello-triangle.html :: init :: line 110"  data: no]
@ vlad : bug report for your demo:

(In reply to comment #12)
> With beta 9 it's still failing whenever the function webglvar.useProgram(v) is
> called in those demos, and WebGL is still having problems rendering.  I assume
> that beta 9 never had any changes in this regard when dealing with WebGL.
> 
> With that triangle example one of the errors is also the same:
> 
> Error: uncaught exception: [Exception... "Could not convert JavaScript argument
> arg 0 [nsIDOMWebGLRenderingContext.deleteProgram]"  nsresult: "0x80570009
> (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame ::
> http://people.mozilla.com/~vladimir/webgl/examples/gles2book/ch2-hello-triangle.html
> :: init :: line 110"  data: no]

This javascript code is broken, that's why it doesn't work: at line 110:

	gl.deleteProgram(fragmentShader);

This is calling deleteProgram on a shader.
Note that with all the webGL examples, it does render on my work computer which is 32-bit XP and with a different video card, but never seems to work on my home computer which uses 64-bit vista.

And I meant to post this here but it ended up in the other bug (for my home computer where rendering doesn't work):

Adapter Description: NVIDIA GeForce 9500GS
Vendor ID: 10de
Device ID: 0644
Adapter RAM: 512
Adapter Drivers: nvd3dumx,nvwgf2umx,nvwgf2umx nvd3dum,nvwgf2um,nvwgf2um
Driver Version:8.17.12.6099
Driver Date: 10-16-2010
Direct2D Enabled: true
DirectWrite Enabled: true
GPU Accelerated Windows: 1/1 Direct3D 10
I now have beta 10 and the 266.58 drivers from nVidia (listed as Driver Version: 8.17.12.6658) and I still have the same problem with UseProgram not linked successfully with every WebGL example I try.
Jason, if you go to about:config and create webgl.prefer_gl=true, does that make a difference?

(note: very soon prefer_gl is going to get renamed prefer-native-gl and will be existing by default (and set to false))
It works with webgl.prefer_gl=true
(In reply to comment #11)

It is now working for me using latest-trunk and the default settings.
All info in the about:support Graphics section stayed the same, except that
the "WebGL Renderer" is now displayed as "NVIDIA Corporation -- GeForce 9600M GT/PCI/SSE2 -- 3.3.0"
(In reply to comment #18)

sorry, about:support now says "WebGL Renderer" is "Google Inc. -- ANGLE -- OpenGL ES 2.0 (ANGLE 0.0.0.541)" (bug 630019)
But it is working now after manually updating DirectX.
Jason, does WebGL work for you now?
Odds are that this was fixed, possibly as part of the ongoing work on ANGLE.
(In reply to Jeff Gilbert [:jgilbert] from comment #20)
> Jason, does WebGL work for you now?
> Odds are that this was fixed, possibly as part of the ongoing work on ANGLE.

It was fixed a while ago.
Status: REOPENED → RESOLVED
Closed: 9 years ago8 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.