Announcement

Collapse
No announcement yet.

Is it possible to saturate a color using a post process effect as a mask?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Is it possible to saturate a color using a post process effect as a mask?

    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.

    Click image for larger version

Name:	Blue-print.PNG
Views:	221
Size:	24.1 KB
ID:	1715852

    So instead of just painting it black (or whatever color), using those lines to desaturate/saturate the color underneath it by a percentage:

    Click image for larger version

Name:	ChloePPImage.PNG
Views:	142
Size:	137.3 KB
ID:	1715853


    #2
    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/

    Comment


      #3
      Originally posted by Suthriel View Post
      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/

      Sure, and thanks, I'll be playing around with the information give. If you find something interesting, please let me know.

      GetPixelNormal: https://blueprintue.com/blueprint/cegg0-n6/
      GetPixelDepth: https://blueprintue.com/blueprint/jcko761o/
      LaplacianNormal: https://blueprintue.com/blueprint/q7j5wvxw/
      LaplacianDepth: https://blueprintue.com/blueprint/mlv6cr4e/
      EdgeDetection: https://blueprintue.com/blueprint/z76b6n0n/

      Comment


        #4
        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.

        Click image for larger version

Name:	EdgeDetection.jpg
Views:	127
Size:	232.0 KB
ID:	1716334

        ( 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 ^.^)

        Comment


          #5
          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.

          https://blueprintue.com/blueprint/o-x5yn2a/



          Hope, this is somewhat helpful and what you have looked for

          Comment


            #6
            Originally posted by Suthriel View Post
            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.

            https://blueprintue.com/blueprint/o-x5yn2a/



            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:

            Click image for larger version

Name:	Color.png
Views:	87
Size:	35.1 KB
ID:	1716955

            Comment


              #7
              Originally posted by Salsa Lizano View Post

              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:

              Click image for larger version

Name:	Color.png
Views:	87
Size:	35.1 KB
ID:	1716955
              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:

              Click image for larger version

Name:	Color1.PNG
Views:	82
Size:	88.6 KB
ID:	1717307Click image for larger version

Name:	Color2.PNG
Views:	74
Size:	109.4 KB
ID:	1717308

              Now the edges have a saturated version of the colour underneath:

              Click image for larger version

Name:	Saturated.PNG
Views:	70
Size:	314.7 KB
ID:	1717309

              Just what I wanted to achieve, now it's about playing with the parameters. Thanks a lot for your help!

              Comment

              Working...
              X