question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NodeMaterial, how to interface with properties

See original GitHub issue

Another topic extracted from https://github.com/mrdoob/three.js/issues/7522 and https://github.com/mrdoob/three.js/issues/14252

When i look at the example here: https://github.com/mrdoob/three.js/blob/dev/examples/webgl_materials_nodes.html#L361-L367

I’m experiencing cognitive overload when i read this code. For every material prop .foo there seems to be a corresponding .node.foo node.

This means that every property .foo that i have on Material now, will no longer be Texture,Color,Vector2,Float etc. but all will be Node.

Every .foo property will thus have to be accessed through .foo.value which is very similar to ShaderMaterial.uniforms.

What kind of an interface can i expect with NodeMaterial moving to /src?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
donmccurdycommented, Jun 8, 2018

The crux of the problem is that no documentation has yet been written. Certainly we should fix that. There is no need for an open-ended issue discussing how to use NodeMaterial or a theoretical backward-compatible wrapper, unless it is feedback on code that is already checked in. Sorry to be terse, these are too many tangents and resurrections of previous threads, and it is becoming disruptive to the aspects of NodeMaterial that require more focused discussion.

0reactions
pailheadcommented, Jun 8, 2018

The checked in code can be seen here: https://github.com/mrdoob/three.js/blob/dev/examples/webgl_materials_nodes.html#L361-L367

The feedback is:

why are inputs one level detached from the material. Why .prop.value and not just .prop?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node Material - Babylon.js Documentation
To do this, place this static property in your code before creating or loading your node materials: BABYLON.NodeMaterial.IgnoreTexturesAtLoadTime = true ...
Read more >
Three.js NodeMaterial introduction - Don McCurdy
js to build the shader for us: const material = new THREE.StandardNodeMaterial(); // Basic material properties. material.color = new THREE.
Read more >
Procedural Node Material Shaders: 3 Tips For Getting Started
Thirdly, it showcases how to create a node, how to set properties of a node, and how to connect nodes to other nodes,...
Read more >
Displaying custom Node properties within Interface (HTML)
For example, we have custom properties on both our nodes and interfaces. We are using HTML to build simple tables to list out...
Read more >
NodeMaterial · Issue #7522 · mrdoob/three.js - GitHub
NodeMaterial to reconcile the differences materials between 3D authoring software. ... NodeMaterial, how to interface with properties #14254.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found