Announcement

Collapse
No announcement yet.

[FREE] Curvature Shader

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

    [ASSETS] [FREE] Curvature Shader

    Hi,

    Made a curvature shader based of this GLSL shader
    - Updated to use BasePassPixelShader.usf version of NormalCurvatureToRoughness it's cheaper and with a better result.

    Youtube

    The normals are interpolated linearly so the faceting can't be fixed at the moment, but with higher resolution mesh or more math savy people (or UE4 will do smooth interpolated normals) this could be improved upon.
    Lemme know if you find it useful.
    Built in 4.16 but can be for any version.

    Zip attached

    ---- Updated with function to include PostProcess
    ---- Updated 2 - New function based off BasePassPixelShader.usf recreated in function attached with image to recreate it.
    Attached Files
    Last edited by mserena; 06-07-2017, 10:16 AM. Reason: Updating Function

    #2
    [MENTION=25000]mserena[/MENTION]: Hi, looks interesting. I just had a brief look on the shader (your supplied uasset from the zip only works in 4.16, 4.15 and earlier versions do not recognize it).
    A question: can you please supply more info or explain how you have used your MF in the material from the examples (picture above and video) - maybe you can post a screenshot of the material BP?

    THX and greetings
    Markus

    Comment


      #3
      Super useful, thank you! I made something similar a while back but didn't get a result quite this good, this looks a lot nicer.

      Comment


        #4
        thank you.

        Comment


          #5
          [MENTION=450716]hessjacobs[/MENTION] sure here you go. nothing that won't work in previous versions.
          Click image for larger version

Name:	MF_Curvature.jpg
Views:	1
Size:	220.4 KB
ID:	1128176
          [MENTION=766]Sitrec[/MENTION] thank you, all credit goes out to Evan Wallace though, I just rebuilt his glsl shader.

          Comment


            #6
            [MENTION=25000]mserena[/MENTION]: thanks - got it working in 4.14, of course In your example video how did you setup your red/green material? ... just using a lerp function between colors an applying the MF output to the alpha input of the lerp?

            Comment


              #7
              Is there a way to make this a postprocess shader?

              Comment


                #8
                Sure thing, just updated my post to include a PP function to do it. Tried to incorporate into the same function but it complained about it being used in an opaque material.
                But the process is just replace the PixelNormalWS with sceneTexture : worldNormal

                Comment


                  #9
                  Originally posted by hessjacobs View Post
                  [MENTION=25000]mserena[/MENTION]: thanks - got it working in 4.14, of course In your example video how did you setup your red/green material? ... just using a lerp function between colors an applying the MF output to the alpha input of the lerp?
                  yep, just use it as the alpha in the lerp and it will blend two colours based of the curvature

                  Comment


                    #10
                    Thanks mserena, this is awesome. I working for a surgical simulator company and I'm trying to use your shader to fill the mesh cracks with blood but the threshold is stock on fine details, I'm trying to change it to the bigger shapes but have a hard time to find what to change. I wonder if you could hint me where I should start? And Do you think that would be possible to fill the curvature of overlapping objects cracks? Well thank you if you can't help anyway, this is already awesome giving it free.

                    Comment


                      #11
                      Hey Mark, from what I saw on the youtube video, this looks fantastic! But I can't see any download in this thread?
                      // Acriax

                      mountaintrail.co :: Maker of affordable quality assets
                      dev@mountaintrail.co :: Get in touch

                      Comment


                        #12
                        Acriax the first post should have a two zips you can download, two different methods and there's also a picture showing you how to recreate it.

                        Comment


                          #13
                          Originally posted by mserena View Post
                          Acriax the first post should have a two zips you can download, two different methods and there's also a picture showing you how to recreate it.
                          Ah, my mistake! Seems I can't see attachments when I'm logged into the forums for some reason. :S
                          // Acriax

                          mountaintrail.co :: Maker of affordable quality assets
                          dev@mountaintrail.co :: Get in touch

                          Comment


                            #14
                            Originally posted by mserena View Post
                            Acriax the first post should have a two zips you can download, two different methods and there's also a picture showing you how to recreate it.
                            Is there a way to do this without the camera affecting it?

                            Comment


                              #15
                              Awesome, thank you very much for this!

                              Comment

                              Working...
                              X