Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
af642399
T
three.js
项目概览
车家大少爷
/
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,发现更多精彩内容 >>
提交
af642399
编写于
11月 20, 2016
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
WebGLDeferredRenderer: Use new Uniform.clone(). See #10178
上级
a54b56aa
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
93 addition
and
78 deletion
+93
-78
examples/js/renderers/WebGLDeferredRenderer.js
examples/js/renderers/WebGLDeferredRenderer.js
+93
-78
未找到文件。
examples/js/renderers/WebGLDeferredRenderer.js
浏览文件 @
af642399
...
...
@@ -353,7 +353,7 @@ THREE.WebGLDeferredRenderer = function ( parameters ) {
var
uniforms
=
material
.
uniforms
;
if
(
uniforms
.
shininess
!==
undefined
)
uniforms
.
shininess
=
new
THREE
.
Uniform
(
uniforms
.
shininess
.
value
);
if
(
uniforms
.
shininess
!==
undefined
)
uniforms
.
shininess
=
uniforms
.
shininess
.
clone
(
);
return
material
;
...
...
@@ -461,11 +461,10 @@ THREE.WebGLDeferredRenderer = function ( parameters ) {
var
uniforms
=
material
.
uniforms
;
uniforms
.
diffuse
=
new
THREE
.
Uniform
(
uniforms
.
diffuse
.
value
.
clone
()
);
uniforms
.
emissive
=
new
THREE
.
Uniform
(
uniforms
.
emissive
.
value
.
clone
()
);
uniforms
.
specular
=
new
THREE
.
Uniform
(
uniforms
.
specular
.
value
.
clone
()
);
uniforms
.
shininess
=
new
THREE
.
Uniform
(
uniforms
.
shininess
.
value
);
uniforms
.
diffuse
=
uniforms
.
diffuse
.
clone
();
uniforms
.
emissive
=
uniforms
.
emissive
.
clone
();
uniforms
.
specular
=
uniforms
.
specular
.
clone
();
uniforms
.
shininess
=
uniforms
.
shininess
.
clone
();
if
(
originalMaterial
.
map
!==
undefined
)
material
.
map
=
originalMaterial
.
map
;
...
...
@@ -854,10 +853,10 @@ THREE.WebGLDeferredRenderer = function ( parameters ) {
var
uniforms
=
material
.
uniforms
;
uniforms
.
lightColor
=
new
THREE
.
Uniform
(
uniforms
.
lightColor
.
value
.
clone
()
);
uniforms
.
lightRadius
=
new
THREE
.
Uniform
(
uniforms
.
lightRadius
.
value
);
uniforms
.
lightIntensity
=
new
THREE
.
Uniform
(
uniforms
.
lightIntensity
.
value
);
uniforms
.
lightPositionVS
=
new
THREE
.
Uniform
(
uniforms
.
lightPositionVS
.
value
.
clone
()
);
uniforms
.
lightColor
=
uniforms
.
lightColor
.
clone
(
);
uniforms
.
lightRadius
=
uniforms
.
lightRadius
.
clone
(
);
uniforms
.
lightIntensity
=
uniforms
.
lightIntensity
.
clone
(
);
uniforms
.
lightPositionVS
=
uniforms
.
lightPositionVS
.
clone
(
);
return
material
;
...
...
@@ -903,11 +902,11 @@ THREE.WebGLDeferredRenderer = function ( parameters ) {
var
uniforms
=
material
.
uniforms
;
uniforms
.
lightColor
=
new
THREE
.
Uniform
(
uniforms
.
lightColor
.
value
.
clone
()
);
uniforms
.
lightAngle
=
new
THREE
.
Uniform
(
uniforms
.
lightAngle
.
value
);
uniforms
.
lightIntensity
=
new
THREE
.
Uniform
(
uniforms
.
lightIntensity
.
value
);
uniforms
.
lightPositionVS
=
new
THREE
.
Uniform
(
uniforms
.
lightPositionVS
.
value
.
clone
()
);
uniforms
.
lightDirectionVS
=
new
THREE
.
Uniform
(
uniforms
.
lightDirectionVS
.
value
.
clone
()
);
uniforms
.
lightColor
=
uniforms
.
lightColor
.
clone
(
);
uniforms
.
lightAngle
=
uniforms
.
lightAngle
.
clone
(
);
uniforms
.
lightIntensity
=
uniforms
.
lightIntensity
.
clone
(
);
uniforms
.
lightPositionVS
=
uniforms
.
lightPositionVS
.
clone
(
);
uniforms
.
lightDirectionVS
=
uniforms
.
lightDirectionVS
.
clone
(
);
return
material
;
...
...
@@ -948,9 +947,9 @@ THREE.WebGLDeferredRenderer = function ( parameters ) {
var
uniforms
=
material
.
uniforms
;
uniforms
.
lightColor
=
new
THREE
.
Uniform
(
uniforms
.
lightColor
.
value
.
clone
()
);
uniforms
.
lightIntensity
=
new
THREE
.
Uniform
(
uniforms
.
lightIntensity
.
value
);
uniforms
.
lightDirectionVS
=
new
THREE
.
Uniform
(
uniforms
.
lightDirectionVS
.
value
.
clone
()
);
uniforms
.
lightColor
=
uniforms
.
lightColor
.
clone
(
);
uniforms
.
lightIntensity
=
uniforms
.
lightIntensity
.
clone
(
);
uniforms
.
lightDirectionVS
=
uniforms
.
lightDirectionVS
.
clone
(
);
return
material
;
...
...
@@ -1596,10 +1595,10 @@ THREE.ShaderDeferredCommon = {
commonUniforms
:
{
matProjInverse
:
{
value
:
new
THREE
.
Matrix4
()
}
,
matProjInverse
:
new
THREE
.
Uniform
(
new
THREE
.
Matrix4
()
)
,
viewWidth
:
{
value
:
800
}
,
viewHeight
:
{
value
:
600
}
viewWidth
:
new
THREE
.
Uniform
(
800
)
,
viewHeight
:
new
THREE
.
Uniform
(
600
)
}
...
...
@@ -1661,13 +1660,13 @@ THREE.ShaderDeferred = {
uniforms
:
{
map
:
{
value
:
null
}
,
offsetRepeat
:
{
value
:
new
THREE
.
Vector4
(
0
,
0
,
1
,
1
)
}
,
map
:
new
THREE
.
Uniform
(
null
)
,
offsetRepeat
:
new
THREE
.
Uniform
(
new
THREE
.
Vector4
(
0
,
0
,
1
,
1
)
)
,
diffuse
:
{
value
:
new
THREE
.
Color
(
0x000000
)
}
,
emissive
:
{
value
:
new
THREE
.
Color
(
0x000000
)
}
,
specular
:
{
value
:
new
THREE
.
Color
(
0x000000
)
}
,
shininess
:
{
value
:
30.0
}
diffuse
:
new
THREE
.
Uniform
(
new
THREE
.
Color
(
0x000000
)
)
,
emissive
:
new
THREE
.
Uniform
(
new
THREE
.
Color
(
0x000000
)
)
,
specular
:
new
THREE
.
Uniform
(
new
THREE
.
Color
(
0x000000
)
)
,
shininess
:
new
THREE
.
Uniform
(
30.0
)
},
...
...
@@ -1723,9 +1722,11 @@ THREE.ShaderDeferred = {
emissiveLight
:
{
uniforms
:
Object
.
assign
(
{
uniforms
:
Object
.
assign
(
{
samplerColor
:
{
value
:
null
}
samplerColor
:
new
THREE
.
Uniform
(
null
)
},
...
...
@@ -1767,15 +1768,17 @@ THREE.ShaderDeferred = {
pointLight
:
{
uniforms
:
Object
.
assign
(
{
uniforms
:
Object
.
assign
(
{
samplerNormalDepth
:
{
value
:
null
}
,
samplerColor
:
{
value
:
null
}
,
samplerNormalDepth
:
new
THREE
.
Uniform
(
null
)
,
samplerColor
:
new
THREE
.
Uniform
(
null
)
,
lightColor
:
{
value
:
new
THREE
.
Color
(
0x000000
)
}
,
lightPositionVS
:
{
value
:
new
THREE
.
Vector3
(
0
,
1
,
0
)
}
,
lightIntensity
:
{
value
:
1.0
}
,
lightRadius
:
{
value
:
1.0
}
lightColor
:
new
THREE
.
Uniform
(
new
THREE
.
Color
(
0x000000
)
)
,
lightPositionVS
:
new
THREE
.
Uniform
(
new
THREE
.
Vector3
(
0
,
1
,
0
)
)
,
lightIntensity
:
new
THREE
.
Uniform
(
1.0
)
,
lightRadius
:
new
THREE
.
Uniform
(
1.0
)
},
...
...
@@ -1848,16 +1851,18 @@ THREE.ShaderDeferred = {
spotLight
:
{
uniforms
:
Object
.
assign
(
{
uniforms
:
Object
.
assign
(
samplerNormalDepth
:
{
value
:
null
},
samplerColor
:
{
value
:
null
},
{
lightColor
:
{
value
:
new
THREE
.
Color
(
0x000000
)
},
lightDirectionVS
:
{
value
:
new
THREE
.
Vector3
(
0
,
1
,
0
)
},
lightPositionVS
:
{
value
:
new
THREE
.
Vector3
(
0
,
1
,
0
)
},
lightAngle
:
{
value
:
1.0
},
lightIntensity
:
{
value
:
1.0
}
samplerNormalDepth
:
new
THREE
.
Uniform
(
null
),
samplerColor
:
new
THREE
.
Uniform
(
null
),
lightColor
:
new
THREE
.
Uniform
(
new
THREE
.
Color
(
0x000000
)
),
lightDirectionVS
:
new
THREE
.
Uniform
(
new
THREE
.
Vector3
(
0
,
1
,
0
)
),
lightPositionVS
:
new
THREE
.
Uniform
(
new
THREE
.
Vector3
(
0
,
1
,
0
)
),
lightAngle
:
new
THREE
.
Uniform
(
1.0
),
lightIntensity
:
new
THREE
.
Uniform
(
1.0
)
},
...
...
@@ -1943,14 +1948,16 @@ THREE.ShaderDeferred = {
directionalLight
:
{
uniforms
:
Object
.
assign
(
{
uniforms
:
Object
.
assign
(
{
samplerNormalDepth
:
{
value
:
null
}
,
samplerColor
:
{
value
:
null
}
,
samplerNormalDepth
:
new
THREE
.
Uniform
(
null
)
,
samplerColor
:
new
THREE
.
Uniform
(
null
)
,
lightColor
:
{
value
:
new
THREE
.
Color
(
0x000000
)
}
,
lightDirectionVS
:
{
value
:
new
THREE
.
Vector3
(
0
,
1
,
0
)
}
,
lightIntensity
:
{
value
:
1.0
}
lightColor
:
new
THREE
.
Uniform
(
new
THREE
.
Color
(
0x000000
)
)
,
lightDirectionVS
:
new
THREE
.
Uniform
(
new
THREE
.
Vector3
(
0
,
1
,
0
)
)
,
lightIntensity
:
new
THREE
.
Uniform
(
1.0
)
},
THREE
.
ShaderDeferredCommon
[
'
commonUniforms
'
]
...
...
@@ -2008,7 +2015,7 @@ THREE.ShaderDeferred = {
uniforms
:
{
shininess
:
{
value
:
30.0
}
shininess
:
new
THREE
.
Uniform
(
30.0
)
},
...
...
@@ -2064,14 +2071,16 @@ THREE.ShaderDeferred = {
pointLightPre
:
{
uniforms
:
Object
.
assign
(
{
uniforms
:
Object
.
assign
(
samplerNormalDepthShininess
:
{
value
:
null
},
{
lightColor
:
{
value
:
new
THREE
.
Color
(
0x000000
)
},
lightPositionVS
:
{
value
:
new
THREE
.
Vector3
(
0
,
1
,
0
)
},
lightIntensity
:
{
value
:
1.0
},
lightRadius
:
{
value
:
1.0
}
samplerNormalDepthShininess
:
new
THREE
.
Uniform
(
null
),
lightColor
:
new
THREE
.
Uniform
(
new
THREE
.
Color
(
0x000000
)
),
lightPositionVS
:
new
THREE
.
Uniform
(
new
THREE
.
Vector3
(
0
,
1
,
0
)
),
lightIntensity
:
new
THREE
.
Uniform
(
1.0
),
lightRadius
:
new
THREE
.
Uniform
(
1.0
)
},
THREE
.
ShaderDeferredCommon
[
'
commonUniforms
'
]
...
...
@@ -2134,15 +2143,17 @@ THREE.ShaderDeferred = {
spotLightPre
:
{
uniforms
:
Object
.
assign
(
{
uniforms
:
Object
.
assign
(
{
samplerNormalDepthShininess
:
{
value
:
null
}
,
samplerNormalDepthShininess
:
new
THREE
.
Uniform
(
null
)
,
lightColor
:
{
value
:
new
THREE
.
Color
(
0x000000
)
}
,
lightDirectionVS
:
{
value
:
new
THREE
.
Vector3
(
0
,
1
,
0
)
}
,
lightPositionVS
:
{
value
:
new
THREE
.
Vector3
(
0
,
1
,
0
)
}
,
lightAngle
:
{
value
:
1.0
}
,
lightIntensity
:
{
value
:
1.0
}
lightColor
:
new
THREE
.
Uniform
(
new
THREE
.
Color
(
0x000000
)
)
,
lightDirectionVS
:
new
THREE
.
Uniform
(
new
THREE
.
Vector3
(
0
,
1
,
0
)
)
,
lightPositionVS
:
new
THREE
.
Uniform
(
new
THREE
.
Vector3
(
0
,
1
,
0
)
)
,
lightAngle
:
new
THREE
.
Uniform
(
1.0
)
,
lightIntensity
:
new
THREE
.
Uniform
(
1.0
)
},
...
...
@@ -2226,13 +2237,15 @@ THREE.ShaderDeferred = {
directionalLightPre
:
{
uniforms
:
Object
.
assign
(
{
uniforms
:
Object
.
assign
(
samplerNormalDepthShininess
:
{
value
:
null
},
{
lightColor
:
{
value
:
new
THREE
.
Color
(
0x000000
)
},
lightDirectionVS
:
{
value
:
new
THREE
.
Vector3
(
0
,
1
,
0
)
},
lightIntensity
:
{
value
:
1.0
}
samplerNormalDepthShininess
:
new
THREE
.
Uniform
(
null
),
lightColor
:
new
THREE
.
Uniform
(
new
THREE
.
Color
(
0x000000
)
),
lightDirectionVS
:
new
THREE
.
Uniform
(
new
THREE
.
Vector3
(
0
,
1
,
0
)
),
lightIntensity
:
new
THREE
.
Uniform
(
1.0
)
},
...
...
@@ -2289,17 +2302,19 @@ THREE.ShaderDeferred = {
reconstruction
:
{
uniforms
:
Object
.
assign
(
{
uniforms
:
Object
.
assign
(
{
samplerLight
:
{
value
:
null
}
,
samplerLight
:
new
THREE
.
Uniform
(
null
)
,
map
:
{
value
:
null
}
,
offsetRepeat
:
{
value
:
new
THREE
.
Vector4
(
0
,
0
,
1
,
1
)
}
,
map
:
new
THREE
.
Uniform
(
null
)
,
offsetRepeat
:
new
THREE
.
Uniform
(
new
THREE
.
Vector4
(
0
,
0
,
1
,
1
)
)
,
diffuse
:
{
value
:
new
THREE
.
Color
(
0x000000
)
}
,
emissive
:
{
value
:
new
THREE
.
Color
(
0x000000
)
}
,
specular
:
{
value
:
new
THREE
.
Color
(
0x000000
)
}
,
shininess
:
{
value
:
30.0
}
diffuse
:
new
THREE
.
Uniform
(
new
THREE
.
Color
(
0x000000
)
)
,
emissive
:
new
THREE
.
Uniform
(
new
THREE
.
Color
(
0x000000
)
)
,
specular
:
new
THREE
.
Uniform
(
new
THREE
.
Color
(
0x000000
)
)
,
shininess
:
new
THREE
.
Uniform
(
30.0
)
},
...
...
@@ -2375,7 +2390,7 @@ THREE.ShaderDeferred = {
uniforms
:
{
samplerResult
:
{
value
:
null
}
samplerResult
:
new
THREE
.
Uniform
(
null
)
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录