Download

Check if UTextureRenderTarget2D is ready

Hi guys

I’m trying to check if UTextureRenderTarget2D is ready for saving. As I’ve just spawned it I throw it in a queue and check back a dozen times and hope for the best right now, but it’d be better if I could only grab the first valid result.

Does anyone know if this is possible? It doesn’t appear to have any ready functions or delegates.

This problem troubles me a lot, too.
But looking into the Engine Source Codes, I found no easy solution to the problem.

It wasn’t too bad in the end. I created a tickable object that has a queue of render textures I’m waiting on. When I create the rendertexture and camera, I add a job to the queue.

Each job has a delay of 10 ticks, which is decremented by the tickable object. When it reaches zero I go save the frame (rather than saving it every frame for 10 ticks I like I was…)

It’s probably ready after 2 or 3 frames for sure and maybe even after just one tick, but it felt safer to get it running with a larger delay first. This also gives you a way to capture cleaner temporal results, like reflections.

I found the Highres ScreenShot codes, it can be perfectly capture currrent Screen with any resolution(different screen resolution from current Viewport).
I can’t figure out why these work perfectly this now.

I don’t found why would these work perfectly.
I copy and modified a little “High Res ScreenShot” in the Engine Source Base to my game codes.
It works perfectly in current viewtarget.

That’s the path I started down before realising I could just use a rendertexture, but I needed it to be independent of the current viewport, as I’m setting up a material capture rather than a scene.

I believe the high res screenshot specifically re-renders the current frame to another target at the res you specify, a lot like how the matinee works.