Jump to content

ocean displacement with deformed geometry


simon green

Recommended Posts

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

 

Link to comment
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.

Link to comment
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 

Link to comment
Share on other sites

  • 3 weeks later...
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!

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...