View Full Version : Pretty Complex Texture Emission Question

08-13-2003, 03:08 PM
Hi everyone!

Righto... I'll try and explain what I am trying to achieve as simpy as possible :)

1) Imagine Uve got 2 nurbs planes in a scene some distance from each other.
2) There is a different file texture applied to each plane.
3) Coloured particles are being emitted from the texture of the first plane.
4) The particles should weave and drift towards the second plane.
5) The particles should 'melt' into the 2nd planes texture.

In short, imagine 2 paintings, where the paint drifts off one painting and forms another painting :)

Has anyone any idea of the best way to achieve this in one shot? Would it be best to emit particles from the 2nd texture, reverse the frames and composite them? Im thinking I need to set the 2nd texture as a 'goal' for the particles not only to reach but to change colour into as well.

Just thought this would be a cool effect to try so if anyone has any ideas lemme know!

Cheers :beer:

08-14-2003, 07:34 AM
wow that would be cool.
I think I might have a way of doing this. Using two different passes and then blending them, using compositing, at the final absortion stage.

But as you say, it would be heaps cooler if one could code something to make the particles go from one sampled colour at their birth to another at their goal.

You could probably link the rgbPP to a value in the particle goalOffsetPP..... hmmm ?????

The thing i am really struggling with is how to make the particles change colour form their emitted colour to the new texture. i might have to lift the hood on the whole 'inherit color' texture emission option to get a better undersatnding of whats possible ??

I'll give a go and get back to you if I come up with anything ???


08-14-2003, 09:26 AM
Hi Aneks.

Yeah, just thought it'd be a cool effect to try and create. Im pretty sure this is possible within Maya, might have to engage in a bit of Mel script though :D

I also think each particle would need to remember the position that it was born on te first nurbs plane, so that this position could be used for its goal on the second nurbs plane. As the particle is travelling we could maybe derive the colour from the 'goal' position and change this particles colour from the emission colour to the goal positions colour over time.

Anyway, Im still struggling to apply any of this so if anyone else has got any ideas jump in :buttrock:

08-14-2003, 11:07 AM
you can maak a particle remember its birth position in UV space from a NURBS surface by turning on needParentUV when you make a surface emitter. You can then use goalUV to do some pretty tricky stuff. If you have acess to the A|W Particles for visual effects DVD they go through some heavy examples of this !

08-14-2003, 11:32 AM
Righto, I'll have a look at that :)

Coupla things I have noticed...
By using numeric particles Ive realised that the particles emit randomly from the birth nurbs plane, ie they don't emit from cv1, cv2, cv3 etc but when they travel to the goal plane Particle 1 goes to cv1, Particle 2 goes to cv2 and so on. Im not really sure if this would be a problem or not though. Just food for thought :hmm:

At the moment Im trying to use an rgbPP ramp fading from the emission texture to the goal texture but I think this then just over-rides the texture emission. I could do with some way of linking the actual emission texture attribute to the ramp.

I suppose this could somehow be done by projecting each texture onto the particles but that just seems too much of an easy way out.

And it just wouldnt look cool enough :beer:

08-14-2003, 12:46 PM
if you emit the particles on both planes with the same emission rate and emitter settings they should be located on the same position on the surfaces.

concerning the travel problem: on the plane that holds the second (the goal) image, just let the particles being emitted with 0 speed and 0 conserve.
then use them just as a goal.

the expression that changes the colors over time should really be easy.
you can either do it over time, or you change the color according to the distance between the 2 particles (which i would guess would be quite slow if you use a lot of particles).

really nice idea for an effect :)

if you need more help, shout



08-14-2003, 01:24 PM
Hi Alex!

Was hoping you would post, you seem to be a bit of a particle maestro :)

Right, Ive done what you said and the particles now move to the correct positions on the second plane, yay! Regarding the particle colour, would it be best to use the texture on the second plane as the colour of the goal particles and then changing the moving particles colour from their birth colour to the goal particles colour?

How would I go about writing an expression in the rgbPP attribute without it over-riding the colour from the texture emission? Ive dabbled a tiny bit in expressions before but expressions and scripting are still one of my weaker points. Its always a case of understanding what I need to do but when I come to writing the expressions I usually hit a :banghead:

Anyway, thanx for the input so far, when ive finally done this with 2 images I wanna try it with two movies :buttrock: :buttrock:


08-14-2003, 01:56 PM
the lifetime solution might not be a really good one, since i guess you dont want to have all of your particles travel with the same speed (a tip there: experiment with setting creation expression attributes on the traveling particles, controlling the goalPP values. like that they will move with different speeds.)

so i guess one of the best solution really would be the distance approach:
you write a PP runtime expression for the rgbPP.
query the positions of the current particle.
query the particleId of the current particle.
use that particleId to query the position of the goal particle with the same particleId (because that will be the particle that the first one will move to).

now calculate the distance between them (either manually or by using a "distanceBetween" node (which you have to create manually as well - but i would do so, since mark once mentioned that these nodes are faster than writing the expressions to calculate them).

now you know the max distance. it might even be a good idea computing that distance in a creation expression and store that value in a custom per particle attribute to be called later without recalculation).

now create a weighting for each frame between the max distance and the current distance and change the color values accordingly)

i would really like to test out myself but i am very short in time currently.



08-14-2003, 02:21 PM
No probs Alex, I'll dive in and get my hands dirty :)
Thanks for the help!

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