Announcement

Collapse
No announcement yet.

3d projection texture coordinates for Terrain layers

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

    3d projection texture coordinates for Terrain layers

    Hi there, I was wondering if someone came up with a material allowing "stretch free" terrain layers.

    I've seen that Crytek uses that method for their terrain system and it seems to work out pretty well.

    So far I've been trying to the do it in the UDK but without much success.

    I'm trying to get a rock texture project itself on XZ and YZ axis
    While the sand texture projects on XY axis

    It would be even better if the textures could project on all axis allowing for true 3d texturing.

    It looks like this at this point :







    Both textures are in one terrain layer (using one material) blending automatically with each other by using the terrain slop angles.
    Any advice from an experimented UDK would be a great help.

    #2
    no one is interested ? or is it just that there is no solution for this ?

    Comment


      #3
      are you using landscape ? If not that look great. On landscape you can set it up using projection with different axes like you mention. Are you the developer of tales of wenda ?

      Comment


        #4
        I'm using an old version of udk that doesn't have landscape support. Just regular terrain.
        And yup, I'm the one who was solo working on tales of wenda, even tho I haven't touched it for the past year due to bigger projects I was working on.
        I'll have a look at landscape tonight and see whats possible.

        Edit : I took a look at the update notes and it seems that all this nice features they added to terrain was already possible back in old UDK versions (2009)

        Couple of screenies of a terrain I did in UDK 2009



        Comment


          #5
          The Mapping Type property in the Terrain Material asset is used to determine which axis (or plane in reality) the Material applied to that Terrain Material is mapped to.

          Comment


            #6
            Originally posted by ffejnosliw View Post
            The Mapping Type property in the Terrain Material asset is used to determine which axis (or plane in reality) the Material applied to that Terrain Material is mapped to.
            Yea, I knew about that feature, but it wont allow me to have the projected texture blend seamlessly. You'd see some huge stretching on the sides of a cliff (as if I was doing a planar projection on a cylinder for example).
            You can even see the stretching on the first two screenshots I posted.

            Also I'm not sure if the devs are planning to add voxels support in the next update. It would be a great feature for making caves and unique terrains.

            One of the things missing in the mapping type propriety is the horizontal slop angle to make this possible. The vertical slop angle is already there.

            Comment


              #7
              here is a video showing what I was talking about :

              http://www.youtube.com/watch?v=-WiBJOFej3s

              Comment


                #8
                Stretching is always going to be an issue when you have large changes in height without enough vertices along those slopes. There really isn't any way around it in the existing terrain system as it is solely height-based with no support for vector fields (offsetting vertices in X and Y).

                Comment


                  #9
                  Was about to sleep, but I got a solution in mind. This is possible to achieve with some proper shader work with materials.
                  Back to work now.

                  Comment


                    #10
                    Alright with this the texture is projected on x,y,z axis.






                    Now I just need to find a way to access this kind of data (mudbox screenshot).
                    Any idea on how to reproduce this ?

                    Comment


                      #11
                      Alright seems like I'm getting very close to it. The trick was to use a vector transformation node as a texture mask for the LERP node.

                      With this material I successfully managed to have textures display on objects that dont have proper UVs. It basically bypasses UVs





                      Comment


                        #12
                        bumping this to get some help with the material

                        Comment


                          #13
                          Thanks Wenda

                          After a day of painful testing we got this to work well enough for a production quality project, couldn't have done it without your post though.
                          If you want to see the result let us know, we have used it on a terrain that used a heavily stratafied texture
                          (striped) running in a horizontal direction,which made the job impossible with regular top down rendering but this works really really well as the strata layers actually help the cause and when the normal map is added in, it is a near perfect result all for 2 texturesamples and 80 instructions(we will have to see how this goes when other mats are added in)
                          We did make some very minor changes to this as we could not get it to work by copying the above screenshots exactly , but put that down to the fact that we got a node wrong in the Expression, as the last screeny of the material editor is too small to read, so we kind of had a guess at it.
                          The only problem now is that the constant 2 vector that is hooked up to both X-Y expressions to control tiling refuses to be made into a parameter , we tried multiplying it with a scalar parameter but that screwed up the expression, may have to leave that as is.

                          Thanks again
                          learning this technique taught me a lot about shader making

                          Comment


                            #14
                            Originally posted by Shez View Post
                            ... we have used it on a terrain that used a heavily stratafied texture{striped) running horizontaly ...
                            Did you try world position or similar to determine a height to apply a color multiplier to the material (to create the striping effect)? Not that I know it would actually work, but as you can get variation using world position and radius it could be possible to get the current height as well. Not certain how complex it would get either.

                            Comment


                              #15
                              @musilowski
                              No we used a texture, we ruled out making a procedural rock as it got too big too soon.
                              Will post a shot as soon as I can figure out how to upload an image
                              we mapped it from x and y as well as z but have done away with z as that s handled by the grond material, and included a blending offset to blend the transition from x @ y projections other wise you get seams.
                              I am going mad trying to optimise it further so its not so IC heavy

                              Comment

                              Working...
                              X