PDA

View Full Version : render pass mel for ambient occlusion


Arcon
03-18-2006, 11:03 PM
i'm setting up a render script that will assign an ambient occlusion shader to all my geometry (shaders with textured transparency will keep their texture but be white mattes). my render pass mel is pretty basic but can switch back and forth between the color pass and ao pass .... but the only way i know how to do it is for every shader i need a duplicate shader, which will be ao or white matte depending on the effect i'm after. the switch selects each shader and assigns its duplicate.

PROBLEM: in my scenes i average around 100 shaders - which would all need ao or matte duplicates. is there a better way to script this where all shaders can somehow reference a single ao shader...? i also need the ability to switch back to the original shaders which is what makes that tricky - there are many shaders with transparency and i would've thought they all need their own seperate matte shader for each unique transparency connection. or maybe there's something really simple i'm missing? calling shaders with mel like i'm doing is prefereable to calling objects (usually there are at least 5,000 scene objects).

btw i'm using 6.5. any pointers would be great - or just tell me if this can't be done :)

CrazyOwl
03-19-2006, 06:12 AM
well, have you tried render layers? you could then override a shader with ao and keep your old connections in another layer.

Arcon
03-19-2006, 09:43 AM
in the render layer attributes in 6.5 there's no option for ambient occlusion...? i havn't used render layers before as i never actually got them to work - a test i did just now with a specular render layer came out black. how are they supposed to work exactly - you don't have to duplicate any geometry do you...? that would be pretty lame.

CrazyOwl
03-19-2006, 12:21 PM
have you assigned lights to that layer?
no you dont have to duplicate geometry, you just have to asign objects to that layer, and then override shader ofcourse (shaderSG.message -> layer1.shadingGroupOverride).
i'm not sure about 6.5 coz i've only started useing render layers since 7.0 (i've read they improved alot) but still there should be a option to override shader, the only trouble is that once you override shader its overriden for all objects in that layer. so each objects that has trasparency should have separate layer it could be troublesome. but for objects w/o transparency it will be quite efficient(i suppose).

Arcon
03-19-2006, 08:13 PM
so each objects that has trasparency should have separate layer it could be troublesome. but for objects w/o transparency it will be quite efficient(i suppose).

i have about 60 or 70 shaders with unique transparency so probably not an option ;) thanks for the info though.

wigal
03-21-2006, 03:48 AM
Render Layers have been introduced first in version 7.0 of Maya....

The old school trick would be to set up a new scene which acts as your "AmbOcc - layer"
just create a new scene and reference the original scene in.... assign your shaders voilaz!

Arcon
03-21-2006, 08:26 PM
The old school trick would be to set up a new scene which acts as your "AmbOcc - layer"
just create a new scene and reference the original scene in.... assign your shaders voilaz!

i'll try referencing again but i don't think it will work on the scale of the scenes i have, i'm not sure if its a bug with 6.5 but when referencing even smaller scenes i noticed a lot of slowdown when opening/saving scenes and rendering.

CGTalk Moderation
03-21-2006, 08:26 PM
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.