Viewer API - changing background colour

Hello! I am trying to use Speckle Viewer 2.0 API, and when changing the background colour of the SpeckleRenderer, it appears to draw the new colour on top of the object I am displaying.

All I’ve done to change the background colour is add this as a step in loading the viewer:

this.viewer.getRenderer().scene.background = new Color(0x33cc33);

and it ends up displaying this:

I would assume that I am somehow adding the colour over the top, but that would not make sense as I am only assigning a new colour to a preexisting background.

Any help would be incredibly appreciated!

Hi @Sebastian_Collis

Currently we haven’t integrated three’s approach on rendering background color or texture into our viewer properly, but your point is fair and will take care of it in the next update on API 2.0

Until then, you can achieve the same effect by doing

viewer.getContainer().style.backgroundColor = "#33cc33"

Here’s a running example: https://codesandbox.io/p/sandbox/optimistic-sutherland-hpkvld?file=%2Fsrc%2Findex.ts%3A18%2C3

Thank you for getting in touch with us, and we appreciate the feedback!

Cheers