Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions src/cameras/Camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ class Camera extends Object3D {

this.type = 'Camera';

/**
* The flag that indicates whether the camera uses a reversed depth buffer.
*
* @type {boolean}
* @default false
*/
this.reversedDepth = false;

/**
* The inverse of the camera's world matrix.
*
Expand Down Expand Up @@ -65,6 +57,20 @@ class Camera extends Object3D {
*/
this.coordinateSystem = WebGLCoordinateSystem;

this._reversedDepth = false;

}

/**
* The flag that indicates whether the camera uses a reversed depth buffer.
*
* @type {boolean}
* @default false
*/
get reversedDepth() {

return this._reversedDepth;

}
Comment on lines +70 to 74
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #31512 (comment).

This should be read-only for users, and set only by the renderer.


copy( source, recursive ) {
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2383,7 +2383,7 @@ class WebGLRenderer {

if ( reversedDepthBuffer && camera.reversedDepth !== true ) {

camera.reversedDepth = true;
camera._reversedDepth = true;
camera.updateProjectionMatrix();

}
Expand Down