[TUTORIAL] Edge Detection Post Process Effect using World Normals

Hey everyone, sorry it took me so long to reply.

Thank you for fixing the error and the [unroll] optimization.

The node version should just be SceneTexture:WorldNormal like the one used in the screenshot of the material above (the color pin).

You may be able to provide the scene lookups as input parameters yes, and yes it would probably also be better to do it that way.
Since the intention of the function was to only be used with the world normal, I hardcoded the scene texture index that represents the world normal: 8. You could probably make another input parameter that replaces this and specifies which scene texture index you want to use. The problem with that is you won’t know what that value means and where it comes from unless you dig it up or have it commented/documented somewhere. But using the dot product on those values probably has a different meaning than what was intended.

Thanks for the kind words!
I currently do not have the time to write a follow-up about how to do edge detection on scene color or scene depth. But this https://udn.epicgames.com/Three/DevelopmentKitGemsSobelEdgeDetection.html may get you started with a scene depth edge detection material. Do note that the link is on the UDN and for the UDK but most of the nodes should be very similar (does not require any HLSL but you could condense it a lot with it). You could also just go ahead and replace the “8” in the HLSL code with some other number. But be warned, you may get really strange results since it really is only meant to be used with a value of “8” :slight_smile: