Skip to content

Nodes: Some subclasses are not exported #32703

@trusktr

Description

@trusktr

Description

Some nodes are not being exported. For example, ShadowNode is

  • exported from src/nodes/lighting/ShadowNode.js
  • and then exported from the entry at src/nodes/Nodes.js
  • which makes it available via import {ShadowNode} from 'three/webgpu'

while PointShadowNode is

  • exported from src/nodes/lighting/ShadowNode.js
  • but not from the entry at src/nodes/Nodes.js
  • and is not available via import {PointShadowNode} from 'three/webgpu'

Is this an oversight, or intentional?

I discovered this while experimenting with how to use the Node classes directly without TSL, and encountered those limitations and others.

Solution

If the classes can be (should be?) exported, I am willing to help make a PR to update exports.

Alternatives

n/a

Additional context

My intent is to use pure Node classes to avoid TSL-specific features such as function closures via Fn for certain cases like conditionals via If, such that by learning how to re-create anything as pure nodes, I can learn how to model that into a node GUI.

The current node playground does not have Fn or If nodes, which makes me think that's because those nodes are not simply representable purely as nodes.

My goal is to be able to express all shader features with the function closure stack, only boxes and lines.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions