NodeMaterial doesn't always recompile
See original GitHub issueDescription of the problem
NodeMaterial is only recompiled the first time the needsUpdate flag is set to true if the WebGL program cache key doesn’t change. I believe that this is due to the fact that now material recompiling is based on version and not only on this needsUpdate flag.
To fix this issue, onBeforeCompile.toString method of NodeMaterial shall return the material version instead of the needsCompile flag. It will force programCacheKey to be different and therefore the material will recompile as requested by the needsUpdate flag.
this.onBeforeCompile.toString = function () {
return self.version
};
Three.js version
- Dev
Browser
- All of them
OS
- All of them
\ping @sunag
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
trying to 'npm install', getting node-gyp rebuild errors #809
Follow these steps to resolve the issue. 1: Make sure you have build-tools installed. ... 3: Delete package-lock.json and node modules folder and ......
Read more >CONSTANTLY compiling shaders! - Feedback & Requests
I noticed when I create a material that it has just for Diffuse, Normal and Spec (using vectors and bitmaps) something like 720...
Read more >How to fix 'failed to compile Node.js app' error on heroku
It always end up with an error "Push rejected, failed to compile Node.js app." Here's my package.json file: { "name": "ecom", "version ...
Read more >UE4 "Compiling Shaders" is super slow
Every new hook-up or disconnect triggers a fresh re-compile of the material's preview, which is a few seconds each time (up to 20-30...
Read more >Compile Errors
This error is output by the file copy operation at the end of the compile if there is no .BSP file to copy,...
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
Should be fixed via #19833.
I think it’s okay to close this one. It can be reopened if there are still recompilation issues with
r119
.@njarraud @rclankhorst You can test now with the current
dev
state of the threejs?