PDA

View Full Version : particleinstancer and particlesamplerinfo?


phyle
08-05-2005, 01:21 AM
Hi all,
does anyone know if its possible to pass shader attributes to my particle instancer objects from the particlesamplerinfo node? It doesnt appear to work..

I would like to use it to change the texture for each instanced object using particleId, but Im sort of gathering that its not possible. Is there some sort of script or other way to do this do you think?

westiemad
08-05-2005, 03:13 PM
this might be a pathetically stupid suggestion, but how many colours do you need, as you might have to assign a different model to each particle of the colour u want. I can't change the colour of the instances either, only the particle they are attached to.

This is however a brief look, but I can't find anything in the help file either. If you do solve it, it would be nice if you could share it :).

AnDy

pixel mixer
08-05-2005, 04:44 PM
if you're instancing just one object then make duplicates of your source, change shader attribute on each of the duplicates then just use an expression on the objectIndex to instance the same geometry (!) with different shaders.

Bonedaddy
08-05-2005, 09:53 PM
You should be able to plug some normalized random custom attribute into the v coord of a ramp, and have that affect the shading.

phyle
08-06-2005, 02:17 AM
Thanks for your help guys!
I was actually hoping to to use it to control a sequence of images, ie. a random image out of a sequence for each particle. Ive just got a bunch of trees that im animating as particles and I wanted to give them different leaves randomly.

But I just ended up doing it the hard way. I made a bunch more particle shapes and copied their expressions, then made new instancers for each.

Pixel mixer: I guess I dont fully understand how the instancer works.. Wouldnt changing the objectIndex change the object for every particle in the instance node every time?

pixel mixer
08-06-2005, 07:47 AM
absolutely, but since each object is the same the only difference being the shader you will end up with the same object but different shaders on it. unfortunatelly the instancer node is very limited. i'm still dreaming of the day i will see PP for everything including radius of the multipoint/streak for hardware rendering and passing channels and offsets to PPs and of course PP shaders. i kind'of gave up upon this and try to write my own tools on top of maya.
tough job!

luispages
08-06-2005, 05:14 PM
You can have only one particle object and a library of trees to instance then you just have to randomize objectIndex so it uses objects from your list, just create an attribute for your particle object and using a creation expression randomize the between 0 adn the number of objects you are instancing, then on objectIndex select the name of the attribute you created and it should work fine.

Make sure that your objects have their pivot points centered before you instance, and I try to have them on the center of the grid, I also use random values from zero to one over the number of items I'm instancing to make sure the last one gts selected by the expression.

Hope this helps

CGTalk Moderation
08-06-2005, 05:14 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.