Skip to content

Commit

Permalink
feat(map): avoid rendering things obscured by fog in map viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
fallenoak committed Jan 13, 2024
1 parent 2ba1b81 commit c957a65
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
14 changes: 7 additions & 7 deletions packages/spelunker-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/spelunker-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"dependencies": {
"@apollo/client": "^3.8.8",
"@wowserhq/format": "^0.13.1",
"@wowserhq/scene": "^0.18.0",
"@wowserhq/scene": "^0.19.0",
"classnames": "^2.3.1",
"crypto-hash": "^2.0.0",
"graphql": "^16.8.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ const MapViewer = ({ map: { id, filename } }) => {
controls.update(delta);
mapManager.update(delta, camera);

// Adjust far clip (reduce draw calls by matching frustum to fog distance)
camera.far = mapManager.cameraFar;
camera.updateProjectionMatrix();

renderer.setClearColor(mapManager.clearColor);
renderer.render(scene, camera);

Expand Down

0 comments on commit c957a65

Please sign in to comment.