PDA

View Full Version : Ocean RND


ruchitinfushion
09-21-2009, 03:54 PM
Hey,hello ppl from today i want to start dive inside Maya ocean.In this thread i want to start debate on Maya Ocean.So post ur question on Maya Ocean or give answer to another question on Maya ocean here.
Let's start with my first question:
Question 1>>How to make collide Maya Ocean To nurbs/Poly OBJ.
For this i have one idea but don't know how to do.Idea is generate texture
for ocean & OBJ interaction by closest point on surface,And then extract the displacement part within OBJ area.so answer this.Thank You

DJ_
09-21-2009, 04:34 PM
Well... I guess you can just convert the Ocean to polygon and keep the history on. Then you will be able to do the collision test between 2 normal polygon objects.

Deppends also on why you need that collision information.... When I need to emit particles from the "collision" of a boat with the ocean, I normally just use the toon shader (converting it to polygons too) and emit my particles from it.

ruchitinfushion
09-22-2009, 04:12 PM
Plz ,give in more detail to capture fast.And i need collision to get realistic output .i think in next version of Maya ocean will come with new feature like real wave in realflow.

Aim:-Ocean Wave Splash.
Reference 1 (http://i410.photobucket.com/albums/pp186/ruchitinfushion/OgAAAKwZjN3ETEmADooA755ZGKsvZrP_n-y.jpg?t=1253635367)
Reference 2 (http://i410.photobucket.com/albums/pp186/ruchitinfushion/OgAAAP8j2L9VC0GCg4iN1jNl2eAakF6syTc.jpg?t=1253635450)
And here is My Starting Scene:Start_Ocean_1 (http://sites.google.com/site/fashionmodelingsite/Home/Start_Ocean_1.rar?attredirects=0)

DJ_
09-23-2009, 08:33 AM
There are a few threads here already with some good research on this subject. You can start reading this one (http://forums.cgsociety.org/showthread.php?f=86&t=721332) .

ruchitinfushion
09-24-2009, 05:44 PM
See here:
Ocean and stone interaction :http://forums.cgsociety.org/showpost.php?p=5903425&postcount=24


how can i do this.

And Also tell me how can i emit particle from toon outline.
Here is test scene:Toon_Outline_interaction (http://sites.google.com/site/fashionmodelingsite/Home/Toon_Outline_interaction.rar?attredirects=0)

ruchitinfushion
09-25-2009, 06:27 PM
Hello everyone plz say somethin...

ucsuro
09-27-2009, 06:16 AM
Hello everyone plz say somethin...

http://www.youtube.com/view_play_list?p=A7756842D6CE3BFD

ruchitinfushion
09-27-2009, 07:02 AM
Hey,ppl i m like tortoise but i know "slow and steady wins the race".
Here is my second Test scene file ,Start_Ocean_2 (http://sites.google.com/site/fashionmodelingsite/Home/Start_Ocean_2.rar?attredirects=0)
now help me further to get same output like IgorFX (http://forums.cgsociety.org/member.php?u=337420)(Ocean and stone interaction).

And @ ucsuro thnx for giving health code.

And also tell me How Can i transfer Y velocity of the ocean on the intersection curve for birth of particles(by any script or simple expression).If this done then Maya is better then houdini

Duncan
09-28-2009, 06:15 PM
If you are using colorAtPoint to get the ocean height when creating a particle then you could initially emit a particle but keep it hidden for one frame. On the second frame in a runtime expression evaluate the ocean height again with colorAtPoint using the particle xz values. The difference of this position and the original particle position is the velocity of the ocean surface at that point.

I once implemented a "suction" force for particles based on wave motion. Large waves pull air around them up and down, which tends to keep low spray and mist moving up and down with the waves. For this I kept a previous ocean height value for each particle to track the motion (one would add a custom per particle attribute to hold this value). I then applied this velocity in a similar fashion to wind drag.


Duncan

ruchitinfushion
09-28-2009, 06:42 PM
Thnx very much for ur reply Duncan..

viki164
09-28-2009, 06:43 PM
try toon outline shader for poly to poly intersection!

ruchitinfushion
09-28-2009, 07:20 PM
Hey Duncan yesterday night was like Searching,RND,pain,etc.After reading some old material on "ColorAtPoint" i got little bit of controll on "ColorAtPoint".
And here is my test scene on ColorAtPoint rnd
Floating_Expression (http://sites.google.com/site/fashionmodelingsite/Home/Floating_With_ColorAtPoint.rar?attredirects=0)
Make Object Floating Using "ColorAtPoint"
float $posu = nurbsSphere1.translateX;
float $posv = nurbsSphere1.translateZ;
float $posy[] = `colorAtPoint -o A -u $posu -v $posv oceanShader1`;
nurbsSphere1.translateY = $posy[0];

Make particle Floating Using "ColorAtPoint"
vector $particlePosition = particleShape1.position;
float $positionU = $particlePosition.x;
float $positionV = $particlePosition.z;
float $Ipoint[] = `colorAtPoint -output RGBA -u $positionU -v $positionV oceanShader1`;
float $positionY = $Ipoint[3];
particleShape1.position = <<$positionU, $positionY, $positionV>>;
But Duncan still i don't know how to translate ur language
to MEL.Because i m not master in scripting or in Expression,so if anybody can help me
then most welcome.Thank you.

ruchitinfushion
09-30-2009, 04:28 PM
Hello,all u Master Of scripting.plz help me to build expression/script for transferring velocity of ocean to particle @ intersecting point using "Idea Of Duncan".For testing purpose u can see my test scene and small and sweet expression for floating object and particle using "ColorAtPoint" cmd.Thank You

___________________________________________________________________
Secret Are Still Hidden........

ruchitinfushion
10-07-2009, 07:05 PM
Ok,here us my first test
Test_1 (http://www.vimeo.com/6949693)

ruchitinfushion
11-10-2009, 03:14 PM
Hello,ppl try to edit my expression and plz try to make it ready to run
Note:expression is for deforming nurbs plane with ocean shader.

int $nP;
int $dI=0;
int i,j;
float $minx = InteractionPlane.scaleX * -0.5 + InteractionPlane.translateX;
float $maxx = InteractionPlane.scaleX * 0.5 + InteractionPlane.translateX;
float $minz = InteractionPlane.scaleZ * -0.5 + InteractionPlane.translateZ;
float $maxz = InteractionPlane.scaleZ * 0.5 + InteractionPlane.translateZ;
float $disp[] = `colorAtPoint -o A -su 21 -sv 9 -mu $minx -mv $minz -xu $maxx -xv $maxz oceanShader1`;
for ($i=0; $i<21; $i++)
{
$nP = 20 + ($i*9);
for ($j=0; $j<9; $j++)
{
InteractionPlaneShape.controlPoints[$nP].yValue = $disp[$dI];
$nP--;
$dI++;
}
}

Error:// Error: Line 13.72: Invalid use of Maya object "InteractionPlaneShape.controlPoints[". //

arkangel-fx
11-10-2009, 05:31 PM
There ya go!

int $nP;
int $dI=0;
int $i,$j;
float $minx = InteractionPlane.scaleX * -0.5 + InteractionPlane.translateX;
float $maxx = InteractionPlane.scaleX * 0.5 + InteractionPlane.translateX;
float $minz = InteractionPlane.scaleZ * -0.5 + InteractionPlane.translateZ;
float $maxz = InteractionPlane.scaleZ * 0.5 + InteractionPlane.translateZ;
float $disp[] = `colorAtPoint -o A -su 21 -sv 9 -mu $minx -mv $minz -xu $maxx -xv $maxz oceanShader1`;
for ($i=0; $i<21; $i++)
{
$nP = 20 + ($i*9);
for ($j=0; $j<9; $j++)
{
setAttr("InteractionPlane.pnts[" + $nP + "].pnty", $disp[$dI]);
$nP--;
$dI++;
}
}

PS: Ive writen a generic script that does what you want on any surface with any node, if you want i can share.

stooch
11-10-2009, 05:39 PM
your particle has a velocity attribute.

what duncan is telling you is to use the difference between the positions as a velcity vector.

so, add a vector PP attribute to your particle shape and label it, "emitPosition"

in your creation expression, add: "emitPosition = position;"

in your runtime expression add:

if ( emitPosition != <<0,0,0>> ){
velocity = position - emitPosition;
emitPosition = <0,0,0>>; //this is just to make sure that the velocity vector is calculated ONCE.
}

this is off the top of my head so there may be syntax errors lol. but its a good place to start.

ruchitinfushion
11-11-2009, 04:37 PM
Hey ,arkangel-fx thnx for reply & i will check this tonight(hope i will get a way of success,and if i got any error then plz be ready to solve .thank you).arkangel-fx you can share this expression to any human which are having true love for maya dynamics.

@ stooch
Hey men i have solution of velocity,so no worry.enjoy now

arkangel-fx
11-11-2009, 05:16 PM
Here you go, my little script for displacement. Its really simple, usage is stated inside the .mel file and some anotations too.

Oh, almost forgot, put it in your scripts directory and source it with:
eval("source \"" + `internalVar -usd` + "chw_realDisplace.mel\"");

ruchitinfushion
11-12-2009, 07:13 AM
Hey,i got error for deforming polyplane from ocean.Error=not valid node selected(on line no 25).So,plz tell me how to use between polyplane and ocean.Thank you

arkangel-fx
11-12-2009, 11:14 AM
Use my script, select first you plane, then the shader node and then run it with the "eval" command.

particlefx
11-13-2009, 09:25 PM
hi,

check the below link it might be helpfull

http://www.youtube.com/view_play_list?p=A7756842D6CE3BFD

http://www.realflowforum.com/view_topic.php?id=411

ruchitinfushion
11-15-2009, 01:51 AM
arkangel-fx i tried but still error. plz if u r in success way then plz upload scene file in ASCII format.

arkangel-fx
11-15-2009, 03:13 AM
gimme 2 min, ill make a scene for you.

arkangel-fx
11-15-2009, 03:23 AM
Here you go! Have fun!

Cristian

ruchitinfushion
11-15-2009, 09:40 AM
Hey it's working fine in ur try,but tell me why i got error.Anyway Thnx very much It's wonderful like displaceD .

ytsejam1976
11-15-2009, 09:55 AM
Look at this. Page 2 for update download tool
http://forums.odforce.net/index.php?/topic/9585-hot-in-mr-for-maya/

pix3lm0nk
11-17-2009, 05:01 PM
Look at this. Page 2 for update download tool
http://forums.odforce.net/index.php?/topic/9585-hot-in-mr-for-maya/

nice.. just downloaded it. I had forgotten all about HOT for Maya!

ruchitinfushion
11-28-2009, 02:32 PM
Hello,Friends u can see here one plane deforming by HotOceandeformer
and one Toon intersection line between statue and ocean.Now for me it's so simple
to find height when i use default inbuilt maya ocean using colorAtPoint cmd,but plz tell
me how can i find same value when i use hotOceanDeformer.i m not able to see any shader
or displacement texture to pick Alpha(height)value.
so,tell me how can i update this,for hotoceandeformer
float Disp[]=`colorAtPoint -o A -u $posU -v $posV oceanShader1`;
http://i410.photobucket.com/albums/pp186/ruchitinfushion/Express.jpg?t=1259418995

ytsejam1976
11-28-2009, 02:43 PM
mmmhhh.... maybe i'm don't understand, but see here:

http://forums.cgsociety.org/showpost.php?p=6227156&postcount=6

and here

http://forums.cgsociety.org/showpost.php?p=6227445&postcount=9

ruchitinfushion
11-28-2009, 03:49 PM
Hello,i want to know how to use colorAtPoint cmd with hotOceanDeformer to find height.

ytsejam1976
11-28-2009, 07:18 PM
oh yeah. sorry for my misunderstand. ColoratPoint for emit particles?
anyway i don't know how.

Aikiman
11-28-2009, 10:09 PM
Hello,i want to know how to use colorAtPoint cmd with hotOceanDeformer to find height.

I havnt used the HOT stuff (being a mac user) but Mayas oceans are driven by the alpha of a texture shader and because it uses a 2D texture, you are able to use colorAtPoint to access height info.

The Hot tool seems to use MR displacement feature then uses a shader just for that, shading and not displacement. I dont think you can get height infomation using COP.

ruchitinfushion
11-29-2009, 02:24 AM
so,tell me now any other way.wht if bake the displacement to texture and then colorAtPoint cmd,but how to bake is big question..........

Aikiman
11-29-2009, 06:21 AM
so,tell me now any other way.wht if bake the displacement to texture and then colorAtPoint cmd,but how to bake is big question..........

If I knew the answer I wouldve told you. I dont think baking texture will give you an alpha based on height. Maybe you could try creating some Z-depth pass in Y on the displacement surface to fake an alpha and use that to read from, You'd just have to make sure your highest crest is taken into account as well as the lowest trough.

Good luck

ytsejam1976
11-29-2009, 06:07 PM
hi jeremy.
One question. In my signature or some post later you see my video to use ocean. Ok i'm use the same workflow to animate the displace_D and i want to know how i'm emit a particles from texture foam. I'm create en amitter from surface and connect the texture to texture rate. But i'm not have the emission from the white or from the black.
I don't remember the correct procedure, maybe this.

Thank you
Dario

Aikiman
11-29-2009, 07:52 PM
hi jeremy.
One question. In my signature or some post later you see my video to use ocean. Ok i'm use the same workflow to animate the displace_D and i want to know how i'm emit a particles from texture foam. I'm create en amitter from surface and connect the texture to texture rate. But i'm not have the emission from the white or from the black.
I don't remember the correct procedure, maybe this.

Thank you
Dario

Thats the general workflow, then make sure 'Enable Texture Rate' is on. Also your ocean has to have UVs mapped in order for the texture to be applied uniformly. I had this problem with converting Mayas Pond to polygons, Maya wont allow you to map UVs the normal way. Instead I had to create another poly surface and use the 'Transfer Attributes > UVS'.

ruchitinfushion
11-30-2009, 06:22 PM
Hello,ppl from terrain map we can deform any obj,but i want script which give texture from deform obj.:Like reverse of displaceD

ytsejam1976
12-06-2009, 01:07 PM
thank you jeremy.
This scene i have made and emit from surface and ocean texture, but i'm render the foam sequence of ocean textures as iff on topCamera, because the texture ocean not good in this situation interactive.

Jeremy if you want i'm bake simulation for a Displace_D. i suppose that you don't run this because you are on mac. I hope help some users.

http://www.megaupload.com/?d=DAMIQALN

or

http://rapidshare.com/files/317077876/Particles_emitted_from_foam.rar.html


Ciao

igorfx
12-07-2009, 07:59 PM
I was making some setup with HOT and Houdini, and

ruchitinfushion ask me if a can make some similar setup with Maya and HOT plugin

this is some fast basic setup

Ocean spray

http://www.vimeo.com/8036664

Rock splash

http://www.vimeo.com/8036704

Aikiman
12-07-2009, 08:43 PM
thank you jeremy.
This scene i have made and emit from surface and ocean texture, but i'm render the foam sequence of ocean textures as iff on topCamera, because the texture ocean not good in this situation interactive.

Jeremy if you want i'm bake simulation for a Displace_D. i suppose that you don't run this because you are on mac. I hope help some users.

http://www.megaupload.com/?d=DAMIQALN

or

http://rapidshare.com/files/317077876/Particles_emitted_from_foam.rar.html


Ciao

Hi,
The files appear to be too big and rapidshare requires a premium account sorry. So you are saying you are projection mapping the texture on top the displacement? You wont be able to emit from surface using projection mapping but you will be able to use colorAtPoint.

igorfx
12-07-2009, 09:56 PM
Videos are now online, with project files....

I will post tutorials soon...

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