Closed
Bug 689136
Opened 13 years ago
Closed 13 years ago
gl.depthmask(false) produces unexpected result
Categories
(Core :: Graphics: CanvasWebGL, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: trigrou, Unassigned)
References
Details
Attachments
(6 files)
User Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.2 (KHTML, like Gecko) Ubuntu/11.10 Chromium/15.0.865.0 Chrome/15.0.865.0 Safari/535.2
Steps to reproduce:
using the webpage in the zip
Actual results:
It display a plane and a green cube on chrome. If you move the mouse to change the camera it looks normal.
On firefox I see a green cube but not the plane and when I change the camera with the mouse, there is a kind of z bug
Expected results:
It should work like in chrome meaning viewing green cube with the plane.
Reporter | ||
Comment 1•13 years ago
|
||
Comment 2•13 years ago
|
||
This was obtained by editing osg-debug.js to comment out the requestAnimationFrame call to draw only one frame.
Firefox renders a gray frame, no green cube.
Comment 3•13 years ago
|
||
Chrome renders the scene with the green cube.
Comment 4•13 years ago
|
||
generated by:
egrep -i draw\|clear\|depth\|buffer firefox-trace-trigrou | egrep -v EXTENSIONS\|glX > firefox-simple
Comment 5•13 years ago
|
||
egrep -i draw\|clear\|depth\|buffer chrome-trace-trigrou | egrep -v EXTENSIONS\|glX > chrome-simple
Comment 6•13 years ago
|
||
Right at the beginning, Firefox does glClearDepth(1) while Chrome does glClearDepth(0).
That would explain it.
Comment 7•13 years ago
|
||
Drawingbuffer default values are described here:
http://www.khronos.org/registry/webgl/specs/latest/#2.2
Renderbuffer default values are described here:
http://www.khronos.org/registry/webgl/specs/latest/#4.1
in both cases, the default value of depth is 1, not 0.
-> Chrome bug.
Comment 8•13 years ago
|
||
Current WebKit sources look fine, and the script does call clearDepth, so this seems to be a red herring. Still CC'ing Gregg as there might be a performance issue if WebKit is uselessly clearing the depth buffer with zero value.
Comment 9•13 years ago
|
||
Further investigation:
* the difference between the clear-calls between firefox and chrome comes from the fact that firefox clears the whole drawingbuffer and then remembers that it's cleared and that the clear-values are the default values so that it skips subsequent clear-calls.
* reloading the page in firefox makes it work, and putting a alert() before the clear() call also makes it work, so there must be a firefox bug.
Comment 10•13 years ago
|
||
Possibly related: bug 677543
Updated•13 years ago
|
Component: General → Graphics
Product: Firefox → Core
QA Contact: general → thebes
Updated•13 years ago
|
Component: Graphics → Canvas: WebGL
QA Contact: thebes → canvas.webgl
Updated•13 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 11•13 years ago
|
||
Almost certainly a dupe of 677543. Patch coming there. Will dupe when i'm 100% sure.
Reporter | ||
Comment 12•13 years ago
|
||
Any workaround ? I tried to use a gl.clearColor(0.01, 0.01, 0.01, 0.01) and gl.clear(allbits) at the begining of the frame but it does not help.
Any hints ?
Comment 13•13 years ago
|
||
As discussed with Cedric: he was relying on gl.clear not being affected by gl.depthmask. The GLES 2.0.25 spec page 103 says that gl.clear is affected by the masks.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•