Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGPURenderer: Add support for VSM. #1245

Merged
merged 3 commits into from
Sep 22, 2024
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
43 changes: 43 additions & 0 deletions examples-testing/changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -15252,6 +15252,49 @@ index a410c04f..64814a2b 100644

init();

diff --git a/examples-testing/examples/webgpu_shadowmap_vsm.ts b/examples-testing/examples/webgpu_shadowmap_vsm.ts
index a9f6f0e5..c68aa5fc 100644
--- a/examples-testing/examples/webgpu_shadowmap_vsm.ts
+++ b/examples-testing/examples/webgpu_shadowmap_vsm.ts
@@ -1,14 +1,24 @@
-import * as THREE from 'three';
+import * as THREE from 'three/webgpu';

import Stats from 'three/addons/libs/stats.module.js';
import { GUI } from 'three/addons/libs/lil-gui.module.min.js';

import { OrbitControls } from 'three/addons/controls/OrbitControls.js';

-let camera, scene, renderer, clock, stats;
-let dirLight, spotLight;
-let torusKnot, dirGroup;
-let config;
+let camera: THREE.PerspectiveCamera,
+ scene: THREE.Scene,
+ renderer: THREE.WebGPURenderer,
+ clock: THREE.Clock,
+ stats: Stats;
+let dirLight: THREE.DirectionalLight, spotLight: THREE.SpotLight;
+let torusKnot: THREE.Mesh, dirGroup: THREE.Group;
+let config: {
+ spotlightRadius: number;
+ spotlightSamples: number;
+ dirlightRadius: number;
+ dirlightSamples: number;
+ animate: boolean;
+};

init();

@@ -188,7 +198,7 @@ function onWindowResize() {
renderer.setSize(window.innerWidth, window.innerHeight);
}

-function animate(time) {
+function animate(time: DOMHighResTimeStamp) {
const delta = clock.getDelta();

if (config.animate === true) {
diff --git a/examples-testing/examples/webgpu_sky.ts b/examples-testing/examples/webgpu_sky.ts
index 097d06af..3836e7ee 100644
--- a/examples-testing/examples/webgpu_sky.ts
Expand Down
Loading