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

feat (Nodes): Improve NodeElements + tangential changes #734

Merged
merged 8 commits into from
Jan 11, 2024

Conversation

0b5vr
Copy link
Contributor

@0b5vr 0b5vr commented Dec 26, 2023

@Methuselah96 I'm sorry if these changes overlap with what you are currently working on. 😓

What

Improve NodeElements interface.

Search the whole three.js project by addNodeElement( to validate these changes.

@0b5vr 0b5vr requested a review from Methuselah96 December 26, 2023 03:39
@0b5vr 0b5vr self-assigned this Dec 26, 2023
0b5vr added 3 commits January 9, 2024 16:16
Search the whole three.js project by `addNodeElement(`

- Nodes I added:
  - `CubeTextureNode.d.ts`: `cubeTexture`
  - `TextureNode.d.ts`: `texture`
  - `FunctionCallNode.d.ts`: `call`
  - `AssignNode.d.ts`: `assign`
  - `BypassNode.d.ts`: `bypass`
  - `CacheNode.d.ts`: `cache`, `globalCache`
  - `ContextNode.d.ts`: `context`, `label`
  - `VaryingNode.d.ts`: `varying`
  - `ColorSpaceNode.d.ts`: `linearTosRGB`, `sRGBToLinear`, `linearToColorSpace`, `colorSpaceToLinear`
  - `NormalMapNode.d.ts`: `normalMap`
  - `ViewportSharedTextureNode.d.ts`: `viewportSharedTexture`
  - `ViewportTextureNode.d.ts`: `viewportTexture`, `viewportMipTexture`
  - `FogExp2Node.d.ts`: `densityFog`
  - `FogNode.d.ts`: `fog`
  - `FogRangeNode.d.ts`: `rangeFog`
  - `ComputeNode.d.ts`: `compute`
  - `LightingContextNode.d.ts`: `lightingContext`
  - `CheckerNode.d.ts`: `checker`
  - `ShaderNode.d.ts`: `color`, `float`, `int`, ..., `bmat4`, `string`, `arrayBuffer`, `element`, `convert`
  - `RotateUVNode.d.ts`: `rotateUV`
  - `TriplanarTexturesNode.d.ts`: `triplanarTexture`
- Nodes I skipped: `toAttribute`, `textureSize`, `scriptable`, `scriptableValue`, `bumpMap`, `gaussianBlur`, `viewportDepthTexture`, `hash`, `discard`, `loop`, `directionToColor`, `colorToDirection`
- defined `globalCache`, a variant of CacheNode without cache scope
  - See: https://github.com/mrdoob/three.js/blob/r160/examples/jsm/nodes/core/CacheNode.js#L44
- defined `label`, a variant of ContextNode that sets a label
  - See: https://github.com/mrdoob/three.js/blob/r160/examples/jsm/nodes/core/ContextNode.js#L56
- `label` on `VarNode.d.ts` is removed instead
  - See: https://github.com/mrdoob/three.js/blob/r160/examples/jsm/nodes/core/VarNode.js
- `colorSpace` has been removed, added `linearTosRGB`, `sRGBToLinear`, `linearToColorSpace`, `colorSpaceToLinear` instead
  - See: https://github.com/mrdoob/three.js/blob/r160/examples/jsm/nodes/display/ColorSpaceNode.js#L97-L101
- `assign` has been moved from `OperatorNode` to `AssignNode` (new)
  - See: https://github.com/mrdoob/three.js/blob/r160/examples/jsm/nodes/math/OperatorNode.js
  - See: https://github.com/mrdoob/three.js/blob/r160/examples/jsm/nodes/core/AssignNode.js
- Add `string` and `arrayBuffer` to `ShaderNode.d.ts`
  - See: https://github.com/mrdoob/three.js/blob/r160/examples/jsm/nodes/shadernode/ShaderNode.js#L587-L588
Copy link
Contributor

@Methuselah96 Methuselah96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

types/three/examples/jsm/nodes/Nodes.d.ts Outdated Show resolved Hide resolved
types/three/examples/jsm/nodes/Nodes.d.ts Outdated Show resolved Hide resolved
types/three/examples/jsm/nodes/core/AssignNode.d.ts Outdated Show resolved Hide resolved
types/three/examples/jsm/nodes/display/ColorSpaceNode.d.ts Outdated Show resolved Hide resolved
@0b5vr 0b5vr requested a review from Methuselah96 January 11, 2024 05:05
@0b5vr
Copy link
Contributor Author

0b5vr commented Jan 11, 2024

@Methuselah96 Thank you for the review! Resolved all the conversations. Feel free to add more if there's something still wrong.

@Methuselah96 Methuselah96 merged commit a66e428 into three-types:master Jan 11, 2024
3 checks passed
@0b5vr 0b5vr deleted the node-elements branch January 12, 2024 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants