model-viewer icon indicating copy to clipboard operation
model-viewer copied to clipboard

Resolve msaa when needed

Open slimbuck opened this issue 2 years ago • 1 comments

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.

slimbuck avatar May 03 '22 15:05 slimbuck

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.

mvaligursky avatar May 03 '22 15:05 mvaligursky