diff --git a/js/outliner/outliner.js b/js/outliner/outliner.js index f9b0b47b..f5f75cfa 100644 --- a/js/outliner/outliner.js +++ b/js/outliner/outliner.js @@ -449,7 +449,7 @@ class OutlinerElement extends OutlinerNode { } OutlinerElement.prototype.isParent = false; OutlinerElement.fromSave = function(obj, keep_uuid) { - let Type = OutlinerElement.types[obj.type]; + let Type = OutlinerElement.types[obj.type] || Cube; if (Type) { return new Type(obj, keep_uuid ? obj.uuid : 0).init() } diff --git a/js/preview/canvas.js b/js/preview/canvas.js index 5d4f5907..0d810fdb 100644 --- a/js/preview/canvas.js +++ b/js/preview/canvas.js @@ -77,8 +77,7 @@ const Canvas = { vec3 N = vec3( modelViewMatrix * vec4(normal, 0.0) ); - float yLight = (1.0+N.z) * 0.5; - light = yLight * (1.0-AMBIENT) + N.x*N.x * XFAC + N.y*N.y * ZFAC + AMBIENT; + light = (0.2 + abs(N.z) * 0.8) * (1.0-AMBIENT) + N.x*N.x * XFAC + N.y*N.y * ZFAC + AMBIENT; } else { @@ -86,8 +85,8 @@ const Canvas = { } - if (color.b == 1.25) { - lift = 0.1; + if (color.b > 1.1) { + lift = 0.12; } else { lift = 0.0; } @@ -112,6 +111,11 @@ const Canvas = { gl_FragColor = vec4(lift + base * light * BRIGHTNESS, 1.0); + if (lift > 0.1) { + gl_FragColor.b = gl_FragColor.b * 1.16; + gl_FragColor.g = gl_FragColor.g * 1.04; + } + }` return new THREE.ShaderMaterial({ @@ -654,7 +658,7 @@ const Canvas = { } - if (color.b == 1.25) { + if (color.b > 1.1) { lift = 0.1; } else { lift = 0.0; diff --git a/js/texturing/textures.js b/js/texturing/textures.js index 14586fbb..79904d3c 100644 --- a/js/texturing/textures.js +++ b/js/texturing/textures.js @@ -83,7 +83,7 @@ class Texture { } - if (color.b == 1.25) { + if (color.b > 1.1) { lift = 0.1; } else { lift = 0.0;