PDA

View Full Version : set particle color from image


richSpence
11-18-2009, 11:19 AM
I'm having trouble setting a particle color from an image file.
I need to render either blobby particles or spheres in mentalRay.

I have a particle grid and using the array mapper connected to the rgbPP I have managed to get color from a file to the particles and then used the particleSampler to color them using a blinn texture.

But it isn't using the file correctly. The particle colors are distorted (scewed or scrambled) as it isn't using particle in the top left for the top left of my image as if it was using uv space.

Any idea what's wrong??

Hope this makes sense, thanks in advance.

Rich.

azshall
11-18-2009, 11:57 PM
I'm having trouble setting a particle color from an image file.
I need to render either blobby particles or spheres in mentalRay.

I have a particle grid and using the array mapper connected to the rgbPP I have managed to get color from a file to the particles and then used the particleSampler to color them using a blinn texture.

But it isn't using the file correctly. The particle colors are distorted (scewed or scrambled) as it isn't using particle in the top left for the top left of my image as if it was using uv space.

Any idea what's wrong??

Hope this makes sense, thanks in advance.

Rich.

Are you using Texture Emission from a Surface Emitter?

richSpence
11-19-2009, 09:05 AM
Thanks for your reply azshall.
No I am having to start with a particle grid, otherwise I could use the 'ParticleColor' in the 'Texture Emission Attributes'.
I eventually got it to work using the 'array mapper' but dont think i quite understand them. Any explaination of them in simple speak would be very useful.

Aikiman
11-19-2009, 07:40 PM
[edit]

If you run a texture straight into the color input of the particle shader, maya SW will render the ramp UVs, for example, across each particle so you get the ramp repeating rather than sampled based on position.

If you then create a particleSampler node and using the connection editor connect specific outputs to the uvCoord inputs on the 2Dplacement node for the ramp, you can start to play around with how the ramp is mapped to each particle.

For example if you normalised your particles position so that it slotted into the uvCoord nicely, you could then get the color of the ramp based on position.

Another option to look at is the colorAtPoint command which can sample a file also.

krisla
12-15-2009, 08:15 AM
Hey Aikiman... Doing the same thing now, want to texture particles with a file from surface emission but I need to have full control over the shader (want to use a layered shader with procedurals combined with the surface emitted color). Could you or someone give a little more detailed explenation on how to set up a shader network like this?

Aikiman
12-15-2009, 07:38 PM
Hey Aikiman... Doing the same thing now, want to texture particles with a file from surface emission but I need to have full control over the shader (want to use a layered shader with procedurals combined with the surface emitted color). Could you or someone give a little more detailed explenation on how to set up a shader network like this?

AFAIK it wont work on shaders per se, emission is based on textures. The Stroika plugin can do this though if you have the funds to shell out for it.

CGTalk Moderation
12-15-2009, 07:38 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.