View Full Version : Lighting through glass
kez717 01-04-2009, 01:22 PM I have a model of Notre Dame cathedral that I have been working on for a while, started as a homework assingment and I got carried away with it. My problem is in the lighting for it, I have the indoor lights set up and looking fine but I can't get any outdoor light to look anywhere near what I should. I've got the stained glass windows in place, the lights up, and all that, but none of the tutorials or info I can find has worked at all.
Basically what I'm trying to do with it is have sunlight stream in through the windows with some rays showing (like it would for a older slightly dusty atmoshpere) and have the images on the windows appear on the floors (slightly blurred ofcourse). Im using Maya 7 Unlimited and can't even get a single aspect of what I'm after to work. I know it's very possible to get it and probably easy but for some reason I havent been able to do it. If anyone can give me a hand with this it would be extremely appreciated as its all I have left to do on this project and it would make it perfect.
| |
InfernalDarkness
01-06-2009, 01:09 AM
I know it's very possible to get it and probably easy but...
I wouldn't consider volumetrics in mental ray "very possible" at all. Not to be discouraging, but I would use the word "probable" instead of possible. Volumetrics have changed so much since version 6 (last time they worked predictably) to the newer versions, and in 2008 and 2009 I've never been able to get them to work at all. It's the case again of something that every other package handles without effort, yet Maya stumbles over such "basic" things. Granted, every other package takes years to render volumetrics too, which is unacceptable in its own way.
In Maya 7, since you don't have the mia_x_material to work with, it might NOT be possible to do this, at least not with the direct approach. In theory, you want your glass pane / stained glass materials to pick up color information and cast shadows corresponding to these colors. In theory, you'd use the parti_volume_photon and parti_volume shaders, connected to your lights. You would make a large cube encompassing your entire scene, and apply the shaders to this cube, and "suppress Maya shaders" as well. Once connected to your lights, the theory is that your photons (GI and Caustics) would hit the window material, pick up any color information, and pass through to the floor with that color information.
So you'll need special mental ray materials for each window, and then the large cube with the volume shaders as well, and also of course your lights need to be casting the proper amount of photons and whatnot...
I'm assuming that you're using GI though, which you might not be.
There are some tutorials around here and the web, but most are outdated, and I have yet to see volumetrics work in mental ray for Maya 2009 at all. Ever.
Consider doing this effect in postwork? I'm sure someone will disagree with me, but hopefully someone will be able to shed light on the topic!
Another workaround would be to make each glass window into a light as well, and use the same window texture as a "gel" for the light. This may work better, but won't give you sunbeams and dust of course, but may at least get your colored shadows on the floor.
Theodocious
01-06-2009, 09:16 PM
first of all I want to take that volumetrics MR challenge, sir. second of all, I don't know why you are making stained-glass transparent shadows sound so difficult, from what I remember Mia shader handles them fine with raytracing, just make sure caustics are off and transparent shadow is on, and set your ray depth deep enough. if you want to send me your scene or even just a window and a floor I'd be happy to look at it and figure out some lighting.
InfernalDarkness
01-06-2009, 10:59 PM
Im using Maya 7 Unlimited and can't even get a single aspect of what I'm after to work.
If he's using Maya 7, he doesn't have access to the mia_material, unless he loaded it in separately along with an upgrade to mental ray. I could be wrong about this, but the addition of mia_material and mia_x_material was the main reason I upgraded Maya from 7, back in the day. I also don't believe the sun/sky is available in stock Maya 7.
But really, I'd also love to see an example of this working, so please feel free to take the challenge, Theodocious!
Theodocious
01-07-2009, 04:48 AM
how's this?
http://img266.imageshack.us/img266/6544/volumefogbmpfinalmu1.png
mr/maya volumetric fog. working on stained glass now :beer:
Theodocious
01-07-2009, 08:50 AM
this could have been a lot easier to do than it was. if a lot of people want an explanation I'll look into doing a tutorialhttp://img381.imageshack.us/img381/8365/pitythefoolpngyi8.png
CurtJ
01-07-2009, 11:28 AM
I just want to know where I can join the Church of B.A.Baracus
:D
kez717
01-07-2009, 05:51 PM
Thanks for the replies on this.
InfernalDarkness - i dont have anything extra loaded, just the normal version of 7 unlimited. i havent heard of any mia materials before but i think i have seen the sun/sky stuff in there somewhere.
Theodocious - both the images you posted are very close to what im after. the stained glass one would go near perfectly. i would love a tutorial on how to get it done, for both of them actually. vbmenu_register("postmenu_5601411", true);
Theodocious
01-07-2009, 09:17 PM
unfortunately I'm not sure you can do this in maya 7. At least for the stained glass to look right I'm pretty sure you need a mia_x material, although you may be able to use a DGS or blinn shader
really quickly,
set up your scene with the lighting first. try to get your transparent shadows looking right before you go for the volumetric effects.
then create a poly cube that encompasses all the lights and objects in the scene. give it a new lambert shader and go into that lambert shading group. under the "mental ray" tab in the shading group attributes, add a new custom shader to the "volume shader" tab and use a mr "parti_volume" shader. you should also use a "physical light" shader attached to your spotlight shading group, added in a similar way, in the mr attributes. for the physical light, bump up the "color" value to 200-400,000. Enable caustics in your render globals and you should begin to see the fog. there is a weird glitch in the transparent shadows that means you should enable only pure raytracing in the renderer (turn off scanline) otherwise the transparent shadows don't map correctly. for the stained glass look I simply applied a colored texture map to the "color at max depth" of the mia_x material: for other shaders this won't work so you'll have to try different things yourself.
to manipulate the fog settings it is very different than other cg packages, because it deals with physically accurate parameters and not such easy things as "cone attenuation" or "fog strength" - by controlling "extinction", "R", "G1," and "G2", you can get different effects from dust, to smoke, to heavy fog. I won't go into detail but do a maya help search on the parti_volume node and you should be able to figure it out from there. good luck. by the way, I'd be happy to trade a detailed explanation of this for a detailed model of notre dame, there are a lot of little quirks and workarounds that took me forever to figure out, this is a very basic explanation...
vBulletin v3.0.5, Copyright ©2000-2009, Jelsoft Enterprises Ltd.