Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make readRenderTargetPixels() work with implementation defined formats #7226

Merged
merged 1 commit into from
Sep 23, 2015

Conversation

nraynaud
Copy link
Contributor

We have to bind the buffer before doing the test, because the answer is circumstantial ( https://www.khronos.org/registry/webgl/specs/1.0/#readpixels ).

Did you know that with the OES_texture_float extension Chrome allows rendering to a float texture then reading a float render target to a Float32ArrayBuffer in readPixels() ?

…formats

We have to bind the buffer before making the test, because the answer is circumstantial ( https://www.khronos.org/registry/webgl/specs/1.0/#readpixels ).

Did you know that with the OES_texture_float extension Chrome allows rendering to a float texture then reading a float render target to a Float32ArrayBuffer in readPixels()  ?
@nraynaud
Copy link
Contributor Author

Firefox does the same with WEBGL_color_buffer_float

mrdoob added a commit that referenced this pull request Sep 23, 2015
Make readRenderTargetPixels() work with implementation defined formats
@mrdoob mrdoob merged commit 1f20a37 into mrdoob:dev Sep 23, 2015
@mrdoob
Copy link
Owner

mrdoob commented Sep 23, 2015

Thanks!

@nraynaud
Copy link
Contributor Author

It's tangentially touching the issue of the WEBGL_color_buffer_float extension (needed for firefox), do you have an opinion on how to handle it?

It's a bit of a mess, I think the algorithm before accepting a user submitted Float RenderTarget would be to try to find and load OES_texture_float (mandatory) then WEBGL_color_buffer_float (optional, carry on if not found), then directly bind the buffer, and look if we could could complete or not. (firefox will complete the binding without the extension, but it won't allow for readPixels() in float buffers when it's read time).

here are the relevants links:
https://www.khronos.org/registry/webgl/extensions/OES_texture_float/
https://www.khronos.org/registry/webgl/extensions/WEBGL_color_buffer_float/

@mrdoob
Copy link
Owner

mrdoob commented Sep 23, 2015

nraynaud added a commit to nraynaud/three.js that referenced this pull request Sep 24, 2015
the renderTarget.texture was forgotten and I enjoyed the edit to integrate that too:

mrdoob#7226

(I can't find an editor were I can comfortably and safely 3-way hand merge a 4kloc file, so I just copy-paste)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants