View Full Version : I need help with spray expressions

01 January 2011, 10:32 PM
I'm simulating a waterfall and you realize a mountain and also the particles and fluid

I was watching some expressions on a tutorial of maya where the spray comes with the waves of an ocean and is very well

I want to use these expressions in my drop of water by the particles and fluid

I have no experience in expressions and is the first time I go to use them to give more realism to the waterfall and to accompany the simulation with particles and fluids

I copied that expression in the tutorial and I write in the expression editor but may not meet the same purpose as they were written for another function but I'm going to copy these to any colleague who has experience can help expressions write and that it fulfills this function, I appreciate the help

remember that I want to use these expressions to simulate the falling spray of water,

these expressions listed below are copies of a tutorial and were used to create some waves spray and let me know if I can use correcting these

vector $pos = particleShape1.position;

float $px = $pos.x;

float $pz = $pos.z;

float $disp[] = `colorAtPoint -u $px -v $pz oceanShader1`;

float $py = $disp[0];

float $yDiff = $py - $pos.y;

$py = $pos.y + $yDiff * oceanPlane1.suckForce;

if( $py < $disp[0] + oceanPlane1.minElevation){

$py = $disp[0] + oceanPlane1.minElevation;


particleShape1.position=<<$pos.x, $py, $pos.z>>;

Derek Wolfe
01 January 2011, 01:03 AM
The expression you have posted positions emitted particles based on a maya ocean shader. Is this what you want for your scene?

01 January 2011, 03:23 AM
hello how are you? my answer is no, I have copied an expression to generate spray add it to the waterfall near the particles and fluid

I know very well that this example of expressions are for use on the ocean spray effects created in Maya

My idea is to see if I can correct these expressions and putting them in my scene


01 January 2011, 03:47 AM
First ,stop to make new post each & every time for same kind of or related question to your topic.
And second thing make plan about your work(Flow chart for work flow).Also put some playblast of your test ,so we can answer quick.

01 January 2011, 01:27 PM
That expression is specifically for an ocean texture and emitting particles using colorAtPoint and texture displacement probably overkill for what you want. You should explain where the spray is coming from first.

01 January 2011, 01:30 PM
Hello, how are you ? thanks for your help, I will explain you

I doing in Maya 2009, a cascade of water particles and I want more realism to the scene but still I can not do something competitive

I want to give volume and good texture to the particles, shadows etc etc, and thought to do it with expressions

I sent you a sample here on youtube which is my idea

As I achieve this?



01 January 2011, 02:14 PM
Use particle type to "cloud" & control the velocity of water by runtime expression.Now i know you will ask "what to type in runtime expression?".Simple answer is read the Newton's law of universal gravitation.When object fall from certain height,they get more & more velocity by going closer to center of earth.Now convert all this fundamental in MEL and enjoy.i think i m giving you pain,right???? ..Lol..hehehehe

01 January 2011, 03:01 PM
Hello ruchitinfushion

hahahaha this really gives me much pain, I understood your concept very well but I must write an expression to achieve the effect shown in the youtube video? or I can achieve the same effect with combination of parameters of maya

As I write the expression to more water weight more speed?

This expression I write about the particles?


CGTalk Moderation
01 January 2011, 03:01 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.