Jump to content
Sign in to follow this  
simon green

ocean displacement with deformed geometry

Recommended Posts

I want to displace the ocean with a deformed grid,, but the displacement of the white caps and foam are being stretched and look wrong due to the deformer,look like this picture ,how can I fix it.

2017-11-22.png

Share this post


Link to post
Share on other sites

Several ways are possible.

1. You can apply ocean to a grid first and then do deformation of complete ocean.

2. Default asset assume x and z coordinates are on the XZ plane and result from FFT evaluates Philips spectrum as displacement in Y coordinate only (if chop parameter is zero). So for example if you try to evaluate ocean on grid in XY plane it will not work well. You can modify original asset to apply displacement in direction of normal instead of Y axis.    

3.

- remove ocean from your deformed grid

- make reference grid with same number of points as your deformed grid

- create @oldpos vector attribute and store @P in it

- apply ocean on that grid

- create point vector attribute v@displ = @P - @oldpos; 

- create point float attribute f@amount = length(@displ);

- compute rotational matrix which orient vector {0,1,0} to vector @displ 

- because both grids match in topology you can access that matrix attribute from your deformed grid simply referencing it by @ptnum and apply that matrix to normals of your deformed grid and scale them by @amount attribute

- now just displace points of your deformed grid by those normals

- catch @Cd (and other attributes if any) from reference grid

cheers

 

Share this post


Link to post
Share on other sites
On 2017/11/25 at 7:37 PM, djiki said:

Several ways are possible.

1. You can apply ocean to a grid first and then do deformation of complete ocean.

2. Default asset assume x and z coordinates are on the XZ plane and result from FFT evaluates Philips spectrum as displacement in Y coordinate only (if chop parameter is zero). So for example if you try to evaluate ocean on grid in XY plane it will not work well. You can modify original asset to apply displacement in direction of normal instead of Y axis.    

3.

- remove ocean from your deformed grid

- make reference grid with same number of points as your deformed grid

- create @oldpos vector attribute and store @P in it

- apply ocean on that grid

- create point vector attribute v@displ = @P - @oldpos; 

- create point float attribute f@amount = length(@displ);

- compute rotational matrix which orient vector {0,1,0} to vector @displ 

- because both grids match in topology you can access that matrix attribute from your deformed grid simply referencing it by @ptnum and apply that matrix to normals of your deformed grid and scale them by @amount attribute

- now just displace points of your deformed grid by those normals

- catch @Cd (and other attributes if any) from reference grid

cheers

 

In this Scenes ,I use the oceanspectrum node export the bgeo file,then use the material  to make grid displacement. So I don't know how to apply ocean to a grid first and then do deformation of complete ocean.

Share this post


Link to post
Share on other sites

In that case its much easier .... Make sure your deformed grid have proper UV and instead of exporting bgeo, export 3D displacement only in texture (ocean spectrum  node can do that) then apply that texture in displacement shader 

Share this post


Link to post
Share on other sites
On 2017/11/25 at 7:37 PM, djiki said:

2. Default asset assume x and z coordinates are on the XZ plane and result from FFT evaluates Philips spectrum as displacement in Y coordinate only (if chop parameter is zero). So for example if you try to evaluate ocean on grid in XY plane it will not work well. You can modify original asset to apply displacement in direction of normal instead of Y axis.    

I have found the derivatives_XZ_fft node, but I don't know how to fix it,Can you say more in detail for this anwer? thank you very much!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×