Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
b23a98f8
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,发现更多精彩内容 >>
提交
b23a98f8
编写于
3月 28, 2016
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added DirectionalLightShadow and SpotLightShadow. Automatically adjust SpotLightShadow. See #7690.
上级
3c836943
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
50 addition
and
9 deletion
+50
-9
src/lights/DirectionalLight.js
src/lights/DirectionalLight.js
+1
-1
src/lights/DirectionalLightShadow.js
src/lights/DirectionalLightShadow.js
+9
-0
src/lights/SpotLight.js
src/lights/SpotLight.js
+1
-1
src/lights/SpotLightShadow.js
src/lights/SpotLightShadow.js
+34
-0
src/renderers/webgl/WebGLShadowMap.js
src/renderers/webgl/WebGLShadowMap.js
+3
-7
utils/build/includes/common.json
utils/build/includes/common.json
+2
-0
未找到文件。
src/lights/DirectionalLight.js
浏览文件 @
b23a98f8
...
...
@@ -14,7 +14,7 @@ THREE.DirectionalLight = function ( color, intensity ) {
this
.
target
=
new
THREE
.
Object3D
();
this
.
shadow
=
new
THREE
.
LightShadow
(
new
THREE
.
OrthographicCamera
(
-
5
,
5
,
5
,
-
5
,
0.5
,
500
)
);
this
.
shadow
=
new
THREE
.
DirectionalLightShadow
(
);
};
...
...
src/lights/DirectionalLightShadow.js
0 → 100644
浏览文件 @
b23a98f8
/**
* @author mrdoob / http://mrdoob.com/
*/
THREE
.
DirectionalLightShadow
=
function
(
light
)
{
THREE
.
LightShadow
.
call
(
this
,
new
THREE
.
OrthographicCamera
(
-
5
,
5
,
5
,
-
5
,
0.5
,
500
)
);
};
src/lights/SpotLight.js
浏览文件 @
b23a98f8
...
...
@@ -18,7 +18,7 @@ THREE.SpotLight = function ( color, intensity, distance, angle, penumbra, decay
this
.
penumbra
=
(
penumbra
!==
undefined
)
?
penumbra
:
0
;
this
.
decay
=
(
decay
!==
undefined
)
?
decay
:
1
;
// for physically correct lights, should be 2.
this
.
shadow
=
new
THREE
.
LightShadow
(
new
THREE
.
PerspectiveCamera
(
50
,
1
,
0.5
,
500
)
);
this
.
shadow
=
new
THREE
.
SpotLightShadow
(
);
};
...
...
src/lights/SpotLightShadow.js
0 → 100644
浏览文件 @
b23a98f8
/**
* @author mrdoob / http://mrdoob.com/
*/
THREE
.
SpotLightShadow
=
function
()
{
THREE
.
LightShadow
.
call
(
this
,
new
THREE
.
PerspectiveCamera
(
50
,
1
,
0.5
,
500
)
);
};
THREE
.
SpotLightShadow
.
prototype
=
{
constructor
:
THREE
.
SpotLightShadow
,
update
:
function
(
light
)
{
var
fov
=
THREE
.
Math
.
radToDeg
(
2
*
light
.
angle
);
var
aspect
=
this
.
mapSize
.
width
/
this
.
mapSize
.
height
;
var
far
=
light
.
distance
||
500
;
var
camera
=
this
.
camera
;
if
(
fov
!==
camera
.
fov
||
aspect
!==
camera
.
aspect
||
far
!==
camera
.
far
)
{
camera
.
fov
=
fov
;
camera
.
aspect
=
aspect
;
camera
.
far
=
far
;
camera
.
updateProjectionMatrix
();
}
}
};
src/renderers/webgl/WebGLShadowMap.js
浏览文件 @
b23a98f8
...
...
@@ -171,15 +171,11 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
shadow
.
map
=
new
THREE
.
WebGLRenderTarget
(
_shadowMapSize
.
x
,
_shadowMapSize
.
y
,
pars
);
//
if
(
light
instanceof
THREE
.
SpotLight
)
{
shadowCamera
.
aspect
=
_shadowMapSize
.
x
/
_shadowMapSize
.
y
;
}
}
if
(
shadow
instanceof
THREE
.
SpotLightShadow
)
{
shadow
Camera
.
updateProjectionMatrix
(
);
shadow
.
update
(
light
);
}
...
...
utils/build/includes/common.json
浏览文件 @
b23a98f8
...
...
@@ -67,9 +67,11 @@
"src/lights/LightShadow.js"
,
"src/lights/AmbientLight.js"
,
"src/lights/DirectionalLight.js"
,
"src/lights/DirectionalLightShadow.js"
,
"src/lights/HemisphereLight.js"
,
"src/lights/PointLight.js"
,
"src/lights/SpotLight.js"
,
"src/lights/SpotLightShadow.js"
,
"src/loaders/AudioLoader.js"
,
"src/loaders/Cache.js"
,
"src/loaders/Loader.js"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录