I whant make snow like in Batman. I found this article http://www.gdcvault.com/play/1020177/Deformable-Snow-Rendering-in-Batman. But i can’t understand how i can get height map between two surface?
The easiest way to get an accurate response would be to use a scene capture actor that is only capturing the depth. It would go right on the floor looking straight up.
I have done basically the same thing to capture water FX as they hit a water surface so they can cause ripples into a fluid sim. If you use the “Show Only Actors” functionality to restrict the objects rendered into the scene capture, you can get the render time pretty fast actually. The size of your render target will also matter for perf. Try keeping is low like 128 or 256.
Also you can expand a bunch of the show flags on the scene capture and disable everything you can like bloom, DOF etc, since the engine will waste time rendering those by default even though they have no effect on the depth capture.
Make sure you do profilegpu to see how long your scene capture takes. Ideally you can get the time to be under half a millisecond.
Thanks alot!! 2017-01-13_16-28-14.gif - Google Drive i did it)))
Ryan, it’ll be great if you guys find the time sometime to give us some hints on how to do this with a large uneven landscape surface.
In that case, it would be more expensive. You would need to have a texture that stores the landscape heightmap that could be accessed in a material. You would also need to adjust the projection depth of the scene capture to be the entire Z extent you wish to capture. Then you also need to inject a Render Target pass that would take the captured Z depth, and perform a spheremask on those depths using the landscape Z as the Z position. Then it ends up being the same thing after that.
For getting the landscape, you can just use another ortho scene capture, but make sure it doesn’t update every frame. Optionally bake it to a static texture by right clicking the RT in the content browser and selecting “Create Static Texutre”. Then use the material function “Landscape manual UVW” to map the texture in the material. Just make sure the extents between the landscape, scene capture, and material match.
That seems like a very complicated setup, but I want to try it for sand on a large landscape. I have a scene capture capturing depth, but all I’m getting is a solid red square. A tutorial on this would be greatly appreciated!
The depth is HDR, which means any depth over 1 will appear as saturated. Render Target needs to be HDR.
OK… it would still be nice to have a full tutorial on this. I’m not familiar with the way Blueprints render to targets. Is there a way to test the results from the render target against a static depth texture in Blueprint, and then mark the pixels around the areas to a new render target in Blueprint? I don’t think this method would work for a very large open world landscape. There has to be a better way to make this work globally…
BP Render targets give you the ability to do this stuff that would otherwise require lots of programming to get working, but in terms of tutorials on individual methods, we don’t have much in the way of that yet. Keep in mind that it usually takes people working on these problems full time to find a way to make them work within the budget of an existing game in an affordable way.