Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve lighting #158

Merged
merged 2 commits into from
May 29, 2023
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
6 changes: 3 additions & 3 deletions packages/jupytercad-extension/src/mainview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ export class MainView extends React.Component<IProps, IStates> {

this._scene = new THREE.Scene();

this._scene.add(new THREE.AmbientLight(0xffffff, 0.8)); // soft white light
this._scene.add(new THREE.AmbientLight(0xffffff, 0.5)); // soft white light

const light = new THREE.SpotLight(0xffffff, 0.2);
const light = new THREE.PointLight(0xffffff, 1);
Copy link
Member

Choose a reason for hiding this comment

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

I did not know adding a point light to the camera would make the point light stick to the camera position! That's good to know!

light.castShadow = true;
Copy link
Member

Choose a reason for hiding this comment

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

I think we should disable the shadowmap computing. We're not using it so we could save some perf here.

light.shadow.radius = 32;
light.shadow.mapSize.width = 128;
Expand Down Expand Up @@ -601,7 +601,7 @@ export class MainView extends React.Component<IProps, IStates> {
side: THREE.DoubleSide,
wireframe: false,
flatShading: false,
shininess: 40
shininess: 0
});

const geometry = new THREE.BufferGeometry();
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.