Skip to content

Commit

Permalink
Nodes: Add CubeMapNode. (#1176)
Browse files Browse the repository at this point in the history
* Nodes: Add CubeMapNode.

* Update three.js

* Add examples

* Update patch and delete examples
  • Loading branch information
Methuselah96 authored Aug 24, 2024
1 parent 3e28fcd commit 2348b3a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
22 changes: 22 additions & 0 deletions examples-testing/changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -13989,6 +13989,28 @@ index 54d26d65..824c087a 100644
geometry.center();

mesh = new THREE.Mesh(geometry, material);
diff --git a/examples-testing/examples/webgpu_materials_envmaps.ts b/examples-testing/examples/webgpu_materials_envmaps.ts
index f49b4ca1..73c27f5c 100644
--- a/examples-testing/examples/webgpu_materials_envmaps.ts
+++ b/examples-testing/examples/webgpu_materials_envmaps.ts
@@ -1,11 +1,13 @@
-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';

-let controls, camera, scene, renderer;
-let textureEquirec, textureCube;
-let sphereMesh, sphereMaterial, params;
+let controls, camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGPURenderer;
+let textureEquirec: THREE.Texture, textureCube: THREE.CubeTexture;
+let sphereMesh: THREE.Mesh,
+ sphereMaterial: THREE.MeshBasicMaterial,
+ params: { Cube: () => void; Equirectangular: () => void; Refraction: boolean };

init();

diff --git a/examples-testing/examples/webgpu_materials_lightmap.ts b/examples-testing/examples/webgpu_materials_lightmap.ts
index 616645aa..288f6e84 100644
--- a/examples-testing/examples/webgpu_materials_lightmap.ts
Expand Down
13 changes: 13 additions & 0 deletions types/three/src/nodes/utils/CubeMapNode.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Node from "../core/Node.js";
import TempNode from "../core/TempNode.js";
import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";

declare class CubeMapNode extends TempNode {
envNode: Node;

constructor(envNode: Node);
}

export const cubeMapNode: (envNode: NodeRepresentation) => ShaderNodeObject<CubeMapNode>;

export default CubeMapNode;

0 comments on commit 2348b3a

Please sign in to comment.