PDA

View Full Version : Black parts on glass when using dielectric material


schyzomaniac
09-14-2007, 09:48 AM
Hi,
I tried to render a simple glass with a liquid inside. I gave both elements a dielectric material (mental ray node). The only thing I changed was the color and IOR for the liquid material.

Now when I render my glass it's strangly dark on the top and at the bottom. Is there a way to get rid of it and achieve a more realistic result? Please see the attached image. I checked all my normals and I think the topology should also be fine.

cheers,
daniel

grantmoore3d
09-14-2007, 01:44 PM
I think you need to increase the number of Reflections / Refractions / Max Trace Depth in your mental ray rendering. These settings define how many "surfaces" the light can pass through before it just gives up and makes it black. So, they should be at least 6, though you'll probably have to make them higher until you get the look that you want.

schyzomaniac
09-14-2007, 01:55 PM
I don't think that that's the problem. my ref/refrac/trace settings are 8/8/16 right now, but I also tested it with 30/30/60 and it didn't change. I have no idea what it could be.


cheers,
daniel

grantmoore3d
09-14-2007, 02:03 PM
Okay, the only other reason I can think of is that it is refracting something that is black... eg: your camera's background colour.

I'm assuming you have this glass against just an L-shaped plane for the background, but everything outside of the camera view is probably black. If you're just using the perspective, go to your outliner and click on "persp", then scroll down to environment, and make sure it's white.

If that's not it, then I have no clue.

HellstormDe
09-14-2007, 07:21 PM
Also check the surfaces normals. When they point into to wrong direction you also get black parts.

schyzomaniac
09-17-2007, 06:06 AM
The glass is inside a sphere with a standard white lambert material. Even if I crank up Incandescence to 1, I still get the black parts. The normals of the sphere are pointing inwards. I also doublechecked the normals of my glass and my liquid and they are pointing to the right directions. Any more ideas? :shrug:



cheers,
daniel

phix314
09-18-2007, 11:27 AM
What's your IOR? That's the only thing I can think of... you've got the normals hammered, it's in a white sphere, got me.

schyzomaniac
09-18-2007, 11:40 AM
Yeah, I also don't know what it is and running out of ideas. I checked my IORs a million times (like anything else in the scene). For the water I use 1.33, for the glass I tried 1.4, 1.5 and 1.6, all giving my similar results when it comes to the black parts.
Even when I just render the glass without the water I get those black parts. I rebuilt the scene several times now, allways with the same unsatisfying results. :sad:


cheers,
daniel

sixbysixx
09-18-2007, 11:59 AM
Did you try different glass materials? (l_glass, mia)

I had some similar problems before and couldn't solve them.

Maybe you can upload the scene, so people can have a look at it.
I'm also very curious as to what causes this behaviour...

schyzomaniac
09-18-2007, 01:26 PM
Sure. When I can try to upload the scene tomorrow. I hope somebody is able to figure out what I'm doing wrong.

cheers,
daniel

schyzomaniac
09-24-2007, 03:28 AM
Ok,
here's the scene file for anybody interested in figuring out the problem. I tried all sorts of setting but was never able to achieve a convincing glass/water look without the black parts and that strange horizontal line in the middle of the water.

cheers,
daniel

Kako
09-24-2007, 02:48 PM
There were some problems with the geometry.
First, there was a little intersection between the water and the glass. That was what was causing the bright stripe. I rescaled the vertices of the bottom half of the water and it was gone.
Then, your normals looked fine, but they weren't, actually. The selected loops showing in the following image were soft, so the normals were interpolated, causing those black parts on the top part of the glass.

http://img.photobucket.com/albums/v179/KakoCG/dieletric_geometryProblem_hardEdges.jpg

After the geometry corrections:

http://img.photobucket.com/albums/v179/KakoCG/dieletric_geometryProblem.jpg

I also raised de reflections and refractions limits. It makes a little difference, but it's not that much important in your scene.

http://rapidshare.com/files/57920069/glass_shader_ok.mb.html

Kako.

Kako
09-24-2007, 03:00 PM
Forgot to advise you that maybe you should use another approach when using more than one dielectric media. It's better if you don't use overlapping geometry. The mia_material guide has a nice explanation about it. ;)

Kako.

schyzomaniac
09-25-2007, 03:58 AM
Kako,
thank you for analyzing my scene and fixing the issues! :thumbsup:
Also thanks for pointing to the mia_material documentation. It explains really well why I shouldn't model the glass and the liquid in the way I did. I will use this approach the next time.

thanks again - and everybody else trying to help me out in this thread,
daniel

CGTalk Moderation
09-25-2007, 03:58 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.