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

Update examples #1211

Merged
merged 5 commits into from
Aug 28, 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
23 changes: 23 additions & 0 deletions examples-testing/changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -15316,6 +15316,29 @@ index 097d06af..3836e7ee 100644

init();

diff --git a/examples-testing/examples/webgpu_texture2darray_compressed.ts b/examples-testing/examples/webgpu_texture2darray_compressed.ts
index 3e8bf7ee..56db87fd 100644
--- a/examples-testing/examples/webgpu_texture2darray_compressed.ts
+++ b/examples-testing/examples/webgpu_texture2darray_compressed.ts
@@ -1,11 +1,16 @@
-import * as THREE from 'three';
+import * as THREE from 'three/webgpu';

import { texture, uniform, uv } from 'three/tsl';

import Stats from 'three/addons/libs/stats.module.js';
import { KTX2Loader } from 'three/addons/loaders/KTX2Loader.js';

-let camera, scene, mesh, renderer, stats, clock;
+let camera: THREE.PerspectiveCamera,
+ scene: THREE.Scene,
+ mesh: THREE.Mesh,
+ renderer: THREE.WebGPURenderer,
+ stats: Stats,
+ clock: THREE.Clock;

const depth = uniform(0);

diff --git a/examples-testing/examples/webgpu_textures_anisotropy.ts b/examples-testing/examples/webgpu_textures_anisotropy.ts
index 7eb0ce1b..7528f59f 100644
--- a/examples-testing/examples/webgpu_textures_anisotropy.ts
Expand Down
18 changes: 18 additions & 0 deletions types/three/src/nodes/accessors/TextureNode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,26 @@ export default class TextureNode extends UniformNode<Texture> {

getDefaultUV(): Node;

setSampler(value: boolean): this;

getSampler(): boolean;

uv(uvNode: NodeRepresentation): ShaderNodeObject<Node>;

blur(amountNode: NodeRepresentation): ShaderNodeObject<Node>;

level(levelNode: NodeRepresentation): ShaderNodeObject<Node>;

size(levelNode: NodeRepresentation): ShaderNodeObject<Node>;

bias(biasNode: NodeRepresentation): ShaderNodeObject<Node>;

compare(compareNode: NodeRepresentation): ShaderNodeObject<Node>;

grad(gradeNodeX: NodeRepresentation, gradeNodeY: NodeRepresentation): ShaderNodeObject<Node>;

depth(depthNode: NodeRepresentation): ShaderNodeObject<Node>;

clone(): this;
}

Expand Down
5 changes: 4 additions & 1 deletion types/three/src/nodes/shadernode/ShaderNode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ export type SwizzleOption = Exclude<
export type Swizzable<T extends Node = Node> =
& T
& {
[key in SwizzleOption | number]: ShaderNodeObject<Node>;
[Key in SwizzleOption | number]: ShaderNodeObject<Node>;
}
& {
[Key in SwizzleOption as `flip${Uppercase<Key>}`]: () => ShaderNodeObject<Node>;
};

export type ShaderNodeObject<T extends Node> =
Expand Down
Loading