PDA

View Full Version : how to LOOP maya 4.5īs ocean shader?


JupiterSunset
12-09-2002, 10:54 PM
Hi there!

Did anybody try to loop the maya ocean shaderīs waves
over time?

Like say in areteīs DNT you can click loop
(just love those click-ploink solutions),
enter the number of frames the water
should loop along and there ya go:
perfectly looping water!


Duncan made a workaround that a nice guy at
a/w passed on to me:
(hope itīs ok to post it here)

"The speed of the various waves are not currently forced into integer relationships, so it is not directly possible to set the ocean shader such that it loops over time. This is often requested, however, so at some point we could perhaps add a loop toggle along with the number of frames. One can
use other methods to get looping over time, however.

I was able to get the following cross dissolve trick to work:
1. Create an ocean( or ocean shader). Make the numFrequencies and waveHeight both zero so that the ocean is totally flat( and more optimal to render ).
2. Map the oceanShader waveHeightOffset with an ocean texture..asProjection = ON and newTexturePlacement OFF. On the projection make the rotateX = 90.
3. Map the colorOffset of this texture with another ocean texture..
asProjection = OFF and newTexturePlacement = OFF
4. Animate the time values of the two ocean textures such that the start of one is the same as the end of the other:
In the time field on oceanTexture1 type:
= frame/30 (the time parameter generally expects seconds, not frames)

In the time field on oceanTexture2 type:
= (frame-200)/30

5. Keyframe the waveHeight on the two textures to do a cross dissolve:
oceanTexture1 frame 1 = desired height, frame 2 = 0
oceanTexture2 frame 1 = 0, frame 2 = desired height

The ocean animation should now loop across 200 frames. For it to work the two ocean textures must have identical values( appart from the wave height and time ). Note that with this method you cannot preview the displacement of the ocean using heightfield node(convert displacement to poly will work,
however). Also buoys and boats will not animate with wave height(texturing on the ocean shader is currently not taken into account for these effects)."
(duncan, youīre the best, cheers!)



NOW: maybe itīs because itīs late and my brainīs offline
(no dial-up connection possible, invalid password..)
or whyever, but I canīt get this to work.
With this method, the waves "jump" between frames 1 and 2, while without the trick they jump between 200 and 0 (during playback, of course).

guess itīs my fault, not Duncans.

anybody can tell me where my brain disconnected?

thanks
over

Duncan
12-10-2002, 12:53 AM
Sorry.. there is a typo in that formula:
oceanTexture1 frame 1 = desired height, frame 2 = 0
oceanTexture2 frame 1 = 0, frame 2 = desired height
SHOULD BE:

oceanTexture1 frame 1 = desired height, frame 200 = 0
oceanTexture2 frame 1 = 0, frame 200 = desired height

hehe.. it WAS my fault!

Duncan

JupiterSunset
12-10-2002, 08:59 AM
Thanks a lot!

Mooncalf
02-13-2005, 09:25 PM
Okay, I know this is a bit of a huge thread resurrection... but I'm trying to accomplish this very thing, and I've run into some trouble. Why start a new thread when everything's all right here, right?

So, where I'm getting tripped up is on this part:

The ocean animation should now loop across 200 frames. For it to work the two ocean textures must have identical values( appart from the wave height and time ). Note that with this method you cannot preview the displacement of the ocean using heightfield node(convert displacement to poly will work,
however).

Does this mean that the oceanPreviewPlane will not display the motion of the waves? My preview plane doesn't move, and I can't tell if I've done something wrong, or if this is simply how it's supposed to be.


(I also don't understand how the "convert displacement to poly" should work, as that doesn't seem to have any effect on the oceanPreviewPlane either)


I'm trying to make a looping animation of ocean WIREFRAMES, and playblasting a looping oceanPreviewPlane would be ideal. I've looked into other methods of doing this, but I've come up short each time. If anyone has any suggestions, I'd be happy to hear them. :)


(hey, is there a way to bake the geomtry animation of the previewPlane?)


Any and all help would be greatly appreciated. Thanks!

- M

Duncan
02-14-2005, 03:33 PM
Your problem is likely that the preview plane no longer correctly displays the ocean when using this looping work flow( your rendered animation should loop, however ). One could render the ocean totally black, but texture the incandescence. There are some scripts people have done to convert an animated displacement to a series of blendshapes(displacement to poly does not have history).

You could also use a preview plane in a different way.. create two ocean textures to create the loop as described, but make these non-projected 2D textures. You may also need to map alpha offset instead of colorOffset. Map the previewPlane height directly from the ocean texture(normally it is mapped from the ocean shader..no need for an ocean shader with this workflow). When using uv textures directly the preview plane will show the effect of alpha gain and color gain mappings.

Duncan

Mooncalf
02-14-2005, 06:47 PM
Hi Duncan,

Thanks for the help... I still seem to be getting tripped up on that second method, though. It looks like the Preview Plane itself is movbing up and down, but not the individual "waves."

I notice that the oceanShader connects its displacement to the preview plane-- wouuld I be correct in assuming that somehow a part of the ocean textures need to be connected to the preview plane's displacement in order for this to work properly?

- M

CGTalk Moderation
02-14-2006, 07: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.