Post Process Materials in UE4

So I have been working more with Post Process Shaders, and I’ve been able to accomplish some very cool things, but I also am having trouble finding resources for various questions I have about the subject. These are my current questions.

  1. When you’re adding a texture is there a way to switch it to World Space so it stays in place instead of moving with the camera? I feel like I’ve gotten halfway there, but all of my solutions tend to make the texture disappear. My solution so far has been “TransformPosition” Granted I could be using it wrong?

  2. Is there a way to create a mask using a mask. I would really love to take a stencil mask, and then blur it. Possibly smudge a whole scene, then use a smudged stencil mask to outline a few objects this way. My end goal is to create a painted look to all of my objects.

Please let me know if you have any leads on these kinds of questions, or other handy Post Processing wisdom.

Hey there!

  1. What are you trying to accomplish with having a texture in worldspace? Are you looking to do something like a decal, where a texture stays projected onto a consistent point in the world? Or do you want it do some kind of parallaxing where the texture appears to be deeper into the world that right in front of the camera?

  2. So the tricky thing about blurring Custom Stencil is that Unreal doesn’t return an object reference to the texture, so you can’t sample it directly in a Custom expression to do the blur (either your own or using something like SpiralBlur-SceneTexture or SceneTextureAvergae). You might be able to do your own version of those that points to the CustomStencil instead, but you’d have to author that yourself.

1 Like

Hi Ozz, thank you for your help! I should mention to you that this project is for VR. We’re making it to run on PC, and I’m optimizing everything, so if an effect is expensive I’m not too worried about it until I’ve tested it in RenderDoc.

  1. I have found one solution to this since I posted it. And that is the WorldAligned Texture node, which will only work in a Post Processing material if you adjust the normal to a Scene Texture Normal. But, really what I was looking for was simply a flat way of laying a texture in front of the camera. But when you move the camera to look around the texture stays in place and doesn’t move with you. I wanted to use that to create a mask to give the scene the feeling of being a painting.

This is a temporary solution, but I feel as tho it creates a different feel to the scene.

Processing: WaterColor_GettingWorldAlignedTexturesToWork.PNG…

  1. Along with this, my end goal with the mask is to create frayed edges that look like paint strokes. It would be a really cool effect, but it seems a lot more complicated than I thought it would be. If you have any resources to get started creating a custom node for this, such as examples of people creating and referencing mask or texture objects then I would really appreciate it.

If I think outside the box, maybe I could put a plane in front of the player, and have it sample the colors behind it in the scene?? I wonder if there’s a way to do that.

One way of laying a texture in front of the camera is to juts attach a particle system to it, single quad, infinite lifetime.
Not sure how that works out in VR though.

1 Like

That’s a good idea, thank you Bob!

I will look into this, in VR it should be fine. I had to hunt to find a way to get Post Processing Materials to work at all. So I’m sure there’s a way to get these kinds of particles to work in VR.

(If anyone who needs help with PPM in VR is reading this you have to switch Instanced Stereo rendering to non Stereo Rendering to even make them work in both eye lenses. It’s in the project settings, under VR, under Rendering.)

If it works I will let you know. I’m still wondering about the stencil masks, because that information could be useful for so many things. So if I figure that out I’ll post about it here as well.

Billboard components might be helpful here, too, since those are pretty good at always facing the camera. Just gotta make sure they’re set to Hidden In Game = False.