[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Requiring certain combinations for framebuffer attachments to work in WebGL



As Gregg pointed out, WebGL has to support DEPTH_STENCIL, even if that means emulating it on platforms which don't support it. I agree that it's silly to do all this work if it's valid to refuse to render to it.

-Jeff

----- Original Message -----
From: "Zhenyao Mo" <zhenyao@gmail.com>
To: "Gregg Tavares (çç)" <gman@google.com>
Cc: "public webgl" <public_webgl@khronos.org>
Sent: Thursday, June 14, 2012 5:20:01 PM
Subject: Re: [Public WebGL] Requiring certain combinations for framebuffer attachments to work in WebGL




On Thu, Jun 14, 2012 at 5:14 PM, Gregg Tavares (çç) < gman@google.com > wrote: 








On Thu, Jun 14, 2012 at 4:37 PM, Mo, Zhenyao < zhenyao@gmail.com > wrote: 







On Thu, Jun 14, 2012 at 4:00 PM, Gregg Tavares (çç) < gman@google.com > wrote: 



OpenGL ES 2.0 only requires 1 combination of framebuffer attachments to work. In other words, it can fail to allow rendering to an GL_RGBA4 renderbuffer as well as a GL_RGBA/UNSIGNED_BYTE texture as long as it say allows rendering to a GL_ALPHA/UNSIGNED_BYTE texture. 


This makes it really hard to write conformance tests for FBOs because there's no guarantee that any specific format will work alone nor any 2 or more formats will work together. 


So for example, it turns out, Chrome was not allowing DEPTH_STENCIL + COLOR attachments and the conformance tests was not able to point this out since by the spec that combination might not work on some platforms and so the test has to pass. 


The spec requires that it's possible to create a DEPTH_STENCIL and that it's possible to attach it but the spec does NOT require that you have to be able to render do it or be able use it with any other attachments. 


What if any platforms would break if we required certain combinations to work? Specifically 


COLOR_ATTACHMENT0 = RGBA/UNSIGNED_BYTE texture 
COLOR_ATTACHMENT0 = RGBA/UNSIGNED_BYTE texture + DEPTH_ATTACHMENT = DEPTH_COMPONENT16 renderbuffer 

COLOR_ATTACHMENT0 = RGBA/UNSIGNED_BYTE texture + DEPTH_STENCIL_ATTACHMENT = DEPTH_STENCIL renderbuffer 




I think at least the first combinations should be required. Maybe requiring 2 or 3 but not both? 


the reason I included 3 is it's required by the WebGL spec that you can create a DEPTH_STENCIL. It seems silly that it's not required to actually be usable though. Right now the spec does not require that you can render to a DEPTH_STENCIL in any form with or without other attachments. 





The reason I said 2 or 3 is I am not sure if all hardwares out there can supports both. I don't have any data, so if most hardwares are able to support the above three today, then definitely I am fine with requiring all three. 

















Anything else would be left optional but these 3 combinations would be required. 


Thoughts? 







-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------