Render Target Data?

https://playground.babylonjs.com/#645DP4#11
I’d like to compare (in JavaScript) the result of a render target texture with a dynamic texture (2D) in order to debug/tune/hack on sdf / msdf fonts. In the playground, the left “a” is shader generated, the center is generated with a drawText, and the right is a render target of the left. Is it possible to get the render target texture data, akin to what you can do with a 2D context? (at line 225). (Suggestions on how to do the same an easier or different way also welcome.)

You can get the RTT’s pixels by calling readPixels. Here I just logged the pixel array after waiting for them to be read for example. :slight_smile:

3 Likes