I’m using Unreal Engine 4.11.2. I have downloaded and followed those instructions. I have set ‘custom depth = true’ in my procedural mesh, set ‘custom depth = true’ but I got these errors:
Error [SM5] Missing Material Function
Error [SM5] (Node If) If input B must be of type float.
Error [SM5] (Node SceneTexture) SceneColor lookups are only available when MaterialDomain = Surface. PostProcessMaterials should use the SceneTexture PostProcessInput0.
And when I open the project I get this error also:
Error /Game/Materials/MI_SobelEdge : Can’t find file for asset. /Game/Materials/SobelEdge/M_SobelEdge
Info Failed to load /Game/Materials/SobelEdge/M_SobelEdge.M_SobelEdge Referenced by MI_SobelEdge
I have solved all these errors changing SceneTexture:SceneColor with SceneTexture:PostProcessInput0. But, without any error, I still don’t see the sobel edge. Any idea? This is very frustrating.
that sobel edge material you linked to is a bit frustrating to work with. it contains a material function that is in the wrong place when you download it (the ‘Error [SM5] Missing Material Function’), so you need to open it up and fix it.
also as i understand it that material *doesnt *draw the post process effect if the object is using custom depth, so if you only want edges on the procedural mesh i suggest inverting that part of the material (delete the highlighted node here):
Yes, yesterday I saw that error on Material Function. I’ve been searching but I haven’t found how to fix it. Because it’s talking about it can’t apply Depth if the material isn’t a Post Process material (or something like) but on the material function I haven’t found how to set the material to that kind of material.
material functions cant be set to anything because they are just groups of nodes. consider them just a collapsed comment block. they are set to whatever material you put them in.
I’ve uploaded a version of this that I’ve been working on, its the best approach to sobel edge detection that I’ve found (and ive messed around with a few different versions people have shown).
as i mentioned before, just remove that ‘1-x’ node from the render custom depth comment block and the edge detection will only apply to objects with custom depth enabled, like your procedural mesh.