Announcement

Collapse
No announcement yet.

Anisotropy material

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

    #31
    Can you share the shader code? I'm trying to recreate an anisotropic shader but I can't because I get stuck implementing the rotating specular lobe part ( the part where the specular highlight rotates just like those pictures you have)

    Comment


      #32
      Waelwindows
      https://github.com/stororokw/UnrealE...4060eeb08c8a8f
      Code is pretty messy, but it should be pretty easy to understand.
      Click image for larger version

Name:	anisotropic_ue4.jpg
Views:	223
Size:	114.9 KB
ID:	1452493

      Comment


        #33
        Originally posted by stororokw View Post
        Waelwindows
        https://github.com/stororokw/UnrealE...4060eeb08c8a8f
        Code is pretty messy, but it should be pretty easy to understand.
        Nothing messy here, you might be a modest person! Awesome work!
        Nilson Lima
        Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
        Join us at Discord: https://discord.gg/uFFSEXY

        UE4 Marketplace: Cloudscape Seasons
        supporting: Community FREE Ocean plugin

        Comment


          #34
          Originally posted by stororokw View Post
          Waelwindows
          https://github.com/stororokw/UnrealE...4060eeb08c8a8f
          Code is pretty messy, but it should be pretty easy to understand.
          This is awesome! Thanks for sharing.


          Any tips for authoring maps for anisotropy? I've tried to do the standard radial anistropy for but I'm getting weird results. See the attached image.
          I looked at many references, including this tutorial: https://www.youtube.com/watch?v=i1Ups-DPlxs

          Am I doing something wrong or is this a limitation of the shader? The only way I've been able to recreate the effect is by altering the UVs.

          Attached Files
          Last edited by wickerman123; 03-30-2018, 10:51 AM.

          Comment


            #35

            Sorry for the late reply I don't seem to get any email notifications from replies on this forum.

            Thanks for trying it out. I made some changes that should fix some issues.
            https://github.com/stororokw/UnrealE...9dc7d62f687b12

            By default the tangent input expects a vector map (anisotropy map) which consist the red and green channels. You can read more about it here: https://learn.foundry.com/modo/901/c...direction.html
            But, it boils down to this:
            red = highlights run horizontally
            green = highlights run vertically

            The rotation input expects a 'rotation map' where black corresponds to 0 degrees rotation and white a 360 degrees rotation.

            You are correct that the tangents are tied to the UVs, so I usually just planar UV map circular things and make sure they are orientated properly.
            where are you using that anis_map.png file?
            what do the UVs look like?

            It should be possible to do. Make sure its srgb is unchecked for the rotation texture.
            Click image for larger version

Name:	anisotropic_ue4_test.jpg
Views:	209
Size:	99.9 KB
ID:	1457413
            And the corresponding rotation map
            Click image for larger version

Name:	pan_rotation_map.jpg
Views:	201
Size:	17.2 KB
ID:	1457414

            Comment


              #36
              stororokw Hey! I was wondering if there's still a way to get your shader, since it seems the original github link has been removed. it looks really cool.

              Comment


                #37
                Originally posted by Fraz_ View Post
                stororokw Hey! I was wondering if there's still a way to get your shader, since it seems the original github link has been removed. it looks really cool.
                IIRC, You don't need it - check out Epic's automotive material package, there should be an anisotropic example in there.

                Comment


                  #38
                  Originally posted by ambershee View Post

                  IIRC, You don't need it - check out Epic's automotive material package, there should be an anisotropic example in there.
                  Nah, there's no anisotropic material in there dude. There's a brake disc which uses a radial normal, which "works" for that one very specific use case. But it wouldn't work on more complex objects, and even in this example, it doesn't do what it's supposed to do with the reflections (stretch them along the anisotropic angles).

                  From what i can see above this looked really promising, i don't think it would take much work to make it production ready at all. Would be good to look at the old code though.
                  Last edited by Almighty_gir; 10-10-2019, 11:17 AM.
                  Lee Devonald
                  Character Technical Artist.
                  Portfolio: http://crazyferretstudios.com

                  Comment


                    #39
                    It looks like UE 4.24 will come with anisotropy (beta). https://trello.com/c/ltJuIFA9/463-anisotropy-beta
                    Freelancer Game Dev Generalist and Unreal Consultant | Portfolio
                    Unreal products: Dynamic Picture Frames, Neo Kinect

                    Comment


                      #40
                      Originally posted by RVillani View Post
                      It looks like UE 4.24 will come with anisotropy (beta). https://trello.com/c/ltJuIFA9/463-anisotropy-beta
                      That's good to hear! I just checked again and it has been removed from the list

                      In the mean time I updated @stororokw's code to 4.23: https://github.com/Dawars/UnrealEngi...cd5aeb19f894ac

                      ​​​​​​​I tried it out but I don't know how to get the Tangent vectors. What did you use? I tried the TangentBases Material expression, didn't work.
                      Last edited by Dawars; 10-16-2019, 04:10 PM.

                      Comment


                        #41
                        Originally posted by Dawars View Post

                        That's good to hear! I just checked again and it has been removed from the list

                        In the mean time I updated @stororokw's code to 4.23: https://github.com/Dawars/UnrealEngi...cd5aeb19f894ac

                        I tried it out but I don't know how to get the Tangent vectors. What did you use? I tried the TangentBases Material expression, didn't work.
                        Awesome, thanks man!

                        For the tangent vectors you could probably look at the hair shader and see how they handle it. Their tangent vector is passed in through the normal map input (probably due to GBuffer space being limited), but if you want (and you probably do) to have both a normal and tangent input you can probably piggy back off of the custom data channel.
                        Lee Devonald
                        Character Technical Artist.
                        Portfolio: http://crazyferretstudios.com

                        Comment

                        Working...
                        X