Hey there,
I am looking into imitating earlier Vector Displays. The ones where a beam lights up a screen covered in phosphor. I have a concept for a shader in mind but I don’t know how to feed my inputs into it.
Shader Concept
I imagine passing an array of lines into the system, where each line is an array of points. The lines are accompanied by a RenderTarget which will be the output of the current frame but already contains the result from the last frame. To simulate the phosphor, I want previous drawings to slowly fade out. So in the first step, each pixel of the RenderTarget should be dimmed down a little. For the second step, the lines should be drawn onto the RenderTarget without clearing it beforehand. It basically overdraws previous images. If the beam hits a given pixel multiple times, the color values should add up instead of replacing themselves. So within a given frame, a fragment’s color output is the result of the previous color tuned down, while adding the phosphor’s color on top of it each time the fragment is part of a line.
The RenderTarget itself should be embedded into a 3DWidget. So that I can move up to a navigation console in First Person to see the vector display.
Question
While I can imagine writing a shader for it, I have no picture in mind of how to embed this into Unreal itself. I mean, do I need a custom Renderer for that? I honestly don’t know where to start. How am I supposed to pass an array of lines into a shader?
All shader tutorials, out there, base on the fact that they either can sample a texture, a model, or generate something out of thin air.
Any advice is highly welcome.