ValhallaTeam / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

No display, no errors in Firefox (ANGLE r1561). #443

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open the web page http://www.stats.uwo.ca/faculty/murdoch/webGL in Firefox

What is the expected output? What do you see instead?

It should display a rotatable red cube.  Instead I see a blank display.

What version of the product are you using? On what operating system?

I'm using Firefox 22.0, which has ANGLE r1561 plus some patches, according to 
this page:

http://hg.mozilla.org/releases/mozilla-release/file/tip/gfx/angle/README.mozilla

Please provide any additional information below.

Back in April with Firefox 20.0.1 I got error messages similar to those 
reported in issue 387, which was reported fixed as of r1557.

http://code.google.com/p/angleproject/issues/detail?id=387

Now I get this error in the console, though I don't think I have
any divisions in the code.  I do use normalize() which probably involves one.

Timestamp: 28/06/2013 11:20:13 AM
Warning: Error: WebGL: linkProgram failed, with this log:
(29,22): warning X4008: floating point division by zero
(16,8): error X4579: NaN and infinity literals not allowed by shader model

Warning: D3D shader compilation failed with default flags. Retrying with avoid 
flow control.
(29,22): warning X4008: floating point division by zero
(16,8): error X4579: NaN and infinity literals not allowed by shader model

Warning: D3D shader compilation failed with avoid flow control flags. Retrying 
with prefer flow control.
(29,22): warning X4008: floating point division by zero
(16,8): error X4579: NaN and infinity literals not allowed by shader model

Warning: D3D shader compilation failed with prefer flow control flags.

Source File: http://www.stats.uwo.ca/faculty/murdoch/webGL/
Line: 180

Original issue reported on code.google.com by murdoch....@gmail.com on 28 Jun 2013 at 3:28

GoogleCodeExporter commented 9 years ago
Sorry, misleading title:  I do get errors in the log.

Original comment by murdoch....@gmail.com on 28 Jun 2013 at 3:32

GoogleCodeExporter commented 9 years ago
I've been informed of the cause of this:  the page has declarations in the 
fragment shader that initialize variables.  Apparently (some of?) these 
shouldn't be global declarations, they need to be moved inside main():

varying vec4 vCol; // carries alpha
varying vec4 vPosition;
varying vec3 vNormal;
vec3 eye = normalize(-vPosition.xyz);
const vec3 emission = vec3(0., 0., 0.);
const vec3 ambient1 = vec3(0., 0., 0.);
const vec3 specular1 = vec3(1., 1., 1.);// light*material
const float shininess1 = 50.;
vec4 colDiff1 = vec4(vCol.rgb * vec3(1., 1., 1.), vCol.a);
const vec3 lightDir1 = vec3(0., 0., 1.);
vec3 halfVec1 = normalize(lightDir1 + eye);
void main(void) {

When I move all of the initialized variables inside main, things display 
properly.  That makes sense, though I can't find documentation requiring this, 
and other webGL engines cope with the original form.

Original comment by murdoch....@gmail.com on 5 Jul 2013 at 3:21

GoogleCodeExporter commented 9 years ago
I'm able to reproduce this with the latest Chrome Canary. I believe the problem 
is that we use HLSL global variables for the attributes, which we initialize to 
zero and only assign the actual input values within main(). So any global 
expression using attributes will use the zeros, which in this case results in a 
division by zero in the optimizer.

Original comment by c...@chromium.org on 22 May 2014 at 2:40

GoogleCodeExporter commented 9 years ago
This has been fixed in recent versions of ANGLE and the linked page now works 
in Chrome.  Firefox doesn't seem to have picked up the change yet though.

Original comment by geofflang@chromium.org on 29 Apr 2015 at 6:38