[Enhancement] onBeforeCompile may break material's .clone() method
See original GitHub issueDescription of the problem
onBeforeCompile
seems to be ignored when cloning materials:
https://codepen.io/anon/pen/yjPLrJ?editors=1010
Expected result is equal amount of yellow and red cubes.
Proposing to either:
- consider
Material.onBeforeCompile
when cloning - document that there should be no cloning happening after setting this callback
- document that
.clone()
is non deterministic, it’s going to be a different clone depending on the presence ofonBeforeCompile
Three.js version
- Dev
- r92
- …
Browser
- All of them
- Chrome
- Firefox
- Internet Explorer
OS
- All of them
- Windows
- macOS
- Linux
- Android
- iOS
Hardware Requirements (graphics card, VR Device, …)
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (11 by maintainers)
Top Results From Across the Web
Material#onBeforeCompile – three.js docs
Materials describe the appearance of objects. They are defined in a (mostly) renderer-independent way, so you don't have to rewrite materials if you...
Read more >THREE.ShaderMaterial cannot perform antialiasing
I created a ShaderMaterial to draw a box in three.js using the following key code: //magnetic orientation let magnetMaterial = new THREE.
Read more >v7 Changelog | Viewer | Autodesk Platform Services
Fixed. FusionSim panel gets cloned when a new model is loaded reusing the same viewer. Thumbnails of PDF sheets not loading in Document...
Read more >Unity on Apple silicon and Big Sur: Known issues and ...
Be prepared for Apple to break it though by Beta 4 ! lol ... Is there any way we can get Unity 2020.2b1...
Read more >ChangeLog - external/v8 - Git at Google
Classes: Add super support in methods and accessors (issue 3330). ... Don't expose Array.prototype.values as it breaks webcompat (Chromium. issue 409858).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I agree, focusing on
NodeMaterial
would be a much better use of our time – and we could follow that up with a graphical API to go with it.As of 2015 there was the idea that NodeMaterial might eventually be in
src/*
… I guess I’m wondering whether we should try to keep improving hooks for replacement into shaders andonBeforeCompile
, or whether we should be spending time on that instead. For example, implement glTF’s spec/gloss materials asTHREE.NodeStandardSGMaterial
.