Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/three.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/three.module.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/three.module.min.js

Large diffs are not rendered by default.

97 changes: 42 additions & 55 deletions build/three.webgpu.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/three.webgpu.min.js

Large diffs are not rendered by default.

97 changes: 42 additions & 55 deletions build/three.webgpu.nodes.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/three.webgpu.nodes.min.js

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions editor/js/libs/app.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
var APP = {
const APP = {

Player: function () {

var renderer = new THREE.WebGLRenderer( { antialias: true } );
const renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio ); // TODO: Use player.setPixelRatio()

var loader = new THREE.ObjectLoader();
var camera, scene;
const loader = new THREE.ObjectLoader();
let camera, scene;

var events = {};
let events = {};

var dom = document.createElement( 'div' );
const dom = document.createElement( 'div' );
dom.appendChild( renderer.domElement );

this.dom = dom;
Expand All @@ -21,7 +21,7 @@ var APP = {

this.load = function ( json ) {

var project = json.project;
const project = json.project;

if ( project.shadows !== undefined ) renderer.shadowMap.enabled = project.shadows;
if ( project.shadowType !== undefined ) renderer.shadowMap.type = project.shadowType;
Expand All @@ -43,8 +43,8 @@ var APP = {
update: []
};

var scriptWrapParams = 'player,renderer,scene,camera';
var scriptWrapResultObj = {};
let scriptWrapParams = 'player,renderer,scene,camera';
const scriptWrapResultObj = {};

for ( var eventKey in events ) {

Expand All @@ -53,11 +53,11 @@ var APP = {

}

var scriptWrapResult = JSON.stringify( scriptWrapResultObj ).replace( /\"/g, '' );
const scriptWrapResult = JSON.stringify( scriptWrapResultObj ).replace( /\"/g, '' );

for ( var uuid in json.scripts ) {
for ( let uuid in json.scripts ) {

var object = scene.getObjectByProperty( 'uuid', uuid, true );
const object = scene.getObjectByProperty( 'uuid', uuid, true );

if ( object === undefined ) {

Expand All @@ -66,15 +66,15 @@ var APP = {

}

var scripts = json.scripts[ uuid ];
const scripts = json.scripts[ uuid ];

for ( var i = 0; i < scripts.length; i ++ ) {
for ( let i = 0; i < scripts.length; i ++ ) {

var script = scripts[ i ];
const script = scripts[ i ];

var functions = ( new Function( scriptWrapParams, script.source + '\nreturn ' + scriptWrapResult + ';' ).bind( object ) )( this, renderer, scene, camera );
const functions = ( new Function( scriptWrapParams, script.source + '\nreturn ' + scriptWrapResult + ';' ).bind( object ) )( this, renderer, scene, camera );

for ( var name in functions ) {
for ( let name in functions ) {

if ( functions[ name ] === undefined ) continue;

Expand Down Expand Up @@ -135,15 +135,15 @@ var APP = {

function dispatch( array, event ) {

for ( var i = 0, l = array.length; i < l; i ++ ) {
for ( let i = 0, l = array.length; i < l; i ++ ) {

array[ i ]( event );

}

}

var time, startTime, prevTime;
let time, startTime, prevTime;

function animate() {

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/physics/JoltPhysics.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Clock, Vector3, Quaternion, Matrix4 } from 'three';

const JOLT_PATH = 'https://cdn.jsdelivr.net/npm/jolt-physics@0.23.0/dist/jolt-physics.wasm-compat.js';
const JOLT_PATH = 'https://cdn.jsdelivr.net/npm/jolt-physics@1.0.0/dist/jolt-physics.wasm-compat.js';

const frameRate = 60;

Expand Down
Binary file modified examples/screenshots/webgpu_postprocessing_outline.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgpu_shadowmap_csm.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgpu_shadowmap_opacity.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 0 additions & 11 deletions examples/webgpu_backdrop_water.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,6 @@
camera.lookAt( 0, 1, 0 );

const sunLight = new THREE.DirectionalLight( 0xFFE499, 5 );
sunLight.castShadow = true;
sunLight.shadow.camera.near = .1;
sunLight.shadow.camera.far = 5;
sunLight.shadow.camera.right = 2;
sunLight.shadow.camera.left = - 2;
sunLight.shadow.camera.top = 1;
sunLight.shadow.camera.bottom = - 2;
sunLight.shadow.mapSize.width = 2048;
sunLight.shadow.mapSize.height = 2048;
sunLight.shadow.bias = - 0.001;
sunLight.position.set( .5, 3, .5 );

const waterAmbientLight = new THREE.HemisphereLight( 0x333366, 0x74ccf4, 5 );
Expand All @@ -87,7 +77,6 @@
loader.load( 'models/gltf/Michelle.glb', function ( gltf ) {

model = gltf.scene;
model.children[ 0 ].children[ 0 ].castShadow = true;

mixer = new THREE.AnimationMixer( model );

Expand Down
1 change: 0 additions & 1 deletion examples/webgpu_camera_array.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
const light = new THREE.DirectionalLight( 0xffffff, 3 );
light.position.set( 0.5, 0.5, 1 );
light.castShadow = true;
light.shadow.bias = - 0.001;
light.shadow.camera.zoom = 4; // tighter shadow map
scene.add( light );

Expand Down
1 change: 0 additions & 1 deletion examples/webgpu_caustics.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
spotLight.shadow.mapSize.height = 1024;
spotLight.shadow.camera.near = .1;
spotLight.shadow.camera.far = 1;
spotLight.shadow.bias = - .003;
spotLight.shadow.intensity = .95;
scene.add( spotLight );

Expand Down
1 change: 0 additions & 1 deletion examples/webgpu_clipping.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
spotLight.shadow.camera.far = 10;
spotLight.shadow.mapSize.width = 2048;
spotLight.shadow.mapSize.height = 2048;
spotLight.shadow.bias = - 0.002;
spotLight.shadow.radius = 4;
scene.add( spotLight );

Expand Down
15 changes: 1 addition & 14 deletions examples/webgpu_compute_particles_rain.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,9 @@
scene = new THREE.Scene();

const dirLight = new THREE.DirectionalLight( 0xffffff, .5 );
dirLight.castShadow = true;
dirLight.position.set( 3, 17, 17 );
dirLight.castShadow = true;
dirLight.shadow.camera.near = 1;
dirLight.shadow.camera.far = 50;
dirLight.shadow.camera.right = 25;
dirLight.shadow.camera.left = - 25;
dirLight.shadow.camera.top = 25;
dirLight.shadow.camera.bottom = - 25;
dirLight.shadow.mapSize.width = 2048;
dirLight.shadow.mapSize.height = 2048;
dirLight.shadow.bias = - 0.01;

scene.add( dirLight );

scene.add( new THREE.AmbientLight( 0x111111 ) );

//
Expand Down Expand Up @@ -257,7 +246,6 @@
collisionBox.position.y = 12;
collisionBox.scale.x = 3.5;
collisionBox.layers.enable( 1 );
collisionBox.castShadow = true;
scene.add( collisionBox );

//
Expand All @@ -268,7 +256,6 @@
geometry.computeVertexNormals();

monkey = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial( { roughness: 1, metalness: 0 } ) );
monkey.receiveShadow = true;
monkey.scale.setScalar( 5 );
monkey.rotation.y = Math.PI / 2;
monkey.position.y = 4.5;
Expand Down
13 changes: 0 additions & 13 deletions examples/webgpu_compute_particles_snow.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,7 @@
scene.fog = new THREE.Fog( 0x0f3c37, 5, 40 );

const dirLight = new THREE.DirectionalLight( 0xf9ff9b, 9 );
dirLight.castShadow = true;
dirLight.position.set( 10, 10, 0 );
dirLight.castShadow = true;
dirLight.shadow.camera.near = 1;
dirLight.shadow.camera.far = 30;
dirLight.shadow.camera.right = 30;
dirLight.shadow.camera.left = - 30;
dirLight.shadow.camera.top = 30;
dirLight.shadow.camera.bottom = - 30;
dirLight.shadow.mapSize.width = 2048;
dirLight.shadow.mapSize.height = 2048;
dirLight.shadow.bias = - 0.009;
scene.add( dirLight );

scene.add( new THREE.HemisphereLight( 0x0f3c37, 0x080d10, 100 ) );
Expand Down Expand Up @@ -200,7 +189,6 @@

const rainParticles = new THREE.Mesh( geometry, staticMaterial );
rainParticles.count = maxParticleCount;
rainParticles.castShadow = true;
rainParticles.layers.disableAll();
rainParticles.layers.enable( layer );

Expand Down Expand Up @@ -249,7 +237,6 @@
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.5 ) + ( count * .6 );
object.add( cone );

Expand Down
2 changes: 0 additions & 2 deletions examples/webgpu_instancing_morph.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@
light.shadow.camera.bottom = - 5000;
light.shadow.camera.far = 2000;

light.shadow.bias = - 0.01;

light.shadow.camera.updateProjectionMatrix();

scene.add( light );
Expand Down
1 change: 0 additions & 1 deletion examples/webgpu_lights_projector.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@
projectorLight.shadow.camera.near = 1;
projectorLight.shadow.camera.far = 10;
projectorLight.shadow.focus = 1;
projectorLight.shadow.bias = - .003;
scene.add( projectorLight );

lightHelper = new THREE.SpotLightHelper( projectorLight );
Expand Down
1 change: 0 additions & 1 deletion examples/webgpu_lights_spotlight.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@
spotLight.shadow.camera.near = 2;
spotLight.shadow.camera.far = 10;
spotLight.shadow.focus = 1;
spotLight.shadow.bias = - .003;
spotLight.shadow.intensity = 1;
scene.add( spotLight );

Expand Down
5 changes: 2 additions & 3 deletions examples/webgpu_postprocessing_motion_blur.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@
sunLight.shadow.camera.left = - 2;
sunLight.shadow.camera.top = 2;
sunLight.shadow.camera.bottom = - 2;
sunLight.shadow.mapSize.width = 2048;
sunLight.shadow.mapSize.height = 2048;
sunLight.shadow.bias = - 0.001;
sunLight.shadow.mapSize.width = 1024;
sunLight.shadow.mapSize.height = 1024;
sunLight.position.set( 4, 4, 2 );

const waterAmbientLight = new THREE.HemisphereLight( 0x333366, 0x74ccf4, 5 );
Expand Down
1 change: 0 additions & 1 deletion examples/webgpu_postprocessing_outline.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
light.castShadow = true;
light.shadow.mapSize.width = 2048;
light.shadow.mapSize.height = 2048;
light.shadow.bias = - 0.005;

const d = 10;

Expand Down
2 changes: 0 additions & 2 deletions examples/webgpu_postprocessing_pixel.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
directionalLight.position.set( 100, 100, 100 );
directionalLight.castShadow = true;
directionalLight.shadow.mapSize.set( 2048, 2048 );
directionalLight.shadow.bias = - 0.0001;
scene.add( directionalLight );

const spotLight = new THREE.SpotLight( 0xffc100, 10, 10, Math.PI / 16, .02, 2 );
Expand All @@ -128,7 +127,6 @@
scene.add( target );
target.position.set( 0, 0, 0 );
spotLight.castShadow = true;
spotLight.shadow.bias = - 0.001;
scene.add( spotLight );

renderer = new THREE.WebGPURenderer();
Expand Down
1 change: 0 additions & 1 deletion examples/webgpu_postprocessing_ssgi.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@
pointLight.castShadow = true;
pointLight.shadow.mapSize.width = 1024;
pointLight.shadow.mapSize.height = 1024;
pointLight.shadow.bias = - 0.0025;
scene.add( pointLight );

// Ambient light
Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_postprocessing_sss.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@
const dirLight = new THREE.DirectionalLight( 0xffffff, 3 );
dirLight.position.set( - 3, 10, - 10 );
dirLight.castShadow = true;
dirLight.shadow.bias = - 0.001; // remove self-shadowing artifacts
dirLight.shadow.camera.top = 4;
dirLight.shadow.camera.bottom = - 4;
dirLight.shadow.camera.left = - 4;
dirLight.shadow.camera.right = 4;
dirLight.shadow.camera.near = 0.1;
dirLight.shadow.camera.far = 40;
dirLight.shadow.bias = - 0.001;
dirLight.shadow.mapSize.width = 1024;
dirLight.shadow.mapSize.height = 1024;
scene.add( dirLight );
Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_reflection.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
sunLight.castShadow = true;
sunLight.shadow.camera.zoom = 1.5;
sunLight.shadow.mapSize.set( 1024, 1024 );
sunLight.shadow.bias = - 0.0001;
sunLight.shadow.bias = - 0.0001; // remove self-shadowing artifacts
scene.add( sunLight );

const backLight = new THREE.DirectionalLight( 0x0487e2, 0.5 );
Expand Down
2 changes: 0 additions & 2 deletions examples/webgpu_shadowmap.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
spotLight.shadow.camera.far = 200;
spotLight.shadow.mapSize.width = 2048;
spotLight.shadow.mapSize.height = 2048;
spotLight.shadow.bias = - 0.002;
spotLight.shadow.radius = 4;
scene.add( spotLight );

Expand All @@ -85,7 +84,6 @@
dirLight.shadow.mapSize.width = 2048;
dirLight.shadow.mapSize.height = 2048;
dirLight.shadow.radius = 4;
dirLight.shadow.bias = - 0.0005;

dirGroup = new THREE.Group();
dirGroup.add( dirLight );
Expand Down
1 change: 0 additions & 1 deletion examples/webgpu_shadowmap_array.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
dirLight.shadow.mapSize.width = 1024 * 4;
dirLight.shadow.mapSize.height = 1024 * 4;
dirLight.shadow.radius = 1;
dirLight.shadow.bias = - 0.005;

// Set up the tile shadow mapping
const tsm = new TileShadowNode( dirLight, {
Expand Down
1 change: 0 additions & 1 deletion examples/webgpu_shadowmap_csm.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@
csmDirectionalLight.shadow.camera.bottom = - 1000;
csmDirectionalLight.shadow.camera.left = - 1000;
csmDirectionalLight.shadow.camera.right = 1000;
csmDirectionalLight.shadow.bias = - 0.001;

csm = new CSMShadowNode( csmDirectionalLight, { cascades: 4, maxFar: params.maxFar, mode: params.mode } );

Expand Down
1 change: 0 additions & 1 deletion examples/webgpu_shadowmap_opacity.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
dirLight.shadow.mapSize.width = 2048;
dirLight.shadow.mapSize.height = 2048;
dirLight.shadow.radius = 4;
dirLight.shadow.bias = - 0.0005;

dirLight.shadow.autoUpdate = false;
dirLight.shadow.needsUpdate = true;
Expand Down
1 change: 0 additions & 1 deletion examples/webgpu_shadowmap_progressive.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@
dirLight.shadow.camera.bottom = - 150;
dirLight.shadow.mapSize.width = shadowMapRes;
dirLight.shadow.mapSize.height = shadowMapRes;
dirLight.shadow.bias = - 0.001;
lightmapObjects.push( dirLight );
dirLights.push( dirLight );

Expand Down
1 change: 0 additions & 1 deletion examples/webgpu_tsl_procedural_terrain.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
directionalLight.shadow.camera.bottom = - 8;
directionalLight.shadow.camera.left = - 8;
directionalLight.shadow.normalBias = 0.05;
directionalLight.shadow.bias = 0;
scene.add( directionalLight );

// terrain
Expand Down
1 change: 0 additions & 1 deletion examples/webgpu_volume_caustics.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
spotLight.shadow.mapSize.height = 1024;
spotLight.shadow.camera.near = .1;
spotLight.shadow.camera.far = 1;
spotLight.shadow.bias = - .003;
spotLight.shadow.intensity = .95;
spotLight.layers.enable( LAYER_VOLUMETRIC_LIGHTING );
scene.add( spotLight );
Expand Down
1 change: 0 additions & 1 deletion examples/webgpu_volume_lighting.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@
spotLight.shadow.camera.near = 1;
spotLight.shadow.camera.far = 15;
spotLight.shadow.focus = 1;
spotLight.shadow.bias = - .003;
spotLight.layers.enable( LAYER_VOLUMETRIC_LIGHTING );
//sunLight.add( new THREE.Mesh( new THREE.SphereGeometry( 0.1, 16, 16 ), new THREE.MeshBasicMaterial( { color: 0xffffff } ) ) );
scene.add( spotLight );
Expand Down
Loading
Loading