Jump to content

ocean displacement with deformed geometry


db.digital

Recommended Posts

Hello!

I am making a geometry deformer to simulate large waves for a student film (we don't have the resources or time to sim out a large tidal wave), and I'm having difficulties with the shader. I'm starting with the default ocean shader to get a feel for it, but the displacement and creation of the white caps and foam are being stretched and look wrong due to the deformer. My thought process is, is there some way to include my deformer in the displacement process so it is factored in when white caps/foam are made? If not, is there some other way to effectively use the ocean shader on a deformed grid (without losing the white caps/foam)? I'm really hoping to be able to have the white caps/foam on the crest of the large wave the same way it appears on the small waves created by the ocean displacement.

My files are attached, I apologize for the messy VEX in the hda, I've been hopping between VOPs and VEX in its development. Also note: the displacement maps are set to .picnc instead of .pic because I am working in Houdini apprentice currently.

Thank you!

displacementworkaround_v01.zip

Link to comment
Share on other sites

hey Dan,

It sounds like you may be using the deformed grid (the preview grid) to render. You render the grid with the attributes created by the ocean evaluate. Then the shader does the rest. If the displacement and caps are stretched it may be caused by a doubling effect, as in displacing a already deformed grid. Search for the off the shelf ocean tools tutorial for the ocean surface workflow.

Link to comment
Share on other sites

Thank you for your response! I've tried a couple workflows. One was creating my own grid, adding my hda deformer, then ocean evaluate, then the ocean shaders. The one in my provided file in my original post is where I used the shelf tool for ocean waves, and placed my hda after the generated grid. I did run tests with preview grid, but I am looking for a solution that incorporates my hda deformation with the displacement generated by the shader (using the node marked 'render' generated by the shelf tool).

I apologize if I was not clear enough by what I meant by deformed grid! I am referring to the grid being deformed by my hda. A better explanation of it is here. I have also attached an image for visual reference of what I am trying to accomplish.

output.jpg

Link to comment
Share on other sites

Ok you can try this

plug your custom grid into ocean_evaluate

go inside ocean_evaluate/bake_maps/

plug gen_displace into a blur node and set 4 pixels

plug blur into left of a subtract node and gen_displace into right

with display flag on the subtract you can open composite view and see the resulting high frequency displacement map

you can bake and apply these maps to your custom grid and it will not change the general shape but allow you to use it for foam and details.

 

now that i think about I'm not sure thats the problem..

 

one thing is for sure, dont use your hda after evaluate..evalute is always last before render. or attributes will be messed up.

If you plug your hda into evaluate, and preview the grid/foam and its making foam where u want - use the tip above and all is good.

If its not making foam on the crest, you will need to customize and i only have some ideas..

foam is generated by v attribute, so maybe using a trail SOP set to compute velocity between your hda and evaluate, the foam solver will pick it up.

The idea is to add the velocity from your custom grid to the velocity from the evaluate. So the foam solver will see higher velocity values on the crest and make more foam.

hopefully the evaluate will make foam where you want by default, then just do the map trick.

dont forget to plug the subtract node into wherever the gen_displace was originally

Edited by Yon Anadeyo
Link to comment
Share on other sites

I had this problem before when adding the displacement shader on the deformed flip simulation!

All I did was come to the COMP network of the shader and then add a blur node with a value of like 5 and then substract the original. Rendered those out and applied it to the shader.

Worked like a charm. For the foam I did a custom SOP solver to create it, I'll try to send my scene file to you later today!

Edited by derjcmp
error
Link to comment
Share on other sites

Thank you for your responses!

James - I don't believe I have permissions to change anything inside of the bake_maps, is this because I have the Apprentice version or is that something I can switch off elsewhere?

João - I would definitely be interested in seeing your SOP/scene file if that is alright!

Thank you again for your help, this is definitely helping me go in the right direction!

Link to comment
Share on other sites

Oh, thank you! I was able to allow the permissions. Your suggestion is definitely getting me much closer, I will still probably have to still make a SOP (would love to get to see João's!) to get it perfect, but this is great! Thank you very much for your help.

Link to comment
Share on other sites

  • 1 year later...

Hi,

I know this is an old thread, but I am trying to do the same thing as the above mentioned, and I cant figure out how to get the foam on the crest of the wave being deformed by a custom deformer.

I tried the suggestion above with the trail SOP, but it didnt seem to change anything.

I am basically using the small ocean shelf tool and deforming the grid going into the ocean evaluate using a custom deformer. Also creating foam with the ocean foam SOP, but I dont think its being produced correctly because I am projecting it on to a deformed object?

I have attached my hip file. Hope somebody can help.

PS - I am using Houdini 16.0.557

 

 

 

 

rd_wave_deformer_v01.hip

Link to comment
Share on other sites

Thx for the link JO. Actually, I have watched this Masterclass, but from what I get, the oceanfoam SOP is projected on to the ocean spectrum plugged in above, and forms foam particles on the cusps.

Using the custom deformer, the ocean foam SOP does not recognize the deformation. I was more or less hoping that I can form whitecaps where the crest of the deformed wave would be. Similar to how the ocean evaluate uses the cusp attribute to form whitecaps.

The look of this tidal wave deformer in this link is ultimately what I am trying to achieve. 

Any clues on how to do something similar?

 

Link to comment
Share on other sites

Have you tried to use the Displace Particles ?

If it still doesn't work, well, the OceanFoam SOP being based on curvature, velocity and height, maybe you can try recalculate those attributes after your custom deformer to plug the Ocean Foam afterward (measure Sop for curvature, trail SOP for velocity of your wave etc.). Just look at how they are named in the standard setup, and check your have the same when you recalculate them.

By the way, check in the Geometry pane what velocities you have, what curvatures (orders of magnitude), so that you can adjust the threshold accordingly into the OceanFoam node (Conditions tab).

Or maybe just use those attributes to emit particles yourself in a DOP network with POP Solver ?

 

Edited by StepbyStepVFX
Link to comment
Share on other sites

On 2018/4/11 at 6:23 PM, StepbyStepVFX said:

Have you tried to use the Displace Particles ?

If it still doesn't work, well, the OceanFoam SOP being based on curvature, velocity and height, maybe you can try recalculate those attributes after your custom deformer to plug the Ocean Foam afterward (measure Sop for curvature, trail SOP for velocity of your wave etc.). Just look at how they are named in the standard setup, and check your have the same when you recalculate them.

By the way, check in the Geometry pane what velocities you have, what curvatures (orders of magnitude), so that you can adjust the threshold accordingly into the OceanFoam node (Conditions tab).

Or maybe just use those attributes to emit particles yourself in a DOP network with POP Solver ?

 

Yes, I checked the Displace Particles, but it only displaces the foam particles according to the ocean spectrum.

I think the best bet is to calculate the curvature and other attributes. I found another thread where the same question was brought up, which also provided a hip file. 

I think for now I will use this as a starting point and work off of this. Thx for all your suggestions and advice JO!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...