Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
ae60091a
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,发现更多精彩内容 >>
提交
ae60091a
编写于
12月 30, 2010
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Small refactoring in WebGLRenderer.
上级
dad635b6
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
305 addition
and
305 deletion
+305
-305
build/Three.js
build/Three.js
+79
-79
build/ThreeDebug.js
build/ThreeDebug.js
+88
-88
build/ThreeExtras.js
build/ThreeExtras.js
+103
-103
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+35
-35
未找到文件。
build/Three.js
浏览文件 @
ae60091a
此差异已折叠。
点击以展开。
build/ThreeDebug.js
浏览文件 @
ae60091a
此差异已折叠。
点击以展开。
build/ThreeExtras.js
浏览文件 @
ae60091a
此差异已折叠。
点击以展开。
src/renderers/WebGLRenderer.js
浏览文件 @
ae60091a
...
@@ -153,9 +153,9 @@ THREE.WebGLRenderer = function ( parameters ) {
...
@@ -153,9 +153,9 @@ THREE.WebGLRenderer = function ( parameters ) {
v2
=
object
.
geometry
.
vertices
[
face
.
b
].
position
;
v2
=
object
.
geometry
.
vertices
[
face
.
b
].
position
;
v3
=
object
.
geometry
.
vertices
[
face
.
c
].
position
;
v3
=
object
.
geometry
.
vertices
[
face
.
c
].
position
;
vertexArray
.
push
(
v1
.
x
,
v1
.
y
,
v1
.
z
);
vertexArray
.
push
(
v1
.
x
,
v1
.
y
,
v1
.
z
,
vertexArray
.
push
(
v2
.
x
,
v2
.
y
,
v2
.
z
);
v2
.
x
,
v2
.
y
,
v2
.
z
,
vertexArray
.
push
(
v3
.
x
,
v3
.
y
,
v3
.
z
);
v3
.
x
,
v3
.
y
,
v3
.
z
);
if
(
object
.
geometry
.
hasTangents
)
{
if
(
object
.
geometry
.
hasTangents
)
{
...
@@ -163,9 +163,9 @@ THREE.WebGLRenderer = function ( parameters ) {
...
@@ -163,9 +163,9 @@ THREE.WebGLRenderer = function ( parameters ) {
t2
=
object
.
geometry
.
vertices
[
face
.
b
].
tangent
;
t2
=
object
.
geometry
.
vertices
[
face
.
b
].
tangent
;
t3
=
object
.
geometry
.
vertices
[
face
.
c
].
tangent
;
t3
=
object
.
geometry
.
vertices
[
face
.
c
].
tangent
;
tangentArray
.
push
(
t1
.
x
,
t1
.
y
,
t1
.
z
,
t1
.
w
);
tangentArray
.
push
(
t1
.
x
,
t1
.
y
,
t1
.
z
,
t1
.
w
,
tangentArray
.
push
(
t2
.
x
,
t2
.
y
,
t2
.
z
,
t2
.
w
);
t2
.
x
,
t2
.
y
,
t2
.
z
,
t2
.
w
,
tangentArray
.
push
(
t3
.
x
,
t3
.
y
,
t3
.
z
,
t3
.
w
);
t3
.
x
,
t3
.
y
,
t3
.
z
,
t3
.
w
);
}
}
...
@@ -202,9 +202,9 @@ THREE.WebGLRenderer = function ( parameters ) {
...
@@ -202,9 +202,9 @@ THREE.WebGLRenderer = function ( parameters ) {
// TODO: don't add lines that already exist (faces sharing edge)
// TODO: don't add lines that already exist (faces sharing edge)
lineArray
.
push
(
vertexIndex
,
vertexIndex
+
1
);
lineArray
.
push
(
vertexIndex
,
vertexIndex
+
1
,
lineArray
.
push
(
vertexIndex
,
vertexIndex
+
2
);
vertexIndex
,
vertexIndex
+
2
,
lineArray
.
push
(
vertexIndex
+
1
,
vertexIndex
+
2
);
vertexIndex
+
1
,
vertexIndex
+
2
);
vertexIndex
+=
3
;
vertexIndex
+=
3
;
...
@@ -215,10 +215,10 @@ THREE.WebGLRenderer = function ( parameters ) {
...
@@ -215,10 +215,10 @@ THREE.WebGLRenderer = function ( parameters ) {
v3
=
object
.
geometry
.
vertices
[
face
.
c
].
position
;
v3
=
object
.
geometry
.
vertices
[
face
.
c
].
position
;
v4
=
object
.
geometry
.
vertices
[
face
.
d
].
position
;
v4
=
object
.
geometry
.
vertices
[
face
.
d
].
position
;
vertexArray
.
push
(
v1
.
x
,
v1
.
y
,
v1
.
z
);
vertexArray
.
push
(
v1
.
x
,
v1
.
y
,
v1
.
z
,
vertexArray
.
push
(
v2
.
x
,
v2
.
y
,
v2
.
z
);
v2
.
x
,
v2
.
y
,
v2
.
z
,
vertexArray
.
push
(
v3
.
x
,
v3
.
y
,
v3
.
z
);
v3
.
x
,
v3
.
y
,
v3
.
z
,
vertexArray
.
push
(
v4
.
x
,
v4
.
y
,
v4
.
z
);
v4
.
x
,
v4
.
y
,
v4
.
z
);
if
(
object
.
geometry
.
hasTangents
)
{
if
(
object
.
geometry
.
hasTangents
)
{
...
@@ -227,10 +227,10 @@ THREE.WebGLRenderer = function ( parameters ) {
...
@@ -227,10 +227,10 @@ THREE.WebGLRenderer = function ( parameters ) {
t3
=
object
.
geometry
.
vertices
[
face
.
c
].
tangent
;
t3
=
object
.
geometry
.
vertices
[
face
.
c
].
tangent
;
t4
=
object
.
geometry
.
vertices
[
face
.
d
].
tangent
;
t4
=
object
.
geometry
.
vertices
[
face
.
d
].
tangent
;
tangentArray
.
push
(
t1
.
x
,
t1
.
y
,
t1
.
z
,
t1
.
w
);
tangentArray
.
push
(
t1
.
x
,
t1
.
y
,
t1
.
z
,
t1
.
w
,
tangentArray
.
push
(
t2
.
x
,
t2
.
y
,
t2
.
z
,
t2
.
w
);
t2
.
x
,
t2
.
y
,
t2
.
z
,
t2
.
w
,
tangentArray
.
push
(
t3
.
x
,
t3
.
y
,
t3
.
z
,
t3
.
w
);
t3
.
x
,
t3
.
y
,
t3
.
z
,
t3
.
w
,
tangentArray
.
push
(
t4
.
x
,
t4
.
y
,
t4
.
z
,
t4
.
w
);
t4
.
x
,
t4
.
y
,
t4
.
z
,
t4
.
w
);
}
}
...
@@ -262,16 +262,16 @@ THREE.WebGLRenderer = function ( parameters ) {
...
@@ -262,16 +262,16 @@ THREE.WebGLRenderer = function ( parameters ) {
}
}
faceArray
.
push
(
vertexIndex
,
vertexIndex
+
1
,
vertexIndex
+
2
);
faceArray
.
push
(
vertexIndex
,
vertexIndex
+
1
,
vertexIndex
+
2
,
faceArray
.
push
(
vertexIndex
,
vertexIndex
+
2
,
vertexIndex
+
3
);
vertexIndex
,
vertexIndex
+
2
,
vertexIndex
+
3
);
// TODO: don't add lines that already exist (faces sharing edge)
// TODO: don't add lines that already exist (faces sharing edge)
lineArray
.
push
(
vertexIndex
,
vertexIndex
+
1
);
lineArray
.
push
(
vertexIndex
,
vertexIndex
+
1
,
lineArray
.
push
(
vertexIndex
,
vertexIndex
+
2
);
vertexIndex
,
vertexIndex
+
2
,
lineArray
.
push
(
vertexIndex
,
vertexIndex
+
3
);
vertexIndex
,
vertexIndex
+
3
,
lineArray
.
push
(
vertexIndex
+
1
,
vertexIndex
+
2
);
vertexIndex
+
1
,
vertexIndex
+
2
,
lineArray
.
push
(
vertexIndex
+
2
,
vertexIndex
+
3
);
vertexIndex
+
2
,
vertexIndex
+
3
);
vertexIndex
+=
4
;
vertexIndex
+=
4
;
...
@@ -1032,8 +1032,8 @@ THREE.WebGLRenderer = function ( parameters ) {
...
@@ -1032,8 +1032,8 @@ THREE.WebGLRenderer = function ( parameters ) {
"
void main() {
"
,
"
void main() {
"
,
"
vec4 mapColor = vec4( 1.0
, 1.0, 1.0, 1.0
);
"
,
"
vec4 mapColor = vec4( 1.0 );
"
,
"
vec4 cubeColor = vec4( 1.0
, 1.0, 1.0, 1.0
);
"
,
"
vec4 cubeColor = vec4( 1.0 );
"
,
// diffuse map
// diffuse map
...
@@ -1066,8 +1066,8 @@ THREE.WebGLRenderer = function ( parameters ) {
...
@@ -1066,8 +1066,8 @@ THREE.WebGLRenderer = function ( parameters ) {
"
#if MAX_POINT_LIGHTS > 0
"
,
"
#if MAX_POINT_LIGHTS > 0
"
,
"
vec4 pointDiffuse = vec4( 0.0
, 0.0, 0.0, 0.0
);
"
,
"
vec4 pointDiffuse = vec4( 0.0 );
"
,
"
vec4 pointSpecular = vec4( 0.0
, 0.0, 0.0, 0.0
);
"
,
"
vec4 pointSpecular = vec4( 0.0 );
"
,
"
for( int i = 0; i < MAX_POINT_LIGHTS; i++ ) {
"
,
"
for( int i = 0; i < MAX_POINT_LIGHTS; i++ ) {
"
,
...
@@ -1101,8 +1101,8 @@ THREE.WebGLRenderer = function ( parameters ) {
...
@@ -1101,8 +1101,8 @@ THREE.WebGLRenderer = function ( parameters ) {
"
#if MAX_DIR_LIGHTS > 0
"
,
"
#if MAX_DIR_LIGHTS > 0
"
,
"
vec4 dirDiffuse = vec4( 0.0
, 0.0, 0.0, 0.0
);
"
,
"
vec4 dirDiffuse = vec4( 0.0 );
"
,
"
vec4 dirSpecular = vec4( 0.0
, 0.0, 0.0, 0.0
);
"
,
"
vec4 dirSpecular = vec4( 0.0 );
"
,
"
for( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {
"
,
"
for( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {
"
,
...
@@ -1834,7 +1834,7 @@ THREE.Snippets = {
...
@@ -1834,7 +1834,7 @@ THREE.Snippets = {
"
if ( !enableLighting ) {
"
,
"
if ( !enableLighting ) {
"
,
"
vLightWeighting = vec3( 1.0
, 1.0, 1.0
);
"
,
"
vLightWeighting = vec3( 1.0 );
"
,
"
} else {
"
,
"
} else {
"
,
...
@@ -1970,8 +1970,8 @@ THREE.ShaderLib = {
...
@@ -1970,8 +1970,8 @@ THREE.ShaderLib = {
"
void main() {
"
,
"
void main() {
"
,
"
vec4 mColor = vec4( color, opacity );
"
,
"
vec4 mColor = vec4( color, opacity );
"
,
"
vec4 mapColor = vec4( 1.0
, 1.0, 1.0, 1.0
);
"
,
"
vec4 mapColor = vec4( 1.0 );
"
,
"
vec4 cubeColor = vec4( 1.0
, 1.0, 1.0, 1.0
);
"
,
"
vec4 cubeColor = vec4( 1.0 );
"
,
THREE
.
Snippets
[
"
map_fragment
"
],
THREE
.
Snippets
[
"
map_fragment
"
],
...
@@ -2043,8 +2043,8 @@ THREE.ShaderLib = {
...
@@ -2043,8 +2043,8 @@ THREE.ShaderLib = {
"
void main() {
"
,
"
void main() {
"
,
"
vec4 mColor = vec4( color, opacity );
"
,
"
vec4 mColor = vec4( color, opacity );
"
,
"
vec4 mapColor = vec4( 1.0
, 1.0, 1.0, 1.0
);
"
,
"
vec4 mapColor = vec4( 1.0 );
"
,
"
vec4 cubeColor = vec4( 1.0
, 1.0, 1.0, 1.0
);
"
,
"
vec4 cubeColor = vec4( 1.0 );
"
,
THREE
.
Snippets
[
"
map_fragment
"
],
THREE
.
Snippets
[
"
map_fragment
"
],
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录