Announcement

Collapse
No announcement yet.

[TUTORIAL] Triplanar material

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

    [TUTORIAL] Triplanar material

    Project download link

    I made a material that maps 3 different textures to an object based on it's xyz world orientation. It really speeds up the texturing process for rocks and other terrain features.
    I apologize in advance for the audio quality, the mic is from a 1990s Gateway computer.

    Last edited by StevePeters; 03-21-2015, 08:24 PM. Reason: Added project download link

    #2

    Comment


      #3
      Added material functions:

      Comment


        #4
        this is great info.. thank you very much for putting it together!

        Comment


          #5
          You could instead just use the World Aligned Blend node, which is basically planar mapping.

          Comment


            #6
            Originally posted by ambershee View Post
            You could instead just use the World Aligned Blend node, which is basically planar mapping.
            It took me a little time to dig up documentation on the world aligned blend node (This is all that I found), it seems to work by modulating the alpha based on a surface slope. I'll play with the node a bit and post what I come up with.

            Comment


              #7
              It's a flexible material function with a few static switches that compile out based on what you're doing with it - you can open it right up and see what it's doing. You could quite happily use one for each planar blend through an axis though

              Comment


                #8
                In the end, I wasn't able to use the world aligned blend node. It has a pixelnormalWS node in it that prevents it from working with normal maps or displacement maps. I did figure out how to get the textures to project almost completely without stretching. Here's the (slightly modified) default UE4 rock that has vertex paintable displaced snow on top.

                Comment


                  #9
                  Repost bc forum outage

                  I uploaded 2 more triplanar tuts to youtube

                  https://www.youtube.com/watch?v=F2WKGIVr39E

                  https://www.youtube.com/watch?v=9yuvt3RatIE

                  and here is the material functions I used. Next up, projection texturing in local space.

                  Comment


                    #10
                    Looks fantastic. Will this work with terrains as well; say the height is grass and the sides of the elevations are rock?

                    Comment


                      #11
                      The most current version of the projection material allows for local or world space mapping (no heightmap based displacement on the local one though), wood grain type noise, and a rudimentary system for determining the projection direction. Instead of just being based on the XY or YZ planes you specify a rotation amount which is stored in the red and green channels of a vector. I'll make a vid about the usage of the material soon.

                      https://dl.dropboxusercontent.com/u/...onMaterials.7z

                      Comment


                        #12
                        Very cool. I see this is actually a pretty old post? I'm glad you bumped it back into relevance.
                        I'm an artist! Check out my work at https://cinebst.wixsite.com/cinebeastart and hit me up!

                        You can e-mail me at cinebst@gmail.com.

                        Comment


                          #13
                          Originally posted by Cinebeast View Post
                          Very cool. I see this is actually a pretty old post? I'm glad you bumped it back into relevance.
                          I got distracted with another project and never quite finished this one. I got a few questions on the materials so I decided that it would be best to get off my butt and clean it up so that I could share it.

                          This is what's in the project for those that are interested:


                          For the material experts out there, I'm changing the projection angle for the projection material by creating a new transform basis based on 2 scalar values (stored in a vector). The values work between 0.0001 and .49999 with larger and smaller values repeating. At 0 and .5 it suffers from what seems like gimbal lock. I can prevent this by clamping the values, but it feels kind of hackey to me. If anyone has a better method I'd love to hear it.

                          One cool thing about using a vector is that I can use a texture to determine projection direction. There's a raised panel door in the project which has the stiles and rails projected at different directions.


                          Comment


                            #14
                            Damaged wall prof of concept

                            Comment


                              #15
                              Oh sweet, i had a bit of an issue getting pattern variation right and was curious about decals, thanks for posting will check it out soon!
                              LEGENDS of EPICA [Twitter] [Facebook] [YouTube] [Vimeo]

                              Comment

                              Working...
                              X