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
39 changes: 39 additions & 0 deletions examples-testing/changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -19931,6 +19931,45 @@ index 5be061456..60811643e 100644
}
});

diff --git a/examples-testing/examples/webgpu_shadowmap_opacity.ts b/examples-testing/examples/webgpu_shadowmap_opacity.ts
index e508e1039..ec2ae1509 100644
--- a/examples-testing/examples/webgpu_shadowmap_opacity.ts
+++ b/examples-testing/examples/webgpu_shadowmap_opacity.ts
@@ -6,7 +6,7 @@ import { Inspector } from 'three/addons/inspector/Inspector.js';
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';

-let camera, scene, renderer;
+let camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGPURenderer;

init();

@@ -64,7 +64,7 @@ async function init() {
floor.scale.x += 4;
floor.scale.y += 4;

- const dragon = gltf.scene.children[1];
+ const dragon = gltf.scene.children[1] as THREE.Mesh<THREE.BufferGeometry, THREE.MeshPhysicalMaterial>;
dragon.position.set(-1.5, -0.8, 1);

const dragon2 = dragon.clone();
@@ -75,10 +75,12 @@ async function init() {

// shadow node

- const customShadow = Fn(([color, opacity = 1]) => {
- //return vec4( color, opacity ); // opacity by blending
- return mix(1, color, opacity); // opacity by color
- });
+ const customShadow = Fn(
+ ([color, opacity = 1]: [THREE.Node<'color'>, THREE.Node<'float'> | number] | [THREE.Node<'color'>]) => {
+ //return vec4( color, opacity ); // opacity by blending
+ return mix(1, color, opacity); // opacity by color
+ },
+ );

// apply shadow

diff --git a/examples-testing/examples/webgpu_shadowmap_pointlight.ts b/examples-testing/examples/webgpu_shadowmap_pointlight.ts
index 3cb878e6f..ef4acd04a 100644
--- a/examples-testing/examples/webgpu_shadowmap_pointlight.ts
Expand Down
1 change: 0 additions & 1 deletion examples-testing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ const exceptionList = [
'webgpu_reflection_blurred',
'webgpu_sandbox',
'webgpu_shadertoy',
'webgpu_shadowmap_opacity',
'webgpu_skinning_points',
'webgpu_tsl_compute_attractors_particles',
'webgpu_tsl_editor',
Expand Down
2 changes: 1 addition & 1 deletion types/three/src/nodes/gpgpu/ComputeNode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class ComputeNode extends Node {
*/
label: (name: string) => this;

onInit(callback: ((args: { renderer: Renderer }) => void) | null): void;
onInit(callback: ((args: { renderer: Renderer }) => void) | null): this;
}

export const computeKernel: (node: Node, workgroupSize?: number[]) => ComputeNode;
Expand Down