Skip to content

Commit

Permalink
Revert "Update three to 114.0"
Browse files Browse the repository at this point in the history
This reverts commit 709dbba.
Wait for fixing mrdoob/three.js#18957
  • Loading branch information
NataliaDSmirnova committed Mar 23, 2020
1 parent 709dbba commit 0c8da84
Show file tree
Hide file tree
Showing 26 changed files with 45 additions and 46 deletions.
2 changes: 1 addition & 1 deletion examples/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="../dist/Miew.min.css">
<script src="https://unpkg.com/@babel/polyfill@7/dist/polyfill.min.js"></script>
<script src="https://unpkg.com/lodash@^4.17.15/lodash.js"></script>
<script src="https://unpkg.com/three@0.114.0/build/three.min.js"></script>
<script src="https://unpkg.com/three@0.112.1/build/three.min.js"></script>
<script src="../dist/Miew.min.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/empty.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="../dist/Miew.min.css">
<script src="https://unpkg.com/@babel/polyfill@7/dist/polyfill.min.js"></script>
<script src="https://unpkg.com/lodash@^4.17.15/lodash.js"></script>
<script src="https://unpkg.com/three@0.114.0/build/three.min.js"></script>
<script src="https://unpkg.com/three@0.112.1/build/three.min.js"></script>
<script src="../dist/Miew.min.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/events.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="../dist/Miew.min.css">
<script src="https://unpkg.com/@babel/polyfill@7/dist/polyfill.min.js"></script>
<script src="https://unpkg.com/lodash@^4.17.15/lodash.js"></script>
<script src="https://unpkg.com/three@0.114.0/build/three.min.js"></script>
<script src="https://unpkg.com/three@0.112.1/build/three.min.js"></script>
<script src="../dist/Miew.min.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/fullscreen.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

<script src="https://unpkg.com/@babel/polyfill@7/dist/polyfill.min.js"></script>
<script src="https://unpkg.com/lodash@^4.17.15/lodash.js"></script>
<script src="https://unpkg.com/three@0.114.0/build/three.min.js"></script>
<script src="https://unpkg.com/three@0.112.1/build/three.min.js"></script>
<script src="../dist/Miew.min.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ <h2>Adverse effects</h2>

