Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
0a555031
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,发现更多精彩内容 >>
提交
0a555031
编写于
1月 29, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Removed MeshPhongMaterial.perPixel as per @WestLangley suggestion in #4338.
上级
e0ca9f3b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
113 deletion
+15
-113
src/materials/MeshPhongMaterial.js
src/materials/MeshPhongMaterial.js
+0
-1
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+0
-3
src/renderers/shaders/ShaderChunk.js
src/renderers/shaders/ShaderChunk.js
+15
-109
未找到文件。
src/materials/MeshPhongMaterial.js
浏览文件 @
0a555031
...
...
@@ -56,7 +56,6 @@ THREE.MeshPhongMaterial = function ( parameters ) {
this
.
shininess
=
30
;
this
.
metal
=
false
;
this
.
perPixel
=
true
;
this
.
wrapAround
=
false
;
this
.
wrapRGB
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
0a555031
...
...
@@ -4212,7 +4212,6 @@ THREE.WebGLRenderer = function ( parameters ) {
alphaTest
:
material
.
alphaTest
,
metal
:
material
.
metal
,
perPixel
:
material
.
perPixel
,
wrapAround
:
material
.
wrapAround
,
doubleSided
:
material
.
side
===
THREE
.
DoubleSide
,
flipSided
:
material
.
side
===
THREE
.
BackSide
...
...
@@ -5579,7 +5578,6 @@ THREE.WebGLRenderer = function ( parameters ) {
parameters
.
morphTargets
?
"
#define USE_MORPHTARGETS
"
:
""
,
parameters
.
morphNormals
?
"
#define USE_MORPHNORMALS
"
:
""
,
parameters
.
perPixel
?
"
#define PHONG_PER_PIXEL
"
:
""
,
parameters
.
wrapAround
?
"
#define WRAP_AROUND
"
:
""
,
parameters
.
doubleSided
?
"
#define DOUBLE_SIDED
"
:
""
,
parameters
.
flipSided
?
"
#define FLIP_SIDED
"
:
""
,
...
...
@@ -5678,7 +5676,6 @@ THREE.WebGLRenderer = function ( parameters ) {
parameters
.
vertexColors
?
"
#define USE_COLOR
"
:
""
,
parameters
.
metal
?
"
#define METAL
"
:
""
,
parameters
.
perPixel
?
"
#define PHONG_PER_PIXEL
"
:
""
,
parameters
.
wrapAround
?
"
#define WRAP_AROUND
"
:
""
,
parameters
.
doubleSided
?
"
#define DOUBLE_SIDED
"
:
""
,
parameters
.
flipSided
?
"
#define FLIP_SIDED
"
:
""
,
...
...
src/renderers/shaders/ShaderChunk.js
浏览文件 @
0a555031
...
...
@@ -700,28 +700,6 @@ THREE.ShaderChunk = {
lights_phong_pars_vertex
:
[
"
#ifndef PHONG_PER_PIXEL
"
,
"
#if MAX_POINT_LIGHTS > 0
"
,
"
uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];
"
,
"
uniform float pointLightDistance[ MAX_POINT_LIGHTS ];
"
,
"
varying vec4 vPointLight[ MAX_POINT_LIGHTS ];
"
,
"
#endif
"
,
"
#if MAX_SPOT_LIGHTS > 0
"
,
"
uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];
"
,
"
uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];
"
,
"
varying vec4 vSpotLight[ MAX_SPOT_LIGHTS ];
"
,
"
#endif
"
,
"
#endif
"
,
"
#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP )
"
,
"
varying vec3 vWorldPosition;
"
,
...
...
@@ -733,44 +711,6 @@ THREE.ShaderChunk = {
lights_phong_vertex
:
[
"
#ifndef PHONG_PER_PIXEL
"
,
"
#if MAX_POINT_LIGHTS > 0
"
,
"
for( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {
"
,
"
vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );
"
,
"
vec3 lVector = lPosition.xyz - mvPosition.xyz;
"
,
"
float lDistance = 1.0;
"
,
"
if ( pointLightDistance[ i ] > 0.0 )
"
,
"
lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );
"
,
"
vPointLight[ i ] = vec4( lVector, lDistance );
"
,
"
}
"
,
"
#endif
"
,
"
#if MAX_SPOT_LIGHTS > 0
"
,
"
for( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {
"
,
"
vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );
"
,
"
vec3 lVector = lPosition.xyz - mvPosition.xyz;
"
,
"
float lDistance = 1.0;
"
,
"
if ( spotLightDistance[ i ] > 0.0 )
"
,
"
lDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );
"
,
"
vSpotLight[ i ] = vec4( lVector, lDistance );
"
,
"
}
"
,
"
#endif
"
,
"
#endif
"
,
"
#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP )
"
,
"
vWorldPosition = worldPosition.xyz;
"
,
...
...
@@ -802,16 +742,8 @@ THREE.ShaderChunk = {
"
uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];
"
,
"
#ifdef PHONG_PER_PIXEL
"
,
"
uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];
"
,
"
uniform float pointLightDistance[ MAX_POINT_LIGHTS ];
"
,
"
#else
"
,
"
varying vec4 vPointLight[ MAX_POINT_LIGHTS ];
"
,
"
#endif
"
,
"
uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];
"
,
"
uniform float pointLightDistance[ MAX_POINT_LIGHTS ];
"
,
"
#endif
"
,
...
...
@@ -823,15 +755,7 @@ THREE.ShaderChunk = {
"
uniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];
"
,
"
uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];
"
,
"
#ifdef PHONG_PER_PIXEL
"
,
"
uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];
"
,
"
#else
"
,
"
varying vec4 vSpotLight[ MAX_SPOT_LIGHTS ];
"
,
"
#endif
"
,
"
uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];
"
,
"
#endif
"
,
...
...
@@ -880,23 +804,14 @@ THREE.ShaderChunk = {
"
for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {
"
,
"
#ifdef PHONG_PER_PIXEL
"
,
"
vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );
"
,
"
vec3 lVector = lPosition.xyz + vViewPosition.xyz;
"
,
"
float lDistance = 1.0;
"
,
"
if ( pointLightDistance[ i ] > 0.0 )
"
,
"
lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );
"
,
"
lVector = normalize( lVector );
"
,
"
#else
"
,
"
vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );
"
,
"
vec3 lVector = lPosition.xyz + vViewPosition.xyz;
"
,
"
vec3 lVector = normalize( vPointLight[ i ].xyz );
"
,
"
float lDistance = vPointLight[ i ].w;
"
,
"
float lDistance = 1.0;
"
,
"
if ( pointLightDistance[ i ] > 0.0 )
"
,
"
lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );
"
,
"
#endif
"
,
"
lVector = normalize( lVector );
"
,
// diffuse
...
...
@@ -941,23 +856,14 @@ THREE.ShaderChunk = {
"
for ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {
"
,
"
#ifdef PHONG_PER_PIXEL
"
,
"
vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );
"
,
"
vec3 lVector = lPosition.xyz + vViewPosition.xyz;
"
,
"
float lDistance = 1.0;
"
,
"
if ( spotLightDistance[ i ] > 0.0 )
"
,
"
lDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );
"
,
"
lVector = normalize( lVector );
"
,
"
#else
"
,
"
vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );
"
,
"
vec3 lVector = lPosition.xyz + vViewPosition.xyz;
"
,
"
vec3 lVector = normalize( vSpotLight[ i ].xyz );
"
,
"
float lDistance = vSpotLight[ i ].w;
"
,
"
float lDistance = 1.0;
"
,
"
if ( spotLightDistance[ i ] > 0.0 )
"
,
"
lDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );
"
,
"
#endif
"
,
"
lVector = normalize( lVector );
"
,
"
float spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );
"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录