UNITY SHADER GRAPH with Fake Interiors Shader

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024
  • We will make a fake interiors shader in Unity Shader Graph tool. We gonna cover a technique called "Interior Mapping" which widely used on many AAA games including recent PS4 Spider-man game.
    You can use this shader in your projects, by doing that you will also learn fundemental nodes of shader graph.
    Here is the link for Joost van Dongen's paper:
    www.proun-game....
    Full Project Source:
    github.com/m3r...

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

  • @joshswanson0
    @joshswanson0 3 месяца назад +1

    Thank you for the detailed explanation of the process. I watched some other tutorials but they didnt explain each step, so it felt like too much black magic. This helped me know what the nodes are actually doing

  • @guneskedi
    @guneskedi 6 месяцев назад +1

    Amazing! It is very obvious that you've mastered this topic!

  • @dyemos
    @dyemos 5 лет назад +9

    Awesomely done! I'm really glad you adapted Van Dongen's paper on this!

    • @MertKirimgeriGameDev
      @MertKirimgeriGameDev  5 лет назад +5

      Thank you! There are awesome usecases of it. Low poly cars, buildings etc. And the awesome part is its just a quad! Which means entire 3d look gets rendered really really fast!🙂

  • @whank2006
    @whank2006 4 года назад +21

    Too much compute skill made me brain explosion ,but soooooooooooo awesome!

  • @saadsarnaik
    @saadsarnaik 4 года назад +11

    What an amazing technique. Thanks for the detailed tutorial. Subbed!

  • @batuhantugrul1966
    @batuhantugrul1966 4 года назад +4

    Thanks mate I was searching this topic a few weeks ago and today I found solutions to my problems =)

  • @tobiasgehring2462
    @tobiasgehring2462 4 года назад +7

    "when you look at a window from a very fine angle, reflection increases a lot"
    Yeah, that's the Fresnel effect, which you already added in. Potentially tweaking the power value would have given you the desired effect without adding in a dozen more nodes? There's also a bunch of inverting coordinates that might be able to be factored out?
    Other than that, really neat technique. I wonder how difficult it would be to add pseudo lighting from outside into the rooms...

    • @MertKirimgeriGameDev
      @MertKirimgeriGameDev  4 года назад +3

      Hi Tobias, that might be true😅 Answer to your second statement is, yes it is doable to add a pseudo lighting. Interior mapping uses raymarching to March a cube. So it is very well possible to apply a phong lighting with a few more nodes.

    • @harrysanders818
      @harrysanders818 3 года назад +1

      Thanks, that was helpful and cleaned up my graph.

    • @PeppoMusic
      @PeppoMusic 3 года назад

      If you want to get really anally retentive about it, you should call it total internal reflection (TIR). They just happened to call the specific shader effect 'Fresnell' in computer graphics, though Fresnell studied TIR and advanced our understanding of it greatly, he didn't discover it or coin the term.
      And ideally you want to base this effect on the index of refraction of the material for the most realistic result. Which should be 1.5 for glass, in the Fresnell node, not 0.7 as was put in the video, that's why there was not enough reflection, as the smaller that number is, the closer sideways you have to look at the surface to get TIR.

    • @tobiasgehring2462
      @tobiasgehring2462 3 года назад +1

      @@PeppoMusic it's called Fresnel because it's computing the Fresnel coefficient, using equations that Fresnel derived. He wasn't the first to realise that the amount of reflection vs refraction is dependent on the angle of incidence, but I believe he was the first to come up with equations for it.
      It would actually be less accurate to call it TIR, as that's a special case where all of the light is being reflected, whereas the node is also computing angles and indices where only part of the light is reflected and the rest is refracted. In those cases, the reflection isn't "total" (and as we're working with surfaces rather than solid volumes, "internal" is a potentially misleading term).
      How's that for anally retentive ;)

  • @ErdemKirmitci
    @ErdemKirmitci 5 лет назад +6

    I'm not interested in unity but watched it anyway! Nice video btw 😊

  • @ronan5946
    @ronan5946 Месяц назад

    Great tutorial, thanks!

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

    very cool!

  • @nonnullptrhuman504
    @nonnullptrhuman504 3 года назад

    Tysm for the video, this is so awesome! Instead of creating the whole interior just implement this Fake Interior shader.

  • @user-fh5bg3qg1u
    @user-fh5bg3qg1u Месяц назад

    Hi, thank you so much for your video tutorial; it really inspired me. However, I have a small question: why do I need to use 1 divided by the product of view and -1?

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

    tysm for this video this is so epic

  • @Rastapapulus
    @Rastapapulus 3 года назад +1

    Saol kardesim, cok yararli bir video.

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

    Really nice! Thank you!

  • @Ben174
    @Ben174 4 года назад +5

    Wadsworth’s constant applies

  • @GokdenizCetin
    @GokdenizCetin 3 года назад +1

    This is amazing

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

    This is so awesome, thanks

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

    9:09 thank you for covering this: it has bitten my ass soo many times..

  • @user-bw1rx1le3w
    @user-bw1rx1le3w 7 месяцев назад

    大佬太牛了!给你疯狂点赞!

  • @mertkaracelik1998
    @mertkaracelik1998 3 года назад +1

    thank you so much

  • @batuaytemiz6437
    @batuaytemiz6437 5 лет назад

    Very well explained an advanced topic!

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

    Sir, How can I get that unlit mode in my shader graph?

  • @why.brotheredits
    @why.brotheredits 3 года назад

    Teşekkürler gerçekten mükemmel bir video olmuş

  • @andrewmad
    @andrewmad 5 лет назад +1

    Cool! Thanks.

  • @werti4894
    @werti4894 4 года назад +4

    Thanks for the video, I managed to re-create it in a different shader editor called Amplify Shader editor. Only one thing I've noticed, do you know why around the intersections of the walls, the interior is distorted? And is there a fix?

    • @MertKirimgeriGameDev
      @MertKirimgeriGameDev  4 года назад

      Yes, it depends on the imaginary cube's scale. I mention it on the video. You can adjust the scale to fix it.🙂

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

    Fantastic video. Thank you for this!
    Does anyone know who to modify the shader to create a parallax effect with an additional texture? To basically make it look like there are objects inside the room that would have a parallax effect relative to the back wall.

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

    Amazing!

  • @MatrixRex05
    @MatrixRex05 4 года назад

    Thanks a lot for the tutorial. I was looking for this effect a long time.

    • @MertKirimgeriGameDev
      @MertKirimgeriGameDev  4 года назад +1

      I hope that people start using it more often in their games. Its basically almost performance cost free better graphics :D

    • @MatrixRex05
      @MatrixRex05 4 года назад

      Most of the open world games can benefited from this. My game isn't open world. But some extra details without performance cost? Why not?

    • @MertKirimgeriGameDev
      @MertKirimgeriGameDev  4 года назад

      Undoubtedly!

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

    Does it improve performance? Or would it be better to just render a non-parallax texture of a interior model then project it onto a cube. Asking for my massive open world game.

    • @medafan53
      @medafan53 3 года назад

      Consider the polygon count, a cube has 6 faces, as far as I can see this only needs 1 face, so for each window you have 5 more faces, so for example with 10 windows, you have 50 additional faces, that'll really raise the polygon count, which will impact performence.

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

      @@medafan53 But a shader to simulate all these faces are more expensive than poly count. I've seen benchmarks and it's only worth it when you use it in hundreds or so.

  • @JayFolipurba
    @JayFolipurba 4 года назад +1

    the preview images in my nodes don't look like yours. It's seemingly random whether they are square, like yours or round/spherical. It has the effect that I end up with a circle where only the upper right corner has the cubemap applied and the other three quarters are black... any ideas?

    • @JayFolipurba
      @JayFolipurba 4 года назад

      I found something. It suddenly worked fine when I put in the Blue value from the split node (that splits the UV) into the R and G of the combine node.

  • @aziz-ow3ib
    @aziz-ow3ib 2 года назад

    Güzel olmuş, ellerine sağlık

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

    Very nice tutorial! but I am getting a weird effect, if you resize the quad where the material is applied so that it becomes a long rectangle, the effect looks very distorted. It only seems to be working on squares, is this a limitation of the method or am I doing something wrong?

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

    Hello, I'm trying to use this method in Blender but it doesn't seem to work.
    Most of the shader nodes are the same but some have different names and that makes it harder to copy into Blender.

  • @lukdra
    @lukdra 3 года назад

    WAUUUUUUUUUUUUU

  • @soumyaranjanpanda8752
    @soumyaranjanpanda8752 4 года назад

    Thank you

  • @zig8925
    @zig8925 3 года назад

    I followed your exact steps, and my side walls are working. Not the back one though. The wall that's supposed to be "the back" of the room doesn't look flat, but is infinitely extending into a single point it seems. Maybe not wuite infinately, but i justneed a way to flatten it out.

  • @prinzpablo527
    @prinzpablo527 3 года назад +1

    Could this be the best way for optimizing a 3D game based on file size and computing power. Or does it take more resources to render and more storage space?

    • @user-og6hl6lv7p
      @user-og6hl6lv7p 3 года назад

      Generally speaking, shaders are the fastest way to render things in a game, but it entirely depends on what you are doing with them. In this case it is not a concern. Storage space depends entirely on the image resolution and format.

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

      Interior Mapping/Fake Interiors should be faster. Cyberpunk 2077, The last of us part 2, even hypercasual mobile games all of them use this method. So it is pretty cheap and pretty fast. Unless you have too high resolution cubemaps, you should be fine.

    • @prinzpablo527
      @prinzpablo527 3 года назад

      @@MertKirimgeriGameDev Thank you for the tuts, it'll help alot in optimizing my game.

  • @starchaser28
    @starchaser28 4 года назад

    Do you generate the cubemaps with reflection probes or another way? I'm finding the effect looks right when the reflection probe is centered in a room, but not if it's off-center like at a doorway or window.

  • @ESTEBANLORETO
    @ESTEBANLORETO 4 года назад

    Thanks so much for this explanation, do you know how to rotate the projection, if the building tilted??

  • @KimboKG14
    @KimboKG14 3 года назад

    such a great explanation really looking forward to use this shader!
    does anybody know how many batches it produces? lot of sampling in there...

  • @Praveenkumar-jb3wd
    @Praveenkumar-jb3wd 2 года назад

    Hi mert! Is it possible to get that much realitic looking glas reflections like that spider man game..If it is which nodes we need to work on?

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

      You might wanna bake reflection probes around your window. Then adjusting the smoothness value should blend reflections with probes.

    • @Praveenkumar-jb3wd
      @Praveenkumar-jb3wd 2 года назад

      @@MertKirimgeriGameDev Thanks for the suggestoin I'll try

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

    Hey, man. Can I use the same shader to simulate a fake exterior?

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

      It's even simpler to make a fake exterior. you can just sample the cubemap or a hdri directly with your view angle. the extra math in this is specifically to line the edges up with the window and to make a cube projection within the window, outside doesn't need to be a cube though

  • @ozgenaliekber
    @ozgenaliekber 3 года назад

    Sen nasıl bir kralsın

  • @tjarkoh.4037
    @tjarkoh.4037 4 года назад

    Hey, does this technique also work with HDRP? Saw another tutorial and that didnt seem to work with HDRP

    • @MertKirimgeriGameDev
      @MertKirimgeriGameDev  4 года назад +1

      Absolutely! I tested it with HDRP too! Same nodes, same workflow. Nothing else needed! Since this technique is technically so naive, it should work with even a potato😜

    • @tjarkoh.4037
      @tjarkoh.4037 4 года назад +1

      @@MertKirimgeriGameDev awesome will try it this week, thanks a lot!

    • @MertKirimgeriGameDev
      @MertKirimgeriGameDev  4 года назад +1

      Good luck!

  • @BadMouseRM
    @BadMouseRM 4 года назад

    I love this! Really great job! One thing Im looking to achieve in my shader is instead of a cubemap use a texture, how I can modify it to make in works ?
    I tried but the walls, floor and ceiling looks super strech like 1 pixel of the texture. Thanks

    • @MertKirimgeriGameDev
      @MertKirimgeriGameDev  4 года назад +1

      Hey Luis! Do you have a projection texture? Or separate texture for per side?

    • @BadMouseRM
      @BadMouseRM 4 года назад

      @@MertKirimgeriGameDev I have a tile texture of 2x4 containing 8 different interiors. So each interior is square like a perspective projection having the top, down, sides and front of the room.
      Another thing I wanna do is those 8 interiors by random.

    • @BadMouseRM
      @BadMouseRM 4 года назад

      Something like Forza 4 will be amazing
      www.artstation.com/artwork/581r9O

    • @MertKirimgeriGameDev
      @MertKirimgeriGameDev  4 года назад +1

      I see. It is possible with shadergraph but requires a bit of work in "virtual room size generation nodes" that I mentioned in the video. I can give you some resources that you can use for research. I'll probably hit another message here as a follow-up later today.

    • @BadMouseRM
      @BadMouseRM 4 года назад

      ​@@MertKirimgeriGameDev Thank you!

  • @RoddKane
    @RoddKane 3 года назад

    What's the music in the first few minutes?

    • @MertKirimgeriGameDev
      @MertKirimgeriGameDev  3 года назад

      Honestly, it's been a while I made that video, so I can't recall. If I can find it somewhere under my archive, I will update this post.

  • @TheBlackbirdii
    @TheBlackbirdii 3 года назад

    how to make it work in hdrp ?

  • @igorthelight
    @igorthelight 3 года назад

    Great video, thanks!
    But why camera man is so sadly breathing? He sounded very tired or bored :-)

    • @MertKirimgeriGameDev
      @MertKirimgeriGameDev  3 года назад

      Haha, my brother was recording it and I guess we shoot some sequences a couple of times. So he was literally tired lol

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

    nice can i kill the beef thing

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

    The tutorial is irreproducable in unity 2021.

    • @Elledan3101
      @Elledan3101 4 месяца назад

      It still works great in Unity 2022 URP. In my case, I had to use "Sample Reflected Cubemap" node

  • @D-K-C
    @D-K-C 3 года назад

    Ъ

  • @cricketpassion9638
    @cricketpassion9638 8 месяцев назад

    HI MY QUESTION IS WILL THIS WORK IN MARMOSET OR MAYA ??? I KNOW ONLY THESE 2 SOFTWARE ... PLS ANSWER