{"action":"created","issue":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/14149","repository_url":"https://api.github.com/repos/mrdoob/three.js","labels_url":"https://api.github.com/repos/mrdoob/three.js/issues/14149/labels{/name}","comments_url":"https://api.github.com/repos/mrdoob/three.js/issues/14149/comments","events_url":"https://api.github.com/repos/mrdoob/three.js/issues/14149/events","html_url":"https://github.com/mrdoob/three.js/pull/14149","id":326701726,"number":14149,"title":"[WIP] GLTFLoader: Use node materials.","user":{"login":"donmccurdy","id":1848368,"avatar_url":"https://avatars3.githubusercontent.com/u/1848368?v=4","gravatar_id":"","url":"https://api.github.com/users/donmccurdy","html_url":"https://github.com/donmccurdy","followers_url":"https://api.github.com/users/donmccurdy/followers","following_url":"https://api.github.com/users/donmccurdy/following{/other_user}","gists_url":"https://api.github.com/users/donmccurdy/gists{/gist_id}","starred_url":"https://api.github.com/users/donmccurdy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donmccurdy/subscriptions","organizations_url":"https://api.github.com/users/donmccurdy/orgs","repos_url":"https://api.github.com/users/donmccurdy/repos","events_url":"https://api.github.com/users/donmccurdy/events{/privacy}","received_events_url":"https://api.github.com/users/donmccurdy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2018-05-26T02:06:52Z","updated_at":"2018-05-29T22:48:52Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/mrdoob/three.js/pulls/14149","html_url":"https://github.com/mrdoob/three.js/pull/14149","diff_url":"https://github.com/mrdoob/three.js/pull/14149.diff","patch_url":"https://github.com/mrdoob/three.js/pull/14149.patch"},"body":"With various threads about `onBeforeCompile` vs `onBeforeRender` for custom materials, per-map UV sets, and per-map texture transforms, thought I'd check on the status of node materials. The API is looking quite nice, and converting the GLTFLoader's mesh/standard material was straightforward.\r\n\r\n| material | preview |\r\n|---|---|\r\n| MeshStandardMaterial | ![screen shot 2018-05-26 at 11 54 34 am](https://user-images.githubusercontent.com/1848368/40579413-a4c08634-60db-11e8-882c-a59716658399.png) |\r\n| StandardNodeMaterial | ![screen shot 2018-05-26 at 11 54 36 am](https://user-images.githubusercontent.com/1848368/40579411-a100c6b2-60db-11e8-91eb-78769735d437.png) |\r\n\r\nDemo: [MeshStandardMaterial](https://threejs.org/examples/webgl_loader_gltf.html) | [StandardNodeMaterial](https://cdn.rawgit.com/donmccurdy/three.js/feat-gltf-node-materials/examples/webgl_loader_gltf.html)\r\n\r\n~~Either I haven't configured it properly or the PBR model isn't quite matching up.~~ I've included a small hack to fix the colorspace, and normals are inverted. I'm in no rush to merge something like this (wouldn't expect users to include all of these nodes individually, for starters) but wanted to start testing node materials more and iron out any issues."},"comment":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/comments/392972498","html_url":"https://github.com/mrdoob/three.js/pull/14149#issuecomment-392972498","issue_url":"https://api.github.com/repos/mrdoob/three.js/issues/14149","id":392972498,"user":{"login":"donmccurdy","id":1848368,"avatar_url":"https://avatars3.githubusercontent.com/u/1848368?v=4","gravatar_id":"","url":"https://api.github.com/users/donmccurdy","html_url":"https://github.com/donmccurdy","followers_url":"https://api.github.com/users/donmccurdy/followers","following_url":"https://api.github.com/users/donmccurdy/following{/other_user}","gists_url":"https://api.github.com/users/donmccurdy/gists{/gist_id}","starred_url":"https://api.github.com/users/donmccurdy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donmccurdy/subscriptions","organizations_url":"https://api.github.com/users/donmccurdy/orgs","repos_url":"https://api.github.com/users/donmccurdy/repos","events_url":"https://api.github.com/users/donmccurdy/events{/privacy}","received_events_url":"https://api.github.com/users/donmccurdy/received_events","type":"User","site_admin":false},"created_at":"2018-05-29T22:48:52Z","updated_at":"2018-05-29T22:48:52Z","author_association":"COLLABORATOR","body":"> That said I support node-based shaders because of their flexibility but you will never be able to export their full flexibility into glTF.\r\n> \r\n> Was this even the goal here? The flexibility should benefit three.js not glTF?\r\n\r\nI have no expectation that arbitrary node-based shaders be exported as to the current glTF spec, nor that the glTF spec should grow to support that — I'm interested in particular features (per-texture transforms, per-texture UV sets, etc...) that would benefit three.js generally, and also give us feature-parity with the glTF specification.\r\n\r\n> Just be aware that shader graphs reduce the ability to transfer shaders between toolsets. Basically they are too flexible to reliable convert between tools because each shader graph framework implements different nodes things differently. This has been a huge issue in the VFX world for the last decade. So there is a distinct tradeoff between portability and flexibility. ... That said I support node-based shaders ...\r\n\r\nThese are helpful points, thank you. As you mention these drawbacks, in what conditions do you support node-based materials? As a hypothetical strawman proposal, suppose that we...\r\n\r\n1. Bring node materials into three.js `src/*`\r\n2. Move Material classes to examples that assemble particular shader graphs\r\n\r\n... would that lose too much portability? Make SSS, GI, and refraction harder to implement?"}}
{"actor":{"display_login":"donmccurdy"}}