Maya 2020 fundamentals - modelling the real world
Get halfway through a model and find it's an unworkable mess? Can't add edge loops where you need them? Can't subdivide a mesh properly? If any of this sounds familiar check this course out.
# 1 25-11-2012 , 01:01 AM
ckyuk's Avatar
Subscriber
Join Date: Apr 2003
Location: Great Britain
Posts: 1,336

Glass Refractions

This may be very basic as I don't know much about raytracing, its a fairly new topic for me. But I've started texturing/lighting a scene this evening and having problems getting good refraction's. The first image posted is the scene how it is at the moment with refraction's turned off on the glass Blinn shader. However in the second image you can see that when I turn refraction's on (currently set to 1.5) all I get is the light being bent from way over at the side and completely loose sight of the contents in the jars. I would of expected the ray to enter the glass and bend then enter the darker material inside and change before coming back out, but it appears to be completely bypassing the contents of both the pepper shaker and vinegar jar. Anyone know what I'm doing wrong?

Attached Thumbnails
# 2 25-11-2012 , 02:27 AM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
You'll need to increase the number of times mental ray calculates light passing through an object. In render settings, under raytracing, increase Reflections and Refractions and set the Max Trace Depth equal to the sum of these.

# 3 25-11-2012 , 03:03 AM
bullet1968's Avatar
Lifetime Member
Join Date: Feb 2010
Location: Australia
Posts: 4,255
I would seriously suggest you watch Miss_Nova's tutorial on making a glass. It is not as simple or easy as it looks to get the real looking thing.


Cheers bullet


bullet1968

"A Darkness at Sethanon", a book I aspire to model some of the charcters and scenes
# 4 25-11-2012 , 06:21 AM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988


Imagination is more important than knowledge.
# 5 25-11-2012 , 09:04 AM
Nilla's Avatar
Administrator
Join Date: Jun 2009
Location: Prague
Posts: 827
Change your raytrace settings like stwert said and also don't use blinn, with the best will in the world you're not going to get that material looking right. What you need to do with blinn is create fresnel reflections by connecting in two ramps with sampler info nodes to the reflectivity and transparency which is sort of overcomplicating it when you could just render with the mia_material_x in mental ray, fresnel's built in and it looks better.

Look up the fresnel effect, it basically states that reflection changes with the viewing angle so if you fly over the sea you'll be able to look through the water whereas if you stand at the beach light reflects off and it's no longer transparent.

https://www.youtube.com/watch?v=F-2cUWUe0fY

If you look in the manual you'll find some tips on how to set it up;

https://docs.autodesk.com/MENTALRAY/2...ntal-ray-help/
mental ray architectural shader library > quick guide to some common materials

I think your lighting looks quite nice but I'd change all my materials to this one instead, there's a preset for thick glass which would work in your scene. Also check out master zap's blog https://mentalraytips.blogspot.cz/

# 6 25-11-2012 , 12:57 PM
ckyuk's Avatar
Subscriber
Join Date: Apr 2003
Location: Great Britain
Posts: 1,336
Had another play but still getting similar problems the glass material is now the mia_material_x Thick glass preset with the exception of the black on on the right that is the dielectric material. As you can see neither are giving me good results. I have my refractive and reflective index's set VERY high to make sure light can get all the way through and my max trace depth set at the sum of the two.

EDIT: Also forgot to say thanks for all the help people, really appreciate it. user added image


Last edited by ckyuk; 25-11-2012 at 07:02 PM.
# 7 25-11-2012 , 01:30 PM
Nilla's Avatar
Administrator
Join Date: Jun 2009
Location: Prague
Posts: 827
It's in your render settings you need to change it, not the material. If you look at your glass with liquid, the light needs to pass through 6 surfaces (outside glass, inside glass, liquid x2), so that would be the minimum amount of refractions you need. I just set it to 10, 10, 20 as in the screen to prevent problems, it will give you the same result as counting surfaces.

Attached Images
# 8 25-11-2012 , 01:39 PM
zestken's Avatar
Registered User
Join Date: Sep 2012
Posts: 31
Hi Ckyuk

I'm no expert but try this and let us know if it works:-

1> Give some thickness to the object if it doesn't already have one and make sure the normals are facing outwards.

2> Give the objects mia_material and from the attribute editor select preset>glassthick>replace

3> In your render settings, keep reflection & refraction at 5 and a max trace depth of 10.

4> Increase your ray depth limit for all of your lights under raytracing shadows to 5 as well.

Render and post the results.


Last edited by zestken; 25-11-2012 at 01:48 PM. Reason: Mispelled user name
# 9 25-11-2012 , 03:05 PM
ckyuk's Avatar
Subscriber
Join Date: Apr 2003
Location: Great Britain
Posts: 1,336
Your all going to have a good laugh now when I tell you what fixed it user added image We were all looking far to deep into it and missed out one very important aspect. I had visible in refraction's turned off on almost all the objects in the scene. Works much better now user added image


Last edited by ckyuk; 02-12-2012 at 11:02 PM.
# 10 25-11-2012 , 04:01 PM
zestken's Avatar
Registered User
Join Date: Sep 2012
Posts: 31
Wow, I couldn't guess that user added image.

# 11 26-11-2012 , 05:53 AM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
That would do it! Glad it worked out.

Also... Is there water in the salt shaker?


Imagination is more important than knowledge.
# 12 01-12-2012 , 11:15 AM
ckyuk's Avatar
Subscriber
Join Date: Apr 2003
Location: Great Britain
Posts: 1,336
Sorry I didn't reply for so long, had the week without access to the internet. No there is not supposed to be water in any of the shakers, can you point out exactly where and what you think is wrong?


Last edited by ckyuk; 02-12-2012 at 11:02 PM.
# 13 01-12-2012 , 04:34 PM
Gen's Avatar
Super Moderator
Join Date: Dec 2006
Location: South FL
Posts: 3,522
I think you may have some artifacting going on inside the pepper shaker with that blockiness happening. And the shadow depth might need increasing as the shadows aren't persisting through the glass.

Sidenote: The shader on the sugar dispenser is getting blown out, it does seem less like glass now and the rough super bright highlight makes it look really vague and almost like it doesn't fit in the scene. The coffee stains are a nice touch, but the darker rim on them is a bit harsh and uniformed I think.


- Genny
__________________
::|| My CG Blog ||::
::|| My Maya FAQ ||::
# 14 02-12-2012 , 11:06 PM
ckyuk's Avatar
Subscriber
Join Date: Apr 2003
Location: Great Britain
Posts: 1,336
Thanks GecT it was the shadow depth that was causing the issue with the shadows through the pepper shaker, seemed to of fixed that. Also stopped the sugar dispenser looking so blown out but want to add some depth to the material as the walls look far to thin. Going for a semi-transparent plastic on this opposed to the glass of the other objects.

Attached Thumbnails
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads