RPG battleground animation loop calls composer.render() twice per frame #1068

Closed
opened 2026-08-13 06:33:03 +00:00 by spikerj · 1 comment
Owner

RpgGameComponent registers renderer.setAnimationLoop and calls this.composer?.render() both before raycasting (line ~465) and again at the end of the same callback (line ~500).

That is two EffectComposer passes per animation frame for the same camera/scene. The first pass is wasted work; the second is the one that includes the hover highlight.

Pinned by rpg-game.component.spec.ts ("animation loop highlights isTile meshes") which asserts composer.render is invoked at least twice per tick.

Fix: drop the first composer.render() (keep stats/controls update, then raycast/highlight, then a single render).

`RpgGameComponent` registers `renderer.setAnimationLoop` and calls `this.composer?.render()` both before raycasting (line ~465) and again at the end of the same callback (line ~500). That is two EffectComposer passes per animation frame for the same camera/scene. The first pass is wasted work; the second is the one that includes the hover highlight. Pinned by `rpg-game.component.spec.ts` ("animation loop highlights isTile meshes") which asserts `composer.render` is invoked at least twice per tick. Fix: drop the first `composer.render()` (keep stats/controls update, then raycast/highlight, then a single render).
Author
Owner

Resolved in spikersoft-angular PR #819 (merged to master). RPG battleground animation loop calls composer.render() once per frame. Closing.

Resolved in spikersoft-angular [PR #819](https://git.spikersoft.com/spikerj/spikersoft-angular/pulls/819) (merged to `master`). RPG battleground animation loop calls composer.render() once per frame. Closing.
Sign in to join this conversation.