Skip to content

Commit

Permalink
NodeMaterial: Add support for alphaHash. (#1366)
Browse files Browse the repository at this point in the history
* NodeMaterial: Add support for alphaHash.

* Update three.js

* Add examples

* Update patch and delete examples
  • Loading branch information
Methuselah96 authored Nov 12, 2024
1 parent a80866c commit 3da584d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
26 changes: 26 additions & 0 deletions examples-testing/changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -13972,6 +13972,32 @@ index 04023326..05ee79b0 100644

init();

diff --git a/examples-testing/examples/webgpu_materials_alphahash.ts b/examples-testing/examples/webgpu_materials_alphahash.ts
index 9e4b627e..cc25f04e 100644
--- a/examples-testing/examples/webgpu_materials_alphahash.ts
+++ b/examples-testing/examples/webgpu_materials_alphahash.ts
@@ -1,4 +1,4 @@
-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';
@@ -7,7 +7,14 @@ import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';

import { ssaaPass } from 'three/addons/tsl/display/SSAAPassNode.js';

-let camera, scene, renderer, controls, stats, mesh, material, postProcessing;
+let camera: THREE.PerspectiveCamera,
+ scene: THREE.Scene,
+ renderer: THREE.WebGPURenderer,
+ controls: OrbitControls,
+ stats: Stats,
+ mesh: THREE.InstancedMesh,
+ material: THREE.MeshStandardMaterial,
+ postProcessing: THREE.PostProcessing;

const amount = parseInt(window.location.search.slice(1)) || 3;
const count = Math.pow(amount, 3);
diff --git a/examples-testing/examples/webgpu_materials_arrays.ts b/examples-testing/examples/webgpu_materials_arrays.ts
index 35a25f77..b893f2c0 100644
--- a/examples-testing/examples/webgpu_materials_arrays.ts
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Node from "../../core/Node.js";
import { NodeRepresentation, ShaderNodeObject } from "../../tsl/TSLCore.js";

declare const getAlphaHashThreshold: (position: NodeRepresentation) => ShaderNodeObject<Node>;

export default getAlphaHashThreshold;

0 comments on commit 3da584d

Please sign in to comment.