Skip to content

Fix bug where glow layer is recreated every frame under NullEngine #16908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 23, 2025

Conversation

djn24
Copy link
Contributor

@djn24 djn24 commented Jul 22, 2025

The render() method in effectLayer.ts checks whether the current main texture size matches the desired size; it disposes and recreates it if it doesn't. Unfortunately when running with the null engine, the size of the created texture is always zero (whatever size arguments are passed into its constructor) so it never matches the desired size and is thus recreated every time.

Changing things such that textures return their intended size when running under the null engine seemed like quite an invasive and risky change, so my fix just changes effectLayer.ts to remember the size it asked for and check against that rather than the reported size of the texture.

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 22, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 22, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 22, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 22, 2025

@sebavan
Copy link
Member

sebavan commented Jul 22, 2025

Only one formatting issue to go

@deltakosh deltakosh enabled auto-merge (squash) July 22, 2025 14:37
@sebavan
Copy link
Member

sebavan commented Jul 22, 2025

@djn24 my guess is
image

should have space after { and before }

auto-merge was automatically disabled July 22, 2025 18:28

Head branch was pushed to by a user without write access

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 22, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 22, 2025

@sebavan
Copy link
Member

sebavan commented Jul 22, 2025

@djn24 this should also be on one line
image

@djn24
Copy link
Contributor Author

djn24 commented Jul 23, 2025

Thanks. I've just found what I think is the right command to run prettier, so hopefully this will pass this time.

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 23, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 23, 2025

@deltakosh deltakosh merged commit 7d07fd6 into BabylonJS:master Jul 23, 2025
18 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.

4 participants