How to make refractive glasses in Iray?
Oso3D
Posts: 15,085
in The Commons
So there's a weird effect in Iray where thin objects with refraction absorb most light, creating a shadow.
Anyone know if there are settings that will look more like, well, eyeglass glass?

Comments
I'd have to see a specific example, but it sounds to me as though you're describing a real effect that actual lenses often exhibit. Like this:
Is that what you're talking about?
That's a natural effect of refraction, assuming a converging lens (as opposed to a diverging lens). The light entering the lens is focused onto a smaller area behind it, making it brighter. Since the amount of light does not change, there will be a dimmer band around the brighter area, since less light is shining there. The effect is more noticeable if the surface behind the lens is near the focal point, where the light is focused, before it starts to spread out again. The effect will also be more noticeable with highly directional light.
Maybe try tinting the Glossy Color a very very subtle blue (almost white).
Here I used the Iray Uber "Glass Solid Clear" shader and added a subtle blue tint to the Glossy Color slot in the surfaces tab.
You could try the Diamond Iray Shader as well. Here's the Diamond shader on the glass.
Aaah. I finally pinned down the problem. I think the shadow issue I mentioned comes from disconnected surfaces; the glasses I was using had a front and back, but they weren't connected along the side.
Popped it into Carrara and bridged it easily, and now looks great. Whew.
Thanks for posting about the way you fixed the problem.
So for glass in iRay to work properly, it needs to be a closed hull model... Basically a separate part and a "watertight" mesh (None of that "no modeling the hidden parts)... This is good to know.
I THOUGHT two planes worked, but ... maybe not. I make no promises this is broadly true, but it’s data. :)
It makes sense, though, considering that cutout on a shape shuts off volume effects.
With iRay, the same thing happens with water. Not only the water has to be one object, but the container as well. Now, I believe the water can be a little larger than the container and it will still render correctly. For example, if you have a glass and water in it, I think it's ok for the water to expand into the glass a little and it will look fine though I'll have to double check this. I do know it's true for swimming pool where you can't see the outside of the container (ie. the pool) so expanding the water beyond the limits of the pool is the proper way of doing that. If you have a glass material only, then yeah, it has to be a single object. I've had to fix several old items myself.
Hi,
sorry, but water (refractive) at all doesn't work correctly, same for any other refractive (and transmissive) medium.
This I demonstrated in two threads in the DAZ forum; one example --> https://www.daz3d.com/forums/discussion/69588/iray-refraction-bugs-pt-2#latest (feeling like an eternaty ago).
It is also responsible for "dark eyes" under certain lighting conditions.
And there is no way to get this bug solved.
Despite to the refraction bug I let my CPU render 1.5 days (due to the Caustic Sampler and its big fireflies).
So is this what you thought about?
I did it with the Trilogy Eyeware product and own shaders.
Correct. It's recommended that the liquid expand so it overlaps into the glass. See the Nvidia docs for a full explanation.
http://raytracing-docs.nvidia.com/iray/manual/index.html#physically_plausible_scene_setup#15001
Yes, they do.
But you can try by yourself; even a simple plane in "empty space" with the water/glass shader creates exactly the same outcome.
More important is that the glass object is a volumetric object. So the refraction has a start and a stop surface. As it is for the Trilogy Eyeware.
Being one that dedicated A LOT of time testing refracting surfaces like water and glass, attempting to get those caustics and rays to show properly simulated in Iray , I have to concur with AndyS. There is DEFINITELY an issue with how Iray calculates and displays shadows and caustics through refractive volumes or planes under certain illumination angles and refraction indexes and as far as I researched and tested myself, there is no workaround to fix that. The only way I managed to alleviate the issues is to avoid those critical light angles and use refraction indexes that are slightly above 1, like something between 1.05 to 1.15, regardles of what material you may want to render. Lowering the shadow density in the render settings can also help in certain scenarios. But everything is highly dependent of scene and illumination context, there is no recipe that fits all conditions. Many issues may also be caused by reversed surface normals in the geometry.
That's an excellent render!
Hi j cade,
no.
[OT]
As I demonstrated in the referenced thread, already below a very steep angle the light stops to be visible within the refractive medium. And that's completely contradicting real physics.
And the wrong (shifted and wrong direction) continuation of the rays is the second indicator for this bug. Please have a look on the demonstration renders and pictures.
[/OT]
This is the reason for the "dark eyes" depending on the lighting situation, too.
Except I get the *same error rendering in blender.*
Either blender and iray somehow both have bugs that create the same problem, or it's not a bug but a technical limitation of the math they both use
Again I'm not saying what happens is correct just that it's not an "iray bug"
I just ran into this problem. The glasses I'm using only have a single surface for the lenses and I want them to have a high magnification. I'm using a refraction index of 1.9 to get the higher magnification but the shadow gets really dark behind the lenses. I tried creating a geometry shell and using it since it has 2 planes for the lenses but I guess it doesn't work as a closed object. I guess I'll keep experimenting until I get bored lol.
You need thickness and convex surfaces, or at least different curvatures, to get magnification as well as an index of refraction (a glass shader will set all the right values). If you want to focus the light passing through, you need to put the caustic sampler on. You can use a sphere primitive and squash it flat in one axis to get a basic circular magnifying glass, or use a D-Former to get a non-circular shape, but that might be tricky.
Thanks for the squashed sphere suggestion! It helped a lot. Luckily, the glasses I'm using have round frames.