Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
3287e640
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,发现更多精彩内容 >>
提交
3287e640
编写于
4月 08, 2015
作者:
R
Ricardo Cabello
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6360 from WestLangley/dev-wrap
Removed wrap lighting from Phong and Lambert
上级
292c93e2
1df48eef
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
11 addition
and
184 deletion
+11
-184
docs/api/materials/MeshLambertMaterial.html
docs/api/materials/MeshLambertMaterial.html
+0
-14
docs/api/materials/MeshPhongMaterial.html
docs/api/materials/MeshPhongMaterial.html
+0
-14
examples/js/MD2Character.js
examples/js/MD2Character.js
+0
-1
examples/js/MD2CharacterComplex.js
examples/js/MD2CharacterComplex.js
+0
-1
examples/js/UCSCharacter.js
examples/js/UCSCharacter.js
+1
-2
examples/scenes/test_scene.js
examples/scenes/test_scene.js
+2
-2
examples/webgl_animation_skinning_morph.html
examples/webgl_animation_skinning_morph.html
+0
-2
examples/webgl_loader_ctm.html
examples/webgl_loader_ctm.html
+0
-2
examples/webgl_loader_utf8.html
examples/webgl_loader_utf8.html
+0
-14
examples/webgl_materials_normalmap.html
examples/webgl_materials_normalmap.html
+0
-2
examples/webgl_performance_doublesided.html
examples/webgl_performance_doublesided.html
+2
-2
examples/webgldeferred_animation.html
examples/webgldeferred_animation.html
+1
-4
examples/webgldeferred_pointlights.html
examples/webgldeferred_pointlights.html
+2
-6
src/materials/MeshLambertMaterial.js
src/materials/MeshLambertMaterial.js
+0
-6
src/materials/MeshPhongMaterial.js
src/materials/MeshPhongMaterial.js
+0
-6
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+0
-13
src/renderers/shaders/ShaderChunk/lights_lambert_pars_vertex.glsl
...erers/shaders/ShaderChunk/lights_lambert_pars_vertex.glsl
+0
-6
src/renderers/shaders/ShaderChunk/lights_lambert_vertex.glsl
src/renderers/shaders/ShaderChunk/lights_lambert_vertex.glsl
+0
-57
src/renderers/shaders/ShaderChunk/lights_phong_fragment.glsl
src/renderers/shaders/ShaderChunk/lights_phong_fragment.glsl
+3
-3
src/renderers/shaders/ShaderChunk/lights_phong_pars_fragment.glsl
...erers/shaders/ShaderChunk/lights_phong_pars_fragment.glsl
+0
-23
src/renderers/shaders/ShaderLib.js
src/renderers/shaders/ShaderLib.js
+0
-2
src/renderers/webgl/WebGLProgram.js
src/renderers/webgl/WebGLProgram.js
+0
-2
未找到文件。
docs/api/materials/MeshLambertMaterial.html
浏览文件 @
3287e640
...
...
@@ -53,20 +53,6 @@
<div>
Emissive (light) color of the material, essentially a solid color unaffected by other lighting. Default is black.
<br
/>
</div>
<h3>
[property:boolean wrapAround]
</h3>
<div>
Define whether the diffuse lighting wraps around the model or not. This option adds a little more (tintable) light
onto the side of the object in relation to a light.
</div>
<h3>
[property:Vector3 wrapRGB]
</h3>
<div>
Decide how much of the wrap around values get used if the wrapAround option is set. The x, y, z values correspond
to the r, g, b values respectively. The typical range is of each is from 0 to 1. For example setting all of the
vector values to 0.5 will add a moderate amount of light to the side of the model. Changing *b* to 1 will
tint the light on the side to be more blue. Defaults to *(1,1,1)*.
</div>
<h3>
[property:Texture map]
</h3>
<div>
Set color texture map. Default is null.
</div>
...
...
docs/api/materials/MeshPhongMaterial.html
浏览文件 @
3287e640
...
...
@@ -74,20 +74,6 @@
underlying colors.
</div>
<h3>
[property:boolean wrapAround]
</h3>
<div>
Define whether the diffuse lighting wraps around the model or not. This option adds a little more (tintable) light
onto the side of the object in relation to a light.
</div>
<h3>
[property:Vector3 wrapRGB]
</h3>
<div>
Decide how much of the wrap around values get used if the wrapAround option is set. The x, y, z values correspond
to the r, g, b values respectively. The typical range is of each is from 0 to 1. For example setting all of the
vector values to 0.5 will add a moderate amount of light to the side of the model. Changing *b* to 1 will
tint the light on the side to be more blue. Defaults to (1,1,1).
</div>
<h3>
[property:Texture map]
</h3>
<div>
Set color texture map. Default is null.
</div>
...
...
examples/js/MD2Character.js
浏览文件 @
3287e640
...
...
@@ -205,7 +205,6 @@ THREE.MD2Character = function () {
var
materialWireframe
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffaa00
,
specular
:
0x111111
,
shininess
:
50
,
wireframe
:
true
,
shading
:
THREE
.
SmoothShading
,
map
:
whiteMap
,
morphTargets
:
true
,
morphNormals
:
true
,
metal
:
false
}
);
var
materialTexture
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
specular
:
0x111111
,
shininess
:
50
,
wireframe
:
false
,
shading
:
THREE
.
SmoothShading
,
map
:
skinMap
,
morphTargets
:
true
,
morphNormals
:
true
,
metal
:
false
}
);
materialTexture
.
wrapAround
=
true
;
//
...
...
examples/js/MD2CharacterComplex.js
浏览文件 @
3287e640
...
...
@@ -528,7 +528,6 @@ THREE.MD2CharacterComplex = function () {
var
materialWireframe
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffaa00
,
specular
:
0x111111
,
shininess
:
50
,
wireframe
:
true
,
shading
:
THREE
.
SmoothShading
,
map
:
whiteMap
,
morphTargets
:
true
,
morphNormals
:
true
,
metal
:
true
}
);
var
materialTexture
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
specular
:
0x111111
,
shininess
:
50
,
wireframe
:
false
,
shading
:
THREE
.
SmoothShading
,
map
:
skinMap
,
morphTargets
:
true
,
morphNormals
:
true
,
metal
:
true
}
);
materialTexture
.
wrapAround
=
true
;
//
...
...
examples/js/UCSCharacter.js
浏览文件 @
3287e640
...
...
@@ -101,8 +101,7 @@ THREE.UCSCharacter = function() {
specular
:
10.0
,
map
:
skins
[
i
],
skinning
:
true
,
morphTargets
:
true
,
wrapAround
:
true
morphTargets
:
true
}
);
}
...
...
examples/scenes/test_scene.js
浏览文件 @
3287e640
...
...
@@ -567,12 +567,12 @@
"
phong_man
"
:
{
"
type
"
:
"
MeshPhongMaterial
"
,
"
parameters
"
:
{
"
color
"
:
16737894
,
"
specular
"
:
2236962
,
"
shininess
"
:
40
,
"
wrapAround
"
:
true
,
"
wrapRGB
"
:
[
0.15
,
0.02
,
0.01
]
}
"
parameters
"
:
{
"
color
"
:
16737894
,
"
specular
"
:
2236962
,
"
shininess
"
:
40
}
},
"
phong_hand
"
:
{
"
type
"
:
"
MeshPhongMaterial
"
,
"
parameters
"
:
{
"
color
"
:
14531481
,
"
specular
"
:
2236962
,
"
shininess
"
:
40
,
"
wrapAround
"
:
true
,
"
wrapRGB
"
:
[
0.15
,
0.02
,
0.01
]
}
"
parameters
"
:
{
"
color
"
:
14531481
,
"
specular
"
:
2236962
,
"
shininess
"
:
40
}
},
"
phong_bunny
"
:
{
...
...
examples/webgl_animation_skinning_morph.html
浏览文件 @
3287e640
...
...
@@ -241,8 +241,6 @@
//m.combine = THREE.MixOperation;
//m.reflectivity = 0.75;
m
.
wrapAround
=
true
;
}
mesh
=
new
THREE
.
SkinnedMesh
(
geometry
,
new
THREE
.
MeshFaceMaterial
(
materials
)
);
...
...
examples/webgl_loader_ctm.html
浏览文件 @
3287e640
...
...
@@ -189,8 +189,6 @@
specularMap
:
THREE
.
ImageUtils
.
loadTexture
(
"
obj/leeperrysmith/Map-SPEC.jpg
"
),
normalMap
:
THREE
.
ImageUtils
.
loadTexture
(
"
obj/leeperrysmith/Infinite-Level_02_Tangent_SmoothUV.jpg
"
),
normalScale
:
new
THREE
.
Vector2
(
0.8
,
0.8
),
wrapRGB
:
new
THREE
.
Vector3
(
0.75
,
0.5
,
0.5
),
wrapAround
:
true
}
);
...
...
examples/webgl_loader_utf8.html
浏览文件 @
3287e640
...
...
@@ -159,13 +159,6 @@
node
.
castShadow
=
true
;
node
.
receiveShadow
=
true
;
if
(
node
.
material
&&
node
.
material
.
name
===
"
skin
"
)
{
node
.
material
.
wrapAround
=
true
;
node
.
material
.
wrapRGB
.
set
(
0.6
,
0.2
,
0.1
);
}
}
);
},
{
normalizeRGB
:
true
}
);
...
...
@@ -186,13 +179,6 @@
node
.
castShadow
=
true
;
node
.
receiveShadow
=
true
;
if
(
node
.
material
&&
(
node
.
material
.
name
===
"
head
"
||
node
.
material
.
name
===
"
skinbody
"
)
)
{
node
.
material
.
wrapAround
=
true
;
node
.
material
.
wrapRGB
.
set
(
0.6
,
0.2
,
0.1
);
}
}
);
},
{
normalizeRGB
:
true
}
);
...
...
examples/webgl_materials_normalmap.html
浏览文件 @
3287e640
...
...
@@ -126,8 +126,6 @@
specularMap
:
THREE
.
ImageUtils
.
loadTexture
(
"
obj/leeperrysmith/Map-SPEC.jpg
"
),
normalMap
:
THREE
.
ImageUtils
.
loadTexture
(
"
obj/leeperrysmith/Infinite-Level_02_Tangent_SmoothUV.jpg
"
),
normalScale
:
new
THREE
.
Vector2
(
0.8
,
0.8
),
wrapRGB
:
new
THREE
.
Vector3
(
0.575
,
0.5
,
0.5
),
wrapAround
:
true
}
);
loader
=
new
THREE
.
JSONLoader
(
true
);
...
...
examples/webgl_performance_doublesided.html
浏览文件 @
3287e640
...
...
@@ -58,6 +58,8 @@
scene
=
new
THREE
.
Scene
();
scene
.
add
(
new
THREE
.
AmbientLight
(
0x050505
)
);
var
light
=
new
THREE
.
PointLight
(
0x0011ff
,
1
,
5500
);
light
.
position
.
set
(
4000
,
0
,
0
);
scene
.
add
(
light
);
...
...
@@ -82,8 +84,6 @@
reflectionCube
.
format
=
THREE
.
RGBFormat
;
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
specular
:
0x101010
,
shininess
:
100
,
envMap
:
reflectionCube
,
combine
:
THREE
.
MixOperation
,
reflectivity
:
0.1
,
side
:
THREE
.
DoubleSide
}
);
material
.
wrapAround
=
true
;
material
.
wrapRGB
.
set
(
0.5
,
0.5
,
0.5
);
var
geometry
=
new
THREE
.
SphereGeometry
(
1
,
32
,
16
,
0
,
Math
.
PI
);
...
...
examples/webgldeferred_animation.html
浏览文件 @
3287e640
...
...
@@ -227,7 +227,7 @@
geometry
.
computeMorphNormals
();
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
specular
:
0x333333
,
shininess
:
20
,
wrapAround
:
true
,
morphTargets
:
true
,
morphNormals
:
true
,
vertexColors
:
THREE
.
NoColors
,
shading
:
THREE
.
FlatShading
}
);
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
specular
:
0x333333
,
shininess
:
20
,
morphTargets
:
true
,
morphNormals
:
true
,
vertexColors
:
THREE
.
NoColors
,
shading
:
THREE
.
FlatShading
}
);
var
meshAnim
=
new
THREE
.
MorphAnimMesh
(
geometry
,
material
);
meshAnim
.
duration
=
3000
;
...
...
@@ -260,9 +260,6 @@
originalMaterial
.
specular
.
setHSL
(
0
,
0
,
0.1
);
originalMaterial
.
shininess
=
75
;
originalMaterial
.
wrapAround
=
true
;
originalMaterial
.
wrapRGB
.
set
(
1
,
0.5
,
0.5
);
}
var
s
=
18.5
;
...
...
examples/webgldeferred_pointlights.html
浏览文件 @
3287e640
...
...
@@ -231,7 +231,7 @@
mapHeight
.
anisotropy
=
4
;
mapHeight
.
format
=
THREE
.
RGBFormat
;
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
map
:
mapColor
,
bumpMap
:
mapHeight
,
bumpScale
:
2.5
,
shininess
:
75
,
specular
:
0x333333
,
wrapAround
:
true
,
metal
:
true
}
);
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
map
:
mapColor
,
bumpMap
:
mapHeight
,
bumpScale
:
2.5
,
shininess
:
75
,
specular
:
0x333333
,
metal
:
true
}
);
var
object
=
new
THREE
.
Mesh
(
geometry
,
material
);
object
.
scale
.
multiplyScalar
(
8
);
...
...
@@ -243,8 +243,6 @@
var
loader
=
new
THREE
.
BinaryLoader
();
loader
.
load
(
"
obj/female02/Female02_bin.js
"
,
function
(
geometry
,
materials
)
{
for
(
var
i
=
0
;
i
<
materials
.
length
;
i
++
)
materials
[
i
].
wrapAround
=
true
;
var
object
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshFaceMaterial
(
materials
)
);
object
.
position
.
x
=
-
50
;
object
.
position
.
y
=
-
48
;
...
...
@@ -255,8 +253,6 @@
loader
.
load
(
"
obj/male02/Male02_bin.js
"
,
function
(
geometry
,
materials
)
{
for
(
var
i
=
0
;
i
<
materials
.
length
;
i
++
)
materials
[
i
].
wrapAround
=
true
;
var
object
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshFaceMaterial
(
materials
)
);
object
.
position
.
x
=
50
;
object
.
position
.
y
=
-
48
;
...
...
@@ -295,7 +291,7 @@
var
matPlane
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
specular
:
0x111111
,
shininess
:
50
,
bumpMap
:
mapHeight2
,
bumpScale
:
0.5
}
);
var
matPlane2
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0x331919
,
specular
:
0x111111
,
shininess
:
50
,
bumpMap
:
mapHeight2
,
bumpScale
:
1
}
);
var
matPlane3
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0x00aaff
,
specular
:
0xffffff
,
shininess
:
200
,
bumpMap
:
mapHeight3
,
bumpScale
:
1.2
,
wrapAround
:
true
}
);
var
matPlane3
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0x00aaff
,
specular
:
0xffffff
,
shininess
:
200
,
bumpMap
:
mapHeight3
,
bumpScale
:
1.2
}
);
var
matPlane4
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
specular
:
0x111111
,
shininess
:
50
,
bumpMap
:
mapHeight3
,
bumpScale
:
1
}
);
// bottom
...
...
src/materials/MeshLambertMaterial.js
浏览文件 @
3287e640
...
...
@@ -47,9 +47,6 @@ THREE.MeshLambertMaterial = function ( parameters ) {
this
.
color
=
new
THREE
.
Color
(
0xffffff
);
// diffuse
this
.
emissive
=
new
THREE
.
Color
(
0x000000
);
this
.
wrapAround
=
false
;
this
.
wrapRGB
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
map
=
null
;
this
.
lightMap
=
null
;
...
...
@@ -94,9 +91,6 @@ THREE.MeshLambertMaterial.prototype.clone = function () {
material
.
color
.
copy
(
this
.
color
);
material
.
emissive
.
copy
(
this
.
emissive
);
material
.
wrapAround
=
this
.
wrapAround
;
material
.
wrapRGB
.
copy
(
this
.
wrapRGB
);
material
.
map
=
this
.
map
;
material
.
lightMap
=
this
.
lightMap
;
...
...
src/materials/MeshPhongMaterial.js
浏览文件 @
3287e640
...
...
@@ -63,9 +63,6 @@ THREE.MeshPhongMaterial = function ( parameters ) {
this
.
metal
=
false
;
this
.
wrapAround
=
false
;
this
.
wrapRGB
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
map
=
null
;
this
.
lightMap
=
null
;
...
...
@@ -124,9 +121,6 @@ THREE.MeshPhongMaterial.prototype.clone = function () {
material
.
metal
=
this
.
metal
;
material
.
wrapAround
=
this
.
wrapAround
;
material
.
wrapRGB
.
copy
(
this
.
wrapRGB
);
material
.
map
=
this
.
map
;
material
.
lightMap
=
this
.
lightMap
;
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
3287e640
...
...
@@ -2007,7 +2007,6 @@ THREE.WebGLRenderer = function ( parameters ) {
alphaTest
:
material
.
alphaTest
,
metal
:
material
.
metal
,
wrapAround
:
material
.
wrapAround
,
doubleSided
:
material
.
side
===
THREE
.
DoubleSide
,
flipSided
:
material
.
side
===
THREE
.
BackSide
...
...
@@ -2572,24 +2571,12 @@ THREE.WebGLRenderer = function ( parameters ) {
uniforms
.
emissive
.
value
=
material
.
emissive
;
uniforms
.
specular
.
value
=
material
.
specular
;
if
(
material
.
wrapAround
)
{
uniforms
.
wrapRGB
.
value
.
copy
(
material
.
wrapRGB
);
}
}
function
refreshUniformsLambert
(
uniforms
,
material
)
{
uniforms
.
emissive
.
value
=
material
.
emissive
;
if
(
material
.
wrapAround
)
{
uniforms
.
wrapRGB
.
value
.
copy
(
material
.
wrapRGB
);
}
}
function
refreshUniformsLights
(
uniforms
,
lights
)
{
...
...
src/renderers/shaders/ShaderChunk/lights_lambert_pars_vertex.glsl
浏览文件 @
3287e640
...
...
@@ -35,9 +35,3 @@ uniform vec3 ambientLightColor;
uniform
float
spotLightDecay
[
MAX_SPOT_LIGHTS
];
#endif
#ifdef WRAP_AROUND
uniform
vec3
wrapRGB
;
#endif
src/renderers/shaders/ShaderChunk/lights_lambert_vertex.glsl
浏览文件 @
3287e640
...
...
@@ -21,25 +21,6 @@ for( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {
vec3
directionalLightWeightingBack
=
vec3
(
max
(
-
dotProduct
,
0
.
0
)
);
#ifdef WRAP_AROUND
vec3
directionalLightWeightingHalfBack
=
vec3
(
max
(
-
0
.
5
*
dotProduct
+
0
.
5
,
0
.
0
)
);
#endif
#endif
#ifdef WRAP_AROUND
vec3
directionalLightWeightingHalf
=
vec3
(
max
(
0
.
5
*
dotProduct
+
0
.
5
,
0
.
0
)
);
directionalLightWeighting
=
mix
(
directionalLightWeighting
,
directionalLightWeightingHalf
,
wrapRGB
);
#ifdef DOUBLE_SIDED
directionalLightWeightingBack
=
mix
(
directionalLightWeightingBack
,
directionalLightWeightingHalfBack
,
wrapRGB
);
#endif
#endif
vLightFront
+=
directionalLightColor
[
i
]
*
directionalLightWeighting
;
...
...
@@ -72,25 +53,6 @@ for( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {
vec3
pointLightWeightingBack
=
vec3
(
max
(
-
dotProduct
,
0
.
0
)
);
#ifdef WRAP_AROUND
vec3
pointLightWeightingHalfBack
=
vec3
(
max
(
-
0
.
5
*
dotProduct
+
0
.
5
,
0
.
0
)
);
#endif
#endif
#ifdef WRAP_AROUND
vec3
pointLightWeightingHalf
=
vec3
(
max
(
0
.
5
*
dotProduct
+
0
.
5
,
0
.
0
)
);
pointLightWeighting
=
mix
(
pointLightWeighting
,
pointLightWeightingHalf
,
wrapRGB
);
#ifdef DOUBLE_SIDED
pointLightWeightingBack
=
mix
(
pointLightWeightingBack
,
pointLightWeightingHalfBack
,
wrapRGB
);
#endif
#endif
vLightFront
+=
pointLightColor
[
i
]
*
pointLightWeighting
*
attenuation
;
...
...
@@ -129,25 +91,6 @@ for( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {
vec3
spotLightWeightingBack
=
vec3
(
max
(
-
dotProduct
,
0
.
0
)
);
#ifdef WRAP_AROUND
vec3
spotLightWeightingHalfBack
=
vec3
(
max
(
-
0
.
5
*
dotProduct
+
0
.
5
,
0
.
0
)
);
#endif
#endif
#ifdef WRAP_AROUND
vec3
spotLightWeightingHalf
=
vec3
(
max
(
0
.
5
*
dotProduct
+
0
.
5
,
0
.
0
)
);
spotLightWeighting
=
mix
(
spotLightWeighting
,
spotLightWeightingHalf
,
wrapRGB
);
#ifdef DOUBLE_SIDED
spotLightWeightingBack
=
mix
(
spotLightWeightingBack
,
spotLightWeightingHalfBack
,
wrapRGB
);
#endif
#endif
vLightFront
+=
spotLightColor
[
i
]
*
spotLightWeighting
*
attenuation
*
spotEffect
;
...
...
src/renderers/shaders/ShaderChunk/lights_phong_fragment.glsl
浏览文件 @
3287e640
...
...
@@ -48,7 +48,7 @@ vec3 totalSpecularLight = vec3( 0.0 );
// diffuse
vec3
cosineTerm
=
calcCosineTerm
(
normal
,
lightDir
);
float
cosineTerm
=
saturate
(
dot
(
normal
,
lightDir
)
);
totalDiffuseLight
+=
lightColor
*
attenuation
*
cosineTerm
;
...
...
@@ -88,7 +88,7 @@ vec3 totalSpecularLight = vec3( 0.0 );
// diffuse
vec3
cosineTerm
=
calcCosineTerm
(
normal
,
lightDir
);
float
cosineTerm
=
saturate
(
dot
(
normal
,
lightDir
)
);
totalDiffuseLight
+=
lightColor
*
attenuation
*
cosineTerm
;
...
...
@@ -114,7 +114,7 @@ vec3 totalSpecularLight = vec3( 0.0 );
// diffuse
vec3
cosineTerm
=
calcCosineTerm
(
normal
,
lightDir
);
float
cosineTerm
=
saturate
(
dot
(
normal
,
lightDir
)
);
totalDiffuseLight
+=
lightColor
*
cosineTerm
;
...
...
src/renderers/shaders/ShaderChunk/lights_phong_pars_fragment.glsl
浏览文件 @
3287e640
...
...
@@ -43,12 +43,6 @@ uniform vec3 ambientLightColor;
#endif
#ifdef WRAP_AROUND
uniform
vec3
wrapRGB
;
#endif
varying
vec3
vViewPosition
;
#ifndef FLAT_SHADED
...
...
@@ -56,20 +50,3 @@ varying vec3 vViewPosition;
varying
vec3
vNormal
;
#endif
vec3
calcCosineTerm
(
in
vec3
normal
,
in
vec3
lightDir
)
{
float
dotProduct
=
dot
(
normal
,
lightDir
);
vec3
cosineTerm
=
vec3
(
saturate
(
dotProduct
)
);
#ifdef WRAP_AROUND
vec3
cosineTermHalf
=
vec3
(
saturate
(
0
.
5
*
dotProduct
+
0
.
5
)
);
cosineTerm
=
mix
(
cosineTerm
,
cosineTermHalf
,
wrapRGB
);
#endif
return
cosineTerm
;
}
src/renderers/shaders/ShaderLib.js
浏览文件 @
3287e640
...
...
@@ -120,7 +120,6 @@ THREE.ShaderLib = {
{
"
emissive
"
:
{
type
:
"
c
"
,
value
:
new
THREE
.
Color
(
0x000000
)
},
"
wrapRGB
"
:
{
type
:
"
v3
"
,
value
:
new
THREE
.
Vector3
(
1
,
1
,
1
)
}
}
]
),
...
...
@@ -261,7 +260,6 @@ THREE.ShaderLib = {
"
emissive
"
:
{
type
:
"
c
"
,
value
:
new
THREE
.
Color
(
0x000000
)
},
"
specular
"
:
{
type
:
"
c
"
,
value
:
new
THREE
.
Color
(
0x111111
)
},
"
shininess
"
:
{
type
:
"
f
"
,
value
:
30
},
"
wrapRGB
"
:
{
type
:
"
v3
"
,
value
:
new
THREE
.
Vector3
(
1
,
1
,
1
)
}
}
]
),
...
...
src/renderers/webgl/WebGLProgram.js
浏览文件 @
3287e640
...
...
@@ -206,7 +206,6 @@ THREE.WebGLProgram = ( function () {
parameters
.
morphTargets
?
'
#define USE_MORPHTARGETS
'
:
''
,
parameters
.
morphNormals
?
'
#define USE_MORPHNORMALS
'
:
''
,
parameters
.
wrapAround
?
'
#define WRAP_AROUND
'
:
''
,
parameters
.
doubleSided
?
'
#define DOUBLE_SIDED
'
:
''
,
parameters
.
flipSided
?
'
#define FLIP_SIDED
'
:
''
,
...
...
@@ -315,7 +314,6 @@ THREE.WebGLProgram = ( function () {
parameters
.
flatShading
?
'
#define FLAT_SHADED
'
:
''
,
parameters
.
metal
?
'
#define METAL
'
:
''
,
parameters
.
wrapAround
?
'
#define WRAP_AROUND
'
:
''
,
parameters
.
doubleSided
?
'
#define DOUBLE_SIDED
'
:
''
,
parameters
.
flipSided
?
'
#define FLIP_SIDED
'
:
''
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录