Render to static texture once and once only

Howdy,



I’ve been taking a look at TestRenderToTexture, TestRenderToMemory etc but cannot work out how I could render an arbitrary camera “snapshot” to a texture.



I have a few thousand quads sitting around that all need to act as (very approximate) mirrors.



Obviously I cannot have thousands of dynamic offscreen views rendering away so what I’m trying to do is put a camera at the center of each quad pointing outwards, render a snapshot to a static texture and then move onto the next one.



I would do this in a sort of scene “pre-rendering” phase and then have all the textures set as if they have come from loading an image.



I cannot work out for the life of me how I would do that from those tests.



Any tips?

But TestRenderToTexture does exactly that? You just need to stop it after the first frame ^^

2 Likes

Orly…



You are quite right.



DERP.




For future idiots like me, you just call

[java]renderManager.removePreview(offView)[/java]

after at least a frame has been rendered.

1 Like