Glass Bump Issue - How to fix?

Hi Tim!

I also got that feedback in a post in the 4.24 Preview Thread.

I just did that and connected the nodes to the Specular Input.
This is a little success story - lol;

However, I am still having issues controlling the IOR as I want to.
As it says in the documentation, the values are clamped from 0-1.

What if I want to change the IOR above 1?
I tried, but of course it doesn’t work because of the limitation of the clamping.
And as you can see in the video below, the Glass Refraction does not look correct.
The Distortion looking through the Teapot is just to intense.

I just uploaded this video to showcase that issue:

Sooo… what else do I have to do to control the Index of Refraction Value beyond 1?

1. Project File with Glass Material
Would it be possible that Epic could create one Simple Glass Material, that includes all the nodes and the correct setup to demonstrate how a Glass Material should be created?

I mean, that would help everyone so much more then just referring to the documentation.
A Project File including a simple geometry, that simple shows how the Glass Material should be setup.

2. Glass Bump Map / Normal Map
On top of it it would be nice to also add an example for the Bump Map (Normal Map).
Because once yo have a double geometry (inner and outer facing normals of polygons) I am curious how the bump map / normal map setup works.

3. Tinted Glass
And yes, this is always needed in production. How to setup and control a Tinted Glass Material.

4. Refraction
And what do you use the Refraction slot for if the IOR is controlled with the Specular node?

I guess we can clearly see that dealing with Refraction and Ray Tracing leaves a lot of open questions.
And Artists including myself struggle a lot to even setup a simple glass material.

One simple Demo Project File from Epic showcasing all these essential Parameters dealing with Refractive Glass and using Ray Tracing.
That would be like an early Christmas!

Thank you so much & happy pixeling!
cheers :slight_smile:

I have to say, i am really confused by this statement, because i was always under the impression, that specular is the amount of light, that gets reflected with (almost) the same angle, that it hits the surface, and refraction determines the angle, at which light/a ray travels trough a transparent medium. And that angle changes, if both have a different IOR (f.e air = 1.0, water = 1.33).
So you might check that again, because it´s true, that both reflection and refraction are calculated with IOR, but they have completely different effects, and the specular should not affect refraction aka light bending (that´s what we are currently after).
And i wonder, why should we even bother with a specular value, if we using the metallic workflow, where only metallic ( for zero = non-metallic mats like plastic, and 1 = metallic like copper and iron etc) and roughness matter, as far as i know, and specular is left untouched.

https://upload.wikimedia.org/wikipedia/commons/b/bd/Lambert2.gif

Source: Diffuse reflection - Wikipedia

https://physicsabout.com/wp-content/uploads/2018/06/reflection-and-refraction-of-light-min.png

However, after that hint about specular and IOR, i found this in one of the Blender Forums:

https://b3d.interplanety.org/en/get-…ions-from-ior/

Also, this here might be interesting for someone:

http://guerillarender.com/forum/viewtopic.php?id=767

http://i.imgur.com/7EgLI4Q.jpg

http://i.imgur.com/rR05wJE.jpg

http://i.imgur.com/WzA25GG.jpg

And this site too: https://refractiveindex.info/

Especially it´s Reflectance calculator ^.^

@BernhardRieder : To clear up some confusion, IOR values can be over 1, but the inputs in those materials usually just accept values from 0 to 1, representing 0% to 100%. So usually we have to calculate from the IOR or whatever else you have in mind and translate this to a zero to 100% value or gradient. That calculation is in our case usually done by the Fresnel node, which already outputs a greyscale value/gradient between black and white, zero and 100% or 0 and 1. :slight_smile:

Edit: something really makes no sense here, raster and raytracer react differently to IOR-Refraction and specular values, check the rasterized material preview and whats happening in the RTX scene in the background. Did someone at Epic got confused abouth refraction and reflection and hooked something to the wrong input in the Raytracer? :confused:

And i still miss the always mentioned Absorption for RTX :frowning: How can we access absorption?

Hey Bernard,

Just to test the IOR and what IOR level the specular needs to use, I would suggest putting a non retraced material with the suggested refraction (above 1) right next to the ray traced one with the same geometry behind, so as to compare the 2 closely enough to make visual determinations on the values needed for specularity.

You can do all the math you want btw, add/subtract, divide.
I would start testing with the math offered in the post above.

Additionally, it seems wierd that high negative value would affect a clamped variable. But like I illustrated it is possible.
The clamp only stops values above or below 0 from showing by converting them to an integer.
Visually, the mask can still be changing with parts still within the visible spectrum of 0 to 1…

as Suthriel mentioned:
at this point it seems to be a mess and a major bug.
I already sent a Bug Submission Form to Epic.

The Dev Team needs to look under the hood of their code and double-check what’s going on here.

At the end it shouldn’t be such a problem to create one simple Glass Material that works with Ray Tracing.
I am positive that Epic will look into this major bug and resolve this issue when releasing 4.24.

It’s really needed. I can’t use Unreal for Production when Glass is not working with Ray Tracing. It’s a major hit.

Thank you all so much for your contribution, tests, hints, suggestions and efforts.
I really do appreciate it.

Thank you Epic Team for making Unreal really epic - love the tool and I am a great fan from Unreal.
I am pretty sure your Master Developers can fix this problem.

Thank you all & happy pixeling,
Bernhard :slight_smile:

And while Epic is checking, can they also please make sure, that at an IOR of 1.0, no light bending happens? Like nothing at all, as IOR 1 is air and a fresnel would then calculate from air (usually the already given start value) to air (which we usually replace with our wanted material like water and it´s own IOR).
The basic fresnel function already has something installed to boost the reflection, there is the **BaseReflectFrctionIn **Input for that:

https://docs.unrealengine.com/en-US/…nel/index.html

https://docs.unrealengine.com/Images/Engine/Rendering/Materials/HowTo/Fresnel/FN_Fresnel_Node.jpg

However, i wonder about that shown value of 5 as an IOR, on their doc, from which material should that be? is there a Fresnel function that uses regular IOR values?

Edit: Or is this the other way around, that BaseReflect **BaseReflectFrctionIn **is actually our IOR input ant that Exponent is just a booster for more reflectivity? The description soudns that way, that is disabled at an input value of 1, which would be an air to air calculation.

And for the normals and fresnel:

https://docs.unrealengine.com/Images/Engine/Rendering/Materials/HowTo/Fresnel/FN_Change_In_Graph.jpg

EPIC Dev Team:
You rock, I love Unreal and it’s the best tool I’ve ever had.

Please keep rocking and thank you so much for looking into the Glass Material Problem.
I really do appreciate that!

cheers! :slight_smile:

…? What happened?

Last I checked, learping any alpha from 1 to 1 returns 1.
If your IOR is set correctly, it would completely ignore whatver the fresnel does and place a value of 1 into refraction for you.
So, try using a scalar of 1 into refraction directly. I don’t see any changes myself with either setup. What are you seeing? If you want them to look into it, give them some screenshots showing its not working as expected…

That lerping afterwards is the thing, that bothers me, when talking about Fresnel, IOR and refraction, because it should not be necessary. I hoped for an Fresnel function, that can be directly feeded with the wanted IOR value and calculate the correct refraction for the refraction node. The solution in the manual and this used fresnel seems to be an approximation.

I don’t have enough knowledge to venture a guess on that, however, I can tell you from experience that the Fresnel node comes in handy when dealing with opacities as well. Essentially, if they can power 2 things with 1 node, for one, you get the immediate performance benefit, and secondarily you also “simplify” or streamline the process while achieving the same end result - that’s if the math makes sense, obviously.

That´s the thing, you would not lose with a different fresnel calculation :wink:

A fresnel can power two things, or, in my opinion, already should power two things at the same time: Reflection, aka, how much light bounces of at which angle, and for transparent materials, transmittance, or how much light goes straight into the material… and at which angle it travels through would also be determined by the IOR. They are all linked together. Don´t you wonder, what happens with the rest of the light? That amount of light, that doesn´t get reflected? Fresnel gives you the answer for both cases. It not only tells you, how much light gets reflected at a certain angle, at the same time, it tells you, how much light gets NOT reflected, and therefore goes into the glass :slight_smile: Absorption, the somehow missing node, would then tell us, how much light leaves the glass, or with which intensity and color.

To break it down: If at a certain angle from 100% incoming light only 4% gets reflected, then you know, that 96% of the light go somewhere else ^.^ They go into the glass, and hopefully leave it somewhere at the other side. If you have one value, you automatically have the other too and can feed it into the other node.

http://engineering.electrical-equipment.org/wp-content/uploads/2014/06/Improving-Light-Absorption-in-Semiconductors-through-Optical-Nano-activity.jpg

(and in some cases, things like total inner reflection happens)

I suppose something like this would technically make the lense glare effects possible with ray-tracing based on the bounce from the surface… it’s quite an interesting concept.

Is it the remainder of light (minus reflection and refraction) is getting absorbed? or is it traveling so far / much and then dissipates / fades? Water is said to scatter light, supposedly implying that is why it doesn’t reach certain depths, even in rivers and lakes at various times (not night). So perhaps using a fresnel doesn’t account for the amount light fades or in a computer’s terms, ‘gets deleted across a gradient’, over distance and in mathematical relationship to objects of different material / texture. How certain are the calculations of raytracing if light is bouncing with a degrading intensity? That may be part of the problem with trying to simulate it in glass with a simple blueprint setup.

Light in water is absorbed, and redistributed based on normal incidence.
Should you want to get some pre-made math on this and more, CPU gems articles on Caustics are perfect as they deal exactly with the math of light going through water (and how to cheat at it).

A fresnel node keeps track of the camera incidence to the plane of the object.
Ergo, the fresnel node can, on it’s own, act as the base for that calculation if the Ray was camera dependent. (That’s the opposite of tay tracing).

The engine should already be performing all the ray math on it’s own. How accurate that is, probably debatable.

The fresnel node only purpose should be to help or re-define what you see at the angle you are compared to the normal of the object you are seeing - and it does do just that for the most part.

So fresnel is crucial to calculations that involve IOR, especially when a camera is dynamic? Well, for water, which is often in constant motion (e.g., is somewhat simulating a dynamic camera), wouldn’t a fresnel work for calculating changing IOR based on various other factors (such as GI, AO, and material specularity / WPO / metallicity)? I’m probably abstracting too much.

Is there any update or solution for this problem from the Epic Dev Team?

Thank you! :rolleyes:

Is the refraction fixed now in 4.25?
Does anybody know?