FORUMS: list search recent posts

Particle size based on texture they're emitted from...

COW Forums : Autodesk Maya

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Christof van Niekerk
Particle size based on texture they're emitted from...
on Jul 26, 2011 at 2:35:25 pm

I'm emitting particles from a surface using texture emission.

I'd also like to have other attributes like radiusPP be determined by the
texture from which they're emitted.

i.e. The darker the underlying texture area, the smaller the particles & the closer to white, the bigger the particles.

Thought I could quickly figure out some array mapping technique that'll sort it out, but it's proving more tricky than I thought. I'd appreciate any help with this!



Return to posts index

Christof van Niekerk
Re: Particle size based on texture they're emitted from...
on Jul 27, 2011 at 9:17:48 am

Hi guys, any ideas?
I'm really stumped by this one, and would really appreciate any guidance.



Return to posts index

Steve Sayer
Re: Particle size based on texture they're emitted from...
on Jul 27, 2011 at 6:16:09 pm

This is certainly possible.

A surface emitter can take two texture files: one for the emission rate and one for the particle colour. But once we've assigned colour, we can use that information to do anything we want, using a creation expression. Then, at the end of that creation expression, we can reset the colour to whatever value we like.

So paint a texture that is white where you want the particles to be largest, and black where you want them to be smallest. Then use a creation expression along these lines:

.radiusPP = mag(.rgbPP);
.rgbPP = <>;

This will make the particles emitted from black areas tiny (radius 0) and the ones emitted from white areas huge (radius 1), with grey values producing varying radii in between. Then, once the particle has its new radius, it reverts to a default black colour.

This uses the magnitude of the rgbPP value, i.e. the brightness. With a little more coding it is possible to use just one of the three colour channels. This allows us to pass up to three different types of unrelated information to the particles at creation (which we could then copy to, say, radius, speed, and goal weight... or any other properties we wanted). Unfortunately this means we can't also control the actual colour using a map... not without a lot more work, anyway.

Hope that helps.

-Steve


Return to posts index


Christof van Niekerk
Re: Particle size based on texture they're emitted from...
on Jul 28, 2011 at 7:38:07 am

Thanks very much for the reply Steve.
For my current Maya competence, it's a mouthful - but I will take today to digest & dissect your solution.

Thanks again for the response.



Return to posts index

Christof van Niekerk
Re: Particle size based on texture they're emitted from...
on Jul 28, 2011 at 8:23:58 am

Great!!! Thanks for the help Steve - everything works exactly as you said!



Return to posts index

Steve Sayer
Re: Particle size based on texture they're emitted from...
on Jul 28, 2011 at 4:02:53 pm

Glad to hear it! Happy to help.

-Steve


Return to posts index


Sebastien Froger
Re: Particle size based on texture they're emitted from...
on Jun 17, 2014 at 2:50:55 pm

Hey,

I cant make it work. i get a syntax error when in Maya 2014.
Thanks in advance


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]