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

Sdílet
Vložit
  • čas přidán 29. 08. 2024
  • 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: • How To Get A Better Gr...
    Making UI Look Good: • Making UI That Looks G...
    Dynamic Depth of Field: • Dynamic Depth of Field...
    --------------------------------------------------------------------------------
    Interior Mapping in Forza Horizon 4: www.gamasutra....
    Rendering Real rooms without Geomety: www.gamasutra....
    Interior Mapping Shader Showcase: www.alanzuccon...
    Windows in Games Case Study: simonschreibt....
    --------------------------------------------------------------------------------
    Want to support the channel?
    ▶️ Help fund new episodes by joining the Patreon - / gamedevguide
    Get the GameDevGuide mug and other merch! ☕ - www.gamedevguid...
    Use these links to grab some cool assets from the asset store:
    Get the Must Have Assets! - assetstore.uni...
    Free Unity Assets! - assetstore.uni...
    New on the Asset Store! - assetstore.uni...
    Top Paid Asset Store Packages - assetstore.uni...
    Asset Store Partners - assetstore.uni...
    --------------------------------------------------------------------------------
    Socials and Other Stuff:
    • Subscribe - www.youtube.co...
    • Join the Discord - / discord
    • Twitter - / gamedevguideyt
    • Facebook - / gamedevguideyt
    • Instagram - / gamedevguideyt

Komentáře • 314

  • @Danidev
    @Danidev Před 4 lety +947

    This was really interesting, good job man!

    • @yousifragab479
      @yousifragab479 Před 4 lety +96

      Why you don't try and add this to Karlson (or you can't do that)

    • @supriyakhanra9068
      @supriyakhanra9068 Před 4 lety +11

      @@yousifragab479 why u bully him ?

    • @yousifragab479
      @yousifragab479 Před 4 lety +27

      @@supriyakhanra9068 Not bullying, he made a game called Karlson because someone challenged him and said that he can't make a 3d game and since then many people comment on his videos like this lol. I'm just joking, I do love his videos.

    • @rklehm
      @rklehm Před 4 lety +5

      You should try it... (You know to finish it, don't you?)

    • @MicMan2710
      @MicMan2710 Před 4 lety +5

      @@yousifragab479 It would look pretty good in Karlson. Once he developed that he can also just throw it into Milkman Karlson as well.

  • @reezuleanu1676
    @reezuleanu1676 Před 4 lety +131

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

  • @erz3030
    @erz3030 Před 4 lety +259

    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 :)

  • @markscott6927
    @markscott6927 Před 2 lety +15

    Back in the day when I worked for a larger game publisher, central tech did a presentation on several shader options for the XBox and PS3. What they called a ' depth shader' is what we have here. This was ~2004. After playing with all our nice new shaders we were immediately informed that they were too expensive to use.
    And such is the life of a game artist

  • @dawdledev
    @dawdledev Před 4 lety +100

    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.

  • @Crystan
    @Crystan Před 4 lety +20

    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!

    • @stylie473joker5
      @stylie473joker5 Před 2 lety

      I remember seeing someone on reddit posting about how Forza horizon 4 Devs had attention to detail when they modeled the interior of building windows he'd be disappointed if he knew the truth XD

  • @DagothDaddy
    @DagothDaddy Před 4 lety +23

    Forget "No loading between buildings." Or "you can climb those mountains." Give me "See that window? You can look through it."

  • @KentHambrock
    @KentHambrock Před 4 lety +2

    There's free drop in resources on the Unity Asset Store for this, but I love that you built it from scratch and showed the process for those of us who want total control over the process.

  • @graffiti9145
    @graffiti9145 Před 2 lety

    It adds life and a soul to the game's ambience

  • @avatar098
    @avatar098 Před 4 lety +5

    I'm a software developer by trade, but video game developers have always inspired me. Y'all are literally the intersection between art, story telling, and computer science. So I've been dabbling a bit in video game development, and man, what you guys do is NOT easy. Much respect for content creators like yourself!

    • @kathipaw
      @kathipaw Před 4 lety

      Sadly, professional video game developers are chronically underpaid and overworked. Not a great industry to work in.

  • @ZackLondres
    @ZackLondres Před 4 lety +2

    i made a new playlist just because of this video called "stuff i should put in a game" Just seeing a practicle demonstration of this helps understand ideas that are within ones grasp. Thank you for reminding me of that.

  • @Hamentsios10
    @Hamentsios10 Před 3 lety +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.

  • @GameOnBudget
    @GameOnBudget Před 2 lety +1

    Want this city you made 😍

  • @utkarshjha9547
    @utkarshjha9547 Před 4 lety +1

    This feels like making stuff look good with unity all over again... I hope u stay... great job!

  • @ml5111
    @ml5111 Před 4 lety +2

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

  • @tajaloe5920
    @tajaloe5920 Před 4 lety +34

    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

    • @KusalGunasekera
      @KusalGunasekera Před 4 lety +17

      That's exactly what I was thinking, we could improve the illusion of depth specially for the things that stick out. But then again, if you're using it for something that will whizz by at 250kmph then there's no point XD. Maybe for something like spider man, they can replace the faked room with a full 3d room once he gets close enough to the window

    • @stan_p
      @stan_p Před 4 lety +1

      you can get a real struggle doing this, cauz you adding things you shouldn't. Depth map cant be baked on the UV of cubemap, so this is first problem to solve if you about to mix those pipelines.

    • @lukabrasi001
      @lukabrasi001 Před 2 lety

      @@KusalGunasekera honestly, in Forza Horizon 5, the normal cubemap approach works really well, things look 3D enough with a little trickery

  • @rickloyd8208
    @rickloyd8208 Před 3 lety

    It took me a year to find a time and watch this video saved in my downloads. I do not regret that since I am learning shaders in details and I can better understand how powerful this trick is. Thank you for another great video!

  • @dimitribobkov-rolandez5729

    I'm just gonna borrow this for a second... nice video man!

  • @MertKirimgeriGameDev
    @MertKirimgeriGameDev Před 4 lety +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 :)

  • @crapgames6795
    @crapgames6795 Před 4 lety +3

    Holy crap, this is amazing! God bless the algorithm for recommending this.

  • @coderious4568
    @coderious4568 Před 3 lety +2

    That is true dedication, great job!

  • @mohhammadmohsin7
    @mohhammadmohsin7 Před 4 lety +1

    Man u make some real tutorials...... Love it 😍

  • @anandsuralkar2947
    @anandsuralkar2947 Před 3 lety

    Man u r opening my eyes to AAA level game graphics

  • @timothysnave
    @timothysnave Před 2 lety

    That's really cool. Just a note - the pacing in these sandbox videos is, IMO, way better than your other videos (from what I've seen so far). Sometimes I can't keep up visually in your other videos. This weird concept exploration format is gold, though.

  • @gone8792
    @gone8792 Před 4 lety +1

    Bro, the fact that I was just looking for a video like this 3 days ago is crazy lmao

  • @MicahTheManiac
    @MicahTheManiac Před 4 lety

    This is very cool. I wish that more games would use this technique, it seems like something like this isn't that resource intensive given that Spider-Man for the PS4 uses it.

  • @andrewpiltenko9432
    @andrewpiltenko9432 Před 4 lety +134

    People install Windows to play games, this guy installs games to play with windows.

  • @thedeveloper2771
    @thedeveloper2771 Před 4 lety +2

    Thank you for sharing it with the community! Great job!

  • @RoseIllo
    @RoseIllo Před 4 lety +1

    Fun fact! One of the examples you gave for blackout windows, Cities Skylines, does actually use a technique similar to this, with the exception that it only shows the floor inside the window, that fades into the distance. So you have interiors, but the interiors are all empty wooden floors and nothing else.

  • @AaditDoshi
    @AaditDoshi Před 4 lety +4

    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 4:15 mark

  • @connor4440
    @connor4440 Před 4 lety +1

    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

  • @AstroSamDev
    @AstroSamDev Před 4 lety +1

    nice work! good job!

  • @flyingjudgement
    @flyingjudgement Před 2 lety

    Waoo you actualy cover complicated topics and you do them realy well Thank you. Your works are realy amazzing, cant wait to watch what pics you interest.

  • @ThousandAnt
    @ThousandAnt Před 4 lety +1

    This is sooooo cooooooool! Great work Matt! I always loved this technique and you've done a great breakdown here.

  • @Sevendogtags
    @Sevendogtags Před 4 lety +1

    Nice! It really adds a lot to a simple environment.

  • @RiversJ
    @RiversJ Před 3 lety

    Thank you for this video, i won't be using this for windows but i will be using the basic techniques for something else that will be far better than my initial implementation!

  • @shivin12
    @shivin12 Před 4 lety

    Really like your channel ,please post more often

  • @Jewalify
    @Jewalify Před 4 lety +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

  • @TNTCProject
    @TNTCProject Před 4 lety

    Incredible analysis and final result! Love it. Goooooood job!

  • @GameDevEFacil
    @GameDevEFacil Před 2 lety

    This shader looks really amazing, good job

  • @piotrw1745
    @piotrw1745 Před 4 lety

    Awsome video! I love this type of video, which shows the whole creative process, showing problems encountered and searching for information.

  • @K0BRAKID
    @K0BRAKID Před 5 měsíci

    this is crazy! very cool!

  • @jacobmartincontreras
    @jacobmartincontreras Před 4 lety

    This is the type of thing that makes this game next gen

  • @mohammadsadeghlavaie5560

    you know how much we love you?

  • @juanquireyes6703
    @juanquireyes6703 Před 4 lety

    must be nice to be a genius like you

  • @brandonz404
    @brandonz404 Před 4 lety

    You spent a ton of time on this obviously and this is really interesting. Great work!(:

  • @harveyduenas8745
    @harveyduenas8745 Před 4 lety

    Woohoo! Nice job. Now I'm off to create my own interior mapping shader, and hopefully learn from your tribulations. Keep up the awesome content!

  • @safrio802
    @safrio802 Před 4 lety +1

    Wuaoooo sin palabras.... Excelente tutorial me sentí emocionado por el shader y el resultado logrado..

  • @CodingWithUnity
    @CodingWithUnity Před 4 lety

    Great info as always! I really enjoyed the watch!

  • @YognaughtAce
    @YognaughtAce Před 4 lety

    wow, that is incredible

  • @GrandHighGamer
    @GrandHighGamer Před 4 lety +4

    Nice. The front glass should be part of the shader though, no need for all that overdraw.

  • @monawoka97
    @monawoka97 Před 4 lety +2

    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.

  • @TheKevphil
    @TheKevphil Před 2 lety

    There is a UE5 demo floating around which uses parallax mapping to "populate" the interior of rooms in a mostly static street scene, so I came here to try to understand it. (Too much math and scripting; my head hurts!) But your result is excellent!

  • @pranshu05
    @pranshu05 Před 3 lety +1

    Awesome video I will add it to my game (because Dani wouldn't)

  • @javimania111
    @javimania111 Před 4 lety

    In 2005 this technique was used in a game called Trackmania Sunrise, in buildings in the bay enviroment. The effect didn't look as good as in current games, but it's still quite surprising considering the time.

  • @ThomasJeff4s0n
    @ThomasJeff4s0n Před 4 lety

    I was JUST thinking about how to do this same thing! Great video! Thanks!

  • @julienheijmans
    @julienheijmans Před 4 lety +1

    Really nice video !
    I was thinking that something that could be cool and give it a sense of increased fidelity would be to display some curtains that are displayed with a smaller parralaxe offset in front, on the sides of the windows. That would give the illusion that the player can see what is behind the curtains. (Said curtains should then be in a different texture, not integrated in the cubemap, of course)

  • @marcocacone
    @marcocacone Před 4 lety +1

    You are amazing! Thank you for sharing your knowledge

  • @ImSkully
    @ImSkully Před 4 lety

    extremely interesting approach, great video!

  • @tehuster
    @tehuster Před 4 lety

    Great video dude, very informative bit also fun to watch!

  • @GameWorkflow
    @GameWorkflow Před 4 lety +1

    Really cool stuff. It would be cool to do some kind of comparison test with this way and the more traditional method. I'm curious to see the performance of this technique vs the simpler one.

  • @jojoyoustudio
    @jojoyoustudio Před 4 lety

    You have so professional game devs and ideas ♥

  • @swagguy47
    @swagguy47 Před 4 lety +1

    The Crew 2 does this effect really nicely.

  • @Dogedevcd
    @Dogedevcd Před 4 lety

    Awesome, my brain is screaming out of confusion but in a good way, great job :D.

  • @andreskushnir2356
    @andreskushnir2356 Před 4 lety

    That is incredible! Thank you for that video, it was really interesting to watch

  • @magneticanimalism7419
    @magneticanimalism7419 Před 4 lety

    This was really interesting to watch, I'm highly unlikely to ever use it but it was awesome. Thank you.

  • @nolanjoseph1553
    @nolanjoseph1553 Před 4 lety

    I actually first noticed this when playing on Naboo in Battlefront 2. Interesting stuff!

  • @AmanKumar-tu2og
    @AmanKumar-tu2og Před 4 lety

    This is really interesting and intriguing!! Thanks for the amazing explanation.

  • @neenaw
    @neenaw Před 4 lety

    Your videos are so next level 🤯

  • @freeju2001
    @freeju2001 Před 4 lety

    This is amazing !

  • @Stxhen
    @Stxhen Před rokem

    beautiful, good job

  • @David-gu8hv
    @David-gu8hv Před rokem

    Pretty impressive

  • @outsidergameing921
    @outsidergameing921 Před 4 lety

    bruh thats amazing

  • @Th3Shnizz
    @Th3Shnizz Před 4 lety

    This is incredibly cool. Thank you for sharing!

  • @ChupachuGames
    @ChupachuGames Před 4 lety

    Fantastic video, thanks so much!

  • @MarcelGrolms
    @MarcelGrolms Před 4 lety +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!

    • @GameDevGuide
      @GameDevGuide  Před 4 lety +1

      It's literally the editor script shown in the video. That's all there is to it. It uses the default Camera.RenderCubemap feature as I mentioned.

  • @Nico-jc7zr
    @Nico-jc7zr Před 4 lety

    this is really cool

  • @waymanharris1284
    @waymanharris1284 Před 4 lety

    Wow, good job! This is nice, thanks for sharing.

  • @simulacrasimulation9070

    Beautiful

  • @AL2009man
    @AL2009man Před 4 lety

    Geez, imagine a combo of procedure generated rooms and this shader. It would be amazing!

  • @SirFency
    @SirFency Před 4 lety

    Well done sir.

  • @AlexTuduran
    @AlexTuduran Před 3 lety

    Nicely done.

  • @uglyburrito_
    @uglyburrito_ Před 4 lety

    This is very epic

  • @lukezhou6349
    @lukezhou6349 Před 4 lety +1

    I guess how the interior mapping shader works is by intersecting camera rays with imaginary cubes behind the plane. Moreover, I think that by pulling the camera out of the window and un-squishing all the geometry may produce better results (which means that you can't simply use a cubemap anymore).

  • @njebs.
    @njebs. Před 4 lety +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?

    • @GameDevGuide
      @GameDevGuide  Před 4 lety +17

      Yeah, there's a lot more you could do with it. In theory, you could expose the Cubemap properties in the Shader and set them on an instanced material using a script for something like that.

    • @Bolt6265
      @Bolt6265 Před 4 lety +2

      You could also use a texture array for the cubemaps and sample from it using some simple rng to make it less tiled. Idk, food for thought.

  • @SoaringSimulator
    @SoaringSimulator Před 4 lety

    Congratulations! Next time, for shader graph, search for UDK3 shaders. There are a tone lots of old forgotten tutorials.

  • @brianfordhamm2740
    @brianfordhamm2740 Před 4 lety

    Very cool! Spider-Man would've definitely benefited if there were more interiors than it has.
    Shouldn't be that different in Unreal though.

  • @damiangonzalez_esp
    @damiangonzalez_esp Před 4 lety

    Excelent video! Thank you for sharing this knowledge

  • @siavashaliyari3458
    @siavashaliyari3458 Před 4 lety

    Awesome work man

  • @arsizhifenerprozhod
    @arsizhifenerprozhod Před 2 lety

    Man, great work! so you made AAA paralax windows

  • @senaesul3128
    @senaesul3128 Před 4 lety

    Because light from the sun is much brighter than any light coming from the rooms, it would be cool to see the textures darken in certain conditions that involve competing light sources.
    Side note: I really feel like total reflection on windows (when viewed from a steep angle) is super unused. There were many cases in the video where I thought, "In real life, that would probably be impossible to see into because of the reflection".

  • @adamking816
    @adamking816 Před 4 lety

    nice work !

  • @MostafaA1s
    @MostafaA1s Před 4 lety

    that was very cool

  • @jakeecake
    @jakeecake Před 4 lety +2

    This is really cool, was wondering if you could plug in an animated image and have a person in some of the rooms? maybe someone on their computer making minute movements so they don't break that depth illusion

  • @NotASpyReally
    @NotASpyReally Před 4 lety

    So Cool.

  • @cudiedgar
    @cudiedgar Před 4 lety

    wow what a quality video, thank you

  • @judgaming3041
    @judgaming3041 Před 4 lety

    Wow, this is really interesting.

  • @zig8925
    @zig8925 Před 4 lety +1

    I remember this technique beeing shown in an episode of boundary break

  • @sanderoneil6998
    @sanderoneil6998 Před 4 lety

    this tripped me out bro

  • @xboxseriousgamer
    @xboxseriousgamer Před 4 lety

    Amazing