Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
79e58379
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 搜索 >>
提交
79e58379
编写于
8月 20, 2016
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactored WebGL classes.
上级
65c22da0
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
653 addition
and
577 deletion
+653
-577
src/Three.js
src/Three.js
+1
-6
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+6
-13
src/renderers/webgl/WebGLBufferRenderer.js
src/renderers/webgl/WebGLBufferRenderer.js
+14
-11
src/renderers/webgl/WebGLCapabilities.js
src/renderers/webgl/WebGLCapabilities.js
+24
-23
src/renderers/webgl/WebGLExtensions.js
src/renderers/webgl/WebGLExtensions.js
+33
-29
src/renderers/webgl/WebGLGeometries.js
src/renderers/webgl/WebGLGeometries.js
+43
-41
src/renderers/webgl/WebGLIndexedBufferRenderer.js
src/renderers/webgl/WebGLIndexedBufferRenderer.js
+21
-14
src/renderers/webgl/WebGLLights.js
src/renderers/webgl/WebGLLights.js
+65
-61
src/renderers/webgl/WebGLObjects.js
src/renderers/webgl/WebGLObjects.js
+10
-6
src/renderers/webgl/WebGLState.js
src/renderers/webgl/WebGLState.js
+436
-373
未找到文件。
src/Three.js
浏览文件 @
79e58379
...
...
@@ -4,12 +4,7 @@ export { SpritePlugin } from './renderers/webgl/plugins/SpritePlugin.js';
export
{
LensFlarePlugin
}
from
'
./renderers/webgl/plugins/LensFlarePlugin.js
'
;
export
{
WebGLUniforms
}
from
'
./renderers/webgl/WebGLUniforms.js
'
;
export
{
WebGLTextures
}
from
'
./renderers/webgl/WebGLTextures.js
'
;
export
{
WebGLStencilBuffer
,
WebGLDepthBuffer
,
WebGLColorBuffer
,
WebGLState
}
from
'
./renderers/webgl/WebGLState.js
'
;
export
{
WebGLState
}
from
'
./renderers/webgl/WebGLState.js
'
;
export
{
WebGLShadowMap
}
from
'
./renderers/webgl/WebGLShadowMap.js
'
;
export
{
WebGLShader
}
from
'
./renderers/webgl/WebGLShader.js
'
;
export
{
WebGLProperties
}
from
'
./renderers/webgl/WebGLProperties.js
'
;
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
79e58379
...
...
@@ -1673,22 +1673,15 @@ function WebGLRenderer( parameters ) {
function
setMaterial
(
material
)
{
if
(
material
.
side
!==
DoubleSide
)
state
.
enable
(
_gl
.
CULL_FACE
);
else
state
.
disable
(
_gl
.
CULL_FACE
);
material
.
side
===
DoubleSide
?
state
.
disable
(
_gl
.
CULL_FACE
)
:
state
.
enable
(
_gl
.
CULL_FACE
);
state
.
setFlipSided
(
material
.
side
===
BackSide
);
if
(
material
.
transparent
===
true
)
{
state
.
setBlending
(
material
.
blending
,
material
.
blendEquation
,
material
.
blendSrc
,
material
.
blendDst
,
material
.
blendEquationAlpha
,
material
.
blendSrcAlpha
,
material
.
blendDstAlpha
,
material
.
premultipliedAlpha
);
}
else
{
state
.
setBlending
(
NoBlending
);
}
material
.
transparent
===
true
?
state
.
setBlending
(
material
.
blending
,
material
.
blendEquation
,
material
.
blendSrc
,
material
.
blendDst
,
material
.
blendEquationAlpha
,
material
.
blendSrcAlpha
,
material
.
blendDstAlpha
,
material
.
premultipliedAlpha
)
:
state
.
setBlending
(
NoBlending
);
state
.
setDepthFunc
(
material
.
depthFunc
);
state
.
setDepthTest
(
material
.
depthTest
);
...
...
src/renderers/webgl/WebGLBufferRenderer.js
浏览文件 @
79e58379
...
...
@@ -2,7 +2,7 @@
* @author mrdoob / http://mrdoob.com/
*/
function
WebGLBufferRenderer
(
_gl
,
extensions
,
_
infoRender
)
{
function
WebGLBufferRenderer
(
gl
,
extensions
,
infoRender
)
{
var
mode
;
...
...
@@ -14,12 +14,12 @@ function WebGLBufferRenderer( _gl, extensions, _infoRender ) {
function
render
(
start
,
count
)
{
_
gl
.
drawArrays
(
mode
,
start
,
count
);
gl
.
drawArrays
(
mode
,
start
,
count
);
_
infoRender
.
calls
++
;
_
infoRender
.
vertices
+=
count
;
infoRender
.
calls
++
;
infoRender
.
vertices
+=
count
;
if
(
mode
===
_gl
.
TRIANGLES
)
_
infoRender
.
faces
+=
count
/
3
;
if
(
mode
===
gl
.
TRIANGLES
)
infoRender
.
faces
+=
count
/
3
;
}
...
...
@@ -52,15 +52,18 @@ function WebGLBufferRenderer( _gl, extensions, _infoRender ) {
}
_infoRender
.
calls
++
;
_infoRender
.
vertices
+=
count
*
geometry
.
maxInstancedCount
;
if
(
mode
===
_gl
.
TRIANGLES
)
_infoRender
.
faces
+=
geometry
.
maxInstancedCount
*
count
/
3
;
infoRender
.
calls
++
;
infoRender
.
vertices
+=
count
*
geometry
.
maxInstancedCount
;
if
(
mode
===
gl
.
TRIANGLES
)
infoRender
.
faces
+=
geometry
.
maxInstancedCount
*
count
/
3
;
}
this
.
setMode
=
setMode
;
this
.
render
=
render
;
this
.
renderInstances
=
renderInstances
;
return
{
setMode
:
setMode
,
render
:
render
,
renderInstances
:
renderInstances
};
}
...
...
src/renderers/webgl/WebGLCapabilities.js
浏览文件 @
79e58379
...
...
@@ -56,40 +56,41 @@ function WebGLCapabilities( gl, extensions, parameters ) {
}
this
.
getMaxAnisotropy
=
getMaxAnisotropy
;
this
.
getMaxPrecision
=
getMaxPrecision
;
var
precision
=
parameters
.
precision
!==
undefined
?
parameters
.
precision
:
'
highp
'
;
var
maxPrecision
=
getMaxPrecision
(
precision
)
;
this
.
precision
=
parameters
.
precision
!==
undefined
?
parameters
.
precision
:
'
highp
'
;
this
.
logarithmicDepthBuffer
=
parameters
.
logarithmicDepthBuffer
!==
undefined
?
parameters
.
logarithmicDepthBuffer
:
false
;
if
(
maxPrecision
!==
precision
)
{
this
.
maxTextures
=
gl
.
getParameter
(
gl
.
MAX_TEXTURE_IMAGE_UNITS
);
this
.
maxVertexTextures
=
gl
.
getParameter
(
gl
.
MAX_VERTEX_TEXTURE_IMAGE_UNITS
);
this
.
maxTextureSize
=
gl
.
getParameter
(
gl
.
MAX_TEXTURE_SIZE
);
this
.
maxCubemapSize
=
gl
.
getParameter
(
gl
.
MAX_CUBE_MAP_TEXTURE_SIZE
);
console
.
warn
(
'
THREE.WebGLRenderer:
'
,
precision
,
'
not supported, using
'
,
maxPrecision
,
'
instead.
'
);
precision
=
maxPrecision
;
this
.
maxAttributes
=
gl
.
getParameter
(
gl
.
MAX_VERTEX_ATTRIBS
);
this
.
maxVertexUniforms
=
gl
.
getParameter
(
gl
.
MAX_VERTEX_UNIFORM_VECTORS
);
this
.
maxVaryings
=
gl
.
getParameter
(
gl
.
MAX_VARYING_VECTORS
);
this
.
maxFragmentUniforms
=
gl
.
getParameter
(
gl
.
MAX_FRAGMENT_UNIFORM_VECTORS
);
}
this
.
vertexTextures
=
this
.
maxVertexTextures
>
0
;
this
.
floatFragmentTextures
=
!!
extensions
.
get
(
'
OES_texture_float
'
);
this
.
floatVertexTextures
=
this
.
vertexTextures
&&
this
.
floatFragmentTextures
;
var
logarithmicDepthBuffer
=
parameters
.
logarithmicDepthBuffer
===
true
&&
!!
extensions
.
get
(
'
EXT_frag_depth
'
);
var
_maxPrecision
=
getMaxPrecision
(
this
.
precision
);
return
{
if
(
_maxPrecision
!==
this
.
precision
)
{
getMaxAnisotropy
:
getMaxAnisotropy
,
getMaxPrecision
:
getMaxPrecision
,
console
.
warn
(
'
THREE.WebGLRenderer:
'
,
this
.
precision
,
'
not supported, using
'
,
_maxPrecision
,
'
instead.
'
);
this
.
precision
=
_maxPrecision
;
precision
:
precision
,
logarithmicDepthBuffer
:
logarithmicDepthBuffer
,
}
maxTextures
:
gl
.
getParameter
(
gl
.
MAX_TEXTURE_IMAGE_UNITS
),
maxVertexTextures
:
gl
.
getParameter
(
gl
.
MAX_VERTEX_TEXTURE_IMAGE_UNITS
),
maxTextureSize
:
gl
.
getParameter
(
gl
.
MAX_TEXTURE_SIZE
),
maxCubemapSize
:
gl
.
getParameter
(
gl
.
MAX_CUBE_MAP_TEXTURE_SIZE
),
if
(
this
.
logarithmicDepthBuffer
)
{
maxAttributes
:
gl
.
getParameter
(
gl
.
MAX_VERTEX_ATTRIBS
),
maxVertexUniforms
:
gl
.
getParameter
(
gl
.
MAX_VERTEX_UNIFORM_VECTORS
),
maxVaryings
:
gl
.
getParameter
(
gl
.
MAX_VARYING_VECTORS
),
maxFragmentUniforms
:
gl
.
getParameter
(
gl
.
MAX_FRAGMENT_UNIFORM_VECTORS
),
this
.
logarithmicDepthBuffer
=
!!
extensions
.
get
(
'
EXT_frag_depth
'
);
vertexTextures
:
this
.
maxVertexTextures
>
0
,
floatFragmentTextures
:
!!
extensions
.
get
(
'
OES_texture_float
'
),
floatVertexTextures
:
this
.
vertexTextures
&&
this
.
floatFragmentTextures
}
}
;
}
...
...
src/renderers/webgl/WebGLExtensions.js
浏览文件 @
79e58379
...
...
@@ -6,52 +6,56 @@ function WebGLExtensions( gl ) {
var
extensions
=
{};
this
.
get
=
function
(
name
)
{
return
{
if
(
extensions
[
name
]
!==
undefined
)
{
get
:
function
(
name
)
{
return
extensions
[
name
];
if
(
extensions
[
name
]
!==
undefined
)
{
}
return
extensions
[
name
];
var
extension
;
}
switch
(
name
)
{
var
extension
;
case
'
WEBGL_depth_texture
'
:
extension
=
gl
.
getExtension
(
'
WEBGL_depth_texture
'
)
||
gl
.
getExtension
(
'
MOZ_WEBGL_depth_texture
'
)
||
gl
.
getExtension
(
'
WEBKIT_WEBGL_depth_texture
'
);
break
;
switch
(
name
)
{
case
'
EXT_texture_filter_anisotropic
'
:
extension
=
gl
.
getExtension
(
'
EXT_texture_filter_anisotropic
'
)
||
gl
.
getExtension
(
'
MOZ_EXT_texture_filter_anisotropic
'
)
||
gl
.
getExtension
(
'
WEBKIT_EXT_texture_filter_anisotropic
'
);
break
;
case
'
WEBGL_depth_texture
'
:
extension
=
gl
.
getExtension
(
'
WEBGL_depth_texture
'
)
||
gl
.
getExtension
(
'
MOZ_WEBGL_depth_texture
'
)
||
gl
.
getExtension
(
'
WEBKIT_WEBGL_depth_texture
'
);
break
;
case
'
WEBGL_compressed_texture_s3t
c
'
:
extension
=
gl
.
getExtension
(
'
WEBGL_compressed_texture_s3tc
'
)
||
gl
.
getExtension
(
'
MOZ_WEBGL_compressed_texture_s3tc
'
)
||
gl
.
getExtension
(
'
WEBKIT_WEBGL_compressed_texture_s3t
c
'
);
break
;
case
'
EXT_texture_filter_anisotropi
c
'
:
extension
=
gl
.
getExtension
(
'
EXT_texture_filter_anisotropic
'
)
||
gl
.
getExtension
(
'
MOZ_EXT_texture_filter_anisotropic
'
)
||
gl
.
getExtension
(
'
WEBKIT_EXT_texture_filter_anisotropi
c
'
);
break
;
case
'
WEBGL_compressed_texture_pvr
tc
'
:
extension
=
gl
.
getExtension
(
'
WEBGL_compressed_texture_pvrtc
'
)
||
gl
.
getExtension
(
'
WEBKIT_WEBGL_compressed_texture_pvr
tc
'
);
break
;
case
'
WEBGL_compressed_texture_s3
tc
'
:
extension
=
gl
.
getExtension
(
'
WEBGL_compressed_texture_s3tc
'
)
||
gl
.
getExtension
(
'
MOZ_WEBGL_compressed_texture_s3tc
'
)
||
gl
.
getExtension
(
'
WEBKIT_WEBGL_compressed_texture_s3
tc
'
);
break
;
case
'
WEBGL_compressed_texture_etc1
'
:
extension
=
gl
.
getExtension
(
'
WEBGL_compressed_texture_etc1
'
);
break
;
case
'
WEBGL_compressed_texture_pvrtc
'
:
extension
=
gl
.
getExtension
(
'
WEBGL_compressed_texture_pvrtc
'
)
||
gl
.
getExtension
(
'
WEBKIT_WEBGL_compressed_texture_pvrtc
'
);
break
;
default
:
extension
=
gl
.
getExtension
(
name
);
case
'
WEBGL_compressed_texture_etc1
'
:
extension
=
gl
.
getExtension
(
'
WEBGL_compressed_texture_etc1
'
);
break
;
}
default
:
extension
=
gl
.
getExtension
(
name
);
if
(
extension
===
null
)
{
}
console
.
warn
(
'
THREE.WebGLRenderer:
'
+
name
+
'
extension not supported.
'
);
if
(
extension
===
null
)
{
}
console
.
warn
(
'
THREE.WebGLRenderer:
'
+
name
+
'
extension not supported.
'
);
extensions
[
name
]
=
extension
;
}
return
extension
;
extensions
[
name
]
=
extension
;
return
extension
;
}
};
...
...
src/renderers/webgl/WebGLGeometries.js
浏览文件 @
79e58379
...
...
@@ -8,44 +8,6 @@ function WebGLGeometries( gl, properties, info ) {
var
geometries
=
{};
function
get
(
object
)
{
var
geometry
=
object
.
geometry
;
if
(
geometries
[
geometry
.
id
]
!==
undefined
)
{
return
geometries
[
geometry
.
id
];
}
geometry
.
addEventListener
(
'
dispose
'
,
onGeometryDispose
);
var
buffergeometry
;
if
(
(
geometry
&&
geometry
.
isBufferGeometry
)
)
{
buffergeometry
=
geometry
;
}
else
if
(
(
geometry
&&
geometry
.
isGeometry
)
)
{
if
(
geometry
.
_bufferGeometry
===
undefined
)
{
geometry
.
_bufferGeometry
=
new
BufferGeometry
().
setFromObject
(
object
);
}
buffergeometry
=
geometry
.
_bufferGeometry
;
}
geometries
[
geometry
.
id
]
=
buffergeometry
;
info
.
memory
.
geometries
++
;
return
buffergeometry
;
}
function
onGeometryDispose
(
event
)
{
var
geometry
=
event
.
target
;
...
...
@@ -93,7 +55,7 @@ function WebGLGeometries( gl, properties, info ) {
function
getAttributeBuffer
(
attribute
)
{
if
(
(
attribute
&&
attribute
.
isInterleavedBufferAttribute
)
)
{
if
(
attribute
.
isInterleavedBufferAttribute
)
{
return
properties
.
get
(
attribute
.
data
).
__webglBuffer
;
...
...
@@ -128,7 +90,7 @@ function WebGLGeometries( gl, properties, info ) {
function
removeAttributeBuffer
(
attribute
)
{
if
(
(
attribute
&&
attribute
.
isInterleavedBufferAttribute
)
)
{
if
(
attribute
.
isInterleavedBufferAttribute
)
{
properties
.
delete
(
attribute
.
data
);
...
...
@@ -140,7 +102,47 @@ function WebGLGeometries( gl, properties, info ) {
}
this
.
get
=
get
;
return
{
get
:
function
(
object
)
{
var
geometry
=
object
.
geometry
;
if
(
geometries
[
geometry
.
id
]
!==
undefined
)
{
return
geometries
[
geometry
.
id
];
}
geometry
.
addEventListener
(
'
dispose
'
,
onGeometryDispose
);
var
buffergeometry
;
if
(
geometry
.
isBufferGeometry
)
{
buffergeometry
=
geometry
;
}
else
if
(
geometry
.
isGeometry
)
{
if
(
geometry
.
_bufferGeometry
===
undefined
)
{
geometry
.
_bufferGeometry
=
new
BufferGeometry
().
setFromObject
(
object
);
}
buffergeometry
=
geometry
.
_bufferGeometry
;
}
geometries
[
geometry
.
id
]
=
buffergeometry
;
info
.
memory
.
geometries
++
;
return
buffergeometry
;
}
};
}
...
...
src/renderers/webgl/WebGLIndexedBufferRenderer.js
浏览文件 @
79e58379
...
...
@@ -2,7 +2,7 @@
* @author mrdoob / http://mrdoob.com/
*/
function
WebGLIndexedBufferRenderer
(
_gl
,
extensions
,
_
infoRender
)
{
function
WebGLIndexedBufferRenderer
(
gl
,
extensions
,
infoRender
)
{
var
mode
;
...
...
@@ -18,12 +18,12 @@ function WebGLIndexedBufferRenderer( _gl, extensions, _infoRender ) {
if
(
index
.
array
instanceof
Uint32Array
&&
extensions
.
get
(
'
OES_element_index_uint
'
)
)
{
type
=
_
gl
.
UNSIGNED_INT
;
type
=
gl
.
UNSIGNED_INT
;
size
=
4
;
}
else
{
type
=
_
gl
.
UNSIGNED_SHORT
;
type
=
gl
.
UNSIGNED_SHORT
;
size
=
2
;
}
...
...
@@ -32,11 +32,12 @@ function WebGLIndexedBufferRenderer( _gl, extensions, _infoRender ) {
function
render
(
start
,
count
)
{
_
gl
.
drawElements
(
mode
,
count
,
type
,
start
*
size
);
gl
.
drawElements
(
mode
,
count
,
type
,
start
*
size
);
_infoRender
.
calls
++
;
_infoRender
.
vertices
+=
count
;
if
(
mode
===
_gl
.
TRIANGLES
)
_infoRender
.
faces
+=
count
/
3
;
infoRender
.
calls
++
;
infoRender
.
vertices
+=
count
;
if
(
mode
===
gl
.
TRIANGLES
)
infoRender
.
faces
+=
count
/
3
;
}
...
...
@@ -53,15 +54,21 @@ function WebGLIndexedBufferRenderer( _gl, extensions, _infoRender ) {
extension
.
drawElementsInstancedANGLE
(
mode
,
count
,
type
,
start
*
size
,
geometry
.
maxInstancedCount
);
_infoRender
.
calls
++
;
_infoRender
.
vertices
+=
count
*
geometry
.
maxInstancedCount
;
if
(
mode
===
_gl
.
TRIANGLES
)
_infoRender
.
faces
+=
geometry
.
maxInstancedCount
*
count
/
3
;
infoRender
.
calls
++
;
infoRender
.
vertices
+=
count
*
geometry
.
maxInstancedCount
;
if
(
mode
===
gl
.
TRIANGLES
)
infoRender
.
faces
+=
geometry
.
maxInstancedCount
*
count
/
3
;
}
this
.
setMode
=
setMode
;
this
.
setIndex
=
setIndex
;
this
.
render
=
render
;
this
.
renderInstances
=
renderInstances
;
return
{
setMode
:
setMode
,
setIndex
:
setIndex
,
render
:
render
,
renderInstances
:
renderInstances
};
}
...
...
src/renderers/webgl/WebGLLights.js
浏览文件 @
79e58379
...
...
@@ -10,74 +10,78 @@ function WebGLLights() {
var
lights
=
{};
this
.
get
=
function
(
light
)
{
return
{
if
(
lights
[
light
.
id
]
!==
undefined
)
{
get
:
function
(
light
)
{
return
lights
[
light
.
id
];
if
(
lights
[
light
.
id
]
!==
undefined
)
{
}
return
lights
[
light
.
id
];
var
uniforms
;
switch
(
light
.
type
)
{
case
'
DirectionalLight
'
:
uniforms
=
{
direction
:
new
Vector3
(),
color
:
new
Color
(),
shadow
:
false
,
shadowBias
:
0
,
shadowRadius
:
1
,
shadowMapSize
:
new
Vector2
()
};
break
;
case
'
SpotLight
'
:
uniforms
=
{
position
:
new
Vector3
(),
direction
:
new
Vector3
(),
color
:
new
Color
(),
distance
:
0
,
coneCos
:
0
,
penumbraCos
:
0
,
decay
:
0
,
shadow
:
false
,
shadowBias
:
0
,
shadowRadius
:
1
,
shadowMapSize
:
new
Vector2
()
};
break
;
case
'
PointLight
'
:
uniforms
=
{
position
:
new
Vector3
(),
color
:
new
Color
(),
distance
:
0
,
decay
:
0
,
shadow
:
false
,
shadowBias
:
0
,
shadowRadius
:
1
,
shadowMapSize
:
new
Vector2
()
};
break
;
case
'
HemisphereLight
'
:
uniforms
=
{
direction
:
new
Vector3
(),
skyColor
:
new
Color
(),
groundColor
:
new
Color
()
};
break
;
}
}
var
uniforms
;
switch
(
light
.
type
)
{
case
'
DirectionalLight
'
:
uniforms
=
{
direction
:
new
Vector3
(),
color
:
new
Color
(),
shadow
:
false
,
shadowBias
:
0
,
shadowRadius
:
1
,
shadowMapSize
:
new
Vector2
()
};
break
;
case
'
SpotLight
'
:
uniforms
=
{
position
:
new
Vector3
(),
direction
:
new
Vector3
(),
color
:
new
Color
(),
distance
:
0
,
coneCos
:
0
,
penumbraCos
:
0
,
decay
:
0
,
shadow
:
false
,
shadowBias
:
0
,
shadowRadius
:
1
,
shadowMapSize
:
new
Vector2
()
};
break
;
lights
[
light
.
id
]
=
uniforms
;
case
'
PointLight
'
:
uniforms
=
{
position
:
new
Vector3
(),
color
:
new
Color
(),
distance
:
0
,
decay
:
0
,
return
uniforms
;
shadow
:
false
,
shadowBias
:
0
,
shadowRadius
:
1
,
shadowMapSize
:
new
Vector2
()
};
break
;
case
'
HemisphereLight
'
:
uniforms
=
{
direction
:
new
Vector3
(),
skyColor
:
new
Color
(),
groundColor
:
new
Color
()
};
break
;
}
lights
[
light
.
id
]
=
uniforms
;
return
uniforms
;
}
};
...
...
src/renderers/webgl/WebGLObjects.js
浏览文件 @
79e58379
...
...
@@ -17,7 +17,7 @@ function WebGLObjects( gl, properties, info ) {
var
geometry
=
geometries
.
get
(
object
);
if
(
(
object
.
geometry
&&
object
.
geometry
.
isGeometry
)
)
{
if
(
object
.
geometry
.
isGeometry
)
{
geometry
.
updateFromObject
(
object
);
...
...
@@ -60,7 +60,7 @@ function WebGLObjects( gl, properties, info ) {
function
updateAttribute
(
attribute
,
bufferType
)
{
var
data
=
(
(
attribute
&&
attribute
.
isInterleavedBufferAttribute
)
)
?
attribute
.
data
:
attribute
;
var
data
=
(
attribute
.
isInterleavedBufferAttribute
)
?
attribute
.
data
:
attribute
;
var
attributeProperties
=
properties
.
get
(
data
);
...
...
@@ -118,7 +118,7 @@ function WebGLObjects( gl, properties, info ) {
function
getAttributeBuffer
(
attribute
)
{
if
(
(
attribute
&&
attribute
.
isInterleavedBufferAttribute
)
)
{
if
(
attribute
.
isInterleavedBufferAttribute
)
{
return
properties
.
get
(
attribute
.
data
).
__webglBuffer
;
...
...
@@ -220,10 +220,14 @@ function WebGLObjects( gl, properties, info ) {
}
this
.
getAttributeBuffer
=
getAttributeBuffer
;
this
.
getWireframeAttribute
=
getWireframeAttribute
;
return
{
this
.
update
=
update
;
getAttributeBuffer
:
getAttributeBuffer
,
getWireframeAttribute
:
getWireframeAttribute
,
update
:
update
};
}
...
...
src/renderers/webgl/WebGLState.js
浏览文件 @
79e58379
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录