Skip to content

3.8.8 Breaks camera.setViewportInOrientedSpace with multiple cameras in one sceneΒ #19108

@Remmoze

Description

@Remmoze

Cocos Creator version

3.8.8

System information

Windows 11

Issue description

When you have 2 cameras in your scene (in my case one is for UI and another one is for field) and you want one of your cameras output to not standard viewport, another camera is affected as well.
Everything works fine and great in 3.8.7, but as soon as you upgrade to 3.8.8, it breaks.

I tried looking at the changelog between 3.8.7 and 3.8.8 but has not idenified what is the issue (i guess it's something in c++ rendering, but i could not idenify what is the real cause)

3.8.7 before and after viewport of field camera change:

Image Image

3.8.8 before and after viewport of field camera change:

Image Image

Relevant error log output

No response

Steps to reproduce

  1. create a project with 2 cameras
  2. set viewport of one camera to not standard 0,0,1,1 rect
  3. 2nd camera is visually affected as well (but not its properties)

Minimal reproduction project

Here is sample project. GameFieldCameraTest.zip
Open it in 3.8.7 and run
cc.director.getScene().getChildByPath('field/Camera').getComponent(cc.CameraComponent).camera.setViewportInOrientedSpace(cc.rect(0.5, 0.5, 0.5, 0.5))

Then open it in 3.8.8 and run the same code. Output looks differently.

Scene structure:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugNeeds TriageNeeds to be assigned by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions