Skip to content

Commit 2cc8971

Browse files
committed
Post-release fixes.
1 parent b5ab79d commit 2cc8971

File tree

2 files changed

+12
-19
lines changed

2 files changed

+12
-19
lines changed

editor/js/libs/app.js

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var APP = {
1111
var loader = new THREE.ObjectLoader();
1212
var camera, scene, renderer;
1313

14-
var vr, controls, effect;
14+
var controls, effect, cameraVR, isVR;
1515

1616
var events = {};
1717

@@ -22,7 +22,7 @@ var APP = {
2222

2323
this.load = function ( json ) {
2424

25-
vr = json.project.vr;
25+
isVR = json.project.vr;
2626

2727
renderer = new THREE.WebGLRenderer( { antialias: true } );
2828
renderer.setClearColor( 0x000000 );
@@ -115,22 +115,13 @@ var APP = {
115115
camera.aspect = this.width / this.height;
116116
camera.updateProjectionMatrix();
117117

118-
if ( vr === true ) {
118+
if ( isVR === true ) {
119119

120-
if ( camera.parent === null ) {
120+
cameraVR = new THREE.PerspectiveCamera();
121+
cameraVR.projectionMatrix = camera.projectionMatrix;
122+
camera.add( cameraVR );
121123

122-
// camera needs to be in the scene so camera2 matrix updates
123-
124-
scene.add( camera );
125-
126-
}
127-
128-
var camera2 = camera.clone();
129-
camera.add( camera2 );
130-
131-
camera = camera2;
132-
133-
controls = new THREE.VRControls( camera );
124+
controls = new THREE.VRControls( cameraVR );
134125
effect = new THREE.VREffect( renderer );
135126

136127
if ( WEBVR.isAvailable() === true ) {
@@ -195,10 +186,12 @@ var APP = {
195186

196187
}
197188

198-
if ( vr === true ) {
189+
if ( isVR === true ) {
190+
191+
camera.updateMatrixWorld();
199192

200193
controls.update();
201-
effect.render( scene, camera );
194+
effect.render( scene, cameraVR );
202195

203196
} else {
204197

examples/js/nodes/NodeMaterial.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ THREE.NodeMaterial.prototype.build = function() {
210210
}
211211

212212
this.lights = this.requestAttrib.light;
213-
this.transparent = this.requestAttrib.transparent;
213+
this.transparent = this.requestAttrib.transparent || (this.blendMode !== THREE.NormalBlending && this.blendMode !== THREE.NoBlending);
214214

215215
this.vertexShader = [
216216
this.prefixCode,

0 commit comments

Comments
 (0)