|
@@ -257,8 +257,8 @@ PMREMGenerator.prototype = {
|
|
|
var fov = 90;
|
|
|
var aspect = 1;
|
|
|
var cubeCamera = new PerspectiveCamera( fov, aspect, near, far );
|
|
|
- var upSign = [ 1, 1, 1, 1, - 1, 1 ];
|
|
|
- var forwardSign = [ 1, 1, - 1, - 1, - 1, 1 ];
|
|
|
+ var upSign = [ 1, - 1, 1, 1, 1, 1 ];
|
|
|
+ var forwardSign = [ 1, 1, 1, - 1, - 1, - 1 ];
|
|
|
var renderer = this._renderer;
|
|
|
|
|
|
var outputEncoding = renderer.outputEncoding;
|
|
@@ -270,7 +270,6 @@ PMREMGenerator.prototype = {
|
|
|
renderer.toneMapping = LinearToneMapping;
|
|
|
renderer.toneMappingExposure = 1.0;
|
|
|
renderer.outputEncoding = LinearEncoding;
|
|
|
- scene.scale.z *= - 1;
|
|
|
|
|
|
var background = scene.background;
|
|
|
if ( background && background.isColor ) {
|
|
@@ -317,7 +316,6 @@ PMREMGenerator.prototype = {
|
|
|
renderer.toneMappingExposure = toneMappingExposure;
|
|
|
renderer.outputEncoding = outputEncoding;
|
|
|
renderer.setClearColor( clearColor, clearAlpha );
|
|
|
- scene.scale.z *= - 1;
|
|
|
|
|
|
},
|
|
|
|
|
@@ -794,26 +792,30 @@ attribute vec3 position;
|
|
|
attribute vec2 uv;
|
|
|
attribute float faceIndex;
|
|
|
varying vec3 vOutputDirection;
|
|
|
+
|
|
|
+// RH coordinate system; PMREM face-indexing convention
|
|
|
vec3 getDirection(vec2 uv, float face) {
|
|
|
uv = 2.0 * uv - 1.0;
|
|
|
vec3 direction = vec3(uv, 1.0);
|
|
|
if (face == 0.0) {
|
|
|
- direction = direction.zyx;
|
|
|
- direction.z *= -1.0;
|
|
|
+ direction = direction.zyx; // ( 1, v, u ) pos x
|
|
|
} else if (face == 1.0) {
|
|
|
direction = direction.xzy;
|
|
|
- direction.z *= -1.0;
|
|
|
+ direction.xz *= -1.0; // ( -u, 1, -v ) pos y
|
|
|
+ } else if (face == 2.0) {
|
|
|
+ direction.x *= -1.0; // ( -u, v, 1 ) pos z
|
|
|
} else if (face == 3.0) {
|
|
|
direction = direction.zyx;
|
|
|
- direction.x *= -1.0;
|
|
|
+ direction.xz *= -1.0; // ( -1, v, -u ) neg x
|
|
|
} else if (face == 4.0) {
|
|
|
direction = direction.xzy;
|
|
|
- direction.y *= -1.0;
|
|
|
+ direction.xy *= -1.0; // ( -u, -1, v ) neg y
|
|
|
} else if (face == 5.0) {
|
|
|
- direction.xz *= -1.0;
|
|
|
+ direction.z *= -1.0; // ( u, v, -1 ) neg z
|
|
|
}
|
|
|
return direction;
|
|
|
}
|
|
|
+
|
|
|
void main() {
|
|
|
vOutputDirection = getDirection(uv, faceIndex);
|
|
|
gl_Position = vec4( position, 1.0 );
|