Linux dpw.dpwebtech.com 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64
Apache
: 192.232.243.69 | : 3.145.71.171
54 Domain
7.3.33
dpclient
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
home /
dpclient /
public_html /
HRD-Test /
examples /
[ HOME SHELL ]
Name
Size
Permission
Action
.pkexec
[ DIR ]
drwxr-xr-x
GCONV_PATH=.
[ DIR ]
drwxr-xr-x
files
[ DIR ]
drwxr-xr-x
fonts
[ DIR ]
drwxr-xr-x
ies
[ DIR ]
drwxr-xr-x
jsm
[ DIR ]
drwxr-xr-x
luts
[ DIR ]
drwxr-xr-x
models
[ DIR ]
drwxr-xr-x
new-gltf
[ DIR ]
drwxr-xr-x
screenshots
[ DIR ]
drwxr-xr-x
sounds
[ DIR ]
drwxr-xr-x
texture
[ DIR ]
drwxr-xr-x
textures
[ DIR ]
drwxr-xr-x
.mad-root
0
B
-rw-r--r--
123.html
3.29
KB
-rw-r--r--
GLTF_test.zip
2.29
MB
-rw-r--r--
css2d_label.html
6.31
KB
-rw-r--r--
css3d_molecules.html
9.87
KB
-rw-r--r--
css3d_orthographic.html
6.88
KB
-rw-r--r--
css3d_periodictable.html
12.2
KB
-rw-r--r--
css3d_sandbox.html
6.42
KB
-rw-r--r--
css3d_sprites.html
5.12
KB
-rw-r--r--
css3d_youtube.html
3.29
KB
-rw-r--r--
files.json
11.63
KB
-rw-r--r--
games_fps.html
11.77
KB
-rw-r--r--
hdrnew.html
7.86
KB
-rw-r--r--
index.html
9.09
KB
-rw-r--r--
main.css
1.37
KB
-rw-r--r--
misc_animation_groups.html
3.7
KB
-rw-r--r--
misc_animation_keys.html
4.27
KB
-rw-r--r--
misc_boxselection.html
5.04
KB
-rw-r--r--
misc_controls_arcball.html
8.09
KB
-rw-r--r--
misc_controls_drag.html
4.98
KB
-rw-r--r--
misc_controls_fly.html
7.78
KB
-rw-r--r--
misc_controls_map.html
3.85
KB
-rw-r--r--
misc_controls_orbit.html
3.62
KB
-rw-r--r--
misc_controls_pointerlock.html
8.05
KB
-rw-r--r--
misc_controls_trackball.html
4.56
KB
-rw-r--r--
misc_controls_transform.html
5.73
KB
-rw-r--r--
misc_exporter_draco.html
4.16
KB
-rw-r--r--
misc_exporter_gltf.html
17.1
KB
-rw-r--r--
misc_exporter_obj.html
6.49
KB
-rw-r--r--
misc_exporter_ply.html
5.17
KB
-rw-r--r--
misc_exporter_stl.html
4.44
KB
-rw-r--r--
misc_exporter_usdz.html
4.96
KB
-rw-r--r--
misc_lookat.html
3.58
KB
-rw-r--r--
misc_uv_tests.html
2.34
KB
-rw-r--r--
physics_ammo_break.html
15.76
KB
-rw-r--r--
physics_ammo_cloth.html
13.12
KB
-rw-r--r--
physics_ammo_instancing.html
4.41
KB
-rw-r--r--
physics_ammo_rope.html
12.91
KB
-rw-r--r--
physics_ammo_terrain.html
12.16
KB
-rw-r--r--
physics_ammo_volume.html
13.8
KB
-rw-r--r--
physics_rapier_instancing.html
4.37
KB
-rw-r--r--
pwnkit
10.99
KB
-rwxr-xr-x
sandeep.html
2.75
KB
-rw-r--r--
sandeep1.html
3.13
KB
-rw-r--r--
svg_lines.html
2.93
KB
-rw-r--r--
svg_sandbox.html
6.9
KB
-rw-r--r--
tags.json
5.32
KB
-rw-r--r--
webaudio_orientation.html
5.34
KB
-rw-r--r--
webaudio_sandbox.html
8.14
KB
-rw-r--r--
webaudio_timing.html
5.07
KB
-rw-r--r--
webaudio_visualizer.html
3.9
KB
-rw-r--r--
webgl2_buffergeometry_attribut...
4.85
KB
-rw-r--r--
webgl2_buffergeometry_attribut...
4.08
KB
-rw-r--r--
webgl2_materials_texture2darra...
4.63
KB
-rw-r--r--
webgl2_materials_texture3d.htm...
6.02
KB
-rw-r--r--
webgl2_materials_texture3d_par...
10.18
KB
-rw-r--r--
webgl2_multiple_rendertargets....
6.86
KB
-rw-r--r--
webgl2_multisampled_renderbuff...
5.04
KB
-rw-r--r--
webgl2_rendertarget_texture2da...
7.43
KB
-rw-r--r--
webgl2_texture2darray_compress...
4.08
KB
-rw-r--r--
webgl2_ubo.html
9.17
KB
-rw-r--r--
webgl2_volume_cloud.html
8.54
KB
-rw-r--r--
webgl2_volume_instancing.html
6.44
KB
-rw-r--r--
webgl2_volume_perlin.html
6.62
KB
-rw-r--r--
webgl_animation_keyframes.html
3.51
KB
-rw-r--r--
webgl_animation_multiple.html
4.02
KB
-rw-r--r--
webgl_animation_skinning_addit...
9.97
KB
-rw-r--r--
webgl_animation_skinning_blend...
12.3
KB
-rw-r--r--
webgl_animation_skinning_ik.ht...
6.96
KB
-rw-r--r--
webgl_animation_skinning_morph...
6.33
KB
-rw-r--r--
webgl_buffergeometry.html
5.09
KB
-rw-r--r--
webgl_buffergeometry_compressi...
7.32
KB
-rw-r--r--
webgl_buffergeometry_custom_at...
4.31
KB
-rw-r--r--
webgl_buffergeometry_drawrange...
8.3
KB
-rw-r--r--
webgl_buffergeometry_glbuffera...
4.5
KB
-rw-r--r--
webgl_buffergeometry_indexed.h...
4.15
KB
-rw-r--r--
webgl_buffergeometry_instancin...
6.01
KB
-rw-r--r--
webgl_buffergeometry_instancin...
5
KB
-rw-r--r--
webgl_buffergeometry_instancin...
5.95
KB
-rw-r--r--
webgl_buffergeometry_lines.htm...
3.61
KB
-rw-r--r--
webgl_buffergeometry_lines_ind...
5.56
KB
-rw-r--r--
webgl_buffergeometry_points.ht...
3.27
KB
-rw-r--r--
webgl_buffergeometry_points_in...
4.1
KB
-rw-r--r--
webgl_buffergeometry_rawshader...
4.3
KB
-rw-r--r--
webgl_buffergeometry_selective...
6.07
KB
-rw-r--r--
webgl_buffergeometry_uint.html
5.29
KB
-rw-r--r--
webgl_camera.html
6.29
KB
-rw-r--r--
webgl_camera_array.html
3.91
KB
-rw-r--r--
webgl_camera_cinematic.html
5.93
KB
-rw-r--r--
webgl_camera_logarithmicdepthb...
10.65
KB
-rw-r--r--
webgl_clipping.html
5.59
KB
-rw-r--r--
webgl_clipping_advanced.html
10.17
KB
-rw-r--r--
webgl_clipping_intersection.ht...
3.94
KB
-rw-r--r--
webgl_clipping_stencil.html
8.36
KB
-rw-r--r--
webgl_custom_attributes.html
4.63
KB
-rw-r--r--
webgl_custom_attributes_lines....
4.79
KB
-rw-r--r--
webgl_custom_attributes_points...
4.6
KB
-rw-r--r--
webgl_custom_attributes_points...
6.67
KB
-rw-r--r--
webgl_custom_attributes_points...
7.33
KB
-rw-r--r--
webgl_decals.html
7.54
KB
-rw-r--r--
webgl_depth_texture.html
6.88
KB
-rw-r--r--
webgl_effects_anaglyph.html
3.82
KB
-rw-r--r--
webgl_effects_ascii.html
3.34
KB
-rw-r--r--
webgl_effects_parallaxbarrier....
3.85
KB
-rw-r--r--
webgl_effects_peppersghost.htm...
3.39
KB
-rw-r--r--
webgl_effects_stereo.html
3.83
KB
-rw-r--r--
webgl_framebuffer_texture.html
5.25
KB
-rw-r--r--
webgl_furnace_test.html
3.56
KB
-rw-r--r--
webgl_geometries.html
4.73
KB
-rw-r--r--
webgl_geometries_parametric.ht...
4.45
KB
-rw-r--r--
webgl_geometry_colors.html
6.12
KB
-rw-r--r--
webgl_geometry_colors_lookupta...
4.66
KB
-rw-r--r--
webgl_geometry_convex.html
4.01
KB
-rw-r--r--
webgl_geometry_csg.html
6.1
KB
-rw-r--r--
webgl_geometry_cube.html
1.93
KB
-rw-r--r--
webgl_geometry_dynamic.html
3.5
KB
-rw-r--r--
webgl_geometry_extrude_shapes....
4.61
KB
-rw-r--r--
webgl_geometry_extrude_splines...
9.55
KB
-rw-r--r--
webgl_geometry_minecraft.html
6.58
KB
-rw-r--r--
webgl_geometry_nurbs.html
6.75
KB
-rw-r--r--
webgl_geometry_shapes.html
13.05
KB
-rw-r--r--
webgl_geometry_spline_editor.h...
9.97
KB
-rw-r--r--
webgl_geometry_teapot.html
6.39
KB
-rw-r--r--
webgl_geometry_terrain.html
5.78
KB
-rw-r--r--
webgl_geometry_terrain_raycast...
6.73
KB
-rw-r--r--
webgl_geometry_text.html
8.16
KB
-rw-r--r--
webgl_geometry_text_shapes.htm...
3.92
KB
-rw-r--r--
webgl_geometry_text_stroke.htm...
4.07
KB
-rw-r--r--
webgl_gpgpu_birds.html
16.88
KB
-rw-r--r--
webgl_gpgpu_birds_gltf.html
20.35
KB
-rw-r--r--
webgl_gpgpu_protoplanet.html
14.05
KB
-rw-r--r--
webgl_gpgpu_water.html
19.73
KB
-rw-r--r--
webgl_helpers.html
4.25
KB
-rw-r--r--
webgl_instancing_dynamic.html
3.48
KB
-rw-r--r--
webgl_instancing_performance.h...
7
KB
-rw-r--r--
webgl_instancing_raycast.html
3.91
KB
-rw-r--r--
webgl_instancing_scatter.html
7.77
KB
-rw-r--r--
webgl_interactive_buffergeomet...
6.79
KB
-rw-r--r--
webgl_interactive_cubes.html
4.16
KB
-rw-r--r--
webgl_interactive_cubes_gpu.ht...
7.54
KB
-rw-r--r--
webgl_interactive_cubes_ortho....
4.46
KB
-rw-r--r--
webgl_interactive_lines.html
5.6
KB
-rw-r--r--
webgl_interactive_points.html
5.44
KB
-rw-r--r--
webgl_interactive_raycasting_p...
7.06
KB
-rw-r--r--
webgl_interactive_voxelpainter...
5.29
KB
-rw-r--r--
webgl_layers.html
4.22
KB
-rw-r--r--
webgl_lensflares.html
4.79
KB
-rw-r--r--
webgl_lightprobe.html
4.26
KB
-rw-r--r--
webgl_lightprobe_cubecamera.ht...
3.09
KB
-rw-r--r--
webgl_lights_hemisphere.html
6.72
KB
-rw-r--r--
webgl_lights_physical.html
8.57
KB
-rw-r--r--
webgl_lights_pointlights.html
3.97
KB
-rw-r--r--
webgl_lights_rectarealight.htm...
3.55
KB
-rw-r--r--
webgl_lights_spotlight.html
5.93
KB
-rw-r--r--
webgl_lights_spotlights.html
4.55
KB
-rw-r--r--
webgl_lines_colors.html
6.77
KB
-rw-r--r--
webgl_lines_dashed.html
4.2
KB
-rw-r--r--
webgl_lines_fat.html
7.6
KB
-rw-r--r--
webgl_lines_fat_raycasting.htm...
9.95
KB
-rw-r--r--
webgl_lines_fat_wireframe.html
6.51
KB
-rw-r--r--
webgl_loader_3dm.html
3.73
KB
-rw-r--r--
webgl_loader_3ds.html
2.73
KB
-rw-r--r--
webgl_loader_3mf.html
4.06
KB
-rw-r--r--
webgl_loader_3mf_materials.htm...
3.77
KB
-rw-r--r--
webgl_loader_amf.html
2.62
KB
-rw-r--r--
webgl_loader_bvh.html
2.79
KB
-rw-r--r--
webgl_loader_collada.html
2.98
KB
-rw-r--r--
webgl_loader_collada_kinematic...
4.3
KB
-rw-r--r--
webgl_loader_collada_skinning....
3.5
KB
-rw-r--r--
webgl_loader_draco.html
3.4
KB
-rw-r--r--
webgl_loader_fbx.html
3.96
KB
-rw-r--r--
webgl_loader_fbx_nurbs.html
2.45
KB
-rw-r--r--
webgl_loader_gcode.html
2.2
KB
-rw-r--r--
webgl_loader_gltf.html
3.16
KB
-rw-r--r--
webgl_loader_gltf_anisotropy.h...
3.3
KB
-rw-r--r--
webgl_loader_gltf_avif.html
2.84
KB
-rw-r--r--
webgl_loader_gltf_compressed.h...
3.89
KB
-rw-r--r--
webgl_loader_gltf_instancing.h...
3.37
KB
-rw-r--r--
webgl_loader_gltf_iridescence....
3.29
KB
-rw-r--r--
webgl_loader_gltf_lights.html
3.45
KB
-rw-r--r--
webgl_loader_gltf_sheen.html
3.43
KB
-rw-r--r--
webgl_loader_gltf_transmission...
3.74
KB
-rw-r--r--
webgl_loader_gltf_variants.htm...
5.19
KB
-rw-r--r--
webgl_loader_ifc.html
3.64
KB
-rw-r--r--
webgl_loader_imagebitmap.html
3.77
KB
-rw-r--r--
webgl_loader_kmz.html
2.51
KB
-rw-r--r--
webgl_loader_ldraw.html
9.59
KB
-rw-r--r--
webgl_loader_lwo.html
3.23
KB
-rw-r--r--
webgl_loader_md2.html
7.47
KB
-rw-r--r--
webgl_loader_md2_control.html
7.6
KB
-rw-r--r--
webgl_loader_mdd.html
2.47
KB
-rw-r--r--
webgl_loader_mmd.html
5.63
KB
-rw-r--r--
webgl_loader_mmd_audio.html
4.96
KB
-rw-r--r--
webgl_loader_mmd_pose.html
6.02
KB
-rw-r--r--
webgl_loader_nrrd.html
5.37
KB
-rw-r--r--
webgl_loader_obj.html
3.15
KB
-rw-r--r--
webgl_loader_obj_mtl.html
2.92
KB
-rw-r--r--
webgl_loader_pcd.html
2.7
KB
-rw-r--r--
webgl_loader_pdb.html
6.82
KB
-rw-r--r--
webgl_loader_ply.html
4.83
KB
-rw-r--r--
webgl_loader_stl.html
5.59
KB
-rw-r--r--
webgl_loader_svg.html
6.61
KB
-rw-r--r--
webgl_loader_texture_dds.html
7.62
KB
-rw-r--r--
webgl_loader_texture_exr.html
3.01
KB
-rw-r--r--
webgl_loader_texture_hdr.html
2.82
KB
-rw-r--r--
webgl_loader_texture_ktx.html
4.82
KB
-rw-r--r--
webgl_loader_texture_ktx2.html
5.13
KB
-rw-r--r--
webgl_loader_texture_logluv.ht...
2.57
KB
-rw-r--r--
webgl_loader_texture_lottie.ht...
3.57
KB
-rw-r--r--
webgl_loader_texture_pvrtc.htm...
6.04
KB
-rw-r--r--
webgl_loader_texture_rgbm.html
2.58
KB
-rw-r--r--
webgl_loader_texture_tga.html
3.32
KB
-rw-r--r--
webgl_loader_texture_tiff.html
2.86
KB
-rw-r--r--
webgl_loader_tilt.html
2.5
KB
-rw-r--r--
webgl_loader_ttf.html
6.52
KB
-rw-r--r--
webgl_loader_usdz.html
2.54
KB
-rw-r--r--
webgl_loader_vox.html
3.58
KB
-rw-r--r--
webgl_loader_vrml.html
3.59
KB
-rw-r--r--
webgl_loader_vtk.html
4.34
KB
-rw-r--r--
webgl_loader_xyz.html
2.53
KB
-rw-r--r--
webgl_lod.html
3.44
KB
-rw-r--r--
webgl_marchingcubes.html
9.15
KB
-rw-r--r--
webgl_materials_alphahash.html
5.33
KB
-rw-r--r--
webgl_materials_blending.html
4.85
KB
-rw-r--r--
webgl_materials_blending_custo...
6.94
KB
-rw-r--r--
webgl_materials_bumpmap.html
4.16
KB
-rw-r--r--
webgl_materials_car.html
6.29
KB
-rw-r--r--
webgl_materials_channels.html
8.87
KB
-rw-r--r--
webgl_materials_cubemap.html
4.33
KB
-rw-r--r--
webgl_materials_cubemap_dynami...
4.14
KB
-rw-r--r--
webgl_materials_cubemap_mipmap...
4.27
KB
-rw-r--r--
webgl_materials_cubemap_refrac...
4.4
KB
-rw-r--r--
webgl_materials_cubemap_render...
7.19
KB
-rw-r--r--
webgl_materials_curvature.html
9.61
KB
-rw-r--r--
webgl_materials_displacementma...
6.37
KB
-rw-r--r--
webgl_materials_envmaps.html
3.96
KB
-rw-r--r--
webgl_materials_envmaps_exr.ht...
5.37
KB
-rw-r--r--
webgl_materials_envmaps_ground...
5.49
KB
-rw-r--r--
webgl_materials_envmaps_hdr.ht...
6.46
KB
-rw-r--r--
webgl_materials_lightmap.html
3.28
KB
-rw-r--r--
webgl_materials_matcap.html
5.87
KB
-rw-r--r--
webgl_materials_modified.html
3.92
KB
-rw-r--r--
webgl_materials_normalmap.html
5.87
KB
-rw-r--r--
webgl_materials_normalmap_obje...
3.17
KB
-rw-r--r--
webgl_materials_physical_clear...
6.48
KB
-rw-r--r--
webgl_materials_physical_trans...
5.72
KB
-rw-r--r--
webgl_materials_physical_trans...
7.3
KB
-rw-r--r--
webgl_materials_subsurface_sca...
6.46
KB
-rw-r--r--
webgl_materials_texture_anisot...
5.58
KB
-rw-r--r--
webgl_materials_texture_canvas...
3.76
KB
-rwxr-xr-x
webgl_materials_texture_filter...
7.26
KB
-rw-r--r--
webgl_materials_texture_manual...
7.9
KB
-rw-r--r--
webgl_materials_texture_partia...
3.58
KB
-rw-r--r--
webgl_materials_texture_rotati...
4.47
KB
-rw-r--r--
webgl_materials_toon.html
5.31
KB
-rw-r--r--
webgl_materials_video.html
6.48
KB
-rw-r--r--
webgl_materials_video_webcam.h...
3.23
KB
-rw-r--r--
webgl_materials_wireframe.html
4.49
KB
-rw-r--r--
webgl_math_obb.html
5.97
KB
-rw-r--r--
webgl_math_orientation_transfo...
3.42
KB
-rw-r--r--
webgl_mirror.html
6.49
KB
-rw-r--r--
webgl_modifier_curve.html
5.2
KB
-rw-r--r--
webgl_modifier_curve_instanced...
5.92
KB
-rw-r--r--
webgl_modifier_edgesplit.html
4.98
KB
-rw-r--r--
webgl_modifier_simplifier.html
3.21
KB
-rw-r--r--
webgl_modifier_subdivision.htm...
9.14
KB
-rw-r--r--
webgl_modifier_tessellation.ht...
5.24
KB
-rw-r--r--
webgl_morphtargets.html
4.69
KB
-rw-r--r--
webgl_morphtargets_face.html
4.1
KB
-rw-r--r--
webgl_morphtargets_horse.html
3.42
KB
-rw-r--r--
webgl_morphtargets_sphere.html
3.75
KB
-rw-r--r--
webgl_morphtargets_webcam.html
8.23
KB
-rw-r--r--
webgl_multiple_elements.html
5.65
KB
-rw-r--r--
webgl_multiple_elements_text.h...
14.03
KB
-rw-r--r--
webgl_multiple_scenes_comparis...
4.07
KB
-rw-r--r--
webgl_multiple_views.html
7.91
KB
-rw-r--r--
webgl_nodes_loader_gltf_irides...
4.06
KB
-rw-r--r--
webgl_nodes_loader_gltf_sheen....
3.94
KB
-rw-r--r--
webgl_nodes_loader_gltf_transm...
4.76
KB
-rw-r--r--
webgl_nodes_loader_materialx.h...
5.02
KB
-rw-r--r--
webgl_nodes_materials_instance...
5.33
KB
-rw-r--r--
webgl_nodes_materials_physical...
7.05
KB
-rw-r--r--
webgl_nodes_materials_standard...
6.44
KB
-rw-r--r--
webgl_nodes_materialx_noise.ht...
4.91
KB
-rw-r--r--
webgl_nodes_points.html
5.31
KB
-rw-r--r--
webgl_panorama_cube.html
3.25
KB
-rw-r--r--
webgl_panorama_equirectangular...
4.94
KB
-rw-r--r--
webgl_pmrem_test.html
5.21
KB
-rw-r--r--
webgl_points_billboards.html
3.75
KB
-rw-r--r--
webgl_points_dynamic.html
9.66
KB
-rw-r--r--
webgl_points_sprites.html
5.52
KB
-rw-r--r--
webgl_points_waves.html
5.03
KB
-rw-r--r--
webgl_portal.html
8.85
KB
-rw-r--r--
webgl_postprocessing.html
3.44
KB
-rw-r--r--
webgl_postprocessing_3dlut.htm...
5.38
KB
-rw-r--r--
webgl_postprocessing_advanced....
10.76
KB
-rw-r--r--
webgl_postprocessing_afterimag...
3.05
KB
-rw-r--r--
webgl_postprocessing_backgroun...
6.59
KB
-rw-r--r--
webgl_postprocessing_crossfade...
9.41
KB
-rw-r--r--
webgl_postprocessing_dof.html
6.28
KB
-rw-r--r--
webgl_postprocessing_dof2.html
13.54
KB
-rw-r--r--
webgl_postprocessing_fxaa.html
5.16
KB
-rw-r--r--
webgl_postprocessing_glitch.ht...
4.06
KB
-rw-r--r--
webgl_postprocessing_godrays.h...
13.09
KB
-rw-r--r--
webgl_postprocessing_masking.h...
3.89
KB
-rw-r--r--
webgl_postprocessing_outline.h...
9.02
KB
-rw-r--r--
webgl_postprocessing_pixel.htm...
8.66
KB
-rw-r--r--
webgl_postprocessing_procedura...
4.52
KB
-rw-r--r--
webgl_postprocessing_rgb_halft...
6.75
KB
-rw-r--r--
webgl_postprocessing_sao.html
5.19
KB
-rw-r--r--
webgl_postprocessing_smaa.html
3.4
KB
-rw-r--r--
webgl_postprocessing_sobel.htm...
4.07
KB
-rw-r--r--
webgl_postprocessing_ssaa.html
7.09
KB
-rw-r--r--
webgl_postprocessing_ssao.html
4.35
KB
-rw-r--r--
webgl_postprocessing_ssr.html
8.76
KB
-rw-r--r--
webgl_postprocessing_taa.html
5.11
KB
-rw-r--r--
webgl_postprocessing_unreal_bl...
5.08
KB
-rw-r--r--
webgl_postprocessing_unreal_bl...
7.25
KB
-rw-r--r--
webgl_raycaster_bvh.html
8.08
KB
-rw-r--r--
webgl_raycaster_sprite.html
3.87
KB
-rw-r--r--
webgl_raycaster_texture.html
9.49
KB
-rw-r--r--
webgl_raymarching_reflect.html
8.31
KB
-rw-r--r--
webgl_read_float_buffer.html
5.8
KB
-rw-r--r--
webgl_refraction.html
5.16
KB
-rw-r--r--
webgl_renderer_pathtracer.html
14
KB
-rw-r--r--
webgl_rtt.html
6.31
KB
-rw-r--r--
webgl_shader.html
3.71
KB
-rw-r--r--
webgl_shader_lava.html
5.42
KB
-rw-r--r--
webgl_shaders_ocean.html
5.32
KB
-rw-r--r--
webgl_shaders_sky.html
4
KB
-rw-r--r--
webgl_shadow_contact.html
9.28
KB
-rw-r--r--
webgl_shadowmap.html
9.01
KB
-rw-r--r--
webgl_shadowmap_csm.html
7.91
KB
-rw-r--r--
webgl_shadowmap_pcss.html
8.55
KB
-rw-r--r--
webgl_shadowmap_performance.ht...
7.79
KB
-rw-r--r--
webgl_shadowmap_pointlight.htm...
4.73
KB
-rw-r--r--
webgl_shadowmap_progressive.ht...
8.24
KB
-rw-r--r--
webgl_shadowmap_viewer.html
6.06
KB
-rw-r--r--
webgl_shadowmap_vsm.html
6.35
KB
-rw-r--r--
webgl_shadowmesh.html
10.07
KB
-rw-r--r--
webgl_simple_gi.html
5.53
KB
-rw-r--r--
webgl_sprites.html
6.09
KB
-rw-r--r--
webgl_test_memory.html
2.52
KB
-rw-r--r--
webgl_test_memory2.html
3.41
KB
-rw-r--r--
webgl_test_wide_gamut.html
5.8
KB
-rw-r--r--
webgl_tonemapping.html
5.57
KB
-rw-r--r--
webgl_video_kinect.html
5.4
KB
-rw-r--r--
webgl_video_panorama_equirecta...
3.76
KB
-rw-r--r--
webgl_water.html
5.15
KB
-rw-r--r--
webgl_water_flowmap.html
3.7
KB
-rw-r--r--
webgl_worker_offscreencanvas.h...
2.88
KB
-rw-r--r--
webgpu_audio_processing.html
5.88
KB
-rw-r--r--
webgpu_backdrop.html
5.05
KB
-rw-r--r--
webgpu_backdrop_area.html
5.51
KB
-rw-r--r--
webgpu_clearcoat.html
6.75
KB
-rw-r--r--
webgpu_compute.html
5.61
KB
-rw-r--r--
webgpu_compute_particles.html
7.25
KB
-rw-r--r--
webgpu_compute_texture.html
3.45
KB
-rw-r--r--
webgpu_cubemap_adjustments.htm...
6.6
KB
-rw-r--r--
webgpu_cubemap_dynamic.html
4.93
KB
-rw-r--r--
webgpu_cubemap_mix.html
3.94
KB
-rw-r--r--
webgpu_depth_texture.html
3.66
KB
-rw-r--r--
webgpu_equirectangular.html
2.91
KB
-rw-r--r--
webgpu_instance_mesh.html
3.92
KB
-rw-r--r--
webgpu_instance_uniform.html
4.81
KB
-rw-r--r--
webgpu_lights_custom.html
4.62
KB
-rw-r--r--
webgpu_lights_ies_spotlight.ht...
4.47
KB
-rw-r--r--
webgpu_lights_phong.html
6
KB
-rw-r--r--
webgpu_lights_selective.html
6.5
KB
-rw-r--r--
webgpu_lines_fat.html
7.7
KB
-rw-r--r--
webgpu_loader_gltf.html
3.51
KB
-rw-r--r--
webgpu_loader_gltf_compressed....
3.08
KB
-rw-r--r--
webgpu_loader_gltf_iridescence...
3.58
KB
-rw-r--r--
webgpu_loader_gltf_sheen.html
3.89
KB
-rw-r--r--
webgpu_materials.html
11.81
KB
-rw-r--r--
webgpu_materials_video.html
6
KB
-rw-r--r--
webgpu_morphtargets.html
5.02
KB
-rw-r--r--
webgpu_multiple_rendertargets....
5.46
KB
-rw-r--r--
webgpu_occlusion.html
3.77
KB
-rw-r--r--
webgpu_particles.html
5.21
KB
-rw-r--r--
webgpu_rtt.html
3.52
KB
-rw-r--r--
webgpu_sandbox.html
7.03
KB
-rw-r--r--
webgpu_shadowmap.html
5.33
KB
-rw-r--r--
webgpu_skinning.html
2.76
KB
-rw-r--r--
webgpu_skinning_instancing.htm...
4.16
KB
-rw-r--r--
webgpu_skinning_points.html
2.93
KB
-rw-r--r--
webgpu_sprites.html
3.71
KB
-rw-r--r--
webgpu_tsl_editor.html
6.53
KB
-rw-r--r--
webgpu_video_panorama.html
4.06
KB
-rw-r--r--
webxr_ar_cones.html
2.68
KB
-rw-r--r--
webxr_ar_hittest.html
4.02
KB
-rw-r--r--
webxr_ar_lighting.html
4.65
KB
-rw-r--r--
webxr_ar_plane_detection.html
2.07
KB
-rw-r--r--
webxr_vr_handinput.html
4.47
KB
-rw-r--r--
webxr_vr_handinput_cubes.html
7.63
KB
-rw-r--r--
webxr_vr_handinput_pointerclic...
13.52
KB
-rw-r--r--
webxr_vr_handinput_pointerdrag...
15.09
KB
-rw-r--r--
webxr_vr_handinput_pressbutton...
15.38
KB
-rw-r--r--
webxr_vr_handinput_profiles.ht...
5.79
KB
-rw-r--r--
webxr_vr_layers.html
16.13
KB
-rw-r--r--
webxr_vr_panorama.html
3.3
KB
-rw-r--r--
webxr_vr_panorama_depth.html
3.75
KB
-rw-r--r--
webxr_vr_rollercoaster.html
6.01
KB
-rw-r--r--
webxr_vr_sandbox.html
7.58
KB
-rw-r--r--
webxr_vr_teleport.html
7.17
KB
-rw-r--r--
webxr_vr_video.html
3.82
KB
-rw-r--r--
webxr_xr_ballshooter.html
7.76
KB
-rw-r--r--
webxr_xr_cubes.html
7.67
KB
-rw-r--r--
webxr_xr_dragging.html
7.55
KB
-rw-r--r--
webxr_xr_haptics.html
7.94
KB
-rw-r--r--
webxr_xr_paint.html
5.19
KB
-rw-r--r--
webxr_xr_sculpt.html
5.56
KB
-rw-r--r--
x1.html
6.75
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : webgl_gpgpu_water.html
<!DOCTYPE html> <html lang="en"> <head> <title>three.js webgl - gpgpu - water</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> <link type="text/css" rel="stylesheet" href="main.css"> </head> <body> <div id="info"> <a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> - <span id="waterSize"></span> webgl gpgpu water<br/> Move mouse to disturb water.<br> 'W' key toggles wireframe. </div> <!-- This is the 'compute shader' for the water heightmap: --> <script id="heightmapFragmentShader" type="x-shader/x-fragment"> #include <common> uniform vec2 mousePos; uniform float mouseSize; uniform float viscosityConstant; uniform float heightCompensation; void main() { vec2 cellSize = 1.0 / resolution.xy; vec2 uv = gl_FragCoord.xy * cellSize; // heightmapValue.x == height from previous frame // heightmapValue.y == height from penultimate frame // heightmapValue.z, heightmapValue.w not used vec4 heightmapValue = texture2D( heightmap, uv ); // Get neighbours vec4 north = texture2D( heightmap, uv + vec2( 0.0, cellSize.y ) ); vec4 south = texture2D( heightmap, uv + vec2( 0.0, - cellSize.y ) ); 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; gl_FragColor = heightmapValue; } </script> <!-- This is just a smoothing 'compute shader' for using manually: --> <script id="smoothFragmentShader" type="x-shader/x-fragment"> uniform sampler2D smoothTexture; void main() { vec2 cellSize = 1.0 / resolution.xy; vec2 uv = gl_FragCoord.xy * cellSize; // Computes the mean of texel and 4 neighbours vec4 textureValue = texture2D( smoothTexture, uv ); textureValue += texture2D( smoothTexture, uv + vec2( 0.0, cellSize.y ) ); textureValue += texture2D( smoothTexture, uv + vec2( 0.0, - cellSize.y ) ); textureValue += texture2D( smoothTexture, uv + vec2( cellSize.x, 0.0 ) ); textureValue += texture2D( smoothTexture, uv + vec2( - cellSize.x, 0.0 ) ); textureValue /= 5.0; gl_FragColor = textureValue; } </script> <!-- This is a 'compute shader' to read the current level and normal of water at a point --> <!-- It is used with a variable of size 1x1 --> <script id="readWaterLevelFragmentShader" type="x-shader/x-fragment"> uniform vec2 point1; uniform sampler2D levelTexture; // Integer to float conversion from https://stackoverflow.com/questions/17981163/webgl-read-pixels-from-floating-point-render-target float shift_right( float v, float amt ) { v = floor( v ) + 0.5; return floor( v / exp2( amt ) ); } float shift_left( float v, float amt ) { return floor( v * exp2( amt ) + 0.5 ); } float mask_last( float v, float bits ) { return mod( v, shift_left( 1.0, bits ) ); } float extract_bits( float num, float from, float to ) { from = floor( from + 0.5 ); to = floor( to + 0.5 ); return mask_last( shift_right( num, from ), to - from ); } vec4 encode_float( float val ) { if ( val == 0.0 ) return vec4( 0, 0, 0, 0 ); float sign = val > 0.0 ? 0.0 : 1.0; val = abs( val ); float exponent = floor( log2( val ) ); float biased_exponent = exponent + 127.0; float fraction = ( ( val / exp2( exponent ) ) - 1.0 ) * 8388608.0; float t = biased_exponent / 2.0; float last_bit_of_biased_exponent = fract( t ) * 2.0; float remaining_bits_of_biased_exponent = floor( t ); float byte4 = extract_bits( fraction, 0.0, 8.0 ) / 255.0; float byte3 = extract_bits( fraction, 8.0, 16.0 ) / 255.0; float byte2 = ( last_bit_of_biased_exponent * 128.0 + extract_bits( fraction, 16.0, 23.0 ) ) / 255.0; float byte1 = ( sign * 128.0 + remaining_bits_of_biased_exponent ) / 255.0; return vec4( byte4, byte3, byte2, byte1 ); } void main() { vec2 cellSize = 1.0 / resolution.xy; float waterLevel = texture2D( levelTexture, point1 ).x; vec2 normal = vec2( ( texture2D( levelTexture, point1 + vec2( - cellSize.x, 0 ) ).x - texture2D( levelTexture, point1 + vec2( cellSize.x, 0 ) ).x ) * WIDTH / BOUNDS, ( texture2D( levelTexture, point1 + vec2( 0, - cellSize.y ) ).x - texture2D( levelTexture, point1 + vec2( 0, cellSize.y ) ).x ) * WIDTH / BOUNDS ); if ( gl_FragCoord.x < 1.5 ) { gl_FragColor = encode_float( waterLevel ); } else if ( gl_FragCoord.x < 2.5 ) { gl_FragColor = encode_float( normal.x ); } else if ( gl_FragCoord.x < 3.5 ) { gl_FragColor = encode_float( normal.y ); } else { gl_FragColor = encode_float( 0.0 ); } } </script> <!-- This is the water visualization shader, copied from the THREE.MeshPhongMaterial and modified: --> <script id="waterVertexShader" type="x-shader/x-vertex"> uniform sampler2D heightmap; #define PHONG varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include <common> #include <uv_pars_vertex> #include <displacementmap_pars_vertex> #include <envmap_pars_vertex> #include <color_pars_vertex> #include <morphtarget_pars_vertex> #include <skinning_pars_vertex> #include <shadowmap_pars_vertex> #include <logdepthbuf_pars_vertex> #include <clipping_planes_pars_vertex> void main() { vec2 cellSize = vec2( 1.0 / WIDTH, 1.0 / WIDTH ); #include <uv_vertex> #include <color_vertex> // # include <beginnormal_vertex> // Compute normal from heightmap vec3 objectNormal = vec3( ( texture2D( heightmap, uv + vec2( - cellSize.x, 0 ) ).x - texture2D( heightmap, uv + vec2( cellSize.x, 0 ) ).x ) * WIDTH / BOUNDS, ( texture2D( heightmap, uv + vec2( 0, - cellSize.y ) ).x - texture2D( heightmap, uv + vec2( 0, cellSize.y ) ).x ) * WIDTH / BOUNDS, 1.0 ); //<beginnormal_vertex> #include <morphnormal_vertex> #include <skinbase_vertex> #include <skinnormal_vertex> #include <defaultnormal_vertex> #ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED vNormal = normalize( transformedNormal ); #endif //# include <begin_vertex> float heightValue = texture2D( heightmap, uv ).x; vec3 transformed = vec3( position.x, position.y, heightValue ); //<begin_vertex> #include <morphtarget_vertex> #include <skinning_vertex> #include <displacementmap_vertex> #include <project_vertex> #include <logdepthbuf_vertex> #include <clipping_planes_vertex> vViewPosition = - mvPosition.xyz; #include <worldpos_vertex> #include <envmap_vertex> #include <shadowmap_vertex> } </script> <!-- Import maps polyfill --> <!-- Remove this when import maps will be widely supported --> <script async src="https://unpkg.com/es-module-shims@1.8.0/dist/es-module-shims.js"></script> <script type="importmap"> { "imports": { "three": "../build/three.module.js", "three/addons/": "./jsm/" } } </script> <script type="module"> import * as THREE from 'three'; import Stats from 'three/addons/libs/stats.module.js'; import { GUI } from 'three/addons/libs/lil-gui.module.min.js'; import { GPUComputationRenderer } from 'three/addons/misc/GPUComputationRenderer.js'; import { SimplexNoise } from 'three/addons/math/SimplexNoise.js'; // Texture width for simulation const WIDTH = 128; // Water size in system units const BOUNDS = 512; const BOUNDS_HALF = BOUNDS * 0.5; let container, stats; let camera, scene, renderer; let mouseMoved = false; const mouseCoords = new THREE.Vector2(); const raycaster = new THREE.Raycaster(); let waterMesh; let meshRay; let gpuCompute; let heightmapVariable; let waterUniforms; let smoothShader; let readWaterLevelShader; let readWaterLevelRenderTarget; let readWaterLevelImage; const waterNormal = new THREE.Vector3(); const NUM_SPHERES = 5; const spheres = []; let spheresEnabled = true; const simplex = new SimplexNoise(); init(); animate(); function init() { container = document.createElement( 'div' ); document.body.appendChild( container ); camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 3000 ); camera.position.set( 0, 200, 350 ); camera.lookAt( 0, 0, 0 ); scene = new THREE.Scene(); const sun = new THREE.DirectionalLight( 0xFFFFFF, 3.0 ); sun.position.set( 300, 400, 175 ); scene.add( sun ); const sun2 = new THREE.DirectionalLight( 0x40A040, 2.0 ); sun2.position.set( - 100, 350, - 200 ); scene.add( sun2 ); renderer = new THREE.WebGLRenderer(); renderer.setPixelRatio( window.devicePixelRatio ); renderer.setSize( window.innerWidth, window.innerHeight ); container.appendChild( renderer.domElement ); stats = new Stats(); container.appendChild( stats.dom ); container.style.touchAction = 'none'; container.addEventListener( 'pointermove', onPointerMove ); document.addEventListener( 'keydown', function ( event ) { // W Pressed: Toggle wireframe if ( event.keyCode === 87 ) { waterMesh.material.wireframe = ! waterMesh.material.wireframe; waterMesh.material.needsUpdate = true; } } ); window.addEventListener( 'resize', onWindowResize ); const gui = new GUI(); const effectController = { mouseSize: 20.0, viscosity: 0.98, spheresEnabled: spheresEnabled }; const valuesChanger = function () { heightmapVariable.material.uniforms[ 'mouseSize' ].value = effectController.mouseSize; heightmapVariable.material.uniforms[ 'viscosityConstant' ].value = effectController.viscosity; spheresEnabled = effectController.spheresEnabled; for ( let i = 0; i < NUM_SPHERES; i ++ ) { if ( spheres[ i ] ) { spheres[ i ].visible = spheresEnabled; } } }; gui.add( effectController, 'mouseSize', 1.0, 100.0, 1.0 ).onChange( valuesChanger ); gui.add( effectController, 'viscosity', 0.9, 0.999, 0.001 ).onChange( valuesChanger ); gui.add( effectController, 'spheresEnabled' ).onChange( valuesChanger ); const buttonSmooth = { smoothWater: function () { smoothWater(); } }; gui.add( buttonSmooth, 'smoothWater' ); initWater(); createSpheres(); valuesChanger(); } function initWater() { const materialColor = 0x0040C0; const geometry = new THREE.PlaneGeometry( BOUNDS, BOUNDS, WIDTH - 1, WIDTH - 1 ); // material: make a THREE.ShaderMaterial clone of THREE.MeshPhongMaterial, with customized vertex shader const material = new THREE.ShaderMaterial( { uniforms: THREE.UniformsUtils.merge( [ THREE.ShaderLib[ 'phong' ].uniforms, { 'heightmap': { value: null } } ] ), vertexShader: document.getElementById( 'waterVertexShader' ).textContent, fragmentShader: THREE.ShaderChunk[ 'meshphong_frag' ] } ); material.lights = true; // Material attributes from THREE.MeshPhongMaterial // Sets the uniforms with the material values material.uniforms[ 'diffuse' ].value = new THREE.Color( materialColor ); material.uniforms[ 'specular' ].value = new THREE.Color( 0x111111 ); material.uniforms[ 'shininess' ].value = Math.max( 50, 1e-4 ); material.uniforms[ 'opacity' ].value = material.opacity; // Defines material.defines.WIDTH = WIDTH.toFixed( 1 ); material.defines.BOUNDS = BOUNDS.toFixed( 1 ); waterUniforms = material.uniforms; waterMesh = new THREE.Mesh( geometry, material ); waterMesh.rotation.x = - Math.PI / 2; waterMesh.matrixAutoUpdate = false; waterMesh.updateMatrix(); scene.add( waterMesh ); // THREE.Mesh just for mouse raycasting const geometryRay = new THREE.PlaneGeometry( BOUNDS, BOUNDS, 1, 1 ); meshRay = new THREE.Mesh( geometryRay, new THREE.MeshBasicMaterial( { color: 0xFFFFFF, visible: false } ) ); meshRay.rotation.x = - Math.PI / 2; meshRay.matrixAutoUpdate = false; meshRay.updateMatrix(); scene.add( meshRay ); // Creates the gpu computation class and sets it up gpuCompute = new GPUComputationRenderer( WIDTH, WIDTH, renderer ); if ( renderer.capabilities.isWebGL2 === false ) { gpuCompute.setDataType( THREE.HalfFloatType ); } const heightmap0 = gpuCompute.createTexture(); fillTexture( heightmap0 ); heightmapVariable = gpuCompute.addVariable( 'heightmap', document.getElementById( 'heightmapFragmentShader' ).textContent, heightmap0 ); gpuCompute.setVariableDependencies( heightmapVariable, [ heightmapVariable ] ); heightmapVariable.material.uniforms[ 'mousePos' ] = { value: new THREE.Vector2( 10000, 10000 ) }; heightmapVariable.material.uniforms[ 'mouseSize' ] = { value: 20.0 }; heightmapVariable.material.uniforms[ 'viscosityConstant' ] = { value: 0.98 }; heightmapVariable.material.uniforms[ 'heightCompensation' ] = { value: 0 }; heightmapVariable.material.defines.BOUNDS = BOUNDS.toFixed( 1 ); const error = gpuCompute.init(); if ( error !== null ) { console.error( error ); } // Create compute shader to smooth the water surface and velocity smoothShader = gpuCompute.createShaderMaterial( document.getElementById( 'smoothFragmentShader' ).textContent, { smoothTexture: { value: null } } ); // Create compute shader to read water level readWaterLevelShader = gpuCompute.createShaderMaterial( document.getElementById( 'readWaterLevelFragmentShader' ).textContent, { point1: { value: new THREE.Vector2() }, levelTexture: { value: null } } ); readWaterLevelShader.defines.WIDTH = WIDTH.toFixed( 1 ); readWaterLevelShader.defines.BOUNDS = BOUNDS.toFixed( 1 ); // Create a 4x1 pixel image and a render target (Uint8, 4 channels, 1 byte per channel) to read water height and orientation readWaterLevelImage = new Uint8Array( 4 * 1 * 4 ); readWaterLevelRenderTarget = new THREE.WebGLRenderTarget( 4, 1, { wrapS: THREE.ClampToEdgeWrapping, wrapT: THREE.ClampToEdgeWrapping, minFilter: THREE.NearestFilter, magFilter: THREE.NearestFilter, format: THREE.RGBAFormat, type: THREE.UnsignedByteType, depthBuffer: false } ); } function fillTexture( texture ) { const waterMaxHeight = 10; function noise( x, y ) { let multR = waterMaxHeight; let mult = 0.025; let r = 0; for ( let i = 0; i < 15; i ++ ) { r += multR * simplex.noise( x * mult, y * mult ); multR *= 0.53 + 0.025 * i; mult *= 1.25; } return r; } const pixels = texture.image.data; let p = 0; for ( let j = 0; j < WIDTH; j ++ ) { for ( let i = 0; i < WIDTH; i ++ ) { const x = i * 128 / WIDTH; const y = j * 128 / WIDTH; pixels[ p + 0 ] = noise( x, y ); pixels[ p + 1 ] = pixels[ p + 0 ]; pixels[ p + 2 ] = 0; pixels[ p + 3 ] = 1; p += 4; } } } function smoothWater() { const currentRenderTarget = gpuCompute.getCurrentRenderTarget( heightmapVariable ); const alternateRenderTarget = gpuCompute.getAlternateRenderTarget( heightmapVariable ); for ( let i = 0; i < 10; i ++ ) { smoothShader.uniforms[ 'smoothTexture' ].value = currentRenderTarget.texture; gpuCompute.doRenderTarget( smoothShader, alternateRenderTarget ); smoothShader.uniforms[ 'smoothTexture' ].value = alternateRenderTarget.texture; gpuCompute.doRenderTarget( smoothShader, currentRenderTarget ); } } function createSpheres() { const sphereTemplate = new THREE.Mesh( new THREE.SphereGeometry( 4, 24, 12 ), new THREE.MeshPhongMaterial( { color: 0xFFFF00 } ) ); for ( let i = 0; i < NUM_SPHERES; i ++ ) { let sphere = sphereTemplate; if ( i < NUM_SPHERES - 1 ) { sphere = sphereTemplate.clone(); } sphere.position.x = ( Math.random() - 0.5 ) * BOUNDS * 0.7; sphere.position.z = ( Math.random() - 0.5 ) * BOUNDS * 0.7; sphere.userData.velocity = new THREE.Vector3(); scene.add( sphere ); spheres[ i ] = sphere; } } function sphereDynamics() { const currentRenderTarget = gpuCompute.getCurrentRenderTarget( heightmapVariable ); readWaterLevelShader.uniforms[ 'levelTexture' ].value = currentRenderTarget.texture; for ( let i = 0; i < NUM_SPHERES; i ++ ) { const sphere = spheres[ i ]; if ( sphere ) { // Read water level and orientation const u = 0.5 * sphere.position.x / BOUNDS_HALF + 0.5; const v = 1 - ( 0.5 * sphere.position.z / BOUNDS_HALF + 0.5 ); readWaterLevelShader.uniforms[ 'point1' ].value.set( u, v ); gpuCompute.doRenderTarget( readWaterLevelShader, readWaterLevelRenderTarget ); renderer.readRenderTargetPixels( readWaterLevelRenderTarget, 0, 0, 4, 1, readWaterLevelImage ); const pixels = new Float32Array( readWaterLevelImage.buffer ); // Get orientation waterNormal.set( pixels[ 1 ], 0, - pixels[ 2 ] ); const pos = sphere.position; // Set height pos.y = pixels[ 0 ]; // Move sphere waterNormal.multiplyScalar( 0.1 ); sphere.userData.velocity.add( waterNormal ); sphere.userData.velocity.multiplyScalar( 0.998 ); pos.add( sphere.userData.velocity ); if ( pos.x < - BOUNDS_HALF ) { pos.x = - BOUNDS_HALF + 0.001; sphere.userData.velocity.x *= - 0.3; } else if ( pos.x > BOUNDS_HALF ) { pos.x = BOUNDS_HALF - 0.001; sphere.userData.velocity.x *= - 0.3; } if ( pos.z < - BOUNDS_HALF ) { pos.z = - BOUNDS_HALF + 0.001; sphere.userData.velocity.z *= - 0.3; } else if ( pos.z > BOUNDS_HALF ) { pos.z = BOUNDS_HALF - 0.001; sphere.userData.velocity.z *= - 0.3; } } } } function onWindowResize() { camera.aspect = window.innerWidth / window.innerHeight; camera.updateProjectionMatrix(); renderer.setSize( window.innerWidth, window.innerHeight ); } function setMouseCoords( x, y ) { mouseCoords.set( ( x / renderer.domElement.clientWidth ) * 2 - 1, - ( y / renderer.domElement.clientHeight ) * 2 + 1 ); mouseMoved = true; } function onPointerMove( event ) { if ( event.isPrimary === false ) return; setMouseCoords( event.clientX, event.clientY ); } function animate() { requestAnimationFrame( animate ); render(); stats.update(); } function render() { // Set uniforms: mouse interaction const uniforms = heightmapVariable.material.uniforms; if ( mouseMoved ) { raycaster.setFromCamera( mouseCoords, camera ); const intersects = raycaster.intersectObject( meshRay ); if ( intersects.length > 0 ) { const point = intersects[ 0 ].point; uniforms[ 'mousePos' ].value.set( point.x, point.z ); } else { uniforms[ 'mousePos' ].value.set( 10000, 10000 ); } mouseMoved = false; } else { uniforms[ 'mousePos' ].value.set( 10000, 10000 ); } // Do the gpu computation gpuCompute.compute(); if ( spheresEnabled ) { sphereDynamics(); } // Get compute output in custom uniform waterUniforms[ 'heightmap' ].value = gpuCompute.getCurrentRenderTarget( heightmapVariable ).texture; // Render renderer.render( scene, camera ); } </script> </body> </html>
Close