Page 1 of 1
Glass with multiple materials assigned
Posted: Sun Sep 20, 2020 8:35 am
by CodeHD
I am currently working on lens systems. One thing I wanted to do is assign slightly different glass materials to different faces - same volume/IOR but different reflection color - to test between which faces certain flares are formed. If I have only one material, I don't know if it came from the front or back surface.
So I created a second material on a lens, made the same settings and assinged it to faces on one side. However, this changes the entire image formation.
In the attached blend file, the faces should be pre-selected. Just toggle between the SF14 material (the original one with correct image formation) and SF14_2.
I had the same problem before when I tried to make one-piece doublet lenses with a volume-volume transition material on the inside faces.
Is there a specific aspect to the glass/volumes implementation from which this is expected, or a bug?
Re: Glass with multiple materials assigned
Posted: Tue Sep 22, 2020 12:46 pm
by lighting_freak
Hello,
does this setup behave like you'd desired it?
BR
Re: Glass with multiple materials assigned
Posted: Wed Sep 23, 2020 5:53 pm
by CodeHD
Unfortunately no. I'm not sure if it is a connected issue, but I have noticed it as well.
Also, I don't get the image you posted in your blend file
The correct image rendered through the camera should look like this:
Re: Glass with multiple materials assigned
Posted: Fri Sep 25, 2020 7:59 pm
by FarbigeWelt
See next post..
Re: Glass with multiple materials assigned
Posted: Fri Sep 25, 2020 8:00 pm
by FarbigeWelt
CodeHD wrote: Wed Sep 23, 2020 5:53 pm
The correct image rendered through the camera should look like this:
Impressive! Your lens system draws a nice White Butterfly. How amazing!

- CodeHD_Lens System_subdivided and reflections colores_denoised
Scene
Scene has some changes. All Glasses has have different colors of reflection now.
Maybe overlapping of meshes should be avoided if one is looking for reflections.
CodeHD, you should improve the code of your add-on.

See how lens meshes are made fit for Modifier Subdivision.
Probably different effects you thought to be connected with 32 bit floating point precision are because of low polygon objects. I guess the circles of a cylinder should have at least 256 points or 32 points subdivided at least 3 times for the final renders of an Object Shaded Smooth (Cylinders and other objects with faces that should appear flat require Object Data Properties Normals Auto Smooth enabled like you did it for the lenses).
Edit: Quote added and attachment fixed, 25.09.2020 22:03
Re: Glass with multiple materials assigned
Posted: Sun Sep 27, 2020 8:14 am
by CodeHD
FarbigeWelt wrote: Fri Sep 25, 2020 8:00 pm
CodeHD, you should improve the code of your add-on.

See how lens meshes are made fit for Modifier Subdivision.
I don't want to go into detail here, as it would be off-topic. I might add some more in the addon-thread lat some later time, after I tried some things.
In short: You can have too much subdivision of a mesh, e.g. it can lead to issues with the normal vectors. The goal with the addon is to create an optimal mesh directly so that modifiers shouldn't be needed.
Re: Glass with multiple materials assigned
Posted: Thu Oct 08, 2020 5:39 pm
by lighting_freak
Hi CodeHD,
Does the solution of FarbigeWelt solve your issue? Does it meet your expectations?
BR
Re: Glass with multiple materials assigned
Posted: Fri Oct 09, 2020 9:28 pm
by CodeHD
I didn't follow this up a lot until just now, and I can say a few things:
1) The original issue with only a different material, but both having the same volume assigned is suddenly gone in new daily builds, and it is also not present in v2.4. Not sure what of course but must have been in some intermediate daily build.
2) However, I still get an issue when I create two materials with different volumes even though they have the exact same volume settings.
3) In these new observations, overlapping meshes don'tseem to be the issue as it happens also on the isolated singlet lens.
Re: Glass with multiple materials assigned
Posted: Sat Oct 10, 2020 9:11 am
by B.Y.O.B.
Re: Glass with multiple materials assigned
Posted: Sat Oct 10, 2020 12:12 pm
by CodeHD
ok yes that could be the explanation for issue 1) from my previous post.
I'm wondering ifwaht Dade siad there has something to do with issue 2)... Though it doesn't concern the camera here (there are no rays going directly from the camera to any of the lenses), and I also don't see any volume comparison in the code related to glass material?