-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
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
NodeMaterial, should all the shaders from /examples be converted to the new format? #14252
Comments
If |
Do you have an idea what would happen to
If |
For example: var material = new THREE.MeshStandardMaterial();
material.map = textureLoader.load('foo.png');
var node = material.node;
node.color.coord.index = 1;
console.log( material.node.color ); // THREE.TextureNode But this really comes down to implementation details, a PR would be necessary to answer these questions in any detail. |
that's a great example but i think it's for a different topic. If you don't mind i'd open another issue and move this there? In the block above, how can I reason about Why not:
Also related is #14250. In order to give a better comparison with what nodes to with textures and mapping, the templates could be refactored. |
For this topic, it sounds like: Wouldn't actually be rewriitten, since it's already a What's confusing is how does this apply to the non-artist people. I would assume that for some reason this shader is different, could be labeled more I would like to establish some kind of a nomenclature or classification to better understand why some materials are eligible for these out of the box modifications and others are not. One rule could be "if its in /examples, not our concern". Another could be "if it does FOO, not a concern". |
I don't think we're going to be able to answer these questions until we begin implementing something... to your original question of "should all shaders from /examples be converted..." I think the answer is no. |
I think the biggest pain point in this whole story is what
i can't relate this to: Isn't it already implemented? What does implementation refer to in this context? |
I believe I misread, thinking you were referring to the backward-compatible For |
I think i'm overall confused with what |
Each one of these will extend https://github.com/mrdoob/three.js/tree/dev/src/materials stuff in |
I think we're pretty far down a chain of assumptions on this discussion. I've written my own suggested steps on this (buried in #7522 somewhere now) which would involve (1) putting NodeMaterial in src, and (2) eventually rewriting core MeshFooMaterial materials to use nodes internally. But mrdoob has not weighed in on whether to merge NodeMaterial at all, and if so he might certainly prefer to keep the existing materials around as-is, or wait a while before changing them. So I think there are too many unanswered questions to really get into this. But (IMO) nothing needs to be converted... if examples can be improved with nodes, we'll improve them. If not, no worries. |
Agreed with everything @donmccurdy said. |
Extracting various topics from #7522.
Today we have a lot of examples in
/examples
. A great example of something that could be part of three.js core from a user's perspective, but not are fat lines.A user would like to be able to:
And often they expect a very simple interface:
This is not possible today out of the box, but it is possible by using the atomic building blocks that three.js exposes -
ShaderMaterial
,InstancedBufferGeometry
,InterleavedBuffer
etc.If we consider something like this:
https://github.com/mrdoob/three.js/blob/dev/examples/js/lines/LineMaterial.js
There are several ways for me to take this shader and modify it to suit the needs of my app. For example, i can inject things into the template, i could look at the string in
onBeforeCompile
etc etc.How are these random scattered shaders/materials going to be treated once
NodeMaterial
becomes the default system?For example, if one looks at this comment, one could deduce that just having an API may not be enough for users who don't code GLSL, and the expectation would be that various example materials/effects would all be converted.
The text was updated successfully, but these errors were encountered: