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 doesn't always recompile

See original GitHub issue
Description 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
Mugen87commented, Jul 17, 2020

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.

0reactions
sunagcommented, Jul 14, 2020

@njarraud @rclankhorst You can test now with the current dev state of the threejs?

Read more comments on GitHub >

github_iconTop 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 >

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