Skip to content

eulerjs API / @eulerjs/marine/webgpu / WaveFieldTextures

WaveFieldTextures ​

Defined in: packages/marine/src/webgpu/GpuWaveFields.ts:46

The textures every patch's waves are drawn from: texture arrays, layer i of each holding patch i (as GpuWaveFields.patches numbers them), each layer repeating every patch size. Arrays, so that a material samples a handful of textures however many patches the sea has: WebGPU allows only 16 to a shader stage unless asked for more.

Properties ​

PropertyModifierTypeDescriptionDefined in
derivativesreadonlyTexture∂h/∂x, ∂h/∂z, ∂Dx/∂x, ∂Dz/∂z.packages/marine/src/webgpu/GpuWaveFields.ts:50
displacementreadonlyTextureSideways x, height, sideways z, and the Jacobian of the sideways motion (below 0 where the surface folds over, for foam).packages/marine/src/webgpu/GpuWaveFields.ts:48
foamreadonly| readonly [Texture<unknown, TextureEventMap>, Texture<unknown, TextureEventMap>] | undefinedThe foam the patches make, kept from frame to frame, in the red channel: two arrays, written in turn, the newer chosen by GpuWaveFields.foamPhase (1 for the second), each patch that makes foam at its own foamLayer; none if no patch makes foam.packages/marine/src/webgpu/GpuWaveFields.ts:62
slopeMomentsreadonlyTextureThe slopes squared, ∂h/∂x² and ∂h/∂z²: mipmapped, their mean over a pixel's footprint less the mean slope's square is how much the slopes vary within it, which a mipmapped slope alone loses (LEAN mapping, Olano and Baker 2010).packages/marine/src/webgpu/GpuWaveFields.ts:56

Released under the MIT License.