PDA

View Full Version : particleSamplerInfo like node but for geometry


rxgeez
11-17-2009, 07:23 PM
I wanted to find out if there is a mental ray and/or maya node similar to the particleSamplerInfo node but that works on custom attributes on geometry. Essentially I want to be able to create an attribute on an object and then apply that attribute's value to a shader at render time.

e.g. lets say I have 50 cubes and I apply a attribute called "transparency" to each with random values. I want to have one shader that at render time reads in the transparency value and maps it to the shaders transparency....in the same manner as the particleSamplerInfo node works.....any ideas? Is there a custom mental ray node/shader out there already...if not any idea how difficult it would be to write a custom node like that?

The idea is that since the particle instancer can't use pp attributes...like rbgPP....I was going to basically uninstance the particles and apply an rgb channel to each piece of geo and I want to somehow be able to use that at render time....any thoughts?

Htogrom
11-17-2009, 09:47 PM
There's node called singleShadingSwitch. In that node you can create list of shapes and give them different values.

In this example, I would create one shader, connect shading switch into transparency, and than add all shapes to the switch node. Every object would have attr called transparency. With simple script I would connect every objects transparency attr to corresponding entry in the switch node. That should work well.

With little bit of mel u can make that objects follow particle system and gather all attributes from particle system, and then pass data to switch.

rxgeez
11-17-2009, 10:02 PM
thanks man...I've seen the switch nodes but never really knew how to use them...I ll give it a try. I already wrote a script that basically de-instances the objects and applies all the attribute values I need to each piece of geo and keyframes their values....now ill see if I can feed those through a switch....



*UPDATE*
The switch nodes work perfect....thanks again

CGTalk Moderation
11-17-2009, 10:02 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.