<script src="https://unpkg.com/@babel/polyfill@7/dist/polyfill.min.js"></script>
<script src="https://unpkg.com/lodash@^4.17.15/lodash.js"></script>
<script src="https://unpkg.com/three@0.114.0/build/three.min.js"></script>
<script src="https://unpkg.com/three@0.112.1/build/three.min.js"></script>
<script src="../dist/Miew.min.js"></script>
<script>
(function() {
Expand Down
2 changes: 1 addition & 1 deletion examples/labels.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="../dist/Miew.min.css">
<script src="https://unpkg.com/@babel/polyfill@7/dist/polyfill.min.js"></script>
<script src="https://unpkg.com/lodash@^4.17.15/lodash.js"></script>
<script src="https://unpkg.com/three@0.114.0/build/three.min.js"></script>
<script src="https://unpkg.com/three@0.112.1/build/three.min.js"></script>
<script src="../dist/Miew.min.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/load_from_string.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="../dist/Miew.min.css">
<script src="https://unpkg.com/@babel/polyfill@7/dist/polyfill.min.js"></script>
<script src="https://unpkg.com/lodash@^4.17.15/lodash.js"></script>
<script src="https://unpkg.com/three@0.114.0/build/three.min.js"></script>
<script src="https://unpkg.com/three@0.112.1/build/three.min.js"></script>
<script src="../dist/Miew.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/miew_via_global.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="../dist/Miew.min.css">
<script src="https://unpkg.com/@babel/polyfill@7/dist/polyfill.min.js"></script>
<script src="https://unpkg.com/lodash@^4.17.15/lodash.js"></script>
<script src="https://unpkg.com/three@0.114.0/build/three.min.js"></script>
<script src="https://unpkg.com/three@0.112.1/build/three.min.js"></script>
<script src="../dist/Miew.min.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/miew_via_require.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h1>Use Miew via Require.js</h1>
require.config({
paths: {
'lodash': 'https://unpkg.com/lodash@^4.17.15/lodash',
'three': 'https://unpkg.com/three@0.114.0/build/three.min',
'three': 'https://unpkg.com/three@0.112.1/build/three.min',
}
});
require(['../dist/Miew.min'], function(Miew) {
Expand Down
2 changes: 1 addition & 1 deletion examples/multiple.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="../dist/Miew.min.css">
<script src="https://unpkg.com/@babel/polyfill@7/dist/polyfill.min.js"></script>
<script src="https://unpkg.com/lodash@^4.17.15/lodash.js"></script>
<script src="https://unpkg.com/three@0.114.0/build/three.min.js"></script>
<script src="https://unpkg.com/three@0.112.1/build/three.min.js"></script>
<script src="../dist/Miew.min.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="../dist/Miew.min.css">
<script src="https://unpkg.com/@babel/polyfill@7/dist/polyfill.min.js"></script>
<script src="https://unpkg.com/lodash@^4.17.15/lodash.js"></script>
<script src="https://unpkg.com/three@0.114.0/build/three.min.js"></script>
<script src="https://unpkg.com/three@0.112.1/build/three.min.js"></script>
<script src="../dist/Miew.min.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/options_fromAttr.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="../dist/Miew.min.css">
<script src="https://unpkg.com/@babel/polyfill@7/dist/polyfill.min.js"></script>
<script src="https://unpkg.com/lodash@^4.17.15/lodash.js"></script>
<script src="https://unpkg.com/three@0.114.0/build/three.min.js"></script>
<script src="https://unpkg.com/three@0.112.1/build/three.min.js"></script>
<script src="../dist/Miew.min.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/options_fromURL.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="../dist/Miew.min.css">
<script src="https://unpkg.com/@babel/polyfill@7/dist/polyfill.min.js"></script>
<script src="https://unpkg.com/lodash@^4.17.15/lodash.js"></script>
<script src="https://unpkg.com/three@0.114.0/build/three.min.js"></script>
<script src="https://unpkg.com/three@0.112.1/build/three.min.js"></script>
<script src="../dist/Miew.min.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/projected.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<script src="https://unpkg.com/@babel/polyfill@7/dist/polyfill.min.js"></script>
<script src="https://unpkg.com/lodash@^4.17.15/lodash.js"></script>
<script src="https://unpkg.com/three@0.114.0/build/three.min.js"></script>
<script src="https://unpkg.com/three@0.112.1/build/three.min.js"></script>
<script src="../dist/Miew.min.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/sequence.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="../dist/Miew.min.css">
<script src="https://unpkg.com/@babel/polyfill@7/dist/polyfill.min.js"></script>
<script src="https://unpkg.com/lodash@^4.17.15/lodash.js"></script>
<script src="https://unpkg.com/three@0.114.0/build/three.min.js"></script>
<script src="https://unpkg.com/three@0.112.1/build/three.min.js"></script>
<script src="../dist/Miew.min.js"></script>
<style>
.miew-container {
Expand Down
2 changes: 1 addition & 1 deletion examples/terminal.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<script src="https://unpkg.com/jquery@3/dist/jquery.min.js"></script>
<script src="https://unpkg.com/jquery.terminal@1/js/jquery.terminal.min.js"></script>
<script src="https://unpkg.com/lodash@^4.17.15/lodash.js"></script>
<script src="https://unpkg.com/three@0.114.0/build/three.min.js"></script>
<script src="https://unpkg.com/three@0.112.1/build/three.min.js"></script>
<script src="../dist/Miew.min.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/transparent_background.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h1>Use transparent background</h1>

<script src="https://unpkg.com/@babel/polyfill@7/dist/polyfill.min.js"></script>
<script src="https://unpkg.com/lodash@^4.17.15/lodash.js"></script>
<script src="https://unpkg.com/three@0.114.0/build/three.min.js"></script>
<script src="https://unpkg.com/three@0.112.1/build/three.min.js"></script>
<script src="../dist/Miew.min.js"></script>
<script>
(function() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
},
"dependencies": {
"lodash": "^4.17.15",
"three": "0.114.0"
"three": "0.112.1"
},
"devDependencies": {
"@babel/core": "^7.8.7",
Expand Down
6 changes: 3 additions & 3 deletions src/Miew.js
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,7 @@ Miew.prototype._performAO = (function () {
return;
}
const gfx = this._gfx;
const tanHalfFOV = Math.tan(THREE.MathUtils.DEG2RAD * 0.5 * gfx.camera.fov);
const tanHalfFOV = Math.tan(THREE.Math.DEG2RAD * 0.5 * gfx.camera.fov);

_aoMaterial.uniforms.diffuseTexture.value = srcColorBuffer.texture;
_aoMaterial.uniforms.depthTexture.value = srcDepthTexture;
Expand Down Expand Up @@ -3128,11 +3128,11 @@ Miew.prototype.screenshot = function (width, height) {
const deviceHeight = gfx.renderer.domElement.height;

function fov2Tan(fov) {
return Math.tan(THREE.MathUtils.degToRad(0.5 * fov));
return Math.tan(THREE.Math.degToRad(0.5 * fov));
}

function tan2Fov(tan) {
return THREE.MathUtils.radToDeg(Math.atan(tan)) * 2.0;
return THREE.Math.radToDeg(Math.atan(tan)) * 2.0;
}

function getDataURL() {
Expand Down
2 changes: 1 addition & 1 deletion src/chem/AromaticLoopsMarker.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function _anotherAtom(bond, currAtom) {

function _cosBetween(v1, v2) {
const theta = v1.dot(v2) / (Math.sqrt(v1.lengthSq() * v2.lengthSq()));
return THREE.MathUtils.clamp(theta, -1, 1);
return THREE.Math.clamp(theta, -1, 1);
}

function _markAromatic(bond) {
Expand Down
2 changes: 1 addition & 1 deletion src/gfx/CSS2DRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class CSS2DRenderer {
element.style.background = colorAsHex(object.userData.background);
}
} else {
const fogFactor = THREE.MathUtils.smoothstep(-this._vector.z, scene.fog.near, scene.fog.far);
const fogFactor = THREE.Math.smoothstep(-this._vector.z, scene.fog.near, scene.fog.far);
element.style.color = lerpColorAsHex(object.userData.color, scene.fog.color, fogFactor);
if (object.userData.background !== 'transparent') {
element.style.background = lerpColorAsHex(object.userData.background, scene.fog.color, fogFactor);
Expand Down
2 changes: 1 addition & 1 deletion src/gfx/VolumeFarPlane.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class VolumeFarPlane {
// update material props
material.uniforms.aspectRatio.value = camera.aspect;
material.uniforms.farZ.value = camera.far;
material.uniforms.tanHalfFOV.value = Math.tan(THREE.MathUtils.DEG2RAD * 0.5 * camera.fov);
material.uniforms.tanHalfFOV.value = Math.tan(THREE.Math.DEG2RAD * 0.5 * camera.fov);
material.uniforms.matWorld2Volume.value = matWorldToVolume;
};

Expand Down
14 changes: 7 additions & 7 deletions src/gfx/gfxutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ THREE.PerspectiveCamera.prototype.setMinimalFov = function (angle) {
if (this.aspect >= 1.0) {
this.fov = angle;
} else {
this.fov = THREE.MathUtils.radToDeg(2 * Math.atan(Math.tan(THREE.MathUtils.degToRad(angle) * 0.5) / this.aspect));
this.fov = THREE.Math.radToDeg(2 * Math.atan(Math.tan(THREE.Math.degToRad(angle) * 0.5) / this.aspect));
}
};

Expand Down Expand Up @@ -182,7 +182,7 @@ THREE.StereoCamera.prototype.updateHalfSized = function (camera, angle) {
* @param {number} angle - Field of view in degrees.
*/
THREE.PerspectiveCamera.prototype.setDistanceToFit = function (radius, angle) {
this.position.z = radius / Math.sin(0.5 * THREE.MathUtils.degToRad(angle));
this.position.z = radius / Math.sin(0.5 * THREE.Math.degToRad(angle));
};

/**
Expand Down Expand Up @@ -445,11 +445,11 @@ function applyTransformsToMeshes(root, mtc) {
if (!parent) {
continue;
}
mesh.applyMatrix4(mtc[0]);
mesh.applyMatrix(mtc[0]);
for (let j = 1; j < mtcCount; ++j) {
const newMesh = new mesh.constructor(mesh.geometry, mesh.material);
parent.add(newMesh);
newMesh.applyMatrix4(mtc[j]);
newMesh.applyMatrix(mtc[j]);
}
}
}
Expand Down Expand Up @@ -480,7 +480,7 @@ function processTransparentMaterial(root, material) {
prepassMesh.material[value] = false;
});
prepassMesh.material.needsUpdate = true;
prepassMesh.applyMatrix4(mesh.matrix);
prepassMesh.applyMatrix(mesh.matrix);
prepassMesh.layers.set(LAYERS.PREPASS_TRANSPARENT);
parent.add(prepassMesh);
}
Expand Down Expand Up @@ -511,7 +511,7 @@ function processColFromPosMaterial(root, material) {
});

colFromPosMesh.material.needsUpdate = true;
colFromPosMesh.applyMatrix4(mesh.matrix);
colFromPosMesh.applyMatrix(mesh.matrix);
colFromPosMesh.layers.set(LAYERS.COLOR_FROM_POSITION);
parent.add(colFromPosMesh);
}
Expand Down Expand Up @@ -549,7 +549,7 @@ function createShadowmapMaterial(root, material) {
});
shadowmapMesh.isShadowmapMesh = true;
shadowmapMesh.material.needsUpdate = true;
shadowmapMesh.applyMatrix4(mesh.matrix);
shadowmapMesh.applyMatrix(mesh.matrix);
shadowmapMesh.layers.set(LAYERS.SHADOWMAP);
parent.add(shadowmapMesh);
}
Expand Down
3 changes: 2 additions & 1 deletion src/gfx/meshes/TransformGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ class TransformGroup extends THREE.Object3D {
const meshes = [];
for (let i = 0, n = transforms.length; i < n; ++i) {
const mesh = new Mesh(geometry, material);
mesh.applyMatrix4(transforms[i]);
mesh.applyMatrix(transforms[i]);

meshes[i] = mesh;
}

Expand Down
18 changes: 8 additions & 10 deletions src/gfx/shaders/Uber.frag
Original file line number Diff line number Diff line change
Expand Up @@ -248,16 +248,14 @@ float unpackRGBAToDepth( const in vec4 v ) {
struct DirectionalLight {
vec3 direction;
vec3 color;
};
uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];

struct DirectionalLightShadow {
vec2 shadowMapSize;
float shadowBias;
float shadowRadius;
};
uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHTS ];
int shadow;
vec2 shadowMapSize;
float shadowBias;
float shadowRadius;
};

uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
uniform vec3 ambientLightColor;

/////////////////////////////////////////// Shadowmap ////////////////////////////////////////////////
Expand All @@ -267,7 +265,7 @@ float unpackRGBAToDepth( const in vec4 v ) {
return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
}

float getShadow( sampler2D shadowMap, DirectionalLightShadow dirLight, vec4 shadowCoord, vec3 vViewPosition, vec3 vNormal ) {
float getShadow( sampler2D shadowMap, DirectionalLight dirLight, vec4 shadowCoord, vec3 vViewPosition, vec3 vNormal ) {
float shadow = 0.0;

// When shadows for sprites will appear use here for them normals as it done for G-buffer
Expand Down Expand Up @@ -395,7 +393,7 @@ float unpackRGBAToDepth( const in vec4 v ) {
#pragma unroll_loop
for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
#ifdef SHADOWMAP
shadowMask = getShadow( directionalShadowMap[ i ], directionalLightShadows[ i ], vDirectionalShadowCoord[ i ], vViewPosition, vDirectionalShadowNormal[ i ] );
if ( directionalLights[ i ].shadow > 0 ) shadowMask = getShadow( directionalShadowMap[ i ], directionalLights[ i ], vDirectionalShadowCoord[ i ], vViewPosition, vDirectionalShadowNormal[ i ] );
#endif

if ( shadowMask > 0.0 ) RE_Direct_BlinnPhong( directionalLights[ i ], geometry, material, reflectedLight, shadowMask );
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9192,10 +9192,10 @@ text-table@^0.2.0:
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=

three@0.114.0:
version "0.114.0"
resolved "https://registry.yarnpkg.com/three/-/three-0.114.0.tgz#754d08467a950ddeef06a0c645a1302b130e455a"
integrity sha512-3av45FxJeqYm7Rl02dfGBoqTaf2a934oUB4zMNrN8xjmASoSGeeykYoAr35+UntTdJDY/STw6CY3KuXFBWETig==
three@0.112.1:
version "0.112.1"
resolved "https://registry.yarnpkg.com/three/-/three-0.112.1.tgz#f8d8f4d0f8e5f753dac6260491b8209457fdc131"
integrity sha512-8I0O74hiYtKl3LgDNcPJbBGOlpekbcJ6fJnImmW3mFdeUFJ2H9Y3/UuUSW2sBdjrIlCM0gvOkaTEFlofO900TQ==

through2@^2.0.0:
version "2.0.5"
Expand Down

0 comments on commit 0c8da84

Please sign in to comment.