Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
11414c7a
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,体验更适合开发者的 AI 搜索 >>
提交
11414c7a
编写于
2月 10, 2016
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
b16d4e0c
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
3 addition
and
3 deletion
+3
-3
build/three.js
build/three.js
+2
-2
build/three.min.js
build/three.min.js
+1
-1
未找到文件。
build/three.js
浏览文件 @
11414c7a
...
...
@@ -23289,9 +23289,9 @@ THREE.Scene = function () {
THREE.Scene.prototype = Object.create( THREE.Object3D.prototype );
THREE.Scene.prototype.constructor = THREE.Scene;
THREE.Scene.prototype.copy = function ( source ) {
THREE.Scene.prototype.copy = function ( source
, recursive
) {
THREE.Object3D.prototype.copy.call( this, source );
THREE.Object3D.prototype.copy.call( this, source
, recursive
);
if ( source.fog !== null ) this.fog = source.fog.clone();
if ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone();
...
...
build/three.min.js
浏览文件 @
11414c7a
...
...
@@ -514,7 +514,7 @@ THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this);this.lensFlares=[]
THREE
.
LensFlare
.
prototype
.
add
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
void
0
===
b
&&
(
b
=-
1
);
void
0
===
c
&&
(
c
=
0
);
void
0
===
f
&&
(
f
=
1
);
void
0
===
e
&&
(
e
=
new
THREE
.
Color
(
16777215
));
void
0
===
d
&&
(
d
=
THREE
.
NormalBlending
);
c
=
Math
.
min
(
c
,
Math
.
max
(
0
,
c
));
this
.
lensFlares
.
push
({
texture
:
a
,
size
:
b
,
distance
:
c
,
x
:
0
,
y
:
0
,
z
:
0
,
scale
:
1
,
rotation
:
0
,
opacity
:
f
,
color
:
e
,
blending
:
d
})};
THREE
.
LensFlare
.
prototype
.
updateLensFlares
=
function
(){
var
a
,
b
=
this
.
lensFlares
.
length
,
c
,
d
=
2
*-
this
.
positionScreen
.
x
,
e
=
2
*-
this
.
positionScreen
.
y
;
for
(
a
=
0
;
a
<
b
;
a
++
)
c
=
this
.
lensFlares
[
a
],
c
.
x
=
this
.
positionScreen
.
x
+
d
*
c
.
distance
,
c
.
y
=
this
.
positionScreen
.
y
+
e
*
c
.
distance
,
c
.
wantedRotation
=
c
.
x
*
Math
.
PI
*
.
25
,
c
.
rotation
+=
.
25
*
(
c
.
wantedRotation
-
c
.
rotation
)};
THREE
.
LensFlare
.
prototype
.
copy
=
function
(
a
){
THREE
.
Object3D
.
prototype
.
copy
.
call
(
this
,
a
);
this
.
positionScreen
.
copy
(
a
.
positionScreen
);
this
.
customUpdateCallback
=
a
.
customUpdateCallback
;
for
(
var
b
=
0
,
c
=
a
.
lensFlares
.
length
;
b
<
c
;
b
++
)
this
.
lensFlares
.
push
(
a
.
lensFlares
[
b
]);
return
this
};
THREE
.
Scene
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
type
=
"
Scene
"
;
this
.
overrideMaterial
=
this
.
fog
=
null
;
this
.
autoUpdate
=!
0
};
THREE
.
Scene
.
prototype
=
Object
.
create
(
THREE
.
Object3D
.
prototype
);
THREE
.
Scene
.
prototype
.
constructor
=
THREE
.
Scene
;
THREE
.
Scene
.
prototype
.
copy
=
function
(
a
){
THREE
.
Object3D
.
prototype
.
copy
.
call
(
this
,
a
);
null
!==
a
.
fog
&&
(
this
.
fog
=
a
.
fog
.
clone
());
null
!==
a
.
overrideMaterial
&&
(
this
.
overrideMaterial
=
a
.
overrideMaterial
.
clone
());
this
.
autoUpdate
=
a
.
autoUpdate
;
this
.
matrixAutoUpdate
=
a
.
matrixAutoUpdate
;
return
this
};
THREE
.
Fog
=
function
(
a
,
b
,
c
){
this
.
name
=
""
;
this
.
color
=
new
THREE
.
Color
(
a
);
this
.
near
=
void
0
!==
b
?
b
:
1
;
this
.
far
=
void
0
!==
c
?
c
:
1
E3
};
THREE
.
Fog
.
prototype
.
clone
=
function
(){
return
new
THREE
.
Fog
(
this
.
color
.
getHex
(),
this
.
near
,
this
.
far
)};
THREE
.
Scene
.
prototype
.
copy
=
function
(
a
,
b
){
THREE
.
Object3D
.
prototype
.
copy
.
call
(
this
,
a
,
b
);
null
!==
a
.
fog
&&
(
this
.
fog
=
a
.
fog
.
clone
());
null
!==
a
.
overrideMaterial
&&
(
this
.
overrideMaterial
=
a
.
overrideMaterial
.
clone
());
this
.
autoUpdate
=
a
.
autoUpdate
;
this
.
matrixAutoUpdate
=
a
.
matrixAutoUpdate
;
return
this
};
THREE
.
Fog
=
function
(
a
,
b
,
c
){
this
.
name
=
""
;
this
.
color
=
new
THREE
.
Color
(
a
);
this
.
near
=
void
0
!==
b
?
b
:
1
;
this
.
far
=
void
0
!==
c
?
c
:
1
E3
};
THREE
.
Fog
.
prototype
.
clone
=
function
(){
return
new
THREE
.
Fog
(
this
.
color
.
getHex
(),
this
.
near
,
this
.
far
)};
THREE
.
FogExp2
=
function
(
a
,
b
){
this
.
name
=
""
;
this
.
color
=
new
THREE
.
Color
(
a
);
this
.
density
=
void
0
!==
b
?
b
:
2.5
E
-
4
};
THREE
.
FogExp2
.
prototype
.
clone
=
function
(){
return
new
THREE
.
FogExp2
(
this
.
color
.
getHex
(),
this
.
density
)};
THREE
.
ShaderChunk
=
{};
THREE
.
ShaderChunk
.
alphamap_fragment
=
"
#ifdef USE_ALPHAMAP
\n\t
diffuseColor.a *= texture2D( alphaMap, vUv ).g;
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
alphamap_pars_fragment
=
"
#ifdef USE_ALPHAMAP
\n\t
uniform sampler2D alphaMap;
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
alphatest_fragment
=
"
#ifdef ALPHATEST
\n\t
if ( diffuseColor.a < ALPHATEST ) discard;
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
ambient_pars
=
"
uniform vec3 ambientLightColor;
\n
vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
\n\t
return PI * ambientLightColor;
\n
}
\n
"
;
THREE
.
ShaderChunk
.
aomap_fragment
=
"
#ifdef USE_AOMAP
\n\t
reflectedLight.indirectDiffuse *= ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;
\n
#endif
\n
"
;
THREE
.
ShaderChunk
.
aomap_pars_fragment
=
"
#ifdef USE_AOMAP
\n\t
uniform sampler2D aoMap;
\n\t
uniform float aoMapIntensity;
\n
#endif
"
;
THREE
.
ShaderChunk
.
begin_vertex
=
"
\n
vec3 transformed = vec3( position );
\n
"
;
THREE
.
ShaderChunk
.
beginnormal_vertex
=
"
\n
vec3 objectNormal = vec3( normal );
\n
"
;
THREE
.
ShaderChunk
.
bsdfs
=
"
float calcLightAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
\n\t
if ( decayExponent > 0.0 ) {
\n\t
return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );
\n\t
}
\n\t
return 1.0;
\n
}
\n
vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {
\n\t
return RECIPROCAL_PI * diffuseColor;
\n
}
\n
vec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {
\n\t
float fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );
\n\t
return ( 1.0 - specularColor ) * fresnel + specularColor;
\n
}
\n
float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {
\n\t
float a2 = alpha * alpha;
\n\t
float gl = dotNL + pow( a2 + ( 1.0 - a2 ) * dotNL * dotNL, 0.5 );
\n\t
float gv = dotNV + pow( a2 + ( 1.0 - a2 ) * dotNV * dotNV, 0.5 );
\n\t
return 1.0 / ( gl * gv );
\n
}
\n
float D_GGX( const in float alpha, const in float dotNH ) {
\n\t
float a2 = alpha * alpha;
\n\t
float denom = dotNH * dotNH * ( a2 - 1.0 ) + 1.0;
\n\t
return RECIPROCAL_PI * a2 / ( denom * denom );
\n
}
\n
vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {
\n\t
float alpha = roughness * roughness;
\n\t
vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );
\n\t
float dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );
\n\t
float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
\n\t
float dotNH = saturate( dot( geometry.normal, halfDir ) );
\n\t
float dotLH = saturate( dot( incidentLight.direction, halfDir ) );
\n\t
vec3 F = F_Schlick( specularColor, dotLH );
\n\t
float G = G_GGX_Smith( alpha, dotNL, dotNV );
\n\t
float D = D_GGX( alpha, dotNH );
\n\t
return F * ( G * D );
\n
}
\n
vec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {
\n\t
float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
\n\t
const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
\n\t
const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
\n\t
vec4 r = roughness * c0 + c1;
\n\t
float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
\n\t
vec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;
\n\t
return specularColor * AB.x + AB.y;
\n
}
\n
float G_BlinnPhong_Implicit( ) {
\n\t
return 0.25;
\n
}
\n
float D_BlinnPhong( const in float shininess, const in float dotNH ) {
\n\t
return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
\n
}
\n
vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {
\n\t
vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );
\n\t
float dotNH = saturate( dot( geometry.normal, halfDir ) );
\n\t
float dotLH = saturate( dot( incidentLight.direction, halfDir ) );
\n\t
vec3 F = F_Schlick( specularColor, dotLH );
\n\t
float G = G_BlinnPhong_Implicit( );
\n\t
float D = D_BlinnPhong( shininess, dotNH );
\n\t
return F * ( G * D );
\n
}
\n
float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {
\n\t
return ( 2.0 / square( ggxRoughness + 0.0001 ) - 2.0 );
\n
}
"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录