Water Transparency and Refraction - Advanced Materials - Episode 38

  Рет қаралды 6,817

Ben Cloward

Ben Cloward

Күн бұрын

Пікірлер: 40
@Uncle_Fred
@Uncle_Fred 11 ай бұрын
Wow, the water is really starting to look great. I feel like this tutorial series could go on for some weeks. Depth, edge interactions, foam caps, directional waves, and underwater shader could all be their own tutorials.
@gitgud1568
@gitgud1568 11 ай бұрын
Even though i only watched couple of videos of you, i still tend to follow your content time to time on twitter and here for a couple minutes and admire your dedication to your art and discipline. Thank you for creating great content
@mlecz
@mlecz 11 ай бұрын
In the previous video you touched on a lot of optimization issues which was fantastic. What I miss in this video is the mention of the 'Single Layer Water' Shading Model. You are using Default Lit with transparency which for water alone is pretty heavy.
@BenCloward
@BenCloward 11 ай бұрын
Yes, very true. However, if you're basing your "pretty heavy" assessment on the number of instructions a transparent shader uses, you may want to look at it more closely. Transparent shaders are a bit more expensive than opaque ones, but no where near what the instruction count might lead you to believe. Transparent objects are rendered in the Forward pass - which means that the shader contains all of the code to do lighting, reflections, ambient, fog, etc - which opaque shaders do not have. So you can't compare the instruction counts of transparent objects with opaque ones to get an accurate performance assessment. Another challenge I run into in this situation is that both Unreal and Unity have built-in water shaders, but their implementation and results are very different from each other. I'm doing my best to present content that is very similar between the two engines, so I chose to do it this way rather than present two separate and very different systems that are very engine specific. Maybe not what some users are looking for? Not sure, but it's always been my goal to teach shader techniques instead of engines.
@jihadrouani5525
@jihadrouani5525 11 ай бұрын
Thanks Ben for the amazing tutorials as usual, I hope you have more and more cool shaders and effects to teach us!
@re5128
@re5128 11 ай бұрын
Great! Ben is "the man" when it comes to tutorialsl. since years top notch.
@andyetnotwant
@andyetnotwant 9 ай бұрын
the chromatic aberration stuff in unity was really cool and i wanted to get that working in unreal too. i don't really know why screen position or scene color in unity is a float4 but after masking out the r,g of my normals in unreal i got it to work. so is doing it this way just kind of manually rebuilding how the refraction output is actually working? also haven't figured out how to blur in unreal like you are in unity yet.
@PRodi_
@PRodi_ 10 ай бұрын
Great tutorial! I'm doing all of this in URP, but is there a way to achieve the same functionality as the 'HD Scene Color Node' in URP?
@BenCloward
@BenCloward 10 ай бұрын
You can use the Scene Color Node instead. It doesn't have the LOD control, but otherwise it's the same.
@PRodi_
@PRodi_ 10 ай бұрын
​@@BenCloward Thank you, your solution is working nicely! P.S. I actually found that the main issue was forgetting to turn on Opaque Texture in URP :)
@Oscar-tw3uq
@Oscar-tw3uq 11 ай бұрын
thanks for this amazing tutorials
@jashdamania8392
@jashdamania8392 Күн бұрын
the water shader only works when lookin in one direction when looking in an opposite direction it breaks... it looks as if the water is divided into two parts on is the transparent part and the other just shows an ochre color due to the scene color (im doing a beach scene... so the scene color just samples the sand texture) any fix for this ?
@BenCloward
@BenCloward 14 сағат бұрын
Unity or Unreal? And are you talking about being under the water and looking up at the underside of the water plane? Sorry I'm not understanding your description of the problem very well.
@gorantrpkov446
@gorantrpkov446 10 ай бұрын
Hey Ben. Thank you for the great tutorial! I want to ask something a bit unrelated to this specific tutorial. If I was to get a bit more in-depth about writing shaders, HLSL in particular, I see that there are quite a few books on your resources page as recommendations. Some of these are written quite a while ago, are there more up to date resources you can recommend, considering that there are new features coming to Unity and Unreal all the time, or you'd say that the way shaders are written is quite universal and all these books are as much relevant today as they were a decade or two ago? Thanks!
@BenCloward
@BenCloward 10 ай бұрын
HLSL itself doesn't change very quickly. There are really only major updates to it when a new version of DirectX is released (which only happens every 5 years or so) and even then the changes and additions to it are minor. And the core techniques, concepts, and math that people need to understand to use it - how lighting calculations work, etc - those don't change at all. So even if you're looking at a book that is more than 10 years old, chances are almost all of what it teaches is still very relevant. The list of books on my site are the books that I learned from over the years and I'm still using that understanding now. Having said all of that, there are two recently published books I would recommend: Essential Math for Game Devs - amzn.to/3vUDGRc (This has great explanations of essential math concepts) The Unity Shaders Bible - amzn.to/3So7AEY (This is more Unity focused but does teach HLSL coding)
@gorantrpkov446
@gorantrpkov446 10 ай бұрын
@@BenCloward Thank you so much! That totally makes sense and thank you for replying so quickly!
@deianSM
@deianSM 10 ай бұрын
Hey Ben! Thank you very much for all this videos as usual! I was wondering if you think it will be possibile to achive some kind of SSAO or HBAO using the full screen shader graph pass in unity? Would you eventually consider making a specific video on Ambient Occlusion? Thank you again and keep up the good work!
@BenCloward
@BenCloward 10 ай бұрын
It can be done, yes, but the graph could get pretty huge. The problem is that techniques such as SSAO require loops and graph tools like Shader Graph don't support looping so you just have to copy and paste nodes over and over. It's hard to show something like that in a video tutorial because of how complex it gets. Doesn't mean I won't look into it and try though.
@deianSM
@deianSM 10 ай бұрын
@@BenCloward Would it be possibile to implement those loops and perhaps the more complex parts of such a shader using custom hlsl code nodes? It would be amazing to have a custom AO implementation in unity so that it can be tweaked in different ways (like dotted pattern for cartoonish stylized rendering and stuff like that). I would love to try and tackle on such a problem but the fact is that I'dont have a clue for what is the logic behind an AO implementation. If you could even point me towards some resources that offer some insight on this I would greatly appreciate it! Thanks again!
@thetego
@thetego 11 ай бұрын
Do you have any plan about showing surface ripples with vertex displacement too instead of normal maps and maybe domain warping for wave push pull effect?
@suraj.1889
@suraj.1889 10 ай бұрын
You are such a great teacher.
@diego6361
@diego6361 11 ай бұрын
Hey ben this is amazing, any plan to make some wind based Vertex Shader exercices, i have seen trees like in War Thunder that have some really nice wind effect to the branches and trunk
@BenCloward
@BenCloward 11 ай бұрын
Thank you for the suggestion! I'll look into that.
@juanmilanese
@juanmilanese 11 ай бұрын
great video. I have a question about the fresnel node. In the docs examples they pass the normal map into a transform vector node (from tangent space to world space) before sending into the "normal" slot of the fresnel node. You just sent the normal directly (albeit toned down) and honestly... it looks good to me is there any technical reasoning behind going one way or the other?
@BenCloward
@BenCloward 11 ай бұрын
It was a mistake - but I got lucky. In the case of Unreal, normals on an up-facing plane in tangent space very closely match world space normals. As long as the up-facing plane isn't rotated, the transform isn't needed! But it would be better to use it, I think.
@Bulborb1
@Bulborb1 11 ай бұрын
Thanks Ben!
@davidcsakvari762
@davidcsakvari762 11 ай бұрын
Nice tutorial, but isn't the IOR of water 1.33? Why are you putting 0.75 there now, it looks better?
@BenCloward
@BenCloward 11 ай бұрын
Great question. This input port isn't asking for the IOR of water, but rather the IOR of air divided by the IOR of water. You have to divide the IOR of the source medium by the the IOR of the destination medium to get the correct refraction. So air's IOR is 1.0003 and water's IOR is 1.333 - so the air IOR divided by the water IOR gives us 0.75..
@davidcsakvari762
@davidcsakvari762 11 ай бұрын
@@BenCloward Interesting, maybe you are right but it is strange to me that in all the unreal documentation this is not mentioned and in the examples they give ior values like 1.52 for glass or 1.33 for water.
@davidcsakvari762
@davidcsakvari762 11 ай бұрын
They even use fresnel like you did in your old videos
@JackMartison
@JackMartison 11 ай бұрын
How do you rate built-in water solution in Unity? Is it worth to use it in production as object that doesn't involve any gameplay elements, or cheaper shader from scratch would be more efficient?
@BenCloward
@BenCloward 11 ай бұрын
The built-in water shader is really good. If it's for a background element, you can probably make something cheaper yourself that gets the job done but costs less performance. The advantage of using the built-in solution is that it's already done and you can use it out of the box. Doing it yourself is more work, but you can also customize your own solution to reduce cost and get exactly what you need.
@oostenmusic
@oostenmusic 8 ай бұрын
FOR ANYONE WITH OUTLINES AROUND THEIR REFRACTED OBJECTS - Turn "translucency pass" on your material output to "before DOF". I spent many hours banging my head against a wall before realizing that the fix came from a simple switch
@itay7
@itay7 11 ай бұрын
Is this type of shader math too expansive in Unity compared to Unreal Engine? Asking because it looked kinda laggy when you started using transparency on the Unity shader graph
@BenCloward
@BenCloward 11 ай бұрын
OBS was struggling with recording my 4k screen at 60fps. It ran fine for me, but the recording I ended up with was really choppy. I've since made some adjustments to my recording settings. Hopefully it will be improved in the next video!
@ledpill
@ledpill 10 ай бұрын
If i put opacity to zero like you did in the beginning my water is gone completely as yours but i don't have any caustics either.
@BenCloward
@BenCloward 10 ай бұрын
The caustics are created by a separate decal material.
@ledpill
@ledpill 10 ай бұрын
@@BenCloward will you make a tutorial on that too? :D
@BenCloward
@BenCloward 10 ай бұрын
@@ledpill I already did a couple of years ago, but I'll do it again in a few weeks just so people don't miss it.
@ledpill
@ledpill 10 ай бұрын
@@BenCloward cool, thank you!
Water Depth Shader - Advanced Materials - Episode 39
27:20
Ben Cloward
Рет қаралды 7 М.
Easy Interior Mapping in Unreal Engine [Unreal Engine Tutorial]
11:12
Poly Playground
Рет қаралды 65 М.
Sigma girl VS Sigma Error girl 2  #shorts #sigma
0:27
Jin and Hattie
Рет қаралды 124 МЛН
Vampire SUCKS Human Energy 🧛🏻‍♂️🪫 (ft. @StevenHe )
0:34
Alan Chikin Chow
Рет қаралды 138 МЛН
Build Your Own Particle System! - Advanced Materials - Episode 43
11:07
Introduction To Vertex Shaders - Advanced Materials - Episode 32
15:57
Using Physics to Improve your Shots in Unreal Engine 5
11:35
William Faucher
Рет қаралды 317 М.
Particle System Billboards - Advanced Materials - Episode 44
30:50
Ben Cloward
Рет қаралды 4,9 М.
Real-Time Snow Simulator in Blender
2:57
SHAIDER
Рет қаралды 1,1 М.
Unreal Engine Materials in 6 Levels of Complexity
44:12
pwnisher
Рет қаралды 321 М.
Introducing EasyMapper for Unreal Engine 5
28:47
William Faucher
Рет қаралды 256 М.
First Steps Walkthrough (Inventory Framework Plugin)
23:53
Varian Daemon
Рет қаралды 67
Vertex Animated Water - Advanced Materials - Episode 36
31:02
Ben Cloward
Рет қаралды 12 М.
Sigma girl VS Sigma Error girl 2  #shorts #sigma
0:27
Jin and Hattie
Рет қаралды 124 МЛН