Skip to content

Commit

Permalink
Fix RenderTexture crashing in the presence of a light.
Browse files Browse the repository at this point in the history
More generally, anything with a default/no normal map should be fixed.
  • Loading branch information
BenjaminDRichards committed Feb 26, 2024
1 parent 7eede9d commit 37ba351
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog/3.90/CHANGELOG-v3.90.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

# Bug Fixes

* Fix `RenderTexture` crashing in the presence of a light.
* Fix failure to restore compressed textures after WebGL context loss.
* Fix a single WebGL error, with no visual side-effects, from occurring while calling `Shader.setRenderToTexture()` after the game has started running. Actually, the root cause was leaving new WebGL textures bound after creation.

Expand Down
4 changes: 2 additions & 2 deletions src/renderer/webgl/pipelines/LightPipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ var LightPipeline = new Class({

if (!gameObject)
{
return this.renderer.normalMap;
return this.renderer.normalTexture;
}
else if (gameObject.displayTexture)
{
Expand All @@ -399,7 +399,7 @@ var LightPipeline = new Class({

if (!normalMap)
{
return this.renderer.normalMap;
return this.renderer.normalTexture;
}

return normalMap.glTexture;
Expand Down

0 comments on commit 37ba351

Please sign in to comment.