Skip to content

Commit

Permalink
Adjust default light intensity
Browse files Browse the repository at this point in the history
Changes in Three.js regarding light computation even with the `renderer.useLegacyLights` parameter enabled.
  • Loading branch information
ppillot committed Apr 11, 2024
1 parent f9802b2 commit 77ca97d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions examples/js/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ NGL.Preferences = function (id, defaultParams) {
cameraFov: 40,
cameraType: 'perspective',
lightColor: 0xdddddd,
lightIntensity: 1.0,
lightIntensity: 1.2,
ambientColor: 0xdddddd,
ambientIntensity: 0.2,
ambientIntensity: 0.3,
hoverTimeout: 0
}

Expand Down
11 changes: 6 additions & 5 deletions src/stage/stage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import Surface from '../surface/surface'
import Volume from '../surface/volume'
import Shape from '../geometry/shape'
import Script from '../script'
import { GenericColor } from '../types'

function matchName (name: string|RegExp, object: { name: string }) {
if (name instanceof RegExp) {
Expand Down Expand Up @@ -123,7 +124,7 @@ export const StageDefaultParameters = {
quality: 'medium' as RenderQualityType,
workerDefault: true,
sampleLevel: 0,
backgroundColor: 'black' as string|number,
backgroundColor: 'black' as GenericColor,
rotateSpeed: 2.0,
zoomSpeed: 1.2,
panSpeed: 1.0,
Expand All @@ -137,10 +138,10 @@ export const StageDefaultParameters = {
cameraFov: 40,
cameraEyeSep: 0.3,
cameraType: 'perspective' as 'perspective'|'orthographic'|'stereo',
lightColor: 0xdddddd as string|number,
lightIntensity: 1.0,
ambientColor: 0xdddddd as string|number,
ambientIntensity: 0.2,
lightColor: 0xdddddd as GenericColor,
lightIntensity: 1.2,
ambientColor: 0xdddddd as GenericColor,
ambientIntensity: 0.3,
hoverTimeout: 0,
tooltip: true,
mousePreset: 'default' as MouseControlPreset
Expand Down
4 changes: 2 additions & 2 deletions src/viewer/viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,9 @@ export default class Viewer {
clipScale: 'relative',

lightColor: new Color(0xdddddd),
lightIntensity: 1.0,
lightIntensity: 1.2,
ambientColor: new Color(0xdddddd),
ambientIntensity: 0.2,
ambientIntensity: 0.3,

sampleLevel: 0,

Expand Down

0 comments on commit 77ca97d

Please sign in to comment.