Scene Texture in Custom node

Hello! I want custom depth in custom node, and sample UV points. How I can do this?

This depends, do you only need UVs that you are currently processing(1) or do you need to search neighborhood(2)?

  1. Use SceneTexture node, set it to Custom Depth and plug Color pin to your Custom Node, then you get RGB values of currently processed pixel
  2. Basically same as (1), you need to plug it into Custom Node in order for the lookup to work, then you can use SceneTextureLookup function that takes 3 parameters, first being uv coordinates, second what scene texture you want to look into (14 for PostProcessInput0, custom depth is 13 I think) and third is bool but I always forget what it does. Anyway, it returns RGB values.

I can give you link to some tutorials I made where it is used if you want. Hope it helps.

I havent expected a reply this fast and right! Thanks dude!

some tutorials would be lovely

No problem I actually just skimmed over the answerhub for the first time in months lol.

Here’s tutorial I made for Sobel edge detection in UE 4.18, you might run into an issue when you just copy paste the code in newer versions, so just consult Issues section Sobel Edge Detection in Unreal Engine

Anyway, the tutorial shows how to sample the surrounding of the currently sampled pixel and how to set the whole shabang up.