Adding ocean spectra

   4043   5   2
User Avatar
Member
33 posts
Joined: Nov. 2008
Offline
Apologies for the cross-post - but I figured there are probably folks who don't monitor both here & odforce…

I'm interested in “layering” large, low-frequency waves with higher-frequency ones. The surface is no problem - just pipe the output of one ocean evaluate into the other. But the ocean evaluate has other products (vel volume, sdf, particles) that are used elsewhere in the pipeline - and in fact some of those parts have their own embedded ocean eval nodes for generating those products.

I could hunt down and deform all the volumes, particles, etc. But it occurred to me that a better solution would be to composite the two ocean spectra at the head of the chain. Unfortunately, my math is too rusty for it to be immediately obvious to me how to do this. (Adding them isn't the answer.)

Does anyone know how I could go about this? I'm assuming the amp/freq/phase volumes that are output by the ocean spectrum node are spectra giving… power? in each band of frequencies across a given range. But it's not really documented anywhere.
User Avatar
Member
818 posts
Joined: Sept. 2013
Offline
If the resolution and size are the same, you could try using volumemix to add the amplitude volumes together. So that each voxel from one spectrum maps exactly to the other's spectrum.

If the resolution and size don't match, then you probably have to do the mixing manually. The volumemix will end up sampling the volumes, which doesn't give you the right result. I think you'd have to do something like adding each low res voxels to only one of the high res voxels.

The attached scene file shows the case where resolution and size are the same.

Attachments:
ocean_add.hip (914.1 KB)

Andrew / アンドリュー
User Avatar
Member
33 posts
Joined: Nov. 2008
Offline
Thanks for the reply. Will that give the correct result? Aren't the frequency & phase spectra necessary to evaluate the whole thing?

And related: I went ahead and started trying to modify the outputs of the ocean evaluate node as a backup solution. I'm currently using the “splash tank” setup, so it appeared that my changes needed to go inside the wavetank node that drives the splashtank sim. If I'm understanding correctly:

1) the particles from the ocean evaluate need to be moved, for instance using the restdisplacement from the secondary ocean evaluate. Their velocities should be summed as well.
2) the vel fields probably need to be composited. So I guess VEX/VOP to move the values of one, then add that to the values from the other. I'm not clear where this field is even being used, though, since the particles already have velocity on them.
3) the SDF can probably just be replaced with an SDF generated from the composite (twice displaced) surface, rather than putting it back together from fields as it was original computed in the wavetank node.

Does that about cover it?
User Avatar
Member
818 posts
Joined: Sept. 2013
Offline
Frequency and phase are the same for both spectrum, so you'd have to ensure that they're the same. Actually, same resolution and size alone aren't enough. If you dive inside oceanspectrum, you can see that a few other parameters, like depth and gravity, also affect frequency and phase. So those parameters would also have to be the same. Otherwise it's not trivial to compose the spectra together.
Andrew / アンドリュー
User Avatar
Staff
809 posts
Joined: July 2006
Offline
meeotch
Thanks for the reply. Will that give the correct result? Aren't the frequency & phase spectra necessary to evaluate the whole thing?

As long as the first seven parameters of the Ocean Spectrum nodes match (i.e. Resolution, Grid Size, Depth, Gravity, Seed, Loop over Time, Loop Period), then the phase and frequency will match and you can just add all the amplitudes as Andrew suggests. Probably the biggest limitation here is Seed, since it controls the random phases of the different frequencies. Also I believe only the second Chop parameter will have an effect.

Note that you can do a fair amount of tweaking to the amplitudes with the Remap Amplitude ramp on the Wave Amplitude tab. Also you could use as many spectra as you want and add all their amplitudes, again assuming those first seven parameters match.

If you can get the desired result, adding the amplitudes is likely the best approach since none of the spectrum nodes are time-dependent and will typically only evaluate once, and you're still only ultimately sending one spectrum into the OceanEvaluate so that's no more expensive.
User Avatar
Member
33 posts
Joined: Nov. 2008
Offline
Unfortunately, I did tweak the grid size & gravity in order to get the really low frequency, huge rolling waves we're looking for.

Though I'm beginning to suspect that we may end up having to sculpt a big wave to layer in, rather than try to get it out of ocean spectrum, and just use the higher freq ocean spectrum for detail. (They're shooting a green screen boat in a gimbal, and we've got no idea what the plates will look like when we get them.)

Does the list in my post above seem accurate, as far as what needs to be changed, in order to deform a splash tank based ocean arbitrarily?
  • Quick Links