提交 037ab4a2 编写于 作者: M Mr.doob

Updated builds.

上级 6f20da05
...@@ -16333,10 +16333,11 @@ ...@@ -16333,10 +16333,11 @@
if ( boxMesh === undefined ) { if ( boxMesh === undefined ) {
// TODO Adjust skybox to camera somehow // Normalized box
// 1.1547 = (1,1,1).normalize() * 2.0
boxMesh = new Mesh( boxMesh = new Mesh(
new BoxBufferGeometry( 2, 2, 2 ), new BoxBufferGeometry( 1.1547, 1.1547, 1.1547 ),
new ShaderMaterial( { new ShaderMaterial( {
uniforms: ShaderLib.cube.uniforms, uniforms: ShaderLib.cube.uniforms,
vertexShader: ShaderLib.cube.vertexShader, vertexShader: ShaderLib.cube.vertexShader,
...@@ -16348,9 +16349,12 @@ ...@@ -16348,9 +16349,12 @@
} ) } )
); );
boxMesh.geometry.removeAttribute( 'normal' );
boxMesh.geometry.removeAttribute( 'uv' );
boxMesh.onBeforeRender = function ( renderer, scene, camera ) { boxMesh.onBeforeRender = function ( renderer, scene, camera ) {
var scale = camera.far / 1.732; // distance from 0,0,0 to 1,1,1 var scale = camera.far;
this.matrixWorld.makeScale( scale, scale, scale ); this.matrixWorld.makeScale( scale, scale, scale );
this.matrixWorld.copyPosition( camera.matrixWorld ); this.matrixWorld.copyPosition( camera.matrixWorld );
因为 它太大了无法显示 source diff 。你可以改为 查看blob
...@@ -16327,10 +16327,11 @@ function WebGLBackground( renderer, state, geometries, premultipliedAlpha ) { ...@@ -16327,10 +16327,11 @@ function WebGLBackground( renderer, state, geometries, premultipliedAlpha ) {
if ( boxMesh === undefined ) { if ( boxMesh === undefined ) {
// TODO Adjust skybox to camera somehow // Normalized box
// 1.1547 = (1,1,1).normalize() * 2.0
boxMesh = new Mesh( boxMesh = new Mesh(
new BoxBufferGeometry( 2, 2, 2 ), new BoxBufferGeometry( 1.1547, 1.1547, 1.1547 ),
new ShaderMaterial( { new ShaderMaterial( {
uniforms: ShaderLib.cube.uniforms, uniforms: ShaderLib.cube.uniforms,
vertexShader: ShaderLib.cube.vertexShader, vertexShader: ShaderLib.cube.vertexShader,
...@@ -16342,9 +16343,12 @@ function WebGLBackground( renderer, state, geometries, premultipliedAlpha ) { ...@@ -16342,9 +16343,12 @@ function WebGLBackground( renderer, state, geometries, premultipliedAlpha ) {
} ) } )
); );
boxMesh.geometry.removeAttribute( 'normal' );
boxMesh.geometry.removeAttribute( 'uv' );
boxMesh.onBeforeRender = function ( renderer, scene, camera ) { boxMesh.onBeforeRender = function ( renderer, scene, camera ) {
var scale = camera.far / 1.732; // distance from 0,0,0 to 1,1,1 var scale = camera.far;
this.matrixWorld.makeScale( scale, scale, scale ); this.matrixWorld.makeScale( scale, scale, scale );
this.matrixWorld.copyPosition( camera.matrixWorld ); this.matrixWorld.copyPosition( camera.matrixWorld );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册