Announcement

Collapse
No announcement yet.

Uncharted 2 Snow type shader?

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

    Uncharted 2 Snow type shader?

    http://www.laurenscorijn.com/vertex-blending-snow.html

    I followed this shader network. it looks decent, but i noticed with my height map from zbrush, when plugged into the network, my painted texture never gets in all those tiny nooks and cracks like the layer textures do all over in uncharted 2.

    in uncharted 2, you see the snow in every little crack for example.


    I wonder if they're using a height map as well as a normal map combined somehow to get the snow in those little cracks? any ideas?

    i wanted to do a uncharted 2 themed env, but i cant start making my textures until i can figure out how to make this shader in unreal. anyone have any ideas? i'd love to be able to get my layered textures into all the nooks and crannies. i know its possible in unreal, just unsure of how to do it.

    #2
    did they use unreal engine for uncharted 2? If it were me, I'd look into using vertex painting for the large stuff and maybe decals for the small cracks and crevices? I'm not seeing alot of evidence that the lil snow is actually in cracks and crevices. Looks to me like its just creating the illusion that it is.

    Comment


      #3
      If you're using a heightmap for the base (Not Snow) texture and you want the snow to show up in the cracks, you can do that. You'll need to experiment with that setup a bit to figure out where to change it.

      Basically, what you need to do is this:

      Take the grayscale heightmap that's plugged into the bumpmap and connect it to an X-1 node to invert it. Now, the lowest parts are white. Plug that into the alpha channel of a lerp. Plug your main texture into the lerps A, and the snow into the lerps B. Now, the deeper the crack, the more snow will be there.

      You just need to figure out how to mix that in with your existing setup.

      EDIT:
      And, if you connect the inverted alpha to a multiply node and multiply it by a scalar parameter or a vertex color, you can can control how heavy the snow layer is. With this setup, you would connect the heightmap to an X-1. Connect the X-1 and the Scalar (Or Vert Color) to a multiply. Connect the Multiply to a Constant Clamp (To maintain 0-1 alpha). Connect the Constant Clamp to the Alpha of the lerp. Connect the primary tex to Lerp A. Connect the snow to Lerp B.

      Now, the brighter that Vert Color gets, the more snow there is. It'll start in the cracks and eventually fill in entirely except for spots that started out 1.0 in the heightmap. Those spots are 0.0 when you invert, so multiplying never goes anywhere. If you wanna be able to get full coverage from that, you would need to add some small amount to it before you multiply it.

      Repeat the exact same setup for the normals and spec and whatever else you're using. Do not use this in the bumpoffset though. You want that to remain the original texture bump all the time so that the snow just covers it and doesn't replace it.

      Comment


        #4
        Originally posted by percydaman View Post
        did they use unreal engine for uncharted 2? If it were me, I'd look into using vertex painting for the large stuff and maybe decals for the small cracks and crevices? I'm not seeing alot of evidence that the lil snow is actually in cracks and crevices. Looks to me like its just creating the illusion that it is.
        They used a custom written engine for the game. One of the lead engineers for it wrote a book called Game Engine Architecture, and Uncharted is used as an example for plenty of things. Its a good read, actually, especially the AI section of the book

        Comment


          #5
          @Wyldhunt

          Would you have an example this material you described how to do? i followed that links method of doing it, but it doesn't get in the fine cracks and stuff, which is what i want it to do (just like in uncharted 2)

          Could you post how you go about making your material? i'd really really appreciate it.

          Comment


            #6
            do you have a heightmap of your rock texture? take it into photoshop, invert it and play with the levels until you get a highly contrasting b/w image where the cracks are white and the rest black. use that as an alpha in a lerp to mix between your rock texture and your snow texture.

            Comment


              #7
              not the best example, but you get the picture I hope.

              Comment


                #8
                I finally got this to work. the snow falloff was just a test, it could look better but the snow gets in all the little cracks and wedges now using a height map. SO thrilled i got this to work. now i can apply this to streets, walls, EVERYTHING. man udk is the BEST!

                Thanks for the help btw everyone.

                Comment


                  #9
                  You can also use something similar to this, or combine this with Vertex Blending: http://www.sparkingspot.com/a_tutorial05.php

                  Comment


                    #10
                    The idea of using a cubemap for that is a good idea, and that could be used as a good inspiration. I'd advise integrating the two techniques though. The cubemap example makes good use of vectors and cubemaps, and they get most of their lerps right. But it has a lot of room for improvement. I don't think they set their specularity up correctly. The heightmap looks like it's the primary spec map. That other map looks like it was supposed to be a detail map. It would look a lot better with proper tiling so that it would add proper detail. And it should probably be detailing more than just the spec. They don't lerp their normals at all, so the snow never appears to fill in the cracks. If they have a heightmap already, they may as well use a bumpoffset to help give the base texture the proper height under the snow and lerp it to fill in the cracks a bit, much like the normals.

                    Both of the techniques here have very good parts. I'd see about taking the good parts from each of them and making something really good.

                    Comment


                      #11
                      wow you guys that know the material editor never cease to amaze me.

                      Comment

                      Working...
                      X