I need to render a flat 2D mesh which uses x and z coordinates repeatedly to a texture for a 2D game’s shadow mask.
This works fine with scene capture 2D but it quickly becomes a bottleneck. I have previously used this technique in Unity and was able to render 30+ to a texture in under 1ms.
The same task here takes over 30ms.
So I’m looking to just render a plain flat mesh to a render target quickly. The mesh does need to use a material for the WPO offsets it requires.
Some properties that could make it easier:
2D coordinates, flat or ortho rendering, no need for any depth in the mesh, triangles are fine but they must be with a material.
I am considering using a canvas with Draw Material Triangles but its a real pain.
Trying to keep it a strictly BP project if I can!
Anyone out there want to think about this problem, or suggest workarounds to avoid SceneCapture2D?
Hi @Robert.Cummings,
Yeah, the SceneCapture2D is really the only method in Unreal for rendering scene components back to a texture. That being said, there are a LOT of optimizations you can make to make the capture really cheap. I’ll go through some of them here:
First of all, you can specify what actors you want rendered to the texture. If you only need this one mesh, that will make your capture a lot cheaper.
You can also turn off show flags for any tonemapper effects you don’t need.
Turning off as many of these as possible will help reduce the cost of your capture.
Overall, I would look through all of the other settings of the scene capture component to make sure yours is as simple as possible, since by default it’s set to as complex as possible.
Let me know how that goes! Let me know if you need any more help.
1 Like
Thanks for your response, I ended up reducing the captures to just 1 per frame and using some trickery to pack more information into that rendered frame.
It’s good to know it’s pretty much the only way, means I can live with it 