How do I use a Depth Map texture to control particle positions in Niagara?

Trying to figure out how to use a depth map (Imgur: The magic of the Internet ) to offset the particle positions ( Imgur: The magic of the Internet ) in Niagara.

The Chris Murphy tutorial ( Building Effects with Niagara and Blueprint | GDC 2019 | Unreal Engine - YouTube) which gives me the exact effect I’m going for. However, the method in the tutorial is to uses depth embedded in the alpha, and struggling to figure out how to adapt it to use the R channel from an image without alpha.

Pretty simple effect and I’m guessing this is probably super easy for someone with more experience.

Would appreciate any insight on how to write the module.

Thanks so much!

I made something that works in a similar manner awhile back. Here’s the project if you want to check it out. Still works in 4.24, probably 4.25 too, except you gotta uncheck “Render in Depth Pass” on all the (now black) objects, that are supposed to be invisible, to get it to behave like it does in the vid. Press C to update the render target.

Mine doesn’t use Niagara, or particles in general, but if you’re using a Scene Capture Component that captures Final Color(LDR), and you’re only interested in the depth, you can apply a post process material to it that remaps SceneTexture:SceneDepth to the R channel of Emissive Look for Rendering Features/Post Process Materials on the Scene Capture Component(mine’s a child of the FirstPersonCharacter camera). I re-project from SceneTexture:CustomDepth and output WorldPosition as my Emissive in the post process material, and use that to drive my point cloud positions.

I seem to recall doing it that way because depth written to a single LDR channel didn’t have as much precision as I wanted, but using all 3 channels for WorldPosition did. It also just might have been to avoid having to pass the scene capture position as an additional parameter to my point cloud material. Been awhile, idk.

Thanks so much for sharing.
I opened it in 4.24.3, but not getting the effect (I did uncheck the render to depth option in details)
Would love to check out the logic, any idea why it’s not working for me?

Hmmm, I’m using 4.24.3 as well, and I just downloaded the project from the link I gave you.

Here’s what I see when I load the project, hit Play, click in the viewport and press C:


Here’s what I see when I uncheck Render in Depth Pass on EditorCube11, hit play, click in the viewport and press C:

Here’s the Details panel for EditorCube11
Details.png
LidarRT should look something like this after you hit C.
LidarRT.png
Other than that, are you using an AMD card? I recall them having issues rendering that particular version of the quadchain-2-20 mesh(flickering), but it should still put the polys in the right place. Is C still mapped to “Capture” for you in the Project Settings/Engine - Input/Action Mappings?

Ah, cool. C was indeed not mapped to capture.

Hi, @anonymous_user_a3899e27 did you find some way to implement a depth map in Niagara? I am trying to do the same thing as you were describing also stumbled upon that tutorial but want to do it with Kinect depth map.