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

Sky: Add WebGPURenderer version. #1161

Merged
merged 7 commits into from
Aug 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
20 changes: 20 additions & 0 deletions examples-testing/changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -15091,6 +15091,26 @@ index dc018c6d..6c7faf4d 100644

const planeGeo = new THREE.PlaneGeometry(100.1, 100.1);

diff --git a/examples-testing/examples/webgpu_sky.ts b/examples-testing/examples/webgpu_sky.ts
index 60af1c2d..1b7a8906 100644
--- a/examples-testing/examples/webgpu_sky.ts
+++ b/examples-testing/examples/webgpu_sky.ts
@@ -1,12 +1,12 @@
-import * as THREE from 'three';
+import * as THREE from 'three/webgpu';

import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
import { Sky } from 'three/addons/objects/SkyGPU.js';

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

-let sky, sun;
+let sky: Sky, sun: THREE.Vector3;

init();

diff --git a/examples-testing/examples/webgpu_textures_anisotropy.ts b/examples-testing/examples/webgpu_textures_anisotropy.ts
index 21cc1197..eec04d7e 100644
--- a/examples-testing/examples/webgpu_textures_anisotropy.ts
Expand Down
17 changes: 17 additions & 0 deletions types/three/examples/jsm/objects/SkyGPU.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Node, ShaderNodeObject, UniformNode } from "three/tsl";
import { BoxGeometry, Mesh, NodeMaterial, Vector3 } from "three/webgpu";

declare class Sky extends Mesh<BoxGeometry, NodeMaterial> {
turbidity: ShaderNodeObject<UniformNode<number>>;
rayleigh: ShaderNodeObject<UniformNode<number>>;
mieCoefficient: ShaderNodeObject<UniformNode<number>>;
mieDirectionalG: ShaderNodeObject<UniformNode<number>>;
sunPosition: ShaderNodeObject<UniformNode<Vector3>>;
upUniform: ShaderNodeObject<UniformNode<Vector3>>;

readonly isSky: true;

constructor();
}

export { Sky };
Loading