diff --git a/examples/files.js b/examples/files.js index 640ca3900fb8ad02a88a59abfeaa8f2370f65e6e..a9c6171aa9e0f4319389047865ac5f2c9660495f 100644 --- a/examples/files.js +++ b/examples/files.js @@ -42,10 +42,6 @@ var files = { "webgl_geometry_terrain_raycast", "webgl_geometry_text", "webgl_geometry_text_shapes", - "webgl_gpgpu_birds", - "webgl_gpgpu_water", - "webgl_gpgpu_protoplanet", - "webgl_gpu_particle_system", "webgl_hdr", "webgl_helpers", "webgl_interactive_buffergeometry", @@ -300,6 +296,10 @@ var files = { "webgl_custom_attributes_points", "webgl_custom_attributes_points2", "webgl_custom_attributes_points3", + "webgl_gpgpu_birds", + "webgl_gpgpu_water", + "webgl_gpgpu_protoplanet", + "webgl_gpu_particle_system", "webgl_materials_modified", "webgl_raymarching_reflect", "webgl_shadowmap_pcss", diff --git a/examples/webgl_gpgpu_water.html b/examples/webgl_gpgpu_water.html index aee28023b80befc8717431f44f706597376d3689..8a328668a6a64b814e711fbbb01424615e26e5d2 100644 --- a/examples/webgl_gpgpu_water.html +++ b/examples/webgl_gpgpu_water.html @@ -74,12 +74,14 @@ vec4 east = texture2D( heightmap, uv + vec2( cellSize.x, 0.0 ) ); vec4 west = texture2D( heightmap, uv + vec2( - cellSize.x, 0.0 ) ); + // https://web.archive.org/web/20080618181901/http://freespace.virgin.net/hugo.elias/graphics/x_water.htm + float newHeight = ( ( north.x + south.x + east.x + west.x ) * 0.5 - heightmapValue.y ) * viscosityConstant; // Mouse influence float mousePhase = clamp( length( ( uv - vec2( 0.5 ) ) * BOUNDS - vec2( mousePos.x, - mousePos.y ) ) * PI / mouseSize, 0.0, PI ); newHeight += ( cos( mousePhase ) + 1.0 ) * 0.28; - + heightmapValue.y = heightmapValue.x; heightmapValue.x = newHeight; @@ -114,17 +116,17 @@ } - +