Glass with multiple materials assigned

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Post Reply
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Glass with multiple materials assigned

Post 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?
Attachments
forvideo.blend
(3.4 MiB) Downloaded 158 times
lighting_freak
Posts: 234
Joined: Thu Jan 18, 2018 6:02 pm

Re: Glass with multiple materials assigned

Post by lighting_freak »

Hello,

does this setup behave like you'd desired it?
forvideo.blend
(3.48 MiB) Downloaded 191 times
untitled.jpg
BR
OS - Windows 7 X64
CPU - Intel CORE i7
GPU1 - Variants of notebook card from nVidia
GPU2 - Variants of notebook onboard card from Intel
Lux - Latest possible relaease
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: Glass with multiple materials assigned

Post 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:
lensrender.png
User avatar
FarbigeWelt
Donor
Donor
Posts: 1046
Joined: Sun Jul 01, 2018 12:07 pm
Location: Switzerland
Contact:

Re: Glass with multiple materials assigned

Post by FarbigeWelt »

See next post..
Last edited by FarbigeWelt on Fri Sep 25, 2020 8:04 pm, edited 2 times in total.
Light and Word designing Creator - www.farbigewelt.ch - aka quantenkristall || #luxcorerender
MacBook Air with M1
User avatar
FarbigeWelt
Donor
Donor
Posts: 1046
Joined: Sun Jul 01, 2018 12:07 pm
Location: Switzerland
Contact:

Re: Glass with multiple materials assigned

Post 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
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. :arrow: 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).
forum_CodeHD_forvideo.blend
forum_CodeHD_forvideo
(3.94 MiB) Downloaded 161 times
Edit: Quote added and attachment fixed, 25.09.2020 22:03
Light and Word designing Creator - www.farbigewelt.ch - aka quantenkristall || #luxcorerender
MacBook Air with M1
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: Glass with multiple materials assigned

Post by CodeHD »

FarbigeWelt wrote: Fri Sep 25, 2020 8:00 pm CodeHD, you should improve the code of your add-on. :arrow: 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.
lighting_freak
Posts: 234
Joined: Thu Jan 18, 2018 6:02 pm

Re: Glass with multiple materials assigned

Post by lighting_freak »

Hi CodeHD,

Does the solution of FarbigeWelt solve your issue? Does it meet your expectations?

BR
OS - Windows 7 X64
CPU - Intel CORE i7
GPU1 - Variants of notebook card from nVidia
GPU2 - Variants of notebook onboard card from Intel
Lux - Latest possible relaease
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: Glass with multiple materials assigned

Post 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.
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Glass with multiple materials assigned

Post by B.Y.O.B. »

Probably had to do with this: viewtopic.php?f=4&t=2611&p=25569#p25569
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: Glass with multiple materials assigned

Post 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?
Post Reply