Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
bd150ec3
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,发现更多精彩内容 >>
提交
bd150ec3
编写于
11月 14, 2015
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
3d0640ce
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
12 deletion
+12
-12
build/three.js
build/three.js
+8
-8
build/three.min.js
build/three.min.js
+4
-4
未找到文件。
build/three.js
浏览文件 @
bd150ec3
...
...
@@ -23235,7 +23235,7 @@ THREE.ShaderChunk[ 'lights_standard_pars_fragment'] = "struct PhysicalMaterial {
// File:src/renderers/shaders/ShaderChunk/lights_template.glsl
THREE.ShaderChunk[ 'lights_template'] = "\nGeometricContext geometry;\ngeometry.position = -vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( Material_RE_DirectLight )\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n PointLight pointLight = pointLights[ i ];\n IncidentLight directLight = getPointDirectLight( pointLight, geometry );\n #ifdef USE_SHADOWMAP\n if ( pointLight.shadow > - 1 ) {\n for ( int j = 0; j < NUM_SHADOWS; j ++ ) {\n if ( j == pointLight.shadow ) {\n directLight.color *= shadows[ j ];\n }\n }\n }\n #endif\n Material_RE_DirectLight( directLight, geometry, material, reflectedLight );\n }\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( Material_RE_DirectLight )\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n SpotLight spotLight = spotLights[ i ];\n IncidentLight directLight = getSpotDirectLight( spotLight, geometry );\n #ifdef USE_SHADOWMAP\n if ( spotLight.shadow > - 1 ) {\n for ( int j = 0; j < NUM_SHADOWS; j ++ ) {\n if ( j == spotLight.shadow ) {\n directLight.color *= shadows[ j ];\n }\n }\n }\n #endif\n Material_RE_DirectLight( directLight, geometry, material, reflectedLight );\n }\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( Material_RE_DirectLight )\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n DirectionalLight directionalLight = directionalLights[ i ];\n IncidentLight directLight = getDirectionalDirectLight( directionalLight, geometry );\n #ifdef USE_SHADOWMAP\n if ( directionalLight.shadow > - 1 ) {\n for ( int j = 0; j < NUM_SHADOWS; j ++ ) {\n if ( j == directionalLight.shadow ) {\n directLight.color *= shadows[ j ];\n }\n }\n }\n #endif\n Material_RE_DirectLight( directLight, geometry, material, reflectedLight );\n }\n#endif\n#if defined( Material_RE_IndirectDiffuseLight )\n {\n vec3 indirectDiffuseIrradiance = getAmbientLightIrradiance( ambientLightColor );\n
#ifdef USE_LIGHTMAP\n indirectDiffuseIrradiance += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n#if ( NUM_HEMI_LIGHTS > 0 )\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n indirectDiffuseIrradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n }\n#endif\n#if defined( USE_ENVMAP ) && defined( STANDARD )\n indirectDiffuseIrradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n
#endif\n Material_RE_IndirectDiffuseLight( indirectDiffuseIrradiance, geometry, material, reflectedLight );\n }\n#endif\n#if defined( USE_ENVMAP ) && defined( Material_RE_IndirectSpecularLight )\n {\n vec3 indirectSpecularRadiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n Material_RE_IndirectSpecularLight( indirectSpecularRadiance, geometry, material, reflectedLight );\n }\n#endif\n";
THREE.ShaderChunk[ 'lights_template'] = "\nGeometricContext geometry;\ngeometry.position = -vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( Material_RE_DirectLight )\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n PointLight pointLight = pointLights[ i ];\n IncidentLight directLight = getPointDirectLight( pointLight, geometry );\n #ifdef USE_SHADOWMAP\n if ( pointLight.shadow > - 1 ) {\n for ( int j = 0; j < NUM_SHADOWS; j ++ ) {\n if ( j == pointLight.shadow ) {\n directLight.color *= shadows[ j ];\n }\n }\n }\n #endif\n Material_RE_DirectLight( directLight, geometry, material, reflectedLight );\n }\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( Material_RE_DirectLight )\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n SpotLight spotLight = spotLights[ i ];\n IncidentLight directLight = getSpotDirectLight( spotLight, geometry );\n #ifdef USE_SHADOWMAP\n if ( spotLight.shadow > - 1 ) {\n for ( int j = 0; j < NUM_SHADOWS; j ++ ) {\n if ( j == spotLight.shadow ) {\n directLight.color *= shadows[ j ];\n }\n }\n }\n #endif\n Material_RE_DirectLight( directLight, geometry, material, reflectedLight );\n }\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( Material_RE_DirectLight )\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n DirectionalLight directionalLight = directionalLights[ i ];\n IncidentLight directLight = getDirectionalDirectLight( directionalLight, geometry );\n #ifdef USE_SHADOWMAP\n if ( directionalLight.shadow > - 1 ) {\n for ( int j = 0; j < NUM_SHADOWS; j ++ ) {\n if ( j == directionalLight.shadow ) {\n directLight.color *= shadows[ j ];\n }\n }\n }\n #endif\n Material_RE_DirectLight( directLight, geometry, material, reflectedLight );\n }\n#endif\n#if defined( Material_RE_IndirectDiffuseLight )\n {\n vec3 indirectDiffuseIrradiance = getAmbientLightIrradiance( ambientLightColor );\n
#ifdef USE_LIGHTMAP\n indirectDiffuseIrradiance += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n #endif\n #if ( NUM_HEMI_LIGHTS > 0 )\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n indirectDiffuseIrradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n }\n
#endif\n Material_RE_IndirectDiffuseLight( indirectDiffuseIrradiance, geometry, material, reflectedLight );\n }\n#endif\n#if defined( USE_ENVMAP ) && defined( Material_RE_IndirectSpecularLight )\n {\n vec3 indirectSpecularRadiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n Material_RE_IndirectSpecularLight( indirectSpecularRadiance, geometry, material, reflectedLight );\n }\n#endif\n";
// File:src/renderers/shaders/ShaderChunk/linear_to_gamma_fragment.glsl
...
...
@@ -23275,7 +23275,7 @@ THREE.ShaderChunk[ 'map_particle_pars_fragment'] = "#ifdef USE_MAP\n uniform vec
// File:src/renderers/shaders/ShaderChunk/metalnessmap_fragment.glsl
THREE.ShaderChunk[ 'metalnessmap_fragment'] = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vUv );\n metalnessFactor = texelMetalness.r;\n#endif\n";
THREE.ShaderChunk[ 'metalnessmap_fragment'] = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vUv );\n metalnessFactor
*
= texelMetalness.r;\n#endif\n";
// File:src/renderers/shaders/ShaderChunk/metalnessmap_pars_fragment.glsl
...
...
@@ -38099,10 +38099,10 @@ THREE.WireframeGeometry = function ( geometry ) {
var indices = geometry.index.array;
var vertices = geometry.attributes.position;
var
drawcalls = geometry.drawcall
s;
var
groups = geometry.group
s;
var numEdges = 0;
if (
drawcall
s.length === 0 ) {
if (
group
s.length === 0 ) {
geometry.addGroup( 0, indices.length );
...
...
@@ -38111,12 +38111,12 @@ THREE.WireframeGeometry = function ( geometry ) {
// allocate maximal size
var edges = new Uint32Array( 2 * indices.length );
for ( var o = 0, ol =
drawcall
s.length; o < ol; ++ o ) {
for ( var o = 0, ol =
group
s.length; o < ol; ++ o ) {
var
drawcall = drawcall
s[ o ];
var
group = group
s[ o ];
var start =
drawcall
.start;
var count =
drawcall
.count;
var start =
group
.start;
var count =
group
.count;
for ( var i = start, il = start + count; i < il; i += 3 ) {
...
...
build/three.min.js
浏览文件 @
bd150ec3
...
...
@@ -525,10 +525,10 @@ THREE.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n\tuniform sampler
THREE
.
ShaderChunk
.
lights_phong_fragment
=
"
BlinnPhongMaterial material;
\n
material.diffuseColor = diffuseColor.rgb;
\n
material.specularColor = specular;
\n
material.specularShininess = shininess;
\n
material.specularStrength = specularStrength;
\n
#ifdef METAL
\n\t
material.diffuseColor = vec3( 0.0 );
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
lights_phong_pars_fragment
=
"
#ifdef USE_ENVMAP
\n\t
varying vec3 vWorldPosition;
\n
#endif
\n
varying vec3 vViewPosition;
\n
#ifndef FLAT_SHADED
\n\t
varying vec3 vNormal;
\n
#endif
\n
struct BlinnPhongMaterial {
\n\t
vec3
\t
diffuseColor;
\n\t
vec3
\t
specularColor;
\n\t
float
\t
specularShininess;
\n\t
float
\t
specularStrength;
\n
};
\n
void BlinnPhongMaterial_RE_DirectLight( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
\n\t
float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
\n\t
vec3 irradiance = dotNL * PI * directLight.color;
\n\t
reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );
\n\t
reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;
\n
}
\n
void BlinnPhongMaterial_RE_IndirectDiffuseLight( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
\n\t
reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );
\n
}
\n
#define Material_RE_DirectLight BlinnPhongMaterial_RE_DirectLight
\n
#define Material_RE_IndirectDiffuseLight BlinnPhongMaterial_RE_IndirectDiffuseLight
\n
#define Material_LightProbeLOD( material ) (0)
\n
"
;
THREE
.
ShaderChunk
.
lights_phong_pars_vertex
=
"
#ifdef USE_ENVMAP
\n\t
varying vec3 vWorldPosition;
\n
#endif
\n
#if NUM_POINT_LIGHTS > 0
\n\t
uniform vec3 pointLightPosition[ NUM_POINT_LIGHTS ];
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
lights_phong_vertex
=
"
#ifdef USE_ENVMAP
\n\t
vWorldPosition = worldPosition.xyz;
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
lights_standard_fragment
=
"
PhysicalMaterial material;
\n
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
\n
material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
\n
"
;
THREE
.
ShaderChunk
.
lights_standard_pars_fragment
=
"
struct PhysicalMaterial {
\n\t
vec3
\t
diffuseColor;
\n\t
float
\t
specularRoughness;
\n\t
vec3
\t
specularColor;
\n\t
float
\t
clearCoatWeight;
\n\t
float
\t
clearCoatRoughness;
\n
};
\n
void PhysicalMaterial_RE_DirectLight( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
\n\t
float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
\n\t
vec3 irradiance = dotNL * PI * directLight.color;
\n\t
reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );
\n\t
reflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );
\n
}
\n
void PhysicalMaterial_RE_DiffuseIndirectLight( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
\n\t
reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );
\n
}
\n
void PhysicalMaterial_RE_SpecularIndirectLight( const in vec3 radiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
\n\t
reflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );
\n
}
\n
#define Material_RE_DirectLight PhysicalMaterial_RE_DirectLight
\n
#define Material_RE_IndirectDiffuseLight PhysicalMaterial_RE_DiffuseIndirectLight
\n
#define Material_RE_IndirectSpecularLight PhysicalMaterial_RE_SpecularIndirectLight
\n
#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )
\n
"
;
THREE
.
ShaderChunk
.
lights_template
=
"
\n
GeometricContext geometry;
\n
geometry.position = -vViewPosition;
\n
geometry.normal = normal;
\n
geometry.viewDir = normalize( vViewPosition );
\n
#if ( NUM_POINT_LIGHTS > 0 ) && defined( Material_RE_DirectLight )
\n\t
for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
\n\t\t
PointLight pointLight = pointLights[ i ];
\n\t\t
IncidentLight directLight = getPointDirectLight( pointLight, geometry );
\n\t\t
#ifdef USE_SHADOWMAP
\n\t\t
if ( pointLight.shadow > - 1 ) {
\n\t\t\t
for ( int j = 0; j < NUM_SHADOWS; j ++ ) {
\n\t\t\t\t
if ( j == pointLight.shadow ) {
\n\t\t\t\t\t
directLight.color *= shadows[ j ];
\n\t\t\t\t
}
\n\t\t\t
}
\n\t\t
}
\n\t\t
#endif
\n\t\t
Material_RE_DirectLight( directLight, geometry, material, reflectedLight );
\n\t
}
\n
#endif
\n
#if ( NUM_SPOT_LIGHTS > 0 ) && defined( Material_RE_DirectLight )
\n\t
for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
\n\t\t
SpotLight spotLight = spotLights[ i ];
\n\t\t
IncidentLight directLight = getSpotDirectLight( spotLight, geometry );
\n\t\t
#ifdef USE_SHADOWMAP
\n\t\t
if ( spotLight.shadow > - 1 ) {
\n\t\t\t
for ( int j = 0; j < NUM_SHADOWS; j ++ ) {
\n\t\t\t\t
if ( j == spotLight.shadow ) {
\n\t\t\t\t\t
directLight.color *= shadows[ j ];
\n\t\t\t\t
}
\n\t\t\t
}
\n\t\t
}
\n\t\t
#endif
\n\t\t
Material_RE_DirectLight( directLight, geometry, material, reflectedLight );
\n\t
}
\n
#endif
\n
#if ( NUM_DIR_LIGHTS > 0 ) && defined( Material_RE_DirectLight )
\n\t
for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
\n\t\t
DirectionalLight directionalLight = directionalLights[ i ];
\n\t\t
IncidentLight directLight = getDirectionalDirectLight( directionalLight, geometry );
\n\t\t
#ifdef USE_SHADOWMAP
\n\t\t
if ( directionalLight.shadow > - 1 ) {
\n\t\t\t
for ( int j = 0; j < NUM_SHADOWS; j ++ ) {
\n\t\t\t\t
if ( j == directionalLight.shadow ) {
\n\t\t\t\t\t
directLight.color *= shadows[ j ];
\n\t\t\t\t
}
\n\t\t\t
}
\n\t\t
}
\n\t\t
#endif
\n\t\t
Material_RE_DirectLight( directLight, geometry, material, reflectedLight );
\n\t
}
\n
#endif
\n
#if defined( Material_RE_IndirectDiffuseLight )
\n\t
{
\n\t\t
vec3 indirectDiffuseIrradiance = getAmbientLightIrradiance( ambientLightColor );
\n
#ifdef USE_LIGHTMAP
\n\t\t
indirectDiffuseIrradiance += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;
\n
#endif
\n
#if ( NUM_HEMI_LIGHTS > 0 )
\n\t\t
for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
\n\t\t\t
indirectDiffuseIrradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );
\n\t\t
}
\n
#endif
\n
#if defined( USE_ENVMAP ) && defined( STANDARD )
\n\t\t
indirectDiffuseIrradiance += getLightProbeIndirectIrradiance( geometry, 8 );
\n
#endif
\n\t\t
Material_RE_IndirectDiffuseLight( indirectDiffuseIrradiance, geometry, material, reflectedLight );
\n\t
}
\n
#endif
\n
#if defined( USE_ENVMAP ) && defined( Material_RE_IndirectSpecularLight )
\n\t
{
\n\t\t
vec3 indirectSpecularRadiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );
\n\t\t
Material_RE_IndirectSpecularLight( indirectSpecularRadiance, geometry, material, reflectedLight );
\n
}
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
lights_template
=
"
\n
GeometricContext geometry;
\n
geometry.position = -vViewPosition;
\n
geometry.normal = normal;
\n
geometry.viewDir = normalize( vViewPosition );
\n
#if ( NUM_POINT_LIGHTS > 0 ) && defined( Material_RE_DirectLight )
\n\t
for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
\n\t\t
PointLight pointLight = pointLights[ i ];
\n\t\t
IncidentLight directLight = getPointDirectLight( pointLight, geometry );
\n\t\t
#ifdef USE_SHADOWMAP
\n\t\t
if ( pointLight.shadow > - 1 ) {
\n\t\t\t
for ( int j = 0; j < NUM_SHADOWS; j ++ ) {
\n\t\t\t\t
if ( j == pointLight.shadow ) {
\n\t\t\t\t\t
directLight.color *= shadows[ j ];
\n\t\t\t\t
}
\n\t\t\t
}
\n\t\t
}
\n\t\t
#endif
\n\t\t
Material_RE_DirectLight( directLight, geometry, material, reflectedLight );
\n\t
}
\n
#endif
\n
#if ( NUM_SPOT_LIGHTS > 0 ) && defined( Material_RE_DirectLight )
\n\t
for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
\n\t\t
SpotLight spotLight = spotLights[ i ];
\n\t\t
IncidentLight directLight = getSpotDirectLight( spotLight, geometry );
\n\t\t
#ifdef USE_SHADOWMAP
\n\t\t
if ( spotLight.shadow > - 1 ) {
\n\t\t\t
for ( int j = 0; j < NUM_SHADOWS; j ++ ) {
\n\t\t\t\t
if ( j == spotLight.shadow ) {
\n\t\t\t\t\t
directLight.color *= shadows[ j ];
\n\t\t\t\t
}
\n\t\t\t
}
\n\t\t
}
\n\t\t
#endif
\n\t\t
Material_RE_DirectLight( directLight, geometry, material, reflectedLight );
\n\t
}
\n
#endif
\n
#if ( NUM_DIR_LIGHTS > 0 ) && defined( Material_RE_DirectLight )
\n\t
for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
\n\t\t
DirectionalLight directionalLight = directionalLights[ i ];
\n\t\t
IncidentLight directLight = getDirectionalDirectLight( directionalLight, geometry );
\n\t\t
#ifdef USE_SHADOWMAP
\n\t\t
if ( directionalLight.shadow > - 1 ) {
\n\t\t\t
for ( int j = 0; j < NUM_SHADOWS; j ++ ) {
\n\t\t\t\t
if ( j == directionalLight.shadow ) {
\n\t\t\t\t\t
directLight.color *= shadows[ j ];
\n\t\t\t\t
}
\n\t\t\t
}
\n\t\t
}
\n\t\t
#endif
\n\t\t
Material_RE_DirectLight( directLight, geometry, material, reflectedLight );
\n\t
}
\n
#endif
\n
#if defined( Material_RE_IndirectDiffuseLight )
\n\t
{
\n\t\t
vec3 indirectDiffuseIrradiance = getAmbientLightIrradiance( ambientLightColor );
\n
\t\t
#ifdef USE_LIGHTMAP
\n\t\t\t
indirectDiffuseIrradiance += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;
\n\t\t
#endif
\n\t\t
#if ( NUM_HEMI_LIGHTS > 0 )
\n\t\t\t
for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
\n\t\t\t\t
indirectDiffuseIrradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );
\n\t\t\t
}
\n\t\t
#endif
\n\t\t
Material_RE_IndirectDiffuseLight( indirectDiffuseIrradiance, geometry, material, reflectedLight );
\n\t
}
\n
#endif
\n
#if defined( USE_ENVMAP ) && defined( Material_RE_IndirectSpecularLight )
\n\t
{
\n\t\t
vec3 indirectSpecularRadiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );
\n\t\t
Material_RE_IndirectSpecularLight( indirectSpecularRadiance, geometry, material, reflectedLight );
\n
}
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
linear_to_gamma_fragment
=
"
\n\t
outgoingLight = linearToOutput( outgoingLight );
\n
"
;
THREE
.
ShaderChunk
.
logdepthbuf_fragment
=
"
#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)
\n\t
gl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;
\n
#endif
"
;
THREE
.
ShaderChunk
.
logdepthbuf_pars_fragment
=
"
#ifdef USE_LOGDEPTHBUF
\n\t
uniform float logDepthBufFC;
\n\t
#ifdef USE_LOGDEPTHBUF_EXT
\n\t\t
varying float vFragDepth;
\n\t
#endif
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
logdepthbuf_pars_vertex
=
"
#ifdef USE_LOGDEPTHBUF
\n\t
#ifdef USE_LOGDEPTHBUF_EXT
\n\t\t
varying float vFragDepth;
\n\t
#endif
\n\t
uniform float logDepthBufFC;
\n
#endif
"
;
THREE
.
ShaderChunk
.
logdepthbuf_vertex
=
"
#ifdef USE_LOGDEPTHBUF
\n\t
gl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;
\n\t
#ifdef USE_LOGDEPTHBUF_EXT
\n\t\t
vFragDepth = 1.0 + gl_Position.w;
\n\t
#else
\n\t\t
gl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;
\n\t
#endif
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
map_fragment
=
"
#ifdef USE_MAP
\n\t
vec4 texelColor = texture2D( map, vUv );
\n\t
texelColor.xyz = inputToLinear( texelColor.xyz );
\n\t
diffuseColor *= texelColor;
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
map_pars_fragment
=
"
#ifdef USE_MAP
\n\t
uniform sampler2D map;
\n
#endif
"
;
THREE
.
ShaderChunk
.
map_particle_fragment
=
"
#ifdef USE_MAP
\n\t
diffuseColor *= texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
map_particle_pars_fragment
=
"
#ifdef USE_MAP
\n\t
uniform vec4 offsetRepeat;
\n\t
uniform sampler2D map;
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
metalnessmap_fragment
=
"
float metalnessFactor = metalness;
\n
#ifdef USE_METALNESSMAP
\n\t
vec4 texelMetalness = texture2D( metalnessMap, vUv );
\n\t
metalnessFactor = texelMetalness.r;
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
map_pars_fragment
=
"
#ifdef USE_MAP
\n\t
uniform sampler2D map;
\n
#endif
"
;
THREE
.
ShaderChunk
.
map_particle_fragment
=
"
#ifdef USE_MAP
\n\t
diffuseColor *= texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
map_particle_pars_fragment
=
"
#ifdef USE_MAP
\n\t
uniform vec4 offsetRepeat;
\n\t
uniform sampler2D map;
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
metalnessmap_fragment
=
"
float metalnessFactor = metalness;
\n
#ifdef USE_METALNESSMAP
\n\t
vec4 texelMetalness = texture2D( metalnessMap, vUv );
\n\t
metalnessFactor
*
= texelMetalness.r;
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
metalnessmap_pars_fragment
=
"
#ifdef USE_METALNESSMAP
\n\t
uniform sampler2D metalnessMap;
\n
#endif
"
;
THREE
.
ShaderChunk
.
morphnormal_vertex
=
"
#ifdef USE_MORPHNORMALS
\n\t
objectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];
\n\t
objectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];
\n\t
objectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];
\n\t
objectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
morphtarget_pars_vertex
=
"
#ifdef USE_MORPHTARGETS
\n\t
#ifndef USE_MORPHNORMALS
\n\t
uniform float morphTargetInfluences[ 8 ];
\n\t
#else
\n\t
uniform float morphTargetInfluences[ 4 ];
\n\t
#endif
\n
#endif
"
;
THREE
.
ShaderChunk
.
morphtarget_vertex
=
"
#ifdef USE_MORPHTARGETS
\n\t
transformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];
\n\t
transformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];
\n\t
transformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];
\n\t
transformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];
\n\t
#ifndef USE_MORPHNORMALS
\n\t
transformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];
\n\t
transformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];
\n\t
transformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];
\n\t
transformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];
\n\t
#endif
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
normal_fragment
=
"
#ifdef FLAT_SHADED
\n\t
vec3 fdx = dFdx( vViewPosition );
\n\t
vec3 fdy = dFdy( vViewPosition );
\n\t
vec3 normal = normalize( cross( fdx, fdy ) );
\n
#else
\n\t
vec3 normal = normalize( vNormal );
\n\t
#ifdef DOUBLE_SIDED
\n\t\t
normal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );
\n\t
#endif
\n
#endif
\n
#ifdef USE_NORMALMAP
\n\t
normal = perturbNormal2Arb( -vViewPosition, normal );
\n
#elif defined( USE_BUMPMAP )
\n\t
normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );
\n
#endif
\n
"
;
...
...
@@ -888,8 +888,8 @@ THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[1,1,
THREE
.
ParametricGeometry
=
function
(
a
,
b
,
c
){
THREE
.
Geometry
.
call
(
this
);
this
.
type
=
"
ParametricGeometry
"
;
this
.
parameters
=
{
func
:
a
,
slices
:
b
,
stacks
:
c
};
var
d
=
this
.
vertices
,
e
=
this
.
faces
,
f
=
this
.
faceVertexUvs
[
0
],
g
,
h
,
k
,
l
,
m
=
b
+
1
;
for
(
g
=
0
;
g
<=
c
;
g
++
)
for
(
l
=
g
/
c
,
h
=
0
;
h
<=
b
;
h
++
)
k
=
h
/
b
,
k
=
a
(
k
,
l
),
d
.
push
(
k
);
var
p
,
n
,
q
,
s
;
for
(
g
=
0
;
g
<
c
;
g
++
)
for
(
h
=
0
;
h
<
b
;
h
++
)
a
=
g
*
m
+
h
,
d
=
g
*
m
+
h
+
1
,
l
=
(
g
+
1
)
*
m
+
h
+
1
,
k
=
(
g
+
1
)
*
m
+
h
,
p
=
new
THREE
.
Vector2
(
h
/
b
,
g
/
c
),
n
=
new
THREE
.
Vector2
((
h
+
1
)
/
b
,
g
/
c
),
q
=
new
THREE
.
Vector2
((
h
+
1
)
/
b
,(
g
+
1
)
/
c
),
s
=
new
THREE
.
Vector2
(
h
/
b
,(
g
+
1
)
/
c
),
e
.
push
(
new
THREE
.
Face3
(
a
,
d
,
k
)),
f
.
push
([
p
,
n
,
s
]),
e
.
push
(
new
THREE
.
Face3
(
d
,
l
,
k
)),
f
.
push
([
n
.
clone
(),
q
,
s
.
clone
()]);
this
.
computeFaceNormals
();
this
.
computeVertexNormals
()};
THREE
.
ParametricGeometry
.
prototype
=
Object
.
create
(
THREE
.
Geometry
.
prototype
);
THREE
.
ParametricGeometry
.
prototype
.
constructor
=
THREE
.
ParametricGeometry
;
THREE
.
WireframeGeometry
=
function
(
a
){
function
b
(
a
,
b
){
return
a
-
b
}
THREE
.
BufferGeometry
.
call
(
this
);
var
c
=
[
0
,
0
],
d
=
{},
e
=
[
"
a
"
,
"
b
"
,
"
c
"
];
if
(
a
instanceof
THREE
.
Geometry
){
var
f
=
a
.
vertices
,
g
=
a
.
faces
,
h
=
0
,
k
=
new
Uint32Array
(
6
*
g
.
length
);
a
=
0
;
for
(
var
l
=
g
.
length
;
a
<
l
;
a
++
)
for
(
var
m
=
g
[
a
],
p
=
0
;
3
>
p
;
p
++
){
c
[
0
]
=
m
[
e
[
p
]];
c
[
1
]
=
m
[
e
[(
p
+
1
)
%
3
]];
c
.
sort
(
b
);
var
n
=
c
.
toString
();
void
0
===
d
[
n
]
&&
(
k
[
2
*
h
]
=
c
[
0
],
k
[
2
*
h
+
1
]
=
c
[
1
],
d
[
n
]
=!
0
,
h
++
)}
c
=
new
Float32Array
(
6
*
h
);
a
=
0
;
for
(
l
=
h
;
a
<
l
;
a
++
)
for
(
p
=
0
;
2
>
p
;
p
++
)
d
=
f
[
k
[
2
*
a
+
p
]],
h
=
6
*
a
+
3
*
p
,
c
[
h
+
0
]
=
d
.
x
,
c
[
h
+
1
]
=
d
.
y
,
c
[
h
+
2
]
=
d
.
z
;
this
.
addAttribute
(
"
position
"
,
new
THREE
.
BufferAttribute
(
c
,
3
))}
else
if
(
a
instanceof
THREE
.
BufferGeometry
){
if
(
null
!==
a
.
index
){
l
=
a
.
index
.
array
;
f
=
a
.
attributes
.
position
;
e
=
a
.
drawcalls
;
h
=
0
;
0
===
e
.
length
&&
a
.
addGroup
(
0
,
l
.
length
);
k
=
new
Uint32Array
(
2
*
l
.
length
);
g
=
0
;
for
(
m
=
e
.
length
;
g
<
m
;
++
g
){
a
=
e
[
g
];
p
=
a
.
start
;
n
=
a
.
count
;
a
=
p
;
for
(
var
q
=
p
+
n
;
a
<
q
;
a
+=
3
)
for
(
p
=
0
;
3
>
p
;
p
++
)
c
[
0
]
=
l
[
a
+
p
],
c
[
1
]
=
l
[
a
+
(
p
+
1
)
%
3
],
c
.
sort
(
b
),
n
=
c
.
toString
(),
void
0
===
d
[
n
]
&&
(
k
[
2
*
h
]
=
c
[
0
],
k
[
2
*
h
+
1
]
=
c
[
1
],
d
[
n
]
=!
0
,
h
++
)}
c
=
new
Float32Array
(
6
*
h
);
a
=
0
;
for
(
l
=
h
;
a
<
l
;
a
++
)
for
(
p
=
0
;
2
>
p
;
p
++
)
h
=
6
*
a
+
3
*
p
,
d
=
k
[
2
*
a
+
p
],
c
[
h
+
0
]
=
f
.
getX
(
d
),
c
[
h
+
1
]
=
f
.
getY
(
d
),
c
[
h
+
2
]
=
f
.
getZ
(
d
)}
else
for
(
f
=
a
.
attributes
.
position
.
array
,
h
=
f
.
length
/
3
,
k
=
h
/
3
,
c
=
new
Float32Array
(
6
*
h
),
a
=
0
,
l
=
k
;
a
<
l
;
a
++
)
for
(
p
=
0
;
3
>
p
;
p
++
)
h
=
18
*
a
+
6
*
p
,
k
=
9
*
a
+
3
*
p
,
c
[
h
+
0
]
=
f
[
k
],
c
[
h
+
1
]
=
f
[
k
+
1
],
c
[
h
+
2
]
=
f
[
k
+
2
],
d
=
9
*
a
+
(
p
+
1
)
%
3
*
3
,
c
[
h
+
3
]
=
f
[
d
],
c
[
h
+
4
]
=
f
[
d
+
1
],
c
[
h
+
5
]
=
f
[
d
+
2
];
this
.
addAttribute
(
"
position
"
,
new
THREE
.
BufferAttribute
(
c
,
3
))}};
THREE
.
WireframeGeometry
.
prototype
=
Object
.
create
(
THREE
.
BufferGeometry
.
prototype
);
c
[
h
+
2
]
=
d
.
z
;
this
.
addAttribute
(
"
position
"
,
new
THREE
.
BufferAttribute
(
c
,
3
))}
else
if
(
a
instanceof
THREE
.
BufferGeometry
){
if
(
null
!==
a
.
index
){
l
=
a
.
index
.
array
;
f
=
a
.
attributes
.
position
;
e
=
a
.
groups
;
h
=
0
;
0
===
e
.
length
&&
a
.
addGroup
(
0
,
l
.
length
);
k
=
new
Uint32Array
(
2
*
l
.
length
);
g
=
0
;
for
(
m
=
e
.
length
;
g
<
m
;
++
g
){
a
=
e
[
g
];
p
=
a
.
start
;
n
=
a
.
count
;
a
=
p
;
for
(
var
q
=
p
+
n
;
a
<
q
;
a
+=
3
)
for
(
p
=
0
;
3
>
p
;
p
++
)
c
[
0
]
=
l
[
a
+
p
],
c
[
1
]
=
l
[
a
+
(
p
+
1
)
%
3
],
c
.
sort
(
b
),
n
=
c
.
toString
(),
void
0
===
d
[
n
]
&&
(
k
[
2
*
h
]
=
c
[
0
],
k
[
2
*
h
+
1
]
=
c
[
1
],
d
[
n
]
=!
0
,
h
++
)}
c
=
new
Float32Array
(
6
*
h
);
a
=
0
;
for
(
l
=
h
;
a
<
l
;
a
++
)
for
(
p
=
0
;
2
>
p
;
p
++
)
h
=
6
*
a
+
3
*
p
,
d
=
k
[
2
*
a
+
p
],
c
[
h
+
0
]
=
f
.
getX
(
d
),
c
[
h
+
1
]
=
f
.
getY
(
d
),
c
[
h
+
2
]
=
f
.
getZ
(
d
)}
else
for
(
f
=
a
.
attributes
.
position
.
array
,
h
=
f
.
length
/
3
,
k
=
h
/
3
,
c
=
new
Float32Array
(
6
*
h
),
a
=
0
,
l
=
k
;
a
<
l
;
a
++
)
for
(
p
=
0
;
3
>
p
;
p
++
)
h
=
18
*
a
+
6
*
p
,
k
=
9
*
a
+
3
*
p
,
c
[
h
+
0
]
=
f
[
k
],
c
[
h
+
1
]
=
f
[
k
+
1
],
c
[
h
+
2
]
=
f
[
k
+
2
],
d
=
9
*
a
+
(
p
+
1
)
%
3
*
3
,
c
[
h
+
3
]
=
f
[
d
],
c
[
h
+
4
]
=
f
[
d
+
1
],
c
[
h
+
5
]
=
f
[
d
+
2
];
this
.
addAttribute
(
"
position
"
,
new
THREE
.
BufferAttribute
(
c
,
3
))}};
THREE
.
WireframeGeometry
.
prototype
=
Object
.
create
(
THREE
.
BufferGeometry
.
prototype
);
THREE
.
WireframeGeometry
.
prototype
.
constructor
=
THREE
.
WireframeGeometry
;
THREE
.
AxisHelper
=
function
(
a
){
a
=
a
||
1
;
var
b
=
new
Float32Array
([
0
,
0
,
0
,
a
,
0
,
0
,
0
,
0
,
0
,
0
,
a
,
0
,
0
,
0
,
0
,
0
,
0
,
a
]),
c
=
new
Float32Array
([
1
,
0
,
0
,
1
,.
6
,
0
,
0
,
1
,
0
,.
6
,
1
,
0
,
0
,
0
,
1
,
0
,.
6
,
1
]);
a
=
new
THREE
.
BufferGeometry
;
a
.
addAttribute
(
"
position
"
,
new
THREE
.
BufferAttribute
(
b
,
3
));
a
.
addAttribute
(
"
color
"
,
new
THREE
.
BufferAttribute
(
c
,
3
));
b
=
new
THREE
.
LineBasicMaterial
({
vertexColors
:
THREE
.
VertexColors
});
THREE
.
LineSegments
.
call
(
this
,
a
,
b
)};
THREE
.
AxisHelper
.
prototype
=
Object
.
create
(
THREE
.
LineSegments
.
prototype
);
THREE
.
AxisHelper
.
prototype
.
constructor
=
THREE
.
AxisHelper
;
THREE
.
ArrowHelper
=
function
(){
var
a
=
new
THREE
.
Geometry
;
a
.
vertices
.
push
(
new
THREE
.
Vector3
(
0
,
0
,
0
),
new
THREE
.
Vector3
(
0
,
1
,
0
));
var
b
=
new
THREE
.
CylinderGeometry
(
0
,.
5
,
1
,
5
,
1
);
b
.
translate
(
0
,
-
.
5
,
0
);
return
function
(
c
,
d
,
e
,
f
,
g
,
h
){
THREE
.
Object3D
.
call
(
this
);
void
0
===
f
&&
(
f
=
16776960
);
void
0
===
e
&&
(
e
=
1
);
void
0
===
g
&&
(
g
=
.
2
*
e
);
void
0
===
h
&&
(
h
=
.
2
*
g
);
this
.
position
.
copy
(
d
);
this
.
line
=
new
THREE
.
Line
(
a
,
new
THREE
.
LineBasicMaterial
({
color
:
f
}));
this
.
line
.
matrixAutoUpdate
=!
1
;
this
.
add
(
this
.
line
);
this
.
cone
=
new
THREE
.
Mesh
(
b
,
new
THREE
.
MeshBasicMaterial
({
color
:
f
}));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录