Wed, Nov 13, 11:34 AM CST

Renderosity Forums / Carrara



Welcome to the Carrara Forum

Forum Coordinators: Kalypso

Carrara F.A.Q (Last Updated: 2024 Nov 05 6:06 am)

 

Visit the Carrara Gallery here.

Carrara Free Stuff here.

 
Visit the Renderosity MarketPlace - Your source for digital art content!
 

 



Subject: Glass shader


Darcal ( ) posted Mon, 25 May 2009 at 4:53 AM · edited Wed, 13 November 2024 at 11:15 AM

file_431475.jpg

I recently purchased Carrara 7 Pro and I'm very pleased with it. Yesterday I created my first two objects in Carrara, which are very basic as I'm new to 3D modelling. They are simply a coaster and an empty glass. I think the coaster looks realistic but the empty glass doesn't because of the clear glass shader. I used almost the highest settings for rendering and it took my laptop about 12 hours to render a 1280x800 image! It looks good in my opinion but the glass shader creates a much too distorted, hall-of-mirrors-like effect. I'd appreciate it if someone would kindly tell me which settings I need to adjust to get a more realistic effect. Thanks. :)


Hoofdcommissaris ( ) posted Mon, 25 May 2009 at 5:08 AM

 This sounds like the refraction going wild. Also, know that it is important to have something to reflect in the glass. The recent versions of Carrara 7 still have the old presents, so the more advanced options of the shader tree are missing. Look for the shading options like 'reflection' and 'index of refraction' and use options like fresnel effect.

Also, you can look for free shaders and tutorials for this. Glass is hard to get right. There are even expansion packs (shoestringshaders) that add factors that are not in the standard shader tree.


Darcal ( ) posted Mon, 25 May 2009 at 6:35 AM

Thanks for the good advice. By the way, I uploaded the image about 10 minutes after my post as it needed compressing a bit. Now you can also see exactly what I meant, but you obviously understood from my description anyway. I'll try altering the refraction and reflection of the clear glass preset first and maybe do a slightly lower quality render (as I don't fancy waiting 12 hours again), then post the result later. Thanks again. :)


bwtr ( ) posted Mon, 25 May 2009 at 7:29 AM

file_431483.jpg

Darcal It looks like common everyday glass distortion --as one should expect-- to me. Not a fault at all.

Brian

bwtr


Hoofdcommissaris ( ) posted Mon, 25 May 2009 at 7:35 AM

 The example from Darcal is probably mainly too much of a good thing. The refraction I guess. Try lower numbers or use 'index of refraction' and choose something like common glass.

Good luck!


bwtr ( ) posted Mon, 25 May 2009 at 7:42 AM

file_431484.jpg

Darcal Both of the shaders I used from the Carrara Browser have the correct glass refraction index of 1.0. I think the image, as again exampled in this attached image, are correct.. I stress--I think!

Brian

bwtr


MarkBremmer ( ) posted Mon, 25 May 2009 at 12:31 PM

file_431507.jpg

Carrara treats all reflective objects as "solid" like  a marble unless you engage the Fresnel effects. Fresnel is a real-world physical phenomenon where the more perpendicular an object is to the viewer, the less the properties of reflection and refraction have an effect on the object. However, the greater the angle is away from perpendicular, the more significant those effects become. 

Carrara has a good, (albiet somewhat slow) calculation scheme for real world Fresnel effects. It does take longer to render than the the "fake" fresnel of ShaderOps by DCG and Shoestring Shaders. Although Shoestring Shaders has a "real" Fresnel version as well, it was created before Carrara had the Fresnel effect  as part of the software and is redundant. 

Why use real Fresnel over fake Fresnel effects? The fake fresnel effects only present an approximation to the camera of what Fresnel would look like and not what is really happening optically. So, if you have multiple lights hitting the ojbect, the fake  fresnel solutions will make the other shadows from the glass object behave in a very weird fashion, rendering as a solid instead of a transparent object. 

Hope this helps. Click on the picture if you want to see the shader tree more clearly.

Mark






Darcal ( ) posted Mon, 25 May 2009 at 5:18 PM · edited Mon, 25 May 2009 at 5:23 PM

file_431526.jpg

Thanks for the replies. Mark, I hadn't noticed fresnel in my shader tree before, but I then realised how to display it thanks to your illustration. I set the fresnel to 26% (simply because that's what the picture shows) in both reflection and transparency. Then, rather than using the refraction of the clear glass preset (which I did try with with fresnel), I set it to 1% instead. This is the result. I think it looks considerably more realistic than my last effort. Do you think I should decrease the refraction more and/or increase the fresnel for even less distortion? Cheers.

PS: This render only took 7 minutes with lower settings and a smaller image. I've since learnt to leave the big render until I've got the shader settings right. :)


MarkBremmer ( ) posted Mon, 25 May 2009 at 6:52 PM

file_431534.jpg

Hi Darcal,

I personally use the presets because they are made from actual refraction values. However, to each his own taste. In the example above, I've mixed two different values (common and crown glass) for the refraction with a noise shader. It's a fast way to add variation without a speed penalty that is associated with a bump texture.

Be careful about over setting the render options. The highest settings do not ensure a better render but do guarantee a longer render time. (This is true for all 3D software by the way) Except for special circumstances, basic screen resolution renders like these should take no more than a couple of minutes depending on your system.

Mark






holyforest ( ) posted Mon, 25 May 2009 at 7:25 PM

file_431539.jpg

Hello Darkal, I only use my own glass presets from my "Heart of Glass  shader set available here at the MarketPlace

 
---------------------------------------
Holyforest,
Hundreds of shaders for Carrara


Darcal ( ) posted Mon, 25 May 2009 at 7:57 PM · edited Mon, 25 May 2009 at 7:59 PM

That's a brilliant render you've done there Mark. Very realistic. I'm starting to wonder if my over-simplistic model is the problem rather than the refraction. It's just a lathed vertex object with 64 vertices for the circle. I have a glass very similar to it beside me funnily enough. :) All I know is when I look at it at the same angle as my render the refraction is minimal. Maybe I need to increase the fresnel effect to make it look more like the real glass. I agree that the presets produce great effects, but as I said it could be my lack of modelling skills that's the culprit here. I'll stick with it for now though and add more fresnel, then post it again a bit later. Thanks also for the advice about render settings. My laptop is a couple of years old and was pretty average when I bought it, so I'd say 5 minutes for me is about right. Last time I just used the high quality preset and added light through transparency to it and it took 7 minutes, so I'll probably stay with that now. Thanks again.

Darren


Darcal ( ) posted Mon, 25 May 2009 at 8:04 PM

Thanks HF. I may well look into that.


bwtr ( ) posted Mon, 25 May 2009 at 9:51 PM

file_431548.jpg

In the attached image. Left--the basic clear glass shader. Right--applying Marks Reflection and  Transparency Fresnel Terms as per his screen shot. Centre--applying The Shoestring Easy Fresnel (Reflection) and Easy Fresnel (Transparency)

Brian

bwtr


Miss Nancy ( ) posted Mon, 25 May 2009 at 10:22 PM

mark, thx fr fresnel screen shot .
perfect vacuum has refr. index of 1.000000....... , whilst air is approx. 1.0003, depending on T & P (in case anybody asks).



Darcal ( ) posted Mon, 25 May 2009 at 10:45 PM

file_431555.jpg

Thanks Brian. Well the shoestring looks best to me in your example to be honest. Maybe I should give that a try.

I'm struggling to get what I want from the shader tree as it is. This image is with 25% fresnel (transparency and reflection) and 1% refraction, but this time I changed the angle of the light to simulate the lighting on my real glass beside me. I hoped that was the problem but soon found out I was mistaken, as you can see. I've tried decreasing the refraction to under 1% but I think the problem lies with the fresnel effect. I tried increasing it to 50% but I just get darker lines either side of the glass. It's as if the fresnel is affecting one layer of transparency but not both, therefore creating a bowl effect. The inside of that glass is not rounded at all yet the refraction makes it look more like a vase than a pint glass. Could it be that the fresnel is not going through two layers?


Darcal ( ) posted Tue, 26 May 2009 at 7:48 AM

file_431588.jpg

