Skip to content

Fix shader setter not updating hasShaderUpdater and hasShaderTimeFn#796

Merged
jfboeve merged 1 commit into
lightning-js:mainfrom
guilhermesimoes:bugfix/setting-default-shader
May 19, 2026
Merged

Fix shader setter not updating hasShaderUpdater and hasShaderTimeFn#796
jfboeve merged 1 commit into
lightning-js:mainfrom
guilhermesimoes:bugfix/setting-default-shader

Conversation

@guilhermesimoes
Copy link
Copy Markdown
Contributor

@guilhermesimoes guilhermesimoes commented May 18, 2026

Fix crash:

TypeError: this.shader.update is not a function

caused by doing:

this.bar = renderer.createNode({
    w: BAR_WIDTH,
    h: BAR_HEIGHT,
    color: 0x00000000,
    shader: renderer.createShader('border', { w: 4, color: 0x000000cc }),
});

setTimeout(() => {
  this.bar.shader = renderer.createShader('default');
}, 5000);

Now, the properties hasShaderUpdater and hasShaderTimeFn are always updated when the shader is set to null or to the default shader.

@jfboeve
Copy link
Copy Markdown
Collaborator

jfboeve commented May 19, 2026

Nice find!

@jfboeve jfboeve merged commit 353242c into lightning-js:main May 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants