Announcement

Collapse
No announcement yet.

Watch Dogs style Interior Mapping material

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

    Watch Dogs style Interior Mapping material

    Hey guys, happy Ascension day!

    Today I devoted my day to bringing the Interior Mapping technique to Unreal Engine 4! For those that are not in the know, Interior Mapping is a technique to simulate virtual geometry with only a pixel shader. It's been most recently used in Watch Dogs:


    *30/5 UPDATE*
    I've migrated the material function + sample textures and materials over into a new project, which you can download here:
    InteriorMapping.rar

    I've tried my absolute best to make it as lightweight as possible, but if you have any comments/additions/suggestions, you're more than welcome! Enjoy!

    One quick note: Due to the Unreal distance units, the tiling and room frequency parameter settings usually have very low values (0.015 is the default). I originally multiplied the parameters by a very small number, but because these floating point operations add more complexity to the shader, I've decided to leave them out altogether.

    Click image for larger version

Name:	InteriorMaterial.png
Views:	2
Size:	429.8 KB
ID:	1135043

    And, combined with a few very basic textures it looks like this:
    Click image for larger version

Name:	InteriorViewport2.png
Views:	2
Size:	789.8 KB
ID:	1135027 Click image for larger version

Name:	InteriorViewport.jpg
Views:	2
Size:	183.8 KB
ID:	1135035 Click image for larger version

Name:	InteriorViewport.png
Views:	2
Size:	696.9 KB
ID:	1135036
    Attached Files
    Last edited by Stefander; 05-30-2014, 10:33 AM.
    Stefan 'Stefander' Wijnker | Senior Game Engineer at Spiderling Games
    JSON Query - Interior Mapping - Looping Louie

    #2
    Originally posted by Stefander View Post
    Hey guys, happy Ascension day!

    Today I devoted my day to bringing the Interior Mapping technique to Unreal Engine 4! For those that are not in the know, Interior Mapping is a technique to simulate virtual geometry with only a pixel shader. It's been most recently used in Watch Dogs (very short video showcasing the technique here) to simulate interiors on skyscrapers and buildings to make them feel more unique. So far, I've succeeded in making a simple material function that takes a couple of parameters (the wall/ceiling/floor textures and the wall/texture tiling options) and outputs the correct sampled color. This looks a little something like this:
    [ATTACH=CONFIG]4030[/ATTACH]

    And, combined with a few very basic textures it looks like this:
    [ATTACH=CONFIG]4033[/ATTACH] [ATTACH=CONFIG]4041[/ATTACH] [ATTACH=CONFIG]4042[/ATTACH]

    I'm still changing around a lot of stuff but it's coming along nicely Any comments/suggestions are very welcome!
    I was literally about to start trying to work something like this out today, looks like you've already made great progress with it. Any ideas if/when we'll be able to try it out?

    Comment


      #3
      Originally posted by Crow87 View Post
      I was literally about to start trying to work something like this out today, looks like you've already made great progress with it. Any ideas if/when we'll be able to try it out?
      Actually, I wasn't really planning to release it because the graph is kind of a mess (the technique is quite complicated, as you might have found out), so the wires go pretty much everywhere... But if you happen to know if there's an easy way to share a material function, let me know and I'll upload it!
      Last edited by Stefander; 05-29-2014, 03:26 PM.
      Stefan 'Stefander' Wijnker | Senior Game Engineer at Spiderling Games
      JSON Query - Interior Mapping - Looping Louie

      Comment


        #4
        @Crow87 - There is a breakdown of how to create a shader just like this that is available on the old UDK website.
        Here is the link with all images, files, etc, if you would like to build one.

        http://udn.epicgames.com/Three/Devel...orMapping.html
        Portfolio
        UE3 - Advanced FX Masterclass Part 1 DVD
        UE3 - Advanced FX Masterclass Part 2 DVD

        Comment


          #5
          Originally posted by JBaldwin View Post
          @Crow87 - There is a breakdown of how to create a shader just like this that is available on the old UDK website.
          Here is the link with all images, files, etc, if you would like to build one.

          http://udn.epicgames.com/Three/Devel...orMapping.html
          I wasn't aware this technique was done in Unreal before, cheers JBaldwin!
          I've seen the technique before (Joost van Dongen is a personal friend of mine), but I've kept some of the features out of my version on purpose, because a full-fledged version would increase the overhead dramatically. I've experimented with quite a lot of input and output features, such as normal output and normal map inputs, but they add way too many instructions for my taste. Plus, now it all fits into one single material function, which you can use to enhance your existing materials!
          Anyway, I haven't found an easy way to share it yet, but my current material function graph looks like this:
          Click image for larger version

