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: StorageBufferNode Support reading external elements in the WebGL Backend #818

Merged
merged 6 commits into from
Feb 17, 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
1 change: 1 addition & 0 deletions examples-testing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ const files = {
// 'webgpu_mirror',
// 'webgpu_multisampled_renderbuffers',
'webgpu_materials_texture_anisotropy',
// 'webgpu_storage_buffer',
],
webaudio: ['webaudio_orientation', 'webaudio_sandbox', 'webaudio_timing', 'webaudio_visualizer'],
webxr: [
Expand Down
2 changes: 1 addition & 1 deletion types/three/examples/jsm/nodes/Nodes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export {
export { default as ReferenceNode, reference } from "./accessors/ReferenceNode.js";
export { default as ReflectVectorNode, reflectVector } from "./accessors/ReflectVectorNode.js";
export { default as SkinningNode, skinning } from "./accessors/SkinningNode.js";
export { default as StorageBufferNode, storage } from "./accessors/StorageBufferNode.js";
export { default as StorageBufferNode, storage, storageObject } from "./accessors/StorageBufferNode.js";
export {
default as TangentNode,
tangentGeometry,
Expand Down
10 changes: 10 additions & 0 deletions types/three/examples/jsm/nodes/accessors/StorageBufferNode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,23 @@ import StorageArrayElementNode from "../utils/StoargeArrayElementNode.js";
import BufferNode from "./BufferNode.js";

export default class StorageBufferNode extends BufferNode {
readonly isStorageBufferNode: true;
bufferObject: boolean;

constructor(value: ArrayLike<number>, bufferType: NodeTypeOption, bufferCount?: number);

element(indexNode: NodeRepresentation): ShaderNodeObject<StorageArrayElementNode>;

setBufferObject(value: boolean): this;
}

export const storage: (
value: ArrayLike<number>,
nodeOrType: NodeOrType,
count: number,
) => ShaderNodeObject<StorageBufferNode>;
export const storageObject: (
value: ArrayLike<number>,
nodeOrType: NodeOrType,
count: number,
) => ShaderNodeObject<StorageBufferNode>;
Loading