Download

Orientation+Depth Aware Post Process Material

Hello All,

In the last Twitch stream on October 15th, Epic’s Ryan Brucks and Jerome Platteaux shared some pretty nifty tricks. One thing that was particularly interesting to me was the post process effect of overlaying a texture on rendered geometry.

Here is a link to the stream: http://www.twitch.tv/unrealengine/v/20817977

My question is about the post process effect at 47:19. I am curious about how the “tech” texture is being overlaid over the rendered geometry in a perspective/orientation/depth aware way.

Is the custom depth buffer being used? Could you point me in the direction of how the “tech” texture is being projected?

Thanks!

That part is very simple, it is just mapping using “World Aligned Texture” and “WorldPosition” as the coordinates.

I mentioned that during the stream but it was probably hard to catch. When you use WorldPosition inside of a postprocess material, it returns the actual worldposition of that pixel.

Then worldposition B is the vertical mask. It gets divided by the total level height in order to make a 0-1 gradient so that the vertical panning mask is revealed by subtracting 1… then the 2nd pass is revealed by subtracting 2 etc.

Thanks Ryan! That was exactly the hint I needed. :smiley:

I was able to test it out with this:
8680f54e485ae40143c4dab45ae5cf120eb31a29.jpeg

I noticed that passing in “WorldPosition” did not change the output.

Yup, you got it.

Worldposition is already the default input to that pin so that makes sense. I was just suggesting it so people realize what is going on there.

That is super cool stuff! Thanks for the help :smiley:

Out of curiosity, to get the square pattern to go across floors and up walls, did you multiply “XY Texture” by “Z Texture”? This is what I did, but I am curious if there was a more elegant solution :smiley:

Actually what I did there was use the mosaic XY pattern as an offset to the worldposition.Z value, and then I created a gradient at the desired position by doing abs(WorldPos.Z - Phase) then * somebignumber and clamped 0-1. That created an edge gradient at the phase height. To make the mask it was instead ceil(WorldPos.Z - Phase)…then clamped 0-1. Where phase here would be a worldposition Z value… you can easily multiply a scalar parameter by the max height of your effect then you have Phase as a 0-1 value.

Can you tell me how to make the grid texture visible over the other meshes when you subtract the phase value.

I have made a gradient using the world position B value and by subtract it using the phase value. I can make a gradient that goes up and down the world.

But I can’t figure out how to make the grid texture appear over the meshes. Like in the final stage of the postprocess effect from bullet train, where the only thing visible is the grid texture.

Thanks.