PDA

View Full Version : Assign Shader to particles


Graogramar
06-16-2003, 12:35 PM
Hi Folks.

Could somebody please discribe how to assign a shader (not a texture) to particles.
I tried in this cases:

(turn smooth shade and HW texturing on)

1. New attribute: color, click on shader, assign new material with the particles selected; this did not work. The particles remain black.

2. nurbs surface, emit from object, tried to assign shader to the particle color attribute of the emitter, inherit color and opacity on, add rgbPP and opacityPP to the particles; same black particles

Could you please help me in both cases.

Thank you :-#

anakinskywalker
06-16-2003, 01:24 PM
Well what you need is to enable the per particle attribute.

Here is how to do it....

1. Select the particle object (not the emmiter) and in the attribute editor in the particleShape node scroll down to "Per Particle Attribute".. down there is a "Add Dynamic Attributes" section.

2. Click on the "Color" button (1) and a Particle Color dialogue box should pop up.

3.Select "Add Per Particle Attribute" (2)

4.An extra attribute called rgbPP should be added (3)

5. Rt click in the text box area and in the menu that pops up select "Create Ramp"

6. Some scripting stuff should be added in the rgbPP so you know it worked.

7. Turn on Shading > Smooth Shaded All. And play the animation. It should be done

See the accompanying pic. hope this solves ur problem.. for both cases.

Sorry for the resolution :hmm: gotta fit it into 20 kb :p

jHromika
06-16-2003, 03:07 PM
While that works, I think the easier solution (provided I'm not reading this incorrectly) is to just make a volumetric particle shader. If you're rendering clouds or tube particle shapes, regular shaders won't apply. Blobby surfaces can take on a blinn though, for example.

anakinskywalker
06-16-2003, 03:42 PM
:applause: ahhhh!!!! now I see how the fire and smoke thing in Maya works.. this is a better option jHromika thanks. I guess however it cant be used to show particle aging ..can it be? for eg with the method i described the particles of different ages could have different colors. I was not able to get it here. Maybe we could try combining both methods so i can have a awesome fire which begins blue .. turns yellow and then gray smoke.:bounce:

jHromika
06-16-2003, 04:04 PM
you could be on to something there young skywalker (heheh, I'm willing to bet you've heard that way too many times, but I couldn't resist ;) )

I haven't done much with coloring particle aging, but I'll be sure to take a look at it when I have some time tonight. :)

The process you're describing makes complete sense in my mind, but if history has taught me anything, my logical process doesn't always match up with maya's, heheh. But we shall see!!

anakinskywalker
06-16-2003, 05:56 PM
hmm.. i will try to put together what is a small flicker at the moment in my mind.. but maybe sometime tomorrow... I hope the flicker does not die out by then :p And talking about logic in Maya i guess we share the same history :) So much so that if something works I dare not mess with it cause i have no idea how it worked.

jHromika
06-17-2003, 12:05 AM
Anakin, try this one out and see where you can go with it :)

- create an omni particle emitter with rate at 250 and speed at 5
- Change lifespan to constant and set lifespan to 5
- Change render type to cloud or tube (doesn't matter which)
- Open up hypershade and create a volumetric particle shader
- Click on the checkered box next to life color and create a ramp
- Change out UV type from Normalized Age to Absolute Age

Play out to about frame 100 or so (so that some particles reach max lifespan) and render :)

I imagine you could pull off a neat fire with some work. Maybe write an expression so that as particles near the end of their lives they emit more particles to produce smoke. That's a bit beyond me though, I'm just getting into the scripting and expression writing.

anakinskywalker
06-18-2003, 03:54 PM
Gee..thanks Jhromika. I had missed out the Life Color and the Particle sampler info tag. This method is sure better.

CGTalk Moderation
01-15-2006, 10:00 AM
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.