Page 1 of 3

Poly-selections for transparent geo

Posted: Thu Jul 06, 2017 2:24 pm
by T0M0
Regarding this post viewtopic.php?f=140&t=44564&start=60#p394862 (credits to Eric Nixon)

Something strange is going on.
- one geo
- two quadpolys selected for triangle group TOP, rest of polygons selected for triangle group BOTTOM SIDE
- two High Grade glass materials, both have same default parameters
- same result with Production (CPU) engine
- tested on Windows 7 x64 SP1, Maxwell 4.1.0.3

Shouldn't the top look uniform without any visual differences even it is the same material ?
It looks that TOP selection has different Nd or so...

Re: Poly-selections for transparent geo

Posted: Thu Jul 06, 2017 3:00 pm
by tom
Yes, it's odd. We're going to check it, thanks!

Re: Poly-selections for transparent geo

Posted: Thu Jul 06, 2017 4:58 pm
by Forum Moderator
Hi,

Thanks, Tomo, now I see what's the problem. This is happening since we introduced Nested Dielectrics in 3.2.

This is actually not broken but an undetermined situation.

Since we added nested dielectrics, we need to geometrically define the limits of the different dielectric materials in order to be able to calculate the index of refraction of the contact surface between the two.
When you define a material by triangles, you are only defining it at the surface, but under the surface, you don't know where each material exists or how the rays should behave. Should it act like dielectric 1 or 2?

Previously, we didn't have to bother about this; each ray, depending on where it was entering the material, refracted like that material and when it found an out face, it went into the air.
This is the price we have to pay for a powerful feature like nested dielectrics. We need to correctly define the geometry of dielectrics that are in contact.

I also asked the developers some time ago (when I first found this issue) if this could behave like before in the cases that nested dielectrics are not involved, but it seems that nested dielectrics are "always working" and it just changes how the calculations are done when the rays enter dielectrics. It's not something that can be activated or deactivated, as the rays do not "know" if they are going to find another dielectric when they enter the geometry.

I hope this makes sense. Maybe there's something else that can be done to address these cases, but this is a quite sensitive part of the code (as far as I know).

Best regards,
Fernando

Re: Poly-selections for transparent geo

Posted: Thu Jul 06, 2017 5:36 pm
by seghier
i remember something like that
if you duplicate the glass material and use it as backface material you will get other result

Re: Poly-selections for transparent geo

Posted: Thu Jul 06, 2017 5:41 pm
by Eric Nixon 20170610100005
The option to disable nested dielectric for the hundreds of cases I have would be most welcome. This situation affects almost every project, because theyre are so many situations where you want a few polys to behave/look differently, Its not a rare thing when you've been used to using it. I also dont know how to render many things without it.

NL policy has been from the start, that projects from older versions should work in newer versions. In this case a compromise would be that the users needs to deactivate a simple setting, to get older assets working, this would really help. There are no simple workarounds in many cases. UV mapping is a pain and wont work with most of my models.

There should have been a discussion about this when 3.2 was released a long time ago.

Re: Poly-selections for transparent geo

Posted: Thu Jul 06, 2017 6:12 pm
by luis.hijarrubia
I find kind of weird to define a dielectric object with a surface selection. You have rays coming inside that object, so it should be a complete object with defined boundaries. If it's not that way, we cannot now what material should be used inside the object, as extruding different faces to inside would give you different materials. It's an indetermination like dividing something by 0. So you can have some programs that crashes if you divide by 0, others give an error, other give you infinite. There is not better solution than other as is a not solvable problem. So you are usually recommended to not divide by 0, check that before hand. And in this case I would generally recommend not to use surface selections to determine materials on dielectrics, as it is going to be wrong not matter how you render it, and that model will have different behaviors on different render engines, and even in different versions as in this case.

Re: Poly-selections for transparent geo

Posted: Thu Jul 06, 2017 6:54 pm
by Forum Moderator
As a possibly feasible solution: if you can make a polygon selection, most probably you will also be able to detach that selection from the object and apply shell modifier (or something similar that gives thickness to that faces) and then use that with the second material and nested dielectrics priority.

I hope this helps.
Cheers!
Fernando

Re: Poly-selections for transparent geo

Posted: Thu Jul 06, 2017 9:24 pm
by tom
Fernando and Luis are totally right. On the other hand, you are right, too. But, having an option for disabling Nested Dielectrics would be a messy solution for something pretty obscure for artists and every newcomer. I also wonder, what's your purpose doing that in this particular scene?

Re: Poly-selections for transparent geo

Posted: Thu Jul 06, 2017 9:40 pm
by seghier
i do other test
the same example like T0M0 and i add backface material with the same paramter of the glass but the nd = 1
and it give nice result ; if you confirm that

Re: Poly-selections for transparent geo

Posted: Thu Jul 06, 2017 9:51 pm
by seghier
the test

scene attached

Re: Poly-selections for transparent geo

Posted: Thu Jul 06, 2017 10:51 pm
by tom
Yes, I confirm Nd=1.0 Backface Material gives a correct result as long as Trans < 255. Very nice, Seghier.

Re: Poly-selections for transparent geo

Posted: Fri Jul 07, 2017 1:28 am
by Eric Nixon 20170610100005
Please explain to me what Seghier has done? I dont understand.

I would like to post another example maybe his technique can work for this,
acrylic swatch.png
I think Fernandos suggestion could be a workaround, but its not a good solution for any shape with tight concave corners, i will give it a try tomorrow. For headlights where you only want the bumpmap on one side there may be another workaround using cubic mapping with no tiling and an offset, again an ugly solution.

Re: Poly-selections for transparent geo

Posted: Fri Jul 07, 2017 2:03 am
by Eric Nixon 20170610100005
Well I tried nd1 without understanding it and got a weird render (only sl13), the mapping appears on the lower face of the glass, I guess this relies on UV's, seems hard/impossible to control the maps position? And if you look from the other side I guess the mapping magically appears to shift sides.
tabletop.png
Theres a kind of persistent grey dust indicating that maxwell doesn't like the setup.

2nd test with inverted normals, removing the floor reveals weird lack of refraction.
tabletop2.png

Re: Poly-selections for transparent geo

Posted: Fri Jul 07, 2017 2:58 am
by Eric Nixon 20170610100005
Tried one last time with the simplest possible settings but renders still have bad refraction, here is a side by side comparison;
tabletop3.png
tabletop4.png
Now please look closely at the second image (which is just a cube of roughness 0 nd 1.45 Forcefresnel, no other settings at all) what are those horizontal curved grey bars seen on the side of the cube facing the camera?

Re: Poly-selections for transparent geo

Posted: Fri Jul 07, 2017 3:10 am
by seghier
Thanks Tom
-----
Eric
I attached a test scene in my previous post , check it
I am not sure about refraction but it looks good