Well, I've just purchased the shoestring shaders from DAZ 3D and never got a password, so it's only working in evaluation mode at the moment. Therefore a large black rectangle is on my glass, but if you can disregard that this image shows the fresnel effect for glass. I added the shoestring fresnel to the refraction part of the shader tree by the way (I hope that's right). Still too much refraction in my opinion but there are a lot more parameters to fiddle with now.


Darcal ( ) posted Wed, 27 May 2009 at 10:14 AM

I'm really sorry to bump this thread again but I'm almost at my wit's end with this. I have shoestring shaders working properly afterall. The black area is just due to the distortion of the SS glass shader and me not having a back wall in my scene. I feel like taking a photo of my real glass on a coaster at the same angle as my renders just to prove how little refraction there is. It's absolutely nothing like any of the glass presets in Carrara or shoestring. I've tried minimizing the distortion by changing the different properties including the fresnel effect properties and the top half of the glass looks fine, but not the bottom half. I'm sure if I changed it to a wine glass it'd be fine but I'm determined to get this one right.

If anyone is interested in my little plight could I perhaps send someone my scene file so they can prove me wrong about this? I'm just not sure subtle refraction is possible in the Carrara shader tree, but hopefully it's my lack of knowledge or my simple model at fault.

So if someone wouldn't mind please let me know. Cheers. :)


MarkBremmer ( ) posted Wed, 27 May 2009 at 11:03 AM · edited Wed, 27 May 2009 at 11:04 AM

file_431709.txt

 No worries. That's what the forum is for!

Download the attached file and change the ".txt.gz" suffix to ".car" and open the file in Carrara. It's the wine  glass and wine from my earlier render. It includes both textures and doesn't use any plug-ins, just pure Carrara stuff. 

Seeing how the shaders and scene is built should help you along.

Best regards,
Mark






Darcal ( ) posted Wed, 27 May 2009 at 6:06 PM

file_431734.jpg

Thanks very much for the file Mark. The glass shader you created is brilliant and judging by the shader tree is more complex than what I've been doing. It shows I've a lot to learn really. I rendered the image and it looks great, so I predictably copied and pasted your glass shader to my empty glass (pictured). The shader is obviously designed to suit a wine glass and not a simple pint glass. I'll study the shader though and see what I can come up with. Thanks again for all the help. :)

Darren


Darcal ( ) posted Thu, 28 May 2009 at 6:39 PM

file_431795.jpg

Argh! What an idiot! :blushing: I was convinced Carrara's glass shaders were a bit strange, but all along it was my stupid model causing all the trouble. As I mentioned earlier I used a lathed vertex object with 64 points for the circle, which looks fine but produces very strange effects when applying a glass shader to it. Anyway, I thought I'd read about how to make a spline object and then created the same object as before except spline instead. I now realise that they can be perfectly circular unlike vertex objects.

This is my new model with Carrara's clear glass preset (unaltered) applied to it. The refraction is the same or very similar to that of my real glass, so problem solved there. I now have a black ring around the base and no highlight(s). I'm not sure why it's done that. Any ideas?

PS: Sorry about the shaders thing.


MarkBremmer ( ) posted Thu, 28 May 2009 at 8:59 PM

 No worries. It's all part of the learning curve. You need an environment to reflect in the glass. I suspect the dark ring is caused by a black surrounding area. Go to Scene Settings => Backdrop and choose Bi-Gradient. 






Darcal ( ) posted Fri, 29 May 2009 at 5:56 AM

Ah yes, you're right. I should've known that by now as it's happened before on my dodgy vertex glass.

Thanks very much for the advice. :)


ravenous ( ) posted Sat, 20 June 2009 at 6:29 AM

Sorry for stealing the thread, but you guys were talking about the fresnel effect. I never really understood what the fresnel effect is. I can't seem to wrap my head around it.

Could anyone show a render where the fresnel effect is really obvious and point out where to look? I know I'm probably stupid but I'd like to think it's even more stupid not to ask.


MarkBremmer ( ) posted Sat, 20 June 2009 at 3:55 PM · edited Sat, 20 June 2009 at 3:57 PM

file_433222.jpg

 Fresnel effect (named after a french optical scientist that invented lighthouse lenses) is visible in everyday life. It's also easy to spot in 3D if it has been engage. 

Think of standing outside and looking into a car window on a sunny day. the more directly perpendicular you are to the car window, the easier it is to see in. The more the window angles away from you if you move, the more difficult it is to see in. This is because as the angle of the viewer increases, the surface begins reflecting more light.

So, in on round, curving or angled surfaces, the surface will reflect more and simultaneously appear darker or lighter depending on the environment around it. The reflected environment is more intense at the edges of the glass too.

In this example, you can see the wood getting darker towards the edge of the glass while the center of the glass shows it clearly. 

Mark






ravenous ( ) posted Sat, 20 June 2009 at 4:26 PM

Sometimes I'm just really happy being a Carrara user knowing Mark Bremmer is on our side. But seriously, I've read a bunch of explanations about angle this and angle that, but none as simple and easy as your example with the car window. Thank you, everything just made sense all of a sudden.

The only problem now is that I feel this urge to re-render anything I ever made with glass material since I always skipped the fresnel effect.


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.