Skip to content
Merged
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
12 changes: 11 additions & 1 deletion examples/jsm/renderers/CSS2DRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,16 @@ class CSS2DRenderer {
*/
this.domElement = domElement;

/**
* Controls whether the renderer assigns `z-index` values to CSS2DObject DOM elements.
* If set to `true`, z-index values are assigned first based on the `renderOrder`
* and secondly - the distance to the camera. If set to `false`, no z-index values are assigned.
*
* @type {boolean}
* @default true
*/
this.sortObjects = true;

/**
* Returns an object containing the width and height of the renderer.
*
Expand Down Expand Up @@ -166,7 +176,7 @@ class CSS2DRenderer {
_viewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, _viewMatrix );

renderObject( scene, scene, camera );
zOrder( scene );
if ( this.sortObjects ) zOrder( scene );

};

Expand Down
Loading