Best way to Construct and use a Float32 RGBA Texture

What would be the best way to create a Float32 Texture with RGBA values?

Can I just do a dynamic texture set it to TEXTURE_FLOAT when I create it then modify its ctx.imageData, or am I going to need to use a RawTexture?

Is there anything special I gotta do to bind it to a custom shader?

https://www.babylonjs-playground.com/#0GT2HX#3

I think I got it from this.

1 Like

I will recommend to NEVER use gl directly. Like NEVER EVER :slight_smile:

Your code will fail miserably when WebGPU will be used.
Here is the correct call:
https://www.babylonjs-playground.com/#0GT2HX#4

1 Like

Yeah, I did not use the gl Call for sure!

I just needed to see how to create it and I got it all done. thank you for the example though.

1 Like