Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
843aa3b7
T
three.js
项目概览
Ablesons
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
843aa3b7
编写于
10月 11, 2015
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
0e045c7c
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
157 addition
and
199 deletion
+157
-199
build/three.js
build/three.js
+35
-76
build/three.min.js
build/three.min.js
+122
-123
未找到文件。
build/three.js
浏览文件 @
843aa3b7
...
...
@@ -1414,6 +1414,14 @@ THREE.Vector2.prototype = {
constructor: THREE.Vector2,
get width() { return this.x },
set width( value ) { this.x = value },
get height() { return this.y },
set height( value ) { this.y = value },
//
set: function ( x, y ) {
this.x = x;
...
...
@@ -14140,63 +14148,37 @@ Object.defineProperties( THREE.Light.prototype, {
console.warn( 'THREE.Light: .onlyShadow has been removed.' );
}
},
shadowCamera: {
get: function () {
return this.shadow.camera;
}
},
shadowCameraFov: {
get: function () {
return this.shadow.camera.fov;
},
set: function ( value ) {
this.shadow.camera.fov = value;
}
},
shadowCameraLeft: {
get: function () {
return this.shadow.camera.left;
},
set: function ( value ) {
this.shadow.camera.left = value;
}
},
shadowCameraRight: {
get: function () {
return this.shadow.camera.right;
},
set: function ( value ) {
this.shadow.camera.right = value;
}
},
shadowCameraTop: {
get: function () {
return this.shadow.camera.top;
},
set: function ( value ) {
this.shadow.camera.top = value;
}
},
shadowCameraBottom: {
get: function () {
return this.shadow.camera.bottom;
},
set: function ( value ) {
this.shadow.camera.bottom = value;
}
},
shadowCameraNear: {
get: function () {
return this.shadow.camera.near;
},
set: function ( value ) {
this.shadow.camera.near = value;
}
},
shadowCameraFar: {
get: function () {
return this.shadow.camera.far;
},
set: function ( value ) {
this.shadow.camera.far = value;
}
...
...
@@ -14207,51 +14189,23 @@ Object.defineProperties( THREE.Light.prototype, {
}
},
shadowBias: {
get: function () {
return this.shadow.bias;
},
set: function ( value ) {
this.shadow.bias = value;
}
},
shadowDarkness: {
get: function () {
return this.shadow.darkness;
},
set: function ( value ) {
this.shadow.darkness = value;
}
},
shadowMap: {
get: function () {
return this.shadow.map;
},
set: function ( value ) {
this.shadow.map = value;
}
},
shadowMapWidth: {
get: function () {
return this.shadow.mapSize.x;
},
set: function ( value ) {
this.shadow.mapSize.
x
= value;
this.shadow.mapSize.
width
= value;
}
},
shadowMapHeight: {
get: function () {
return this.shadow.mapSize.y;
},
set: function ( value ) {
this.shadow.mapSize.y = value;
}
},
shadowMatrix: {
get: function () {
return this.shadow.matrix;
},
set: function ( value ) {
this.shadow.ma
trix
= value;
this.shadow.ma
pSize.height
= value;
}
}
} );
...
...
@@ -23471,30 +23425,32 @@ THREE.WebGLRenderer = function ( parameters ) {
var light = lights[ i ];
if (
! light.castShadow
) continue;
if (
light.castShadow === false
) continue;
if ( light instanceof THREE.PointLight || light instanceof THREE.SpotLight || light instanceof THREE.DirectionalLight ) {
var shadow = light.shadow;
if ( light instanceof THREE.PointLight ) {
// for point lights we set the shadow matrix to be a translation-only matrix
// equal to inverse of the light's position
_vector3.setFromMatrixPosition( light.matrixWorld ).negate();
light.shadowM
atrix.identity().setPosition( _vector3 );
shadow.m
atrix.identity().setPosition( _vector3 );
// for point lights we set the sign of the shadowDarkness uniform to be negative
uniforms.shadowDarkness.value[ j ] = -
light.shadowD
arkness;
uniforms.shadowDarkness.value[ j ] = -
shadow.d
arkness;
} else {
uniforms.shadowDarkness.value[ j ] =
light.shadowD
arkness;
uniforms.shadowDarkness.value[ j ] =
shadow.d
arkness;
}
uniforms.shadowMatrix.value[ j ] =
light.shadowM
atrix;
uniforms.shadowMap.value[ j ] =
light.shadowM
ap;
uniforms.shadowMapSize.value[ j ] =
light.
shadow.mapSize;
uniforms.shadowBias.value[ j ] =
light.shadowB
ias;
uniforms.shadowMatrix.value[ j ] =
shadow.m
atrix;
uniforms.shadowMap.value[ j ] =
shadow.m
ap;
uniforms.shadowMapSize.value[ j ] = shadow.mapSize;
uniforms.shadowBias.value[ j ] =
shadow.b
ias;
j ++;
...
...
@@ -26806,7 +26762,6 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
var useMorphing = ( i & _MorphingFlag ) !== 0;
var useSkinning = ( i & _SkinningFlag ) !== 0;
var depthMaterial = new THREE.ShaderMaterial( {
uniforms: depthUniforms,
vertexShader: depthShader.vertexShader,
...
...
@@ -26871,13 +26826,17 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
if ( light.castShadow === false ) continue;
var shadow = light.shadow;
var shadowCamera = shadow.camera;
var shadowMapSize = shadow.mapSize;
if ( light instanceof THREE.PointLight ) {
faceCount = 6;
isPointLight = true;
var vpWidth =
light.shadowMapWidth
/ 4.0;
var vpHeight =
light.shadowMapHeight
/ 2.0;
var vpWidth =
shadowMapSize.x
/ 4.0;
var vpHeight =
shadowMapSize.y
/ 2.0;
// These viewports map a cube-map onto a 2D texture with the
// following orientation:
...
...
@@ -26912,7 +26871,7 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
}
if (
light.shadowM
ap === null ) {
if (
shadow.m
ap === null ) {
var shadowFilter = THREE.LinearFilter;
...
...
@@ -26924,25 +26883,23 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
var pars = { minFilter: shadowFilter, magFilter: shadowFilter, format: THREE.RGBAFormat };
light.shadowMap = new THREE.WebGLRenderTarget( light.shadow.mapSize.x, light.shadow.mapSize.y, pars );
light.shadowMatrix = new THREE.Matrix4();
shadow.map = new THREE.WebGLRenderTarget( shadowMapSize.x, shadowMapSize.y, pars );
shadow.matrix = new THREE.Matrix4();
//
if ( light instanceof THREE.SpotLight ) {
light.shadowCamera.aspect = light.shadow.mapSize.x / light.shadow.m
apSize.y;
shadowCamera.aspect = shadowMapSize.x / shadowM
apSize.y;
}
light.
shadowCamera.updateProjectionMatrix();
shadowCamera.updateProjectionMatrix();
}
var shadowMap = light.shadowMap;
var shadowMatrix = light.shadowMatrix;
var shadowCamera = light.shadowCamera;
var shadowMap = shadow.map;
var shadowMatrix = shadow.matrix;
_lightPositionWorld.setFromMatrixPosition( light.matrixWorld );
shadowCamera.position.copy( _lightPositionWorld );
...
...
@@ -35977,6 +35934,8 @@ THREE.CameraHelper = function ( camera ) {
THREE.LineSegments.call( this, geometry, material );
this.camera = camera;
this.camera.updateProjectionMatrix();
this.matrix = camera.matrixWorld;
this.matrixAutoUpdate = false;
...
...
build/three.min.js
浏览文件 @
843aa3b7
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录