Name:	InteriorMaterialFunction.jpg
Views:	1
Size:	741.5 KB
ID:	1050949
          Attached Files
          Stefan 'Stefander' Wijnker | Senior Game Engineer at Spiderling Games
          JSON Query - Interior Mapping - Looping Louie

          Comment


            #6
            Originally posted by JBaldwin View Post
            @Crow87 - There is a breakdown of how to create a shader just like this that is available on the old UDK website.
            Here is the link with all images, files, etc, if you would like to build one.

            http://udn.epicgames.com/Three/Devel...orMapping.html
            That's brilliant, thanks for the heads up dude.

            Comment


              #7
              I've taken the time to clean up the graphs and migrated the content over into a blank project so I can share it with all of you. It's about as clean as I'll be able to make it without breaking stuff.
              I've kept the pass as clean as possible to minimize the overhead, all you have to do is use MF_InteriorMappingSimple (which is exposed) and plug in some textures and values! The download link is right here (unzip it into your Unreal Projects folder):
              InteriorMapping.rar
              Last edited by Stefander; 05-30-2014, 10:33 AM.
              Stefan 'Stefander' Wijnker | Senior Game Engineer at Spiderling Games
              JSON Query - Interior Mapping - Looping Louie

              Comment


                #8
                Originally posted by Stefander View Post
                Hey guys, happy Ascension day!

                Today I devoted my day to bringing the Interior Mapping technique to Unreal Engine 4! For those that are not in the know, Interior Mapping is a technique to simulate virtual geometry with only a pixel shader. It's been most recently used in Watch Dogs:

                *30/5 UPDATE*
                I've migrated the material function + sample textures and materials over into a new project, which you can download here:
                InteriorMapping.rar

                I've tried my absolute best to make it as lightweight as possible, but if you have any comments/additions/suggestions, you're more than welcome! Enjoy!

                One quick note: Due to the Unreal distance units, the tiling and room frequency parameter settings usually have very low values (0.015 is the default). I originally multiplied the parameters by a very small number, but because these floating point operations add more complexity to the shader, I've decided to leave them out altogether.

                [ATTACH=CONFIG]4091[/ATTACH]

                And, combined with a few very basic textures it looks like this:
                [ATTACH=CONFIG]4033[/ATTACH] [ATTACH=CONFIG]4041[/ATTACH] [ATTACH=CONFIG]4042[/ATTACH]
                Nice I was totally looking for something like that.

                Is this hard on the GPU? I mean is it worth the additional consumed resources?

                Comment


                  #9
                  Originally posted by DragonBroz View Post
                  Nice I was totally looking for something like that.

                  Is this hard on the GPU? I mean is it worth the additional consumed resources?
                  It shouldn't be! I've done my best to keep the function as lightweight as possible. Normally, if you use the material function and turn on Shader Complexity, it should still be totally invisible!
                  If you have any troubles through, try assigning the same texture to multiple inputs (doing this will decrease the amount of samplers required by your shader, quite handy on mobile). Cheers for the reply, appreciate it!
                  Stefan 'Stefander' Wijnker | Senior Game Engineer at Spiderling Games
                  JSON Query - Interior Mapping - Looping Louie

                  Comment


                    #10
                    Awesome, the effect is really convincing in Watch_Dogs. Great way of adding cheap details.
                    Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

                    Comment


                      #11
                      Awesome, thanks for Stefander!

                      Comment


                        #12
                        Sorry to resurrect an old thread, I just discovered this and was playing around with it. It's fantastic, but I was wondering if there's a way to account for object/building rotation in the shader (at least Z-axis rotation)? I tried picking it apart but realized that the math at play is a bit beyond me.

                        Comment


                          #13
                          I love all the little details that really make a game, similar to this. People barely notice them but they take so much work and really pay off
                          Check out the horror themed adventure game RELAPSE

                          Comment


                            #14
                            Did some poking around and figured out how to get rotations working. It's actually a simple matter of adding World>Local transforms to the World, Object, and Camera position vectors. I've attached a screenshot in case someone stumbles on this thread in the future and wants to do the same thing.Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	82.4 KB
ID:	1088353

                            Comment


                              #15
                              how can i make this as only 1 room? Or how can offset the rooms walls and floors so that it lines up with my window geometry..
                              Last edited by kurylo3d; 12-05-2017, 03:16 PM.

                              Comment

                              Working...
                              X