Skip to content

Commit

Permalink
clipping and frustum culling
Browse files Browse the repository at this point in the history
Signed-off-by: hanbollar <[email protected]>
  • Loading branch information
hanbollar committed May 17, 2024
1 parent cd3af5d commit d808d15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/core/MRApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ export class MRApp extends MRElement {
this.renderer.toneMapping = THREE.ACESFilmicToneMapping;
this.renderer.toneMappingExposure = 1;
this.renderer.localClippingEnabled = true;
this.renderer.setFrustumCulling(true);

this.appendChild(this.renderer.domElement);

Expand Down
4 changes: 3 additions & 1 deletion src/core/componentSystems/ClippingSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ export class ClippingSystem extends MRSystem {
*/
update(deltaTime, frame) {
for (const entity of this.registry) {
this.updatePlanes(entity);
if (entity.visible) {
this.updatePlanes(entity);
}
}
}

Expand Down

0 comments on commit d808d15

Please sign in to comment.