Hi there! I was playing around with cel shading effects and edge detection following Tatsuro Ide’s tutorial on cel shading. He uses a laplacian filter for the edge detection and I was wondering if there’s a way of instead just painting it with a single color using a vector (Like in the image below), to saturate the color underneath those edges detected by the laplacian filter created.
So instead of just painting it black (or whatever color), using those lines to desaturate/saturate the color underneath it by a percentage:
Should be possible, if you use the detected and created edges as mask for a LERP, that lerps between a “normal” colored SceneTexture and a (completely) desaturated SceneTexture, like its done in that clip here at 7:15 mark, where he creates the lerp for the desaturation:
It´s hard to test without the actual cel shader ^.^ maybe you want upload it there for testing? https://blueprintue.com/
After some short testing, i guess, one of the easiest ways would be to insert a Blend-overlay node, where the SceneTexture gets multiplied with the edges.
( Don´t wonder, why my LERP there is not connected. For some reason, i could not get the Edge detection to work with this custom stencil based method. Had to use the distance based from the cel shader, and that sits above this part ^.^)
After some more testing and grubbling about float3 and float4s, that won´t lerp or multiply with each other, i got this. Not very nice, because i still cannot get the custom stencil method to work (therefore, could not test, if it works with that too or not), and had to use a distance based, but now you can use the edge color for darkening or lightening (is that a valid word in english? ) your edges. So i included a switch, that switches from your original work with black edges and custom stencil based to distance based and colored edges.
An Edge color with a grey at 0.5 will make all edges invisible, everything below 0.5 will darken them, and above 0,5 will lighten them up. Values above 1 are funny too.
Hope, this is somewhat helpful and what you have looked for
Thanks for the reply, it’s not really what I’m trying to achieve but it actually help me deal with some problems I had lol. What I’m looking for is to saturate the color underneath the line I have, so for example, if the texture/material where the line is on top get’s saturated. Something like this:
Alright, so instead of using a vector with an RGB as a plain colour, I used the same scene colour to calculate a more saturated colour with the Linear Burn blend node, like this: