Search Issue Tracker

Won't Fix

Votes

1

Found in

5.5.0p1

Issue ID

874955

Regression

No

Camera always clears framebuffer on WebGL

WebGL

-

Reproduction Steps:
1- Download the project and open "test" scene.
2- Make sure main camera's Clear Flags option is set to "Don't Clear" or "Depth only".
3- Play scene in editor, move cube with left/right arrow keys.
4- Observe expected results.
5- Build and run for WebGL.

Expected Result: Current scene should be rendered on top of previous one. (As seen at 4th step.)
Observed Result: Camera always clears both color and depth buffers.

Reproduced with: 5.6.0b6, 5.2.5f1

Comments (4)

  1. Emrys95

    Jun 19, 2020 12:37

    Is there any other workaround to this?

    UnityLoader.instantiate("gameContainer", "Build/name.json", {onProgress: UnityProgress,
    Module: {
    "webglContextAttributes": {"preserveDrawingBuffer": true},
    }});

    doesn't really work.

  2. Marco-Trivellato

    Jan 04, 2019 12:40

    This is the default webgl behaviour. See https://www.khronos.org/registry/webgl/specs/latest/1.0/#2.2 for more information.

    If you really want to preserve the content of the drawing buffer, you can set webglContextAttributes.preserveDrawingBuffer to true, at instantiation time:

    UnityLoader.instantiate("gameContainer", "Build/name.json", {onProgress: UnityProgress,
    Module: {
    "webglContextAttributes": {"preserveDrawingBuffer": true},
    }});

    Hope that helps.

  3. kevin-masson

    Dec 19, 2018 14:25

    Hey, what can we do to bypass this issue ?

  4. russellsavage

    Aug 28, 2017 17:00

    Why will this not be fixed? Could you please give an explanation. This is keeping us from upgrading to the newest versions of Unity.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.