Skip to content

Commit 8f83fd1

Browse files
authored
Prevent glClearColor when clear color is changed (#559)
Updating the `glClearColor` also triggers a `glClear`, this can lead to unwanted behaviour in the case where the render is idle.
2 parents 6ba91d9 + e251715 commit 8f83fd1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/core/renderers/webgl/WebGlRenderer.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -725,8 +725,7 @@ export class WebGlRenderer extends CoreRenderer {
725725
}
726726

727727
/**
728-
* Updates the WebGL context's clear color and clears the color buffer.
729-
*
728+
* Sets the glClearColor to the specified color. *
730729
* @param color - The color to set as the clear color, represented as a 32-bit integer.
731730
*/
732731
updateClearColor(color: number) {
@@ -745,6 +744,5 @@ export class WebGlRenderer extends CoreRenderer {
745744
raw: color,
746745
normalized: normalizedColor,
747746
};
748-
glw.clear();
749747
}
750748
}

0 commit comments

Comments
 (0)