simon green Posted November 22, 2017 Share Posted November 22, 2017 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. Quote Link to comment Share on other sites More sharing options...
djiki Posted November 26, 2017 Share Posted November 26, 2017 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 Quote Link to comment Share on other sites More sharing options...
simon green Posted November 28, 2017 Author Share Posted November 28, 2017 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. Quote Link to comment Share on other sites More sharing options...
djiki Posted November 28, 2017 Share Posted November 28, 2017 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 Quote Link to comment Share on other sites More sharing options...
simon green Posted December 14, 2017 Author Share Posted December 14, 2017 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.