Hi everyone,
Lately, I’ve been trying to learn how to use render target feature in Unreal. It appeared to me it was a pretty basic knowledge to have as VFX artists, and I was lacking it until now. The purpose was only to grasp what this feature is capable of but I had a lot of fun on the way! Let’s start!
The Topographic map painter:
To begin with, I’ve look to the Blueprint_RenderToTarget map in the ContentExample project. I found the heightfield painter was a really interesting and fun example to study, therefore I tried to replicate it “with a twist” to both understand it and try to create something a bit more visually interesting.
The result is some kind of island topograpic map painter at runtime:
I added some “on mouse click release” brush randomiser within the drawn to target material. The idea is pretty simple, when mouse left click is pressed the “brush” material will be drawn to target, adding a radial shape multiplied with some crossed noise textures. When the mouse click is released, the drawing to target end and the random offset for both noise textures is reset, resulting in some different brush stroke at each click:
A simple camera and related TV screen:
With a better understanding of render target basics and how to draw material to them at runtime, I wanted to get a first intuition about scene capture at runtime and how to use it in the more simple way.
It resulted in some kind of surveillance camera that will display the result on some giant screen.
The blueprint part of it was pretty simple, but I had some fun trying to make a “real” screen shader. The idea is to begin by pixelating render target UVs coordinate with some basic maths. Then, I tried to separate each channels of the resulting pixel and offset it just a bit to have those 3 RGB line that create the pixel color code.
Still, for now it’s just playing around with basics maths for fun, but it was a good training to make it react procedurally to the input pixel amount or other variables.
The Flame flipbook recorder:
This part get closer to what I was looking for in the first place : how does FluidNinjaVFX (the flipbook baker, not Live) works very basically ? While trying to answer this question, I found the wonderful sketch done by @simonschreibt almost a year ago. This one was more than very helpful to get more into render target and scene capture usages, make sure to check his awesome work. (Thanks Simon ! )
To start the all thing, I chose a very similar structure to the one use by Simon’s blueprint for flipbook capture, but with a few twists
The first thing I did is trying to recreate the same logic, but with a few basic changes for a more procedural result (like changing canvas and/or frames resolution at runtime, or being able to restart the flipbook capture with a single key press). I also added some debug print in the output log with detailed for each event of the graph (resulting in all those line you can see appears on the viewport left side while capturing), this was a very good thing to do to be able to really dive in “what’s actually really happening ?” when I had some difficulties about making some part work correctly.
After I had the base working as intented, I wanted to add a new layer to the actual overall workflow. In a few words, for now the scene capture is actually writting what it sees inside a render target “A”, and then draw A at a specific location of another render target “B” to create the flipbook current frame. My idea was to begin with same thing (writte scene capture inside A), then use A as texture input inside a shader that will distort and erode it and writte the result inside a render target “C”, finally draw C at a specific location of B to create the current frame.
This process was really fun to investigate, and I’m really surprised by the final results, that ends being very satisfying with a minimum time effort spent on tweaking materials values and Niagara simulation as inputs. I’d love to spent more time playing with this one, and I hope to find time or opportunity to come back to it later!
Even if it was nearly scratching the surface, those little studies to discover render target feature really helped me to have better intuition about how does a 2D fluid simulation tool can work.
I hope you enjoy reading this little learning report, and I hope to make more of those in the future ! Feel free to ask any question you could have or for additional details!
Thanks for reading, be well and may the VFX be with you guys!