Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
b9680040
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,发现更多精彩内容 >>
提交
b9680040
编写于
9月 04, 2012
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'alteredq/dev' into dev
上级
84b40c1f
09991eb0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
2 addition
and
2 deletion
+2
-2
build/three.min.js
build/three.min.js
+1
-1
src/renderers/WebGLShaders.js
src/renderers/WebGLShaders.js
+1
-1
未找到文件。
build/three.min.js
浏览文件 @
b9680040
...
...
@@ -296,7 +296,7 @@ map_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NOR
lightmap_pars_vertex
:
"
#ifdef USE_LIGHTMAP
\n
varying vec2 vUv2;
\n
#endif
"
,
lightmap_fragment
:
"
#ifdef USE_LIGHTMAP
\n
gl_FragColor = gl_FragColor * texture2D( lightMap, vUv2 );
\n
#endif
"
,
lightmap_vertex
:
"
#ifdef USE_LIGHTMAP
\n
vUv2 = uv2;
\n
#endif
"
,
bumpmap_pars_fragment
:
"
#ifdef USE_BUMPMAP
\n
uniform sampler2D bumpMap;
\n
uniform float bumpScale;
\n
vec2 dHdxy_fwd() {
\n
vec2 dSTdx = dFdx( vUv );
\n
vec2 dSTdy = dFdy( vUv );
\n
float Hll = bumpScale * texture2D( bumpMap, vUv ).x;
\n
float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;
\n
float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;
\n
return vec2( dBx, dBy );
\n
}
\n
vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {
\n
vec3 vSigmaX = dFdx( surf_pos );
\n
vec3 vSigmaY = dFdy( surf_pos );
\n
vec3 vN = surf_norm;
\n
vec3 R1 = cross( vSigmaY, vN );
\n
vec3 R2 = cross( vN, vSigmaX );
\n
float fDet = dot( vSigmaX, R1 );
\n
vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
\n
return normalize( abs( fDet ) * surf_norm - vGrad );
\n
}
\n
#endif
"
,
normalmap_pars_fragment
:
"
#ifdef USE_NORMALMAP
\n
uniform sampler2D normalMap;
\n
uniform vec2 normalScale;
\n
vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {
\n
vec3 q0 = dFdx( eye_pos.xyz );
\n
vec3 q1 = dFdy( eye_pos.xyz );
\n
vec2 st0 = dFdx( vUv.st );
\n
vec2 st1 = dFdy( vUv.st );
\n
vec3 S = normalize( q0 * st1.t - q1 * st0.t );
\n
vec3 T = normalize( -q0 * st1.s + q1 * st0.s );
\n
vec3 N = normalize( surf_norm );
\n
vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
\n
mapN.xy = normalScale * mapN.xy;
\n
mat3 tsn = mat3( S, T, N );
\n
return normalize( tsn * mapN );
\n
}
\n
#endif
"
,
specularmap_pars_fragment
:
"
#ifdef USE_SPECULARMAP
\n
uniform sampler2D specularMap;
\n
#endif
"
,
specularmap_fragment
:
"
float specularStrength;
\n
#ifdef USE_SPECULARMAP
\n
vec4 texelSpecular = texture2D( specularMap, vUv );
\n
specularStrength = texelSpecular.r;
\n
#else
\n
specularStrength = 1.0;
\n
#endif
"
,
lights_lambert_pars_vertex
:
"
uniform vec3 ambient;
\n
uniform vec3 diffuse;
\n
uniform vec3 emissive;
\n
uniform vec3 ambientLightColor;
\n
#if MAX_DIR_LIGHTS > 0
\n
uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];
\n
uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];
\n
#endif
\n
#if MAX_HEMI_LIGHTS > 0
\n
uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];
\n
uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];
\n
uniform vec3 hemisphereLightPosition[ MAX_HEMI_LIGHTS ];
\n
#endif
\n
#if MAX_POINT_LIGHTS > 0
\n
uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];
\n
uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];
\n
uniform float pointLightDistance[ MAX_POINT_LIGHTS ];
\n
#endif
\n
#if MAX_SPOT_LIGHTS > 0
\n
uniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];
\n
uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];
\n
uniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];
\n
uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];
\n
uniform float spotLightAngle[ MAX_SPOT_LIGHTS ];
\n
uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];
\n
#endif
\n
#ifdef WRAP_AROUND
\n
uniform vec3 wrapRGB;
\n
#endif
"
,
lights_lambert_vertex
:
"
vLightFront = vec3( 0.0 );
\n
#ifdef DOUBLE_SIDED
\n
vLightBack = vec3( 0.0 );
\n
#endif
\n
transformedNormal = normalize( transformedNormal );
\n
#if MAX_DIR_LIGHTS > 0
\n
for( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {
\n
vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );
\n
vec3 dirVector = normalize( lDirection.xyz );
\n
float dotProduct = dot( transformedNormal, dirVector );
\n
vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );
\n
#ifdef DOUBLE_SIDED
\n
vec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );
\n
#ifdef WRAP_AROUND
\n
vec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );
\n
#endif
\n
#endif
\n
#ifdef WRAP_AROUND
\n
vec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );
\n
directionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );
\n
#ifdef DOUBLE_SIDED
\n
directionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );
\n
#endif
\n
#endif
\n
vLightFront += directionalLightColor[ i ] * directionalLightWeighting;
\n
#ifdef DOUBLE_SIDED
\n
vLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;
\n
#endif
\n
}
\n
#endif
\n
#if MAX_POINT_LIGHTS > 0
\n
for( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {
\n
vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );
\n
vec3 lVector = lPosition.xyz - mvPosition.xyz;
\n
float lDistance = 1.0;
\n
if ( pointLightDistance[ i ] > 0.0 )
\n
lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );
\n
lVector = normalize( lVector );
\n
float dotProduct = dot( transformedNormal, lVector );
\n
vec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );
\n
#ifdef DOUBLE_SIDED
\n
vec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );
\n
#ifdef WRAP_AROUND
\n
vec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );
\n
#endif
\n
#endif
\n
#ifdef WRAP_AROUND
\n
vec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );
\n
pointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );
\n
#ifdef DOUBLE_SIDED
\n
pointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );
\n
#endif
\n
#endif
\n
vLightFront += pointLightColor[ i ] * pointLightWeighting * lDistance;
\n
#ifdef DOUBLE_SIDED
\n
vLightBack += pointLightColor[ i ] * pointLightWeightingBack * lDistance;
\n
#endif
\n
}
\n
#endif
\n
#if MAX_SPOT_LIGHTS > 0
\n
for( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {
\n
vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );
\n
vec3 lVector = lPosition.xyz - mvPosition.xyz;
\n
lVector = normalize( lVector );
\n
float spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - mPosition.xyz ) );
\n
if ( spotEffect > spotLightAngle[ i ] ) {
\n
spotEffect = pow( spotEffect, spotLightExponent[ i ] );
\n
float lDistance = 1.0;
\n
if ( spotLightDistance[ i ] > 0.0 )
\n
lDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );
\n
float dotProduct = dot( transformedNormal, lVector );
\n
vec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );
\n
#ifdef DOUBLE_SIDED
\n
vec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );
\n
#ifdef WRAP_AROUND
\n
vec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );
\n
#endif
\n
#endif
\n
#ifdef WRAP_AROUND
\n
vec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );
\n
spotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );
\n
#ifdef DOUBLE_SIDED
\n
spotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );
\n
#endif
\n
#endif
\n
vLightFront += spotLightColor[ i ] * spotLightWeighting * lDistance * spotEffect;
\n
#ifdef DOUBLE_SIDED
\n
vLightBack += spotLightColor[ i ] * spotLightWeightingBack * lDistance * spotEffect;
\n
#endif
\n
}
\n
}
\n
#endif
\n
#if MAX_HEMI_LIGHTS > 0
\n
for( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {
\n
vec4 lPosition = viewMatrix * vec4( hemisphereLightPosition[ i ], 1.0 );
\n
vec3 lVector = lPosition.xyz - mvPosition.xyz;
\n
lVector = normalize( lVector );
\n
float dotProduct = dot(
n
ormal, lVector );
\n
float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;
\n
float hemiDiffuseWeightBack = -0.5 * dotProduct + 0.5;
\n
vLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );
\n
#ifdef DOUBLE_SIDED
\n
vLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );
\n
#endif
\n
}
\n
#endif
\n
vLightFront = vLightFront * diffuse + ambient * ambientLightColor + emissive;
\n
#ifdef DOUBLE_SIDED
\n
vLightBack = vLightBack * diffuse + ambient * ambientLightColor + emissive;
\n
#endif
"
,
lights_lambert_vertex
:
"
vLightFront = vec3( 0.0 );
\n
#ifdef DOUBLE_SIDED
\n
vLightBack = vec3( 0.0 );
\n
#endif
\n
transformedNormal = normalize( transformedNormal );
\n
#if MAX_DIR_LIGHTS > 0
\n
for( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {
\n
vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );
\n
vec3 dirVector = normalize( lDirection.xyz );
\n
float dotProduct = dot( transformedNormal, dirVector );
\n
vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );
\n
#ifdef DOUBLE_SIDED
\n
vec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );
\n
#ifdef WRAP_AROUND
\n
vec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );
\n
#endif
\n
#endif
\n
#ifdef WRAP_AROUND
\n
vec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );
\n
directionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );
\n
#ifdef DOUBLE_SIDED
\n
directionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );
\n
#endif
\n
#endif
\n
vLightFront += directionalLightColor[ i ] * directionalLightWeighting;
\n
#ifdef DOUBLE_SIDED
\n
vLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;
\n
#endif
\n
}
\n
#endif
\n
#if MAX_POINT_LIGHTS > 0
\n
for( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {
\n
vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );
\n
vec3 lVector = lPosition.xyz - mvPosition.xyz;
\n
float lDistance = 1.0;
\n
if ( pointLightDistance[ i ] > 0.0 )
\n
lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );
\n
lVector = normalize( lVector );
\n
float dotProduct = dot( transformedNormal, lVector );
\n
vec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );
\n
#ifdef DOUBLE_SIDED
\n
vec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );
\n
#ifdef WRAP_AROUND
\n
vec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );
\n
#endif
\n
#endif
\n
#ifdef WRAP_AROUND
\n
vec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );
\n
pointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );
\n
#ifdef DOUBLE_SIDED
\n
pointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );
\n
#endif
\n
#endif
\n
vLightFront += pointLightColor[ i ] * pointLightWeighting * lDistance;
\n
#ifdef DOUBLE_SIDED
\n
vLightBack += pointLightColor[ i ] * pointLightWeightingBack * lDistance;
\n
#endif
\n
}
\n
#endif
\n
#if MAX_SPOT_LIGHTS > 0
\n
for( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {
\n
vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );
\n
vec3 lVector = lPosition.xyz - mvPosition.xyz;
\n
lVector = normalize( lVector );
\n
float spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - mPosition.xyz ) );
\n
if ( spotEffect > spotLightAngle[ i ] ) {
\n
spotEffect = pow( spotEffect, spotLightExponent[ i ] );
\n
float lDistance = 1.0;
\n
if ( spotLightDistance[ i ] > 0.0 )
\n
lDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );
\n
float dotProduct = dot( transformedNormal, lVector );
\n
vec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );
\n
#ifdef DOUBLE_SIDED
\n
vec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );
\n
#ifdef WRAP_AROUND
\n
vec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );
\n
#endif
\n
#endif
\n
#ifdef WRAP_AROUND
\n
vec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );
\n
spotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );
\n
#ifdef DOUBLE_SIDED
\n
spotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );
\n
#endif
\n
#endif
\n
vLightFront += spotLightColor[ i ] * spotLightWeighting * lDistance * spotEffect;
\n
#ifdef DOUBLE_SIDED
\n
vLightBack += spotLightColor[ i ] * spotLightWeightingBack * lDistance * spotEffect;
\n
#endif
\n
}
\n
}
\n
#endif
\n
#if MAX_HEMI_LIGHTS > 0
\n
for( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {
\n
vec4 lPosition = viewMatrix * vec4( hemisphereLightPosition[ i ], 1.0 );
\n
vec3 lVector = lPosition.xyz - mvPosition.xyz;
\n
lVector = normalize( lVector );
\n
float dotProduct = dot(
transformedN
ormal, lVector );
\n
float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;
\n
float hemiDiffuseWeightBack = -0.5 * dotProduct + 0.5;
\n
vLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );
\n
#ifdef DOUBLE_SIDED
\n
vLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );
\n
#endif
\n
}
\n
#endif
\n
vLightFront = vLightFront * diffuse + ambient * ambientLightColor + emissive;
\n
#ifdef DOUBLE_SIDED
\n
vLightBack = vLightBack * diffuse + ambient * ambientLightColor + emissive;
\n
#endif
"
,
lights_phong_pars_vertex
:
"
#ifndef PHONG_PER_PIXEL
\n
#if MAX_POINT_LIGHTS > 0
\n
uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];
\n
uniform float pointLightDistance[ MAX_POINT_LIGHTS ];
\n
varying vec4 vPointLight[ MAX_POINT_LIGHTS ];
\n
#endif
\n
#if MAX_SPOT_LIGHTS > 0
\n
uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];
\n
uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];
\n
varying vec4 vSpotLight[ MAX_SPOT_LIGHTS ];
\n
#endif
\n
#endif
\n
#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP )
\n
varying vec3 vWorldPosition;
\n
#endif
"
,
lights_phong_vertex
:
"
#ifndef PHONG_PER_PIXEL
\n
#if MAX_POINT_LIGHTS > 0
\n
for( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {
\n
vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );
\n
vec3 lVector = lPosition.xyz - mvPosition.xyz;
\n
float lDistance = 1.0;
\n
if ( pointLightDistance[ i ] > 0.0 )
\n
lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );
\n
vPointLight[ i ] = vec4( lVector, lDistance );
\n
}
\n
#endif
\n
#if MAX_SPOT_LIGHTS > 0
\n
for( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {
\n
vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );
\n
vec3 lVector = lPosition.xyz - mvPosition.xyz;
\n
float lDistance = 1.0;
\n
if ( spotLightDistance[ i ] > 0.0 )
\n
lDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );
\n
vSpotLight[ i ] = vec4( lVector, lDistance );
\n
}
\n
#endif
\n
#endif
\n
#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP )
\n
vWorldPosition = mPosition.xyz;
\n
#endif
"
,
lights_phong_pars_fragment
:
"
uniform vec3 ambientLightColor;
\n
#if MAX_DIR_LIGHTS > 0
\n
uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];
\n
uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];
\n
#endif
\n
#if MAX_HEMI_LIGHTS > 0
\n
uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];
\n
uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];
\n
uniform vec3 hemisphereLightPosition[ MAX_HEMI_LIGHTS ];
\n
#endif
\n
#if MAX_POINT_LIGHTS > 0
\n
uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];
\n
#ifdef PHONG_PER_PIXEL
\n
uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];
\n
uniform float pointLightDistance[ MAX_POINT_LIGHTS ];
\n
#else
\n
varying vec4 vPointLight[ MAX_POINT_LIGHTS ];
\n
#endif
\n
#endif
\n
#if MAX_SPOT_LIGHTS > 0
\n
uniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];
\n
uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];
\n
uniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];
\n
uniform float spotLightAngle[ MAX_SPOT_LIGHTS ];
\n
uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];
\n
#ifdef PHONG_PER_PIXEL
\n
uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];
\n
#else
\n
varying vec4 vSpotLight[ MAX_SPOT_LIGHTS ];
\n
#endif
\n
#endif
\n
#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP )
\n
varying vec3 vWorldPosition;
\n
#endif
\n
#ifdef WRAP_AROUND
\n
uniform vec3 wrapRGB;
\n
#endif
\n
varying vec3 vViewPosition;
\n
varying vec3 vNormal;
"
,
...
...
src/renderers/WebGLShaders.js
浏览文件 @
b9680040
...
...
@@ -665,7 +665,7 @@ THREE.ShaderChunk = {
"
lVector = normalize( lVector );
"
,
"
float dotProduct = dot(
n
ormal, lVector );
"
,
"
float dotProduct = dot(
transformedN
ormal, lVector );
"
,
"
float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;
"
,
"
float hemiDiffuseWeightBack = -0.5 * dotProduct + 0.5;
"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录