Interior Mapping - Shader Graph Basics - Episode 34

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024
  • In this shader tutorial, I show how to create Interior Mapping - a way to make simple shapes appear to have interior details. This technique is popular for games because it gives the illusion that buildings that are made of simple flat polygons have complex interiors. This week, I show the core of the shader and next week, we'll expand it.
    Here's last week's video that shows how to create Cube Maps:
    • Creating Cubemaps - Sh...
    Here's the playlist for the whole series:
    • Shader Graph Basics
    Learn more!
    • Creating an Interior M...
    • Spider-Man PS4 Interio...
    • FAKE BUILDING INTERIOR...
    Shader Book Recommendations
    www.bencloward...
    ------------------------------
    Theme Music
    Peace in the Circuitry - Glitch Hop
    teknoaxe.com/Li...
    Background Music
    Speo - The Little Things
    • The Little Things
    #UnrealEngine #shadergraph #Unity

Комментарии • 57

  • @marcusng1317
    @marcusng1317 2 года назад +10

    I understand this whole video (and probably the next few) is only going to cover tangent-spaced interior mapping. Before you move on to another topic, please do not ignore object-spaced (or world-space) interior mapping which I want to learn as well. I really need interiors for sloped and curved buildings, as I commented a few days ago, the drawback to tangent-space interior mapping is unrealistically tilted rooms on sloped facades or distorted rooms on curved facades, which I do not want. I hope you understand my plight and I trust that you will soon cover object-spaced interior mapping.
    For some reason, I cannot attach a link to show you what I am talking about.
    I do not want to repeat again, thank you.

    • @BenCloward
      @BenCloward  2 года назад +11

      I have a technique for object space interior mapping working. I can share that in a later video.

    • @marcusng1317
      @marcusng1317 2 года назад +1

      @@BenCloward Thank you so much for replying. I am looking forward to it. 👍

  • @LoopSkaify
    @LoopSkaify 2 года назад +4

    This is black magic to me. amazing!

  • @CanadianReset
    @CanadianReset 2 года назад +5

    This was a great explanation. At the start of the day I didn't really have much of an idea of how to achieve this effect but after setting this up and playing around I can already see how to add more parallaxing layers etc. Excellent job!

  • @VisualTechArt
    @VisualTechArt 2 года назад +9

    That's a very smart way of getting that fake interior! Didn't know about this solution :)
    I was planning a video on the same topic for the future too, as an excuse to explain better raycasting and other things. Keep it up, you're doing a great job!

    • @BenCloward
      @BenCloward  2 года назад +1

      Thanks! That means a lot coming from you!

  • @alejandroandrino8363
    @alejandroandrino8363 2 года назад +8

    Freaking cool man, thanks for doing it on both engines :D

  • @binyaminbass
    @binyaminbass 2 года назад +1

    God bless you, Ben Cloward.

  • @cedric7751
    @cedric7751 2 года назад +3

    Gil Damoiseaux made a version of interior mapping where he uses a 2D mask to project a shadow inside the room.
    Later he added options for different room sizes and even point lights inside the rooms.

  • @Prototype0rangE
    @Prototype0rangE 2 года назад +6

    Have you guys looked into the Matrix interior mapping? Quite impressive how they are faking 3D in the interior. Any thoughts on breaking that down?
    Great channel and recommend it all the time....

  • @user-ti4fb5sd8w
    @user-ti4fb5sd8w Год назад +2

    I need help...
    I followed your tutorial in Unity, but I'm getting a weird warping effect, It looks perfect in parallel camera view, but not working correctly in perspective camera view, and I also spotted a warping effect in your video at 12:24 where you moved the preview window, the top side of the cube where the texture is green, it seems to be wrong.
    ( sorry for my bad English )

  • @Crylar44
    @Crylar44 Год назад +1

    Thank you!

  • @antoniosuarez7881
    @antoniosuarez7881 Год назад +1

    thanks, really grate tutorial

  •  2 года назад +6

    Hi, Can you show us how to improve interior mapping with adding second layer ? (Curtains, Decorations etc) PS you are awesome!!

    • @BenCloward
      @BenCloward  2 года назад +2

      Thanks for the suggestion!

  • @Louluufff
    @Louluufff 11 месяцев назад +1

    This was so helpful!! Thanks so much

  • @jhebadiasprunklefunk9243
    @jhebadiasprunklefunk9243 2 года назад +1

    Love it! Thanks Ben, I'm looking forward to more on this subject :)

  • @AhmedHasan91
    @AhmedHasan91 2 года назад +1

    amazing

  • @aukehuys2297
    @aukehuys2297 2 года назад +1

    I would be also interessted in how to spread a single cube map over several instances. A building is built of several instances and rooms do have more than one window and is spreading over several instances. How to accomplish this? Maybe custom data and manipulating the UVs?

  • @lalamax3d
    @lalamax3d Год назад

    hey Ben, just wanted to say, huge thanks for sharing knowledge with such a precision. if you could create same shader via nodeToy or threejs that would be super awesome, cheers,

  • @jkazulyblanco
    @jkazulyblanco 2 года назад +1

    Amazing tutorial, very well explained

  • @thskts.nguyenkhacthang7926
    @thskts.nguyenkhacthang7926 15 дней назад

    thank you so much with your share. it so useful. but i dont understand why you divide camera vecto by 1and after that
    why you multiple this result with UV Coordinate operation for which purpose , please explain help me. thank you ^^

  • @sr2sdouble
    @sr2sdouble 2 года назад +5

    what about paralax interiors mapping from "matrix ue5 demo"? there are implemented 3d objects inside the maps, for example tables and chairs

    • @JamesKellyWickerman123
      @JamesKellyWickerman123 2 года назад +1

      I'd love to know more about this too. Hopefully they'll being the project to the launcher when UE5 fully releases so we can pull it all apart!

    • @12345ches
      @12345ches 2 года назад

      I guess we'll have to wait until they release the project files :P

    • @TechArtAlex
      @TechArtAlex 2 года назад

      The Matrix demo appears to use this technique, combined with creative parallax occlusion mapping. You can see typical artifacts of POM on certain objects such as layer slices, and also dithering between multiple sample frequencies which causes the blurriness artifact but makes the layers less obvious.

    • @JamesKellyWickerman123
      @JamesKellyWickerman123 2 года назад

      @@TechArtAlex it's the POM I want to know about, I've no idea how you'd get it to work with a cubemap! I'd heard it was a form of volumetric raymarching which suggests they're using some kind of volume texture rather than a simple heightmap. Maybe a cubemap with a corresponding volume texture?

    • @VisualTechArt
      @VisualTechArt 2 года назад +1

      I didn't see the matrix demo, but, around a year ago I think, in the studio where I work, I made a fake interior where you can actually place meshes inside the fake room :)
      I'll make a video about that sooner or later (a very long and complex one xD)

  • @Devorkan
    @Devorkan 9 дней назад

    Great effect! I don't understand how the projection really works though

  • @minapecheux
    @minapecheux Год назад

    Hi Ben, and thanks for an amazing tutorial, as always! :)
    I had a question though about the view vector transformation part: if I understand properly, the point is to do a raycast from the camera onto the surface, so as to get the intersection with the three possibles sides of the room to render, and then check which one is closer to render the right one. So I've seen the technique you show used in various places on the net (either in code or in graphs), but I can't understand how computing this reciprocal vector, then taking the absolute value etc gives us the raycast result... could you please shine some light on this part?
    Thanks in advance, and again thanks for all your great videos on shaders :D
    Cheers!

  • @Hotrood999
    @Hotrood999 2 года назад +1

    Great video Ben! I've been learning a lot from you
    Could you explain the benefits of using this technique over using actual geometry to build the interiors?
    I always thought this technique was more kind of a "shortcut" to make the life of artists easier, better than spent a lot of time populating the buildings interiors with a bunch of textured boxes, but does it has any performance benefit too?

    • @BenCloward
      @BenCloward  2 года назад +1

      Yes, this technique provides a significant performance benefit over building cube interiors for all of your windows. First, you don't have to use a transparent material on your windows - so the windows can be the same opaque material as the rest of the building. Transparent materials are more expensive that opaque materials, and not needing them saves you a draw call. Plus the interior cubes would be an additional draw call and at least 10 triangles per window. That can really add up on a sky scraper with hundreds of windows.

    • @Native_Creation
      @Native_Creation 2 года назад

      @@BenCloward Does Nanite help with this issue on the Drawcall? Or the transparency still remains heavy?

  • @gorantrpkov446
    @gorantrpkov446 Год назад

    Is is possible to apply this interior mapping to shapes other than cubes? Like If I was to represent the interior of a sphere? Or a portion of a sphere? I'm trying to show a fair depiction of an Iris being refracted behind a cornea with the Iris itself appearing under the surface and also concave, rather than sitting on the surface. I borrowed an example from the Refractive Ice tutorial where you can reflect the view direction and push the texture under the surface, but I can't really make it look properly concave. Wondering if this approach would better help me instead? Great content as always Ben, thanks!

  • @tbunreall
    @tbunreall Год назад

    Thanks for the video. I noticed in cyberpunk 2077, the interiors of buildings have light that go off and on. Would they be using a cube map for these interiors? If not, how do you think they achieved these interiors?

  • @wjc1514
    @wjc1514 Год назад

    hi! very like your videos. i'm newer to shader program, by follow your videos i can achieve the same result in unity but i still didn't understand the math behind, is there any related reference can explains this formula?

  • @DaDarkDragon
    @DaDarkDragon 2 года назад +1

    Don't know if you know but Unreal has a material function for this, including what you mentioned for next video

    • @BenCloward
      @BenCloward  2 года назад +11

      Yes, I'm aware. As I explained in the series on triplanar projection, I like to show people what's going on inside those material functions. There are several reasons for that. It's much better to understand something yourself rather than just reply on the work someone else has done. Sometimes the built-in functions don't do exactly what you want, so it's helpful to understand them so you can make modifications. And sometimes they do things in less effective ways (as was the case with triplanar normal projection). My plan is to expand on what's done in the built-in function so you'll be able to make improvements to it if you want.

    • @DaDarkDragon
      @DaDarkDragon 2 года назад

      @@BenCloward ah I see thank you for that then. Think you can do spline thicken mat function unreal has at some point? I have tried disecting it a few times before but still don't get the math.

  • @TheMadMuffin
    @TheMadMuffin 2 года назад

    Ben, great tutorial. Can you share the shader graph file? I followed your explination node by node identically, but my output results look completely different and I've scrubbed the shader graph portion over a dozen times, nothing is different but the end appearance is completely wrong in comparison. It would be helpful if all your nodes weren't collapsed so I could see what it should look like at those steps.

  • @marshallxu3411
    @marshallxu3411 2 года назад

    Can you talk about the Transformation Matrix node in Unity? Many thanks

  • @curhob
    @curhob 2 года назад

    Impressive! I have to say though, can you not just use a cube with flipped normals?

    • @BenCloward
      @BenCloward  2 года назад

      You can, but using that method would be a lot more work and would probably be more expensive to draw.

  • @sureztv5836
    @sureztv5836 2 года назад

    Why no Amplify shader?

    • @MrChristopher2413
      @MrChristopher2413 2 года назад

      Probably cause it's not free

    • @BenCloward
      @BenCloward  2 года назад +3

      Amplify is very similar to what I'm already showing. You should be able to apply the principles I'm sharing in that tool as well. My point isn't to show how to use a specific tool. It's to show the math - which can then be done in any tool. That's why I'm doing it in both Unreal and Unity.

    • @sureztv5836
      @sureztv5836 2 года назад

      @@BenCloward yep got it.. I was just curious..

  • @pilsmer
    @pilsmer Год назад

    Although this tutorial is amazing, I've just found out Unreal Engine 5 already has this feature in the form of the "Interior Cubemap" node.

    • @BenCloward
      @BenCloward  Год назад +2

      Yes, you are correct! I have done several tutorials that go over techniques that are already encapsulated in an Unreal node already. The advantage of knowing how the internals of the built-in node work are that you can improve on it and fix issues with it instead of just relying on the built-in version. You can customize it to your own needs.

  • @legendarywolf2372
    @legendarywolf2372 Год назад

    just look the shadow of spyderman on the glass 😂

  • @pravarchviz1782
    @pravarchviz1782 2 года назад

    I guess there is inbuilt fake interior mapping node inside recent UE 4 and 5 versions. we dont need too many nodes and operations to achieve that.

    • @BenCloward
      @BenCloward  2 года назад +1

      There is, but there were some things about it that don't work very well - like the randomization feature - so I decided to make my own and explain how it works do everyone will understand it better. I hope that's more helpful than just plopping down the pre-built node.

  • @nullchecker9985
    @nullchecker9985 2 года назад

    hi ben tnx for this amazing videos im realy new to this stuff and your videos is a big help for me but i have a question about how to creat this kind of effect
    m.ruclips.net/video/pmdRLyjxZ-A/видео.html&feature=emb_logo
    can you guide me to analyze this effect for weapon scop shader how should i know the analyze effect and recreate everything i see ,im really intrested and want to be pro at shader creation
    tnx again god bless you