oizma / angleproject

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

gl_FragCoord is computed incorrectly for points of size > 1 #71

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Original bug filed by deanm@chromium.org under http://crbug.com/59762 .

The attached WebGL test case demonstrates that gl_FragCoord is not being 
computed properly when rendering point sprites of size > 1. The lower left 
three quads should have visible gradients across them.

The root cause is that while the Direct3D 9 documentation claims that points 
are rasterized as a quadrilateral (see 
http://msdn.microsoft.com/en-us/library/bb147281(VS.85).aspx ), in fact only 
one vertex is processed. The gl_FragCoord emulation in ANGLE works by sending a 
varying variable from the vertex to the fragment shader, but this never gets an 
opportunity to assign and interpolate different values for the vertices of the 
quadrilateral.

The most effective fix is to use the VPOS semantic to implement gl_FragCoord 
when Shader Model 3 is supported.

Original issue reported on code.google.com by kbr@chromium.org on 5 Nov 2010 at 1:15

Attachments:

GoogleCodeExporter commented 9 years ago
Nicolas Capens pointed out that the z and w coordinates provided by the VPOS 
semantic do not provide the guarantees required by the OpenGL ES 2.0 spec. 
Adjusting the technique to use VPOS's x and y coordinates only when they are 
available.

Original comment by kbr@chromium.org on 5 Nov 2010 at 6:56

GoogleCodeExporter commented 9 years ago
Code review ongoing under http://codereview.appspot.com/2921041/ .

Original comment by kbr@chromium.org on 5 Nov 2010 at 6:57

GoogleCodeExporter commented 9 years ago
Fixed in r473 per http://codereview.appspot.com/2921041/ .

Original comment by kbr@chromium.org on 5 Nov 2010 at 11:09