Skip to content

Commit

Permalink
Examples: Improved webgpu_compute_particles_snow.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Dec 22, 2023
1 parent caf8c1f commit de3d5ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Binary file modified examples/screenshots/webgpu_compute_particles_snow.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions examples/webgpu_compute_particles_snow.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<body>

<div id="info">
<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> WebGPU - GPU Compute Snow - 100.000 Particles
<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> WebGPU - Compute Snow - 100K Particles
</div>

<script type="importmap">
Expand Down Expand Up @@ -229,7 +229,7 @@

// tree

function tree( count = 10 ) {
function tree( count = 8 ) {

const coneMaterial = new MeshStandardNodeMaterial( {
color: 0x0d492c,
Expand All @@ -243,11 +243,11 @@

const radius = 1 + i;

const coneGeometry = new THREE.ConeGeometry( radius, radius, 64 );
const coneGeometry = new THREE.ConeGeometry( radius * 0.95, radius * 1.25, 32 );

const cone = new THREE.Mesh( coneGeometry, coneMaterial );
cone.castShadow = true;
cone.position.y = ( ( count - i ) * 1.3 ) + ( count * .5 );
cone.position.y = ( ( count - i ) * 1.5 ) + ( count * .6 );
object.add( cone );

}
Expand All @@ -261,11 +261,11 @@

}

const teapotTree = new THREE.Mesh( new TeapotGeometry( .8, 18 ), new MeshBasicNodeMaterial( {
const teapotTree = new THREE.Mesh( new TeapotGeometry( .5, 18 ), new MeshBasicNodeMaterial( {
color: 0xfcfb9e
} ) );

teapotTree.position.y = 19.5;
teapotTree.position.y = 18;

scene.add( tree() );
scene.add( teapotTree );
Expand Down Expand Up @@ -322,7 +322,7 @@
controls.maxDistance = 35;
controls.maxPolarAngle = Math.PI / 1.7;
controls.autoRotate = true;
controls.autoRotateSpeed = - 1;
controls.autoRotateSpeed = - 0.7;
controls.update();

//
Expand Down

0 comments on commit de3d5ff

Please sign in to comment.