Passing on the knowledge you've collected and pioneered through out your years in the industry is extremely generous and I just wanted to express my gratitude!
@momosietube5 ай бұрын
I am just ecstatic! This is the best tutorial on glass shader!! Thanks, Ben!
@DavidWKimber Жыл бұрын
Excellent breakdown, always appreciated! Also, don't worry about showing 'crazy expensive' versions, because I work primarily with cinematic content so we can crank it up to 11 :)
@alexanderalikin1210 Жыл бұрын
Metallness (reflectivity) should be altered based on dot(viewNorm, pixelNorm). Most of the time, when you’re looking straight at the window, you mostly see through it with just subtle reflection, but when looking at a sharp angle you don’t see anything behind the glass, you see 100% reflection. Another thing that went through my mind is, how the brightness in front of / behind the glass affects the intensity of reflection. Like, when looking outside though the window at night, you mostly see your room, because there’s a lot of light in it. But if you turn it off, you mostly see the street regardless of how dark it is. Another example: when looking at the car from the street you see a lot of reflection (because it’s darker inside the car). When looking in the car through the window (daytime) you never see the cars interior reflection. Assuming there are pure glasses without any tint or reflective film In most scenarios you probably don’t need this effect, but in some cases it might make sense and add a lot to the final look.
@FireF1y644 Жыл бұрын
Strata materials already support rough refraction (background blurring) in UE 5.1. Would be cool to see a full Strata course once it's production ready (probably 5.2 or 5.3) Upd. No, not 5.2, probably 5.3-5.5. And its called Substrate now.
@da-mor Жыл бұрын
Oh wow 🥺, that's exactly what I was looking for! especially with the frost glass. I was using a totally wrong approach to it. Thank you!
@srod8509 Жыл бұрын
PERFECT TIMING!!!!!
@ragingraijin3 ай бұрын
Awesome tutorial sir, Unreal engine user here, is there a way I can make it so objects farther behind the glass are more blurred than the ones very close to it?
@BenCloward3 ай бұрын
Yes, you can drive the amount of blur based on the distance between the glass surface and the objects behind it. That's a cool idea!
@ragingraijin3 ай бұрын
@@BenCloward could I get pointers on how to do this sir?
@isawedthedemons Жыл бұрын
someone needs to start a petition to get epic to add mipmaps for the scene color texture.
@MustafaBerkeGureltol Жыл бұрын
I feel like using a blurry cubemap with parallax occlusion mapping for static scenes in Unreal would yield more performant results.
@BenCloward Жыл бұрын
That may be true, you’re right. It wouldn’t look as nice or be accurate at all, but it might be cheaper. So many of these things depend on what your priority is.
@hotsauce7124 Жыл бұрын
Thank you so Much!
@arturoorgaz Жыл бұрын
Great explanation, thank you! What if I want to make a glass that has a more physically plausible specular amount? In Unreal, when you make something less opaque, you also lose the specular component. So, if I have an opacity of 0.1, the total amount of specular I get is multiplied by that value. This shouldn't happen, glass doesn't become less reflective the more transparent it is. Basically, I'd like my glass to reflect say 5% from the front and 100% at grazing angle. What would be some good ways around this issue? Thank you, I love your channel! PS: Would it be possible to read the nearest env probes and use those for "rough refractions" instead of screenspace info?
@BenCloward Жыл бұрын
You can use a Fresnel node for the opacity so that the glass is more opaque at glancing angles. That should be pretty easy. Another thing you could do is create the reflections yourself in the material by sampling a cube map with the reflection vector - and then use the brightness of that reflection to control the opacity as well. The only issue with that is that your reflections wouldn't always match the environment. You'd have to manage that manually.
@BenCloward Жыл бұрын
Regarding using env probes for refraction, I don't recommend that as the results would be VERY inaccurate. You can usually get away with using probes for reflections because it's hard to judge the accuracy of reflections - but with refractions you're looking straight through the object to things on the other side and it's very easy to tell when they don't line up right.
@arturoorgaz Жыл бұрын
@@BenCloward Thank you for your replies, Ben! 🙂
@nishblr6522 Жыл бұрын
It would be really helpful if you do the same tutorial for Unity - URP. Because URP is more common and creating real looking glass in URP is much more harder than in HDRP.
@BenCloward Жыл бұрын
Yes, that's a good point. Thanks for the suggestion!
@nishblr6522 Жыл бұрын
@@BenCloward 👍👍👍
@tombruckner255611 ай бұрын
Do you happen to know how to do it?
@JONnn-c8v Жыл бұрын
nice and helpful video!! I have a question about that, at the time 10:05(unity) and 24:20(unreal engine), it has the same problem that we can’t see a glass object thought another glass,how to fix it
@BenCloward Жыл бұрын
We're sampling a texture to find out what the scene looks like behind the transparent object. That texture is rendered with only the opaque objects in the scene and it's done before the transparent objects have been rendered. That's why a transparent object doesn't show up - because it doesn't yet exist in the scene when the texture is rendered. If you want to see transparent objects through other transparent objects, you'll need to not use this technique, but make your object transparent by setting the alpha or opacity value less than one.
@TheJakeblake Жыл бұрын
Thanks mate
@tigeryang-vg1tt Жыл бұрын
Hi Ben! Your videos are so great! I learned so much from you,But why is my Voronoi Node style different from yours?
@BenCloward Жыл бұрын
How is it different?
@tigeryang-vg1tt Жыл бұрын
@@BenCloward wow, thank you for your answer first!But I don't know how to describe it,different Unity versions of the noise algorithm problem? So, can I ask you, what's your versions of unity for car paint?
@BenCloward Жыл бұрын
@@tigeryang-vg1tt I'm using 2023.1
@tigeryang-vg1tt Жыл бұрын
@@BenCloward alpha version? ok! I'll try it by 2023.1! Thank u again!!!
@tigeryang-vg1tt Жыл бұрын
@@BenCloward Hi Ben, I've already verified that。There is no "hash type" option of my Voronoi node in my unity 2021.3, but not in unity 2023.1 alaph; Thank u again!!!
@tombruckner255611 ай бұрын
Is there any chance to create such a glass effect with URP, so it works on mobile devices?
@polygonflow Жыл бұрын
Nice video! How can I reach you? Would like to run an idea by you :)
@BenCloward Жыл бұрын
ben@bencloward.com I don't have a lot of extra time for this sort of thing, but you're welcome to reach out.
@JonathanSulivan666 Жыл бұрын
I'm using engine version 5.2 and I have refraction disabled by default and it says this: takes in a texture or value that simulates index of refraction of the surface and when I turn on the index of refraction and do everything according to the instructions, then for some reason the glass strongly reflects the mirror and reflects itself, it turns out a recursion. Ie in the window I see the window and transparency at the same time, this is not normal. What to do? Maybe this is because the glass I have is thick? And it is necessary to do one polygon?
@tryit2136 Жыл бұрын
hey how is the shader complexity?
@EdVizenor Жыл бұрын
QUESTION: Could you add this to a metahuman or a character so it can look like a glass or water person? Can shaders also be animated?
@BenCloward Жыл бұрын
Yes.
@jbttbjtjjtbbtj4865 Жыл бұрын
@BenCloward Hi, i also have a question : how to invert colors in transparent material so the white will be transparent and the black will show ?
@jbttbjtjjtbbtj4865 Жыл бұрын
@@BenCloward .
@jbttbjtjjtbbtj4865 Жыл бұрын
@@BenCloward Please help. I've been struggling with this for days now
@BenCloward Жыл бұрын
@@jbttbjtjjtbbtj4865 In the material, connect your texture or value to a One Minus node. This will invert the value so that what used to be white is black and what used to be black is white.
@PhantomZtryker Жыл бұрын
You can simulate the lens effect in ue as well but as far as I know you have to use actual raytracing.
@GreyManFaustus Жыл бұрын
On the note of "cheap version" - I'd love to get some input on achieving effects as cheaply as possible. Like, running on a shrivelled potato cheap.
@ianbrown4160 Жыл бұрын
Had problems with the UE blurry reflections and then discovered it was because I have the post process volume translucency set to ray tracing. Is it possible to disable that on a particular material?
@randomdsfhqe Жыл бұрын
I thought refraction in UE was the inverse of the refraction index. Your glass bends light the wrong way and looks more like a mirage. (There's a bit more wrong with UE's refraction (at least in this setup, I'd like to know how to do things correctly for glass), for example, leave out the Fresnel and you get all kinds of screen space problems. Also, for a plane it should not work as a magnifying glass, but rather give some offsets when looking at objects at a glance, which it does not do correctly.) What is going on with the vanishing object in the Unity project? The one that is not visible through the glass? Also, at first there is very low resolution roughness and reflection, but later on it looks better. Did anything change there?
@SimoneVenturasHQ Жыл бұрын
I am getting the same issues. Also, maybe it works fine in editor view, but once you bump in game it just looks awful lol (UE5.1)
@tranceemerson8325 Жыл бұрын
what if I want to see the backfaces through my model in the glass? what would I need to do?
@muhammetemirbulut6511 Жыл бұрын
very nice !!!
@TheFunDimension Жыл бұрын
How to add my textures maps on it? I have been trying to import my models from blender to UE, but I don’t know Jack squad about UE.
@antoniosuarez7881 Жыл бұрын
thanks, grate tutorial
@kvanck5576 Жыл бұрын
I have a issue, i wanted to make frozen glass, but also there is other glass behind the frozen glass. In your unreal engine example, when you look at the frozen glass, sphere glass dissapears. How can we show that sphere glass when we look through the frozen glass?
@BenCloward Жыл бұрын
What you're asking for isn't possible to do with this method. I don't think it's doable at all - at least not in real time. It might be possible to do with ray tracing, but it would be really expensive. My recommendation is to make the glass blurry enough that you can't make out details of what's behind it.
@kvanck5576 Жыл бұрын
Thank you.
@mindped Жыл бұрын
no fresnel?
@JD-bf2gv Жыл бұрын
Hi, setting the lightning mode to Surface TranslucencyVolume and Surface ForwardShading increases the number of operations on the material drasticly, do you know any way to be able to control this depending on the scalability / quality of material ?
@BenCloward Жыл бұрын
Looking at that instruction count is comparing apples to oranges. The reason for this is that opaque shaders are only rendering the material description to the g buffer, whereas transparent shaders are doing the material description as well as all of the lighting - because they're rendered in the forward pass that happens after the opaque objects are rendered. So the extra instructions you see for transparent objects are the lighting calculations. Lighting is also being done for the opaque objects - but the cost of it doesn't show up in the instruction count - so it's not really a fair comparison.
@BenCloward Жыл бұрын
However, if you want to create a VERY cheap transparent shader in UE, I recommend using one of the techniques in this video: kzbin.info/www/bejne/nWrRoax4q5uBf6s