Creating an Interior Mapping Shader using Unity's Shader Graph - Game Dev Sandbox

  • Published on May 3, 2020
  • I've been fascinated by technique used on the windows in Marvel's Spider-Man and Forza Horizon 4 so I set out to learn how these games achieved the effect and to see if I could build an Interior Mapping Shader myself using Shader Graph in Unity. Here's how it went...

    Flexible Grids:
    Making UI Look Good:
    Dynamic Depth of Field:

    Interior Mapping in Forza Horizon 4:

    Rendering Real rooms without Geomety:

    Interior Mapping Shader Showcase:

    Windows in Games Case Study:

    Want to support the channel?

    ▶️ Help fund new episodes by joining the Patreon -

    Get the GameDevGuide mug and other merch! ☕ -

    Use these links to grab some cool assets from the asset store:

    Get the Must Have Assets! -
    Free Unity Assets! -
    New on the Asset Store! -
    Top Paid Asset Store Packages -
    Asset Store Partners -

    Socials and Other Stuff:

    • Subscribe -
    • Join the Discord -
    • Twitter - GameDevGuideYT
    • Facebook - GameDevGuideYT
    • Instagram - GameDevGuideYT

Comments • 297

  • Dani
    Dani Year ago +803

    This was really interesting, good job man!

  • Eric
    Eric Year ago +230

    Wow, this was way more impressive than I expected. You could flesh this out a bit and sell this as an asset I bet. Keep up the excellent content, cheers :)

  • Dawdle
    Dawdle Year ago +87

    Awesome tutorial! I really appreciate that you both explain the shader and include a full view of the shader graph so it can easily be recreated! The struggle to recreate a shader using nothing but gifs of the finished product and maybe some code that doesn't work anymore is the worst part of game dev.

  • Njebs
    Njebs Year ago +38

    Really cool video! As a followup, could you potentially create a system that automatically randomises each room for every iteration of the cubemap, just to add that extra bit of variation?

  • Crystan
    Crystan Year ago +15

    I was today years old when I realised Spiderman didn't have rooms rendered behind those windows. This is an amazing technique, and one which I would love to make use of in future projects!

  • SPi
    SPi Year ago +2

    Things like that are what makes game developing so much interesting and fun to mess with these innovations are so interesting to come up with even in smaller scales. it does make it more difficult than challenging to accomplish but it adds more magic to it and makes everything so interesting.

  • Harry Bosch
    Harry Bosch Year ago +1

    I have fallen in love with your tutorials, covering advanced, relevant topics no one else does. It's so refreshing!

    YVZ STUDIOS Year ago +3

    That looks awesome! Do you perhaps have any tips on how to do the opposite? An interior scene with windows as walls that have nice reflections? I've tried out reflections probes with cube projections, but the illusion breaks if I'm change my position. They look like flat textures instead of real relfections..

  • Mert Kirimgeri
    Mert Kirimgeri Year ago +4

    That's a nice one! For a few months ago, when I was creating my version of this tutorial, I followed similar steps to your thought process. Happy to see it kinda converges with others like a common sense :)

  • Tajaloe - Personal
    Tajaloe - Personal Year ago +36

    My brain: render out a room in one image with a depth map. Use those textures on a model and use inverse camera mapping to displace using a parallax node. idk if that works lmao I haven't tried it, but someone should. Probably not as performance Friendly though, but hey, you get per object depth information at the sub pixel level, so that's cool I guess

  • monawoka97
    monawoka97 Year ago +1

    I would LOVE to see a video on projection decal shaders. I know that HDRP has these built in, but I would love to have it decomposed in shader graph so I could do some more custom processing on the texture that gets projected.

  • cuarq
    cuarq Year ago

    Great tutorial as always, you have some of the highest quality game dev content on youtube. Another suggestion that I would think would be helpful, and go along with your strategy/city builder game theme that comes up in some of your videos, would be a tutorial on how to create a 3D based grid map system, Where buildings/units/roads are snapped to a grid when placed. This would be a great niche to hit, as the current tutorials for this on youtube are either poorly made or use an inefficient method to create this. Cheers

  • Marcel Grolms
    Marcel Grolms Year ago +1

    Amazing! Would also be interessted in how the script works to get the cubemaps for the rooms. I already learned so much from your videos, thank you!

    LEUKICK Year ago

    Congrats!! This is amazing work :)) Would you consider making the doors in the room models facing the back walls as if to exit to a hallway, instead having all the room doors oddly connecting to each other?

  • Julien H
    Julien H Year ago +1

    Really nice video !

  • Angelo Barredo
    Angelo Barredo Year ago

    Awesome tutorial, can't wait to try it out myself! Though I was wondering if the cubemap camera is set to perspective instead of orthographic. Given how the sample cubemap is flat, maybe setting the camera to orthographic would eliminate the need to squish the 3D objects.

  • M L
    M L Year ago +1

    This is a brilliantly presented video on a really interested topic, deserves so many more views!

  • Jewalify Official
    Jewalify Official Year ago +1

    This is so cool. It only works in 2D. In VR this wouldn't work, you would be able to tell that it's a flat surface but it would still kind of look like it had depth

  • Aadit Doshi
    Aadit Doshi Year ago +3

    Great video! I appreciate your efforts! I just wish you went into a little bit more detail about why something went wrong, and how changing it fixed it, an example is around the

  • Reezuleanu
    Reezuleanu Year ago +122

    Local hero teaches game designer wannabes how to pull off rad effects. Thank you sir.