model-viewer
model-viewer copied to clipboard
Resolve msaa when needed
The viewer was resolving color & depth buffers every frame, even though depth was not always needed.
This PR updates the viewer to only resolve color buffers every frame and then resolve depth buffer when it's required.
This change saves 3.0ms per frame when rendering 4xMSAA at 1440p on macbook ATI hardware.
Ideally we would not resolve depth .. as this is the only code at the moment that does it, and it's not compatible with WebGl1 nor WebGPU. I'd prefer we remove depth parameter to RenderTarget.resolve and implement this feature using SceneDepth.