I have a spaceship. I want to display a wireframe render of what’s in front of the spaceship on a display inside the cockpit. The end goal is to have my wireframe render in a Realtime Virtual Texture so I can apply it to the material inside the cockpit with live updates.
I want the wireframe scene to have a far distance clip, so I’m not seeing things in the distance, (planets, nebula, distant ships) and I want to be able to color each of the wireframe models, base on if they’re friend or foe. I can’t seem to find a post-process wireframe method, nor can I find a way to have the camera override materials with a wireframe material.
The good news is, I’m doing this as a cinematic, so non-realtime options are open to me, but I’d like to avoid things like “render the ship’s view in wireframe mode”, so I don’t have to render the scene for each copy of the spaceship. (Or re-render if we need to change a ship’s flight path.)
Is this at all possible, or am I going to have to explore other alternatives?
For those wondering, yes I was able to get this to work, but it’s not right now. It stopped working when I came back to write a step-by-step guide for doing this a while back, and I haven’t had a chance to try and fix it.
How I got it to work (when it works):
I created a wireframe Post Process material with three color support, based on stencil ID. (Neutral, Ally, and Enemy.) I also used Scene Depth to clip the far distance. Everything is parameterized for customization. (This was honestly one of the harder things to setup.)
I created a Texture Render Target 2D as a variable for the ship’s blueprint.
On construction, I create a blank Render Target 2D, and assigned it to that variable.
I added a SceneCaptureComponent2D to my blueprint.
I also create a Dynamic Material for the post process material, so I could change the FoF values based on blueprint values.
Blueprint FoF values set stencil mask values.
Dynamic Material is set as only material in SCC2D’s Post Process Materials at construction.
The SCC2D’s Texture Target is set to the Render Target variable from step 2, also at construction.
By changing the FoF values of the blueprint, I could then see them show up (in real time) on the ship’s main display, and change colors as I change their FoF faction ID. It was exactly what I wanted.
This worked for a while, but now, the problem is that my SceneCaptureComponent2D isn’t capturing the scene at all, and I’m not sure why not… Even when I remove everything and try to JUST capture the scene as-is, it’s not working.