Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
ccd108de
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,发现更多精彩内容 >>
提交
ccd108de
编写于
9月 28, 2015
作者:
M
Marius Kintel
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#7245 coding style
上级
1f6e5915
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
120 addition
and
43 deletion
+120
-43
src/renderers/WebGLRenderTarget.js
src/renderers/WebGLRenderTarget.js
+102
-27
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+18
-16
未找到文件。
src/renderers/WebGLRenderTarget.js
浏览文件 @
ccd108de
...
@@ -12,12 +12,7 @@ THREE.WebGLRenderTarget = function ( width, height, options ) {
...
@@ -12,12 +12,7 @@ THREE.WebGLRenderTarget = function ( width, height, options ) {
options
=
options
||
{};
options
=
options
||
{};
this
.
texture
=
new
THREE
.
Texture
(
undefined
,
undefined
,
this
.
texture
=
new
THREE
.
Texture
(
undefined
,
undefined
,
options
.
wrapS
,
options
.
wrapT
,
options
.
magFilter
,
options
.
minFilter
!==
undefined
?
options
.
minFilter
:
THREE
.
LinearFilter
,
options
.
format
,
options
.
type
,
options
.
anisotropy
);
options
.
wrapS
,
options
.
wrapT
,
options
.
magFilter
,
options
.
minFilter
!==
undefined
?
options
.
minFilter
:
THREE
.
LinearFilter
,
options
.
format
,
options
.
type
,
options
.
anisotropy
);
this
.
depthBuffer
=
options
.
depthBuffer
!==
undefined
?
options
.
depthBuffer
:
true
;
this
.
depthBuffer
=
options
.
depthBuffer
!==
undefined
?
options
.
depthBuffer
:
true
;
this
.
stencilBuffer
=
options
.
stencilBuffer
!==
undefined
?
options
.
stencilBuffer
:
true
;
this
.
stencilBuffer
=
options
.
stencilBuffer
!==
undefined
?
options
.
stencilBuffer
:
true
;
...
@@ -70,27 +65,107 @@ THREE.WebGLRenderTarget.prototype = {
...
@@ -70,27 +65,107 @@ THREE.WebGLRenderTarget.prototype = {
this
.
dispatchEvent
(
{
type
:
'
dispose
'
}
);
this
.
dispatchEvent
(
{
type
:
'
dispose
'
}
);
},
},
get
wrapS
()
{
return
this
.
texture
.
wrapS
;
},
get
wrapS
()
{
set
wrapS
(
wrapS
)
{
this
.
texture
.
wrapS
=
wrapS
;
},
get
wrapT
()
{
return
this
.
texture
.
wrapT
;
},
return
this
.
texture
.
wrapS
;
set
wrapT
(
wrapT
)
{
this
.
texture
.
wrapT
=
wrapT
;
},
get
magFilter
()
{
return
this
.
texture
.
magFilter
;
},
},
set
magFilter
(
magFilter
)
{
this
.
texture
.
magFilter
=
magFilter
;
},
set
wrapS
(
wrapS
)
{
get
minFilter
()
{
return
this
.
texture
.
minFilter
;
},
set
minFilter
(
minFilter
)
{
this
.
texture
.
minFilter
=
minFilter
;
},
this
.
texture
.
wrapS
=
wrapS
;
get
anisotropy
()
{
return
this
.
texture
.
anisotropy
;
},
set
anisotropy
(
anisotropy
)
{
this
.
texture
.
anisotropy
=
anisotropy
;
},
},
get
offset
()
{
return
this
.
texture
.
offset
;
},
get
wrapT
()
{
set
offset
(
offset
)
{
this
.
texture
.
offset
=
offset
;
},
get
repeat
()
{
return
this
.
texture
.
repeat
;
},
return
this
.
texture
.
wrapT
;
set
repeat
(
repeat
)
{
this
.
texture
.
repeat
=
repeat
;
},
get
format
()
{
return
this
.
texture
.
format
;
},
},
set
format
(
format
)
{
this
.
texture
.
format
=
format
;
},
set
wrapT
(
wrapT
)
{
get
type
()
{
return
this
.
texture
.
type
;
},
set
type
(
type
)
{
this
.
texture
.
type
=
type
;
},
this
.
texture
.
wrapT
=
wrapT
;
get
generateMipmaps
()
{
return
this
.
texture
.
generateMipmaps
;
},
set
generateMipmaps
(
generateMipmaps
)
{
this
.
texture
.
generateMipmaps
=
generateMipmaps
;
}
},
get
magFilter
()
{
return
this
.
texture
.
magFilter
;
},
set
magFilter
(
magFilter
)
{
this
.
texture
.
magFilter
=
magFilter
;
},
get
minFilter
()
{
return
this
.
texture
.
minFilter
;
},
set
minFilter
(
minFilter
)
{
this
.
texture
.
minFilter
=
minFilter
;
},
get
anisotropy
()
{
return
this
.
texture
.
anisotropy
;
},
set
anisotropy
(
anisotropy
)
{
this
.
texture
.
anisotropy
=
anisotropy
;
},
get
offset
()
{
return
this
.
texture
.
offset
;
},
set
offset
(
offset
)
{
this
.
texture
.
offset
=
offset
;
},
get
repeat
()
{
return
this
.
texture
.
repeat
;
},
set
repeat
(
repeat
)
{
this
.
texture
.
repeat
=
repeat
;
},
get
format
()
{
return
this
.
texture
.
format
;
},
set
format
(
format
)
{
this
.
texture
.
format
=
format
;
},
get
type
()
{
return
this
.
texture
.
type
;
},
set
type
(
type
)
{
this
.
texture
.
type
=
type
;
},
get
generateMipmaps
()
{
return
this
.
texture
.
generateMipmaps
;
},
set
generateMipmaps
(
generateMipmaps
)
{
this
.
texture
.
generateMipmaps
=
generateMipmaps
;
}
};
};
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
ccd108de
...
@@ -32,9 +32,9 @@ THREE.WebGLRenderer = function ( parameters ) {
...
@@ -32,9 +32,9 @@ THREE.WebGLRenderer = function ( parameters ) {
var
lights
=
[];
var
lights
=
[];
var
opaqueObjects
=
[];
var
opaqueObjects
=
[];
var
opaqueObjectsLastIndex
=
-
1
;
var
opaqueObjectsLastIndex
=
-
1
;
var
transparentObjects
=
[];
var
transparentObjects
=
[];
var
transparentObjectsLastIndex
=
-
1
;
var
transparentObjectsLastIndex
=
-
1
;
var
morphInfluences
=
new
Float32Array
(
8
);
var
morphInfluences
=
new
Float32Array
(
8
);
...
@@ -603,6 +603,7 @@ THREE.WebGLRenderer = function ( parameters ) {
...
@@ -603,6 +603,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if
(
programInfo
!==
undefined
)
{
if
(
programInfo
!==
undefined
)
{
programCache
.
releaseProgram
(
programInfo
);
programCache
.
releaseProgram
(
programInfo
);
}
}
}
}
...
@@ -1093,8 +1094,8 @@ THREE.WebGLRenderer = function ( parameters ) {
...
@@ -1093,8 +1094,8 @@ THREE.WebGLRenderer = function ( parameters ) {
lights
.
length
=
0
;
lights
.
length
=
0
;
opaqueObjectsLastIndex
=
-
1
;
opaqueObjectsLastIndex
=
-
1
;
transparentObjectsLastIndex
=
-
1
;
transparentObjectsLastIndex
=
-
1
;
sprites
.
length
=
0
;
sprites
.
length
=
0
;
lensFlares
.
length
=
0
;
lensFlares
.
length
=
0
;
...
@@ -1158,16 +1159,17 @@ THREE.WebGLRenderer = function ( parameters ) {
...
@@ -1158,16 +1159,17 @@ THREE.WebGLRenderer = function ( parameters ) {
lensFlarePlugin
.
render
(
scene
,
camera
,
_currentWidth
,
_currentHeight
);
lensFlarePlugin
.
render
(
scene
,
camera
,
_currentWidth
,
_currentHeight
);
// Generate mipmap if we're using any kind of mipmap filtering
// Generate mipmap if we're using any kind of mipmap filtering
if
(
renderTarget
)
{
if
(
renderTarget
)
{
var
texture
=
renderTarget
.
texture
;
var
texture
=
renderTarget
.
texture
;
var
isTargetPowerOfTwo
=
THREE
.
Math
.
isPowerOfTwo
(
renderTarget
.
width
)
&&
THREE
.
Math
.
isPowerOfTwo
(
renderTarget
.
height
);
var
isTargetPowerOfTwo
=
THREE
.
Math
.
isPowerOfTwo
(
renderTarget
.
width
)
&&
THREE
.
Math
.
isPowerOfTwo
(
renderTarget
.
height
);
if
(
texture
.
generateMipmaps
&&
if
(
texture
.
generateMipmaps
&&
isTargetPowerOfTwo
&&
texture
.
minFilter
!==
THREE
.
NearestFilter
&&
texture
.
minFilter
!==
THREE
.
LinearFilter
)
{
isTargetPowerOfTwo
&&
texture
.
minFilter
!==
THREE
.
NearestFilter
&&
texture
.
minFilter
!==
THREE
.
LinearFilter
)
{
updateRenderTargetMipmap
(
renderTarget
);
updateRenderTargetMipmap
(
renderTarget
);
}
}
}
}
// Ensure depth buffer writing is enabled so it can be cleared on next render
// Ensure depth buffer writing is enabled so it can be cleared on next render
...
@@ -1335,17 +1337,17 @@ THREE.WebGLRenderer = function ( parameters ) {
...
@@ -1335,17 +1337,17 @@ THREE.WebGLRenderer = function ( parameters ) {
if
(
object
instanceof
THREE
.
ImmediateRenderObject
)
{
if
(
object
instanceof
THREE
.
ImmediateRenderObject
)
{
setMaterial
(
material
);
setMaterial
(
material
);
var
program
=
setProgram
(
camera
,
lights
,
fog
,
material
,
object
);
var
program
=
setProgram
(
camera
,
lights
,
fog
,
material
,
object
);
_currentGeometryProgram
=
''
;
_currentGeometryProgram
=
''
;
object
.
render
(
function
(
object
)
{
object
.
render
(
function
(
object
)
{
_this
.
renderBufferImmediate
(
object
,
program
,
material
);
_this
.
renderBufferImmediate
(
object
,
program
,
material
);
}
);
}
);
}
else
{
}
else
{
...
@@ -1991,7 +1993,7 @@ THREE.WebGLRenderer = function ( parameters ) {
...
@@ -1991,7 +1993,7 @@ THREE.WebGLRenderer = function ( parameters ) {
uniforms
.
shadowDarkness
.
value
[
j
]
=
-
light
.
shadowDarkness
;
uniforms
.
shadowDarkness
.
value
[
j
]
=
-
light
.
shadowDarkness
;
}
else
{
}
else
{
uniforms
.
shadowDarkness
.
value
[
j
]
=
light
.
shadowDarkness
;
uniforms
.
shadowDarkness
.
value
[
j
]
=
light
.
shadowDarkness
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录