How to create customisable rim erosion and offset outline for mesh

Made a PP outline based on the video above. Currently it looks like this. It’s detecting edges, not gonna be able to detect pixels if they’re invisible and the rim erosion is a fresnel currently.
image

I think there’s two ways to go about it.

A.


de Laubier ended up using several static mesh instances with different custom data values to do the trick. So I think I’d have to do something similar. First instance would be for the inner shell, the solid part, the second would be for handling the outer shell, which is the rim erosion.

Because I already have a PP outline, I think I’d have to add the first instance/inner shell with its own custom depth stencil value (1), have the outline add colors based on that, then somehow offset/inflate based on it. However I have no clue how you would do that with pixels.

B.
Somehow make the rim erosion itself a PP effect. From what I’ve researched, you can get edge wears using Sobel or whatever edge detection algorithm, can’t remember where I found it but saw something similar about edge detection in general here, and I already have an outline PP material.

Theoretically couldn’t I just grab the outline I made, and instead of having a color there, somehow apply the rim erosion gradiant to it, play around with the alpha and scale of it to give that effect?

Still use the PP offset outline material though based on the stencil value the inner shell has then scale it up from there.

Update:
Tried using custom data values for rim erosion, the shader complexity is pretty high though. PerInstanceCustomData with Value = 1 and Index = 0 controls the outer shell. Also ignore the comment, that should be for the outer shell inflating and deflating.
image



Ah, about the inner shell and outer shell, :person_facepalming:, I think it’s actually supposed to be more reminiscent of shell based fur texturing. Looking at GitHub - Aqu-Hub/ShellBasedStroke for reference. Although it looks like with this method draw calls is expensive, but since I’m only doing an inner shell and an outer shell, hopefully it’s not that expensive? Although I’d have to test it.