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

Re: [Public WebGL] Restricting WebGL exposure of OES_depth_texture



Hi,

thank you for your help! However, I would have liked to use reading back floats exactly for getting rid of such encodings and to improve performance. My use case is simply that I want to improve buffer-based picking by encoding the fragment's position - including an integer object ID - into one floating point RGBA texture to avoid additional calculations and render passes. Are there any plans to include FLOAT readback from an FBO in the near future?

Best regards
Yvonne

Am 28.06.2012 um 15:59 schrieb Carlos Scheidegger:

> For what is worth, you can achieve the equivalent of a single-channel FLOAT readback by rendering the bit patterns of the floating point numbers to a 4x8-bit RGBA channel, and then reading the texture. It is horrendously ugly, but it is simple and does the job.
> 
> The version I wrote does not handle denormals, infinities, NaNs or anything that is not a "nice" IEEE 754 value. But I have used this in the past, and it works.
> 
> I don't have a ready-made GLSL program for you, for technical reasons; but the idea can be seen here:
> 
> 	https://github.com/cscheid/facet/blob/master/src/shade/bits/encode_float.js
> 
> Let me know if you need more specifics.
> 
> Cheers,
> -carlos
> 
> On Jun 28, 2012, at 4:44 AM, Yvonne Jung wrote:
> 
>> 
>> Hi all,
>> 
>> another question concerning depth textures: is it still correct that readPixels is not yet implemented for FLOAT (I got an error when trying to use it and also found a corresponding bug report in the Mozilla bug tracker) and if true, when do you expect to be able to provide such an implementation?
>> 
>> Regards
>> Yvonne

-----------------------------------------------------------
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
-----------------------------------------------------------