turn down intensity of sky in dark mode
This commit is contained in:
parent
25c81d3e87
commit
cae667f840
2 changed files with 12 additions and 3 deletions
|
|
@ -33,11 +33,11 @@ function init() {
|
||||||
|
|
||||||
// setup default workspace
|
// setup default workspace
|
||||||
space.useDefaultKeys(false);
|
space.useDefaultKeys(false);
|
||||||
|
space.init($('container'), delta => { }, ortho);
|
||||||
space.sky.set({
|
space.sky.set({
|
||||||
grid: false,
|
grid: false,
|
||||||
color: dark ? 0 : 0xffffff
|
color: dark ? 0 : 0xffffff
|
||||||
});
|
});
|
||||||
space.init($('container'), delta => { }, ortho);
|
|
||||||
platform.set({
|
platform.set({
|
||||||
volume: false,
|
volume: false,
|
||||||
round: false,
|
round: false,
|
||||||
|
|
@ -474,7 +474,10 @@ function set_darkmode(dark) {
|
||||||
mesh.material.wireframe.color.set(0,0,0);
|
mesh.material.wireframe.color.set(0,0,0);
|
||||||
$('app').classList.remove('dark');
|
$('app').classList.remove('dark');
|
||||||
}
|
}
|
||||||
sky.set({ color: dark ? 0 : 0xffffff });
|
sky.set({
|
||||||
|
color: dark ? 0 : 0xffffff,
|
||||||
|
ambient: { intensity: dark ? 0.6 : 1 }
|
||||||
|
});
|
||||||
platform.set({
|
platform.set({
|
||||||
grid: dark ? {
|
grid: dark ? {
|
||||||
colorMajor: 0x666666,
|
colorMajor: 0x666666,
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@
|
||||||
lightIntensity = 0.3,
|
lightIntensity = 0.3,
|
||||||
initialized = false,
|
initialized = false,
|
||||||
alignedTracking = false,
|
alignedTracking = false,
|
||||||
|
skyAmbient,
|
||||||
skyGridColor = 0xcccccc,
|
skyGridColor = 0xcccccc,
|
||||||
skyMaterial = undefined,
|
skyMaterial = undefined,
|
||||||
skyGridMaterial = undefined,
|
skyGridMaterial = undefined,
|
||||||
|
|
@ -923,6 +924,11 @@
|
||||||
if (grid) Space.sky.showGrid(grid);
|
if (grid) Space.sky.showGrid(grid);
|
||||||
if (color !== undefined) Space.sky.setColor(color);
|
if (color !== undefined) Space.sky.setColor(color);
|
||||||
if (gridColor !== undefined) Space.sky.setGridColor(gridColor);
|
if (gridColor !== undefined) Space.sky.setGridColor(gridColor);
|
||||||
|
if (skyAmbient && opt.ambient) {
|
||||||
|
let { color, intensity } = opt.ambient;
|
||||||
|
if (color) skyAmbient.color.set(color);
|
||||||
|
if (intensity) skyAmbient.intensity = intensity;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setPlatform(opt = {}) {
|
function setPlatform(opt = {}) {
|
||||||
|
|
@ -1186,7 +1192,7 @@
|
||||||
viewControl.noKeys = true;
|
viewControl.noKeys = true;
|
||||||
viewControl.maxDistance = 1000;
|
viewControl.maxDistance = 1000;
|
||||||
|
|
||||||
SCENE.add(new THREE.AmbientLight(0x707070));
|
SCENE.add(skyAmbient = new THREE.AmbientLight(0x707070));
|
||||||
|
|
||||||
light1 = addLight( 200, 250, 200, lightIntensity * 1.15);
|
light1 = addLight( 200, 250, 200, lightIntensity * 1.15);
|
||||||
light2 = addLight(-200, 250, -200, lightIntensity * 0.95);
|
light2 = addLight(-200, 250, -200, lightIntensity * 0.95);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue