So: I’m in the beginning of a project I’d like to work on, but I’m trying to decide on the specific artstyle I want to go with before committing to anything (e.g. the character meshes I create)
So, I essentially want to detect the “edges” of the visual silhouette of the material - NOT the mesh - which I can’t find basically any documentation on, to my dismay.
From what I’ve been reading through, it seems due to materials being pixel shaders, this would have to be handled as a post-processing effect - which is fine, I’m pretty sure.
I’m wanting to use this on different objects and have different properties based on that, which as far as I can tell should be pretty easy afterwards - just using Custom Depth Stencil, I believe? (haven’t gotten too far into the engine work yet)
But to start, is this effect achievable?
Could you try resubmitting your image? It isn’t loading.
…ah, sorry! it seems I only copied one layer, rookie mistake (the preview was covered by the new user dialog)
this is of course not even, but I hope the point comes across
So you want to extract the frensel from the image and use that to subtract from the silhouette of the object?
Not exactly - fresnel is mesh dependent, based on the angle of reflection. I’d like a material node (or post processing efffect) that lets me calculate the distance from the silhouette’s edge - completely independent of whatever particular mesh I’m using.
He want’s the camera-facing cross-section to be the basis for his ‘frenel’ effect. Whatever overall silhouette the player sees of item-x.
My gut is telling me somehow PostProcess would work here, maybe with some modded outline effect, or SDF? Maybe you can somehow paint the an object-gradient (center to edge of the mesh) into some temporary buffer and then use that as a basis?
Perhaps isolating part of the image via custom depth mask + guassian blur + desaturation could get you partly there
Guassian blur custom material node
Custom depth buffer
there’s not enough information to do this with normals or sdf. derivates and slope detection won’t do that either. i tried a bunch. didn’t work. i’m tired now… but… a quick idea left…
you could try to render a duplicate with back faces only into a custom depth buffer. render the front faces into a stencil. in the post shader you check the stencil and when hit you compute the depth difference of the back and front faces to get something to compute the “shade”.
it’s not edge detection per se, more like inverted subsurface shading.
You can achieve edge detection in a material (rather than the mesh) using Screen Space Techniques or Post-Processing Materials in Unreal Engine.
- Use Sobel Filter in a Post-Processing Material – This helps detect edges based on color and depth differences.
- Use Scene Depth & Normals – Compare depth and normal variations in a custom shader to highlight edges dynamically.
- Custom HLSL in Material Editor – Implement an edge-detection algorithm within the material itself for finer control.
Would you like a step-by-step guide for implementing this?
well… i got it somewhere. my blueprint doesn’t wanna dupe meshes or i’m just stupid. but… the rendering works as i intended. it’s using a translucent front material rather then the postprocess stencil, but it’s fairly cheap, considering you will likely have more translucent objects to throw in that comp pass anyway. works for simple shapes but does not do well with complex “depth occlusion”. for… reasons.
back face custom depth material
and the front face depth test shade material
feel free to improve it. : )
ooh! very nice
i’ve shifted artstyles a bit to something simpler so i don’t spread myself too thin
but there’s a good chance I’ll end up using this in the future at least somewhere
hopefully this thread is helpful to anyone looking for the same!
marking this as the solution for now