Any example or tips to render sea surface(shader+FFT)?

Any example or tips to do it?
If can’t be done with VTK,any opengl integration mechanism suggestion is appreciated also.

Hi, Alex,

Can you give us a visual example of what you want to achieve? “Sea surface” can mean a lot of things in terms of computer graphics depending on your goal. For me, who makes petroleum reservoir models, the sea surface is just a flat plane painted in translucent blue. For a 3D artist making the next Pixar movie, it is a whole different game and so on.

regards,

Paulo

Thanks,something like this,Shader - Shadertoy BETA, generated by FFT

That example was made via shader. In VTK you can set shaders via one of the vtkMapper classes.

Please, take a look at this example: https://gitlab.kitware.com/vtk/vtk/blob/v7.0.0.rc2/Rendering/OpenGL2/Testing/Cxx/TestUserShader2.cxx .

I hope this helps getting you started.

See this:
https://discourse.paraview.org/t/visualizations-of-water/4183/18

and this:
https://www.kitware.com/screen-space-fluid-rendering-vtk/

FYI @Timothee_Chabat

VTK is primarily designed to render actual data (ie geometry or volumes described in a finite way) so doing sphere/ray tracing like stuff you can find on shadertoy is a bit hard. So really depends of what you want :

  • If you want a scene rendered using sphere tracing for a fully procedural scene then a trick I can think of is to render a quad geometry taking the whole camera frustum and then assigning it a custom shader like @Paulo_Carvalho suggested
  • If you just want to render some sea surface with actual wavelet geometry then you can create a plane geometry, subdividing it, warp it along a scalar field that you created and that is the result of your fractal noise and use the visualizations trick that @mwestphal mentioned

I don’t have any example to link but VTK is just not really designed for doing the kind of rendering you’re thinking of imo.

1 Like