When the sky is set to atmosphere the stars entity and mesh are generated. However, this also happens if the computed number of stars is 0, which is the case for several of the presets. While nothing is being drawn it still has some drawbacks:
Three.js still prepares everything for this draw call (e.g. uniforms), which is just wasted effort
The Quest browser logs a warning each frame (RENDER WARNING: Render count or primcount is 0.), which after logging 256 warnings stops any further WebGL errors from being logged.
This PR adds an additional check if the star count is 0, in which case the stars aren't created (or even disposed/removed if created prior).
When the sky is set to
atmosphere
the stars entity and mesh are generated. However, this also happens if the computed number of stars is 0, which is the case for several of the presets. While nothing is being drawn it still has some drawbacks:RENDER WARNING: Render count or primcount is 0.
), which after logging 256 warnings stops any further WebGL errors from being logged.This PR adds an additional check if the star count is 0, in which case the stars aren't created (or even disposed/removed if created prior).