Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
9d64683c
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,发现更多精彩内容 >>
提交
9d64683c
编写于
11月 13, 2015
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
ed7be74d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
2 addition
and
2 deletion
+2
-2
build/three.js
build/three.js
+1
-1
build/three.min.js
build/three.min.js
+1
-1
未找到文件。
build/three.js
浏览文件 @
9d64683c
...
...
@@ -23197,7 +23197,7 @@ THREE.ShaderChunk[ 'lights_phong_vertex'] = "#ifdef USE_ENVMAP\n vWorldPosition
// File:src/renderers/shaders/ShaderChunk/lights_standard_fragment.glsl
THREE.ShaderChunk[ 'lights_standard_fragment'] = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness =
roughnessFactor * 0.5 + 0.5
;material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n";
THREE.ShaderChunk[ 'lights_standard_fragment'] = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness =
clamp( roughnessFactor, 0.04, 1.0 )
;material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n";
// File:src/renderers/shaders/ShaderChunk/lights_standard_pars_fragment.glsl
...
...
build/three.min.js
浏览文件 @
9d64683c
...
...
@@ -522,7 +522,7 @@ THREE.ShaderChunk.fog_fragment="#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t
THREE
.
ShaderChunk
.
fog_pars_fragment
=
"
#ifdef USE_FOG
\n\t
uniform vec3 fogColor;
\n\t
#ifdef FOG_EXP2
\n\t\t
uniform float fogDensity;
\n\t
#else
\n\t\t
uniform float fogNear;
\n\t\t
uniform float fogFar;
\n\t
#endif
\n
#endif
"
;
THREE
.
ShaderChunk
.
lights_pars
=
"
uniform vec3 ambientLightColor;
\n
vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
\n\t
return PI * ambientLightColor;
\n
}
\n
#if NUM_DIR_LIGHTS > 0
\n\t
struct DirectionalLight {
\n\t
vec3 direction;
\n\t
vec3 color;
\n\t
int shadow;
\n\t
};
\n\t
uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
\n\t
IncidentLight getDirectionalDirectLight( const in DirectionalLight directionalLight, const in GeometricContext geometry ) {
\n\t\t
IncidentLight directLight;
\n\t\t
directLight.color = directionalLight.color;
\n\t\t
directLight.direction = directionalLight.direction;
\n\t\t
return directLight;
\n\t
}
\n
#endif
\n
#if NUM_POINT_LIGHTS > 0
\n\t
struct PointLight {
\n\t
vec3 position;
\n\t
vec3 color;
\n\t
float distance;
\n\t
float decay;
\n\t
int shadow;
\n\t
};
\n\t
uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
\n\t
IncidentLight getPointDirectLight( const in PointLight pointLight, const in GeometricContext geometry ) {
\n\t\t
IncidentLight directLight;
\n\t\t
vec3 lVector = pointLight.position - geometry.position;
\n\t\t
directLight.direction = normalize( lVector );
\n\t\t
directLight.color = pointLight.color;
\n\t\t
directLight.color *= calcLightAttenuation( length( lVector ), pointLight.distance, pointLight.decay );
\n\t\t
return directLight;
\n\t
}
\n
#endif
\n
#if NUM_SPOT_LIGHTS > 0
\n\t
struct SpotLight {
\n\t
vec3 position;
\n\t
vec3 direction;
\n\t
vec3 color;
\n\t
float distance;
\n\t
float decay;
\n\t
float angleCos;
\n\t
float exponent;
\n\t
int shadow;
\n\t
};
\n\t
uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
\n\t
IncidentLight getSpotDirectLight( const in SpotLight spotLight, const in GeometricContext geometry ) {
\n\t\t
IncidentLight directLight;
\n\t\t
vec3 lVector = spotLight.position - geometry.position;
\n\t\t
directLight.direction = normalize( lVector );
\n\t\t
float spotEffect = dot( directLight.direction, spotLight.direction );
\n\t\t
if ( spotEffect > spotLight.angleCos ) {
\n\t\t\t
float spotEffect = dot( spotLight.direction, directLight.direction );
\n\t\t\t
spotEffect = saturate( pow( saturate( spotEffect ), spotLight.exponent ) );
\n\t\t\t
directLight.color = spotLight.color;
\n\t\t\t
directLight.color *= ( spotEffect * calcLightAttenuation( length( lVector ), spotLight.distance, spotLight.decay ) );
\n\t\t
} else {
\n\t\t\t
directLight.color = vec3( 0.0 );
\n\t\t
}
\n\t\t
return directLight;
\n\t
}
\n
#endif
\n
#if NUM_HEMI_LIGHTS > 0
\n\t
struct HemisphereLight {
\n\t
vec3 direction;
\n\t
vec3 skyColor;
\n\t
vec3 groundColor;
\n\t
};
\n\t
uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
\n\t
vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {
\n\t\t
float dotNL = dot( geometry.normal, hemiLight.direction );
\n\t\t
float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
\n\t\t
return PI * mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
\n\t
}
\n
#endif
\n
#if defined( USE_ENVMAP ) && defined( STANDARD )
\n\t
vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {
\n\t\t
#ifdef DOUBLE_SIDED
\n\t\t\t
float flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );
\n\t\t
#else
\n\t\t\t
float flipNormal = 1.0;
\n\t\t
#endif
\n\t\t
vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );
\n\t\t
#ifdef ENVMAP_TYPE_CUBE
\n\t\t\t
vec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );
\n\t\t\t
#if defined( TEXTURE_CUBE_LOD_EXT )
\n\t\t\t\t
vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );
\n\t\t\t
#else
\n\t\t\t\t
vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );
\n\t\t\t
#endif
\n\t\t
#else
\n\t\t\t
vec3 envMapColor = vec3( 0.0 );
\n\t\t
#endif
\n\t\t
envMapColor.rgb = inputToLinear( envMapColor.rgb );
\n\t\t
return PI * envMapColor.rgb * envMapIntensity;
\n\t
}
\n\t
float getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {
\n\t\t
float maxMIPLevelScalar = float( maxMIPLevel );
\n\t\t
float desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( square( blinnShininessExponent ) + 1.0 );
\n\t\t
return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );
\n\t
}
\n\t
vec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {
\n\t\t
#ifdef ENVMAP_MODE_REFLECTION
\n\t\t\t
vec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );
\n\t\t
#else
\n\t\t\t
vec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );
\n\t\t
#endif
\n\t\t
#ifdef DOUBLE_SIDED
\n\t\t\t
float flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );
\n\t\t
#else
\n\t\t\t
float flipNormal = 1.0;
\n\t\t
#endif
\n\t\t
reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
\n\t\t
#ifdef ENVMAP_TYPE_CUBE
\n\t\t\t
vec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );
\n\t\t\t
#if defined( TEXTURE_CUBE_LOD_EXT )
\n\t\t\t\t
float specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );
\n\t\t\t\t
vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );
\n\t\t\t
#else
\n\t\t\t\t
vec4 envMapColor = textureCube( envMap, queryReflectVec );
\n\t\t\t
#endif
\n\t\t
#elif defined( ENVMAP_TYPE_EQUIREC )
\n\t\t\t
vec2 sampleUV;
\n\t\t\t
sampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );
\n\t\t\t
sampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;
\n\t\t\t
vec4 envMapColor = texture2D( envMap, sampleUV );
\n\t\t
#elif defined( ENVMAP_TYPE_SPHERE )
\n\t\t\t
vec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));
\n\t\t\t
vec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );
\n\t\t
#endif
\n\t\t
envMapColor.rgb = inputToLinear( envMapColor.rgb );
\n\t\t
return envMapColor.rgb * envMapIntensity;
\n\t
}
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
lightmap_pars_fragment
=
"
#ifdef USE_LIGHTMAP
\n\t
uniform sampler2D lightMap;
\n\t
uniform float lightMapIntensity;
\n
#endif
"
;
THREE
.
ShaderChunk
.
lights_lambert_vertex
=
"
vec3 diffuse = vec3( 1.0 );
\n
GeometricContext geometry;
\n
geometry.position = mvPosition.xyz;
\n
geometry.normal = normalize( transformedNormal );
\n
geometry.viewDir = normalize( -mvPosition.xyz );
\n
GeometricContext backGeometry;
\n
backGeometry.position = geometry.position;
\n
backGeometry.normal = -geometry.normal;
\n
backGeometry.viewDir = geometry.viewDir;
\n
vLightFront = vec3( 0.0 );
\n
#ifdef DOUBLE_SIDED
\n\t
vLightBack = vec3( 0.0 );
\n
#endif
\n
#if NUM_POINT_LIGHTS > 0
\n\t
for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
\n\t\t
IncidentLight directLight = getPointDirectLight( pointLights[ i ], geometry );
\n\t\t
float dotNL = dot( geometry.normal, directLight.direction );
\n\t\t
vec3 directLightColor_Diffuse = PI * directLight.color;
\n\t\t
vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
\n\t\t
#ifdef DOUBLE_SIDED
\n\t\t\t
vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;
\n\t\t
#endif
\n\t
}
\n
#endif
\n
#if NUM_SPOT_LIGHTS > 0
\n\t
for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
\n\t\t
IncidentLight directLight = getSpotDirectLight( spotLights[ i ], geometry );
\n\t\t
float dotNL = dot( geometry.normal, directLight.direction );
\n\t\t
vec3 directLightColor_Diffuse = PI * directLight.color;
\n\t\t
vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
\n\t\t
#ifdef DOUBLE_SIDED
\n\t\t\t
vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;
\n\t\t
#endif
\n\t
}
\n
#endif
\n
#if NUM_DIR_LIGHTS > 0
\n\t
for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
\n\t\t
IncidentLight directLight = getDirectionalDirectLight( directionalLights[ i ], geometry );
\n\t\t
float dotNL = dot( geometry.normal, directLight.direction );
\n\t\t
vec3 directLightColor_Diffuse = PI * directLight.color;
\n\t\t
vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
\n\t\t
#ifdef DOUBLE_SIDED
\n\t\t\t
vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;
\n\t\t
#endif
\n\t
}
\n
#endif
\n\t
{
\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
vLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );
\n\t\t\t\t
#ifdef DOUBLE_SIDED
\n\t\t\t\t\t
vLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );
\n\t\t\t\t
#endif
\n\t\t\t
}
\n\t\t
#endif
\n\t
}
\n
"
;
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 =
roughnessFactor * 0.5 + 0.5
;material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
\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
.
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
"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录