Mihai wrote:
This whole problem at its base is that with polygons, you can't really model a polygon right on top of another.
But this should practically be decided in the renderer. We should have a setting that says: when the gap between two polys is this small, consider them to be one on top of the other, with no "air" between them.
As you say, this can be handled in the render engine. I think it would make more sense to have coplanar faces, and have the engine understand what two dielectic faces on top of each other means. Making the geometry would be easy using Booleans, without the need for offsetting. And you would not have to worry if you are inside the threshold, or what to do if you really want to make a small gap. Having coplanar faces seems more correct and intuitive to me, even if we have learned it is not a good thing in other engines.
After having given this a few days of thought I feel the safest solution to a physically correct solution would be to use closed meshes for the different dielectics, normal out naturally, and then to treat coplanar faces as the point where you exit m1 and enter m2, no need for extra faces or splitting the mesh with different IOR you have calculated.
I doubt Tonfarbens approach is correct, because the dielectic material faces seem two sided, and they will be seen by the renderer. And I think this is way too complicated to model and calculate. We want an intuitive solution right? But the rendered glass looks realistic…
Mihais approach where he cut away the glass could be close, but the light entering from the top (air, enter wine, exit wine into the unknown, exit glass, back to air) is where this approach may fail. You will have places where light exits from a back face without knowing what the next material is also a dielectic, and would probably assume it is air…
I made a small test to demonstrate test how Maxwell will react to coplanar faces. Not well now I am sorry to say. You can se triangles of the mesh where the water meets the pool (pool sides are also of water). This is clearly confusing Maxwell, so this is not the way NL is thinking of doing it now.

I then tested what a small gap (of air) between the two layers of water will do. As I expected the right side of the pool becomes reflective, and you can not see the water inside the pool at small angles (should have had a background to make it clearer). Gaps between dielectics mean trouble.

I can not find a solution to underwater pictures. The dielectic doest work if the camera is inside. I remember reading somewhere there would be a water material type(?). That will probably solve this issue.
As said before this is really something NextLimit could clear up, as it is very difficult to test what is actually correct. Victor announced last Friday the whole team went out for beers. I wonder if they are back yet. I can just picture a group of programmers having their tenth physically correct beers, staring into their glasses tying to figure out how this should be modelled, and how the world would look like looking out from inside the beer

.
Sheik