Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
329f5e60
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,发现更多精彩内容 >>
未验证
提交
329f5e60
编写于
7月 11, 2019
作者:
M
Mr.doob
提交者:
GitHub
7月 11, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17006 from WestLangley/dev_renderer_context
WebGLRenderer: removed .context property
上级
d6ffa4d4
246cf015
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
26 addition
and
19 deletion
+26
-19
docs/api/en/renderers/webgl/WebGLShader.html
docs/api/en/renderers/webgl/WebGLShader.html
+1
-1
examples/jsm/loaders/BasisTextureLoader.js
examples/jsm/loaders/BasisTextureLoader.js
+1
-1
examples/jsm/postprocessing/BloomPass.js
examples/jsm/postprocessing/BloomPass.js
+2
-2
examples/jsm/postprocessing/EffectComposer.js
examples/jsm/postprocessing/EffectComposer.js
+3
-3
examples/jsm/postprocessing/MaskPass.js
examples/jsm/postprocessing/MaskPass.js
+1
-1
examples/jsm/postprocessing/OutlinePass.js
examples/jsm/postprocessing/OutlinePass.js
+2
-2
examples/jsm/postprocessing/UnrealBloomPass.js
examples/jsm/postprocessing/UnrealBloomPass.js
+2
-2
examples/jsm/renderers/WebGLDeferredRenderer.js
examples/jsm/renderers/WebGLDeferredRenderer.js
+1
-1
examples/webgl_shaders_ocean2.html
examples/webgl_shaders_ocean2.html
+2
-2
src/Three.Legacy.js
src/Three.Legacy.js
+9
-0
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+0
-2
src/renderers/webgl/WebGLProgram.js
src/renderers/webgl/WebGLProgram.js
+1
-1
src/renderers/webvr/WebXRManager.js
src/renderers/webvr/WebXRManager.js
+1
-1
未找到文件。
docs/api/en/renderers/webgl/WebGLShader.html
浏览文件 @
329f5e60
...
...
@@ -15,7 +15,7 @@
<h2>
Example
</h2>
<code>
var gl = renderer.
context
;
var gl = renderer.
getContext()
;
var glVertexShader = new THREE.WebGLShader( gl, gl.VERTEX_SHADER, vertexSourceCode );
var glFragmentShader = new THREE.WebGLShader( gl, gl.FRAGMENT_SHADER, fragmentSourceCode );
...
...
examples/jsm/loaders/BasisTextureLoader.js
浏览文件 @
329f5e60
...
...
@@ -82,7 +82,7 @@ BasisTextureLoader.prototype = {
detectSupport
:
function
(
renderer
)
{
var
context
=
renderer
.
context
;
var
context
=
renderer
.
getContext
()
;
var
config
=
this
.
workerConfig
;
config
.
etcSupported
=
!!
context
.
getExtension
(
'
WEBGL_compressed_texture_etc1
'
);
...
...
examples/jsm/postprocessing/BloomPass.js
浏览文件 @
329f5e60
...
...
@@ -90,7 +90,7 @@ BloomPass.prototype = Object.assign( Object.create( Pass.prototype ), {
render
:
function
(
renderer
,
writeBuffer
,
readBuffer
,
deltaTime
,
maskActive
)
{
if
(
maskActive
)
renderer
.
context
.
disable
(
renderer
.
context
.
STENCIL_TEST
);
if
(
maskActive
)
renderer
.
getContext
().
disable
(
renderer
.
getContext
().
STENCIL_TEST
);
// avoid direct gl calls
// Render quad with blured scene into texture (convolution pass 1)
...
...
@@ -119,7 +119,7 @@ BloomPass.prototype = Object.assign( Object.create( Pass.prototype ), {
this
.
copyUniforms
[
"
tDiffuse
"
].
value
=
this
.
renderTargetY
.
texture
;
if
(
maskActive
)
renderer
.
context
.
enable
(
renderer
.
context
.
STENCIL_TEST
);
if
(
maskActive
)
renderer
.
getContext
().
enable
(
renderer
.
getContext
().
STENCIL_TEST
);
// avoid direct gl calls
renderer
.
setRenderTarget
(
readBuffer
);
if
(
this
.
clear
)
renderer
.
clear
();
...
...
examples/jsm/postprocessing/EffectComposer.js
浏览文件 @
329f5e60
...
...
@@ -147,13 +147,13 @@ Object.assign( EffectComposer.prototype, {
if
(
maskActive
)
{
var
context
=
this
.
renderer
.
context
;
var
context
=
this
.
renderer
.
getContext
()
;
context
.
stencilFunc
(
context
.
NOTEQUAL
,
1
,
0xffffffff
);
context
.
stencilFunc
(
context
.
NOTEQUAL
,
1
,
0xffffffff
);
// avoid direct gl calls
this
.
copyPass
.
render
(
this
.
renderer
,
this
.
writeBuffer
,
this
.
readBuffer
,
deltaTime
);
context
.
stencilFunc
(
context
.
EQUAL
,
1
,
0xffffffff
);
context
.
stencilFunc
(
context
.
EQUAL
,
1
,
0xffffffff
);
// avoid direct gl calls
}
...
...
examples/jsm/postprocessing/MaskPass.js
浏览文件 @
329f5e60
...
...
@@ -25,7 +25,7 @@ MaskPass.prototype = Object.assign( Object.create( Pass.prototype ), {
render
:
function
(
renderer
,
writeBuffer
,
readBuffer
/*, deltaTime, maskActive */
)
{
var
context
=
renderer
.
context
;
var
context
=
renderer
.
getContext
()
;
var
state
=
renderer
.
state
;
// don't update color or depth
...
...
examples/jsm/postprocessing/OutlinePass.js
浏览文件 @
329f5e60
...
...
@@ -280,7 +280,7 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
renderer
.
autoClear
=
false
;
if
(
maskActive
)
renderer
.
context
.
disable
(
renderer
.
context
.
STENCIL_TEST
);
if
(
maskActive
)
renderer
.
getContext
().
disable
(
renderer
.
getContext
()
.
STENCIL_TEST
);
renderer
.
setClearColor
(
0xffffff
,
1
);
...
...
@@ -382,7 +382,7 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), {
this
.
overlayMaterial
.
uniforms
[
"
usePatternTexture
"
].
value
=
this
.
usePatternTexture
;
if
(
maskActive
)
renderer
.
context
.
enable
(
renderer
.
context
.
STENCIL_TEST
);
if
(
maskActive
)
renderer
.
getContext
().
enable
(
renderer
.
getContext
()
.
STENCIL_TEST
);
renderer
.
setRenderTarget
(
readBuffer
);
this
.
fsQuad
.
render
(
renderer
);
...
...
examples/jsm/postprocessing/UnrealBloomPass.js
浏览文件 @
329f5e60
...
...
@@ -206,7 +206,7 @@ UnrealBloomPass.prototype = Object.assign( Object.create( Pass.prototype ), {
renderer
.
setClearColor
(
this
.
clearColor
,
0
);
if
(
maskActive
)
renderer
.
context
.
disable
(
renderer
.
context
.
STENCIL_TEST
);
if
(
maskActive
)
renderer
.
getContext
().
disable
(
renderer
.
getContext
()
.
STENCIL_TEST
);
// Render input to screen
...
...
@@ -271,7 +271,7 @@ UnrealBloomPass.prototype = Object.assign( Object.create( Pass.prototype ), {
this
.
fsQuad
.
material
=
this
.
materialCopy
;
this
.
copyUniforms
[
"
tDiffuse
"
].
value
=
this
.
renderTargetsHorizontal
[
0
].
texture
;
if
(
maskActive
)
renderer
.
context
.
enable
(
renderer
.
context
.
STENCIL_TEST
);
if
(
maskActive
)
renderer
.
getContext
().
enable
(
renderer
.
getContext
()
.
STENCIL_TEST
);
if
(
this
.
renderToScreen
)
{
...
...
examples/jsm/renderers/WebGLDeferredRenderer.js
浏览文件 @
329f5e60
...
...
@@ -159,7 +159,7 @@ var WebGLDeferredRenderer = function ( parameters ) {
_this
.
renderer
=
parameters
.
renderer
!==
undefined
?
parameters
.
renderer
:
new
WebGLRenderer
();
_this
.
domElement
=
_this
.
renderer
.
domElement
;
_context
=
_this
.
renderer
.
context
;
_context
=
_this
.
renderer
.
getContext
()
;
_state
=
_this
.
renderer
.
state
;
_width
=
parameters
.
width
!==
undefined
?
parameters
.
width
:
_this
.
renderer
.
getSize
(
new
Vector2
()
).
width
;
...
...
examples/webgl_shaders_ocean2.html
浏览文件 @
329f5e60
...
...
@@ -36,8 +36,8 @@
this
.
ms_Renderer
=
new
THREE
.
WebGLRenderer
();
this
.
ms_Renderer
.
setPixelRatio
(
window
.
devicePixelRatio
);
this
.
ms_Renderer
.
context
.
getExtension
(
'
OES_texture_float
'
);
this
.
ms_Renderer
.
context
.
getExtension
(
'
OES_texture_float_linear
'
);
this
.
ms_Renderer
.
getContext
()
.
getExtension
(
'
OES_texture_float
'
);
this
.
ms_Renderer
.
getContext
()
.
getExtension
(
'
OES_texture_float_linear
'
);
document
.
body
.
appendChild
(
this
.
ms_Renderer
.
domElement
);
...
...
src/Three.Legacy.js
浏览文件 @
329f5e60
...
...
@@ -1548,8 +1548,17 @@ Object.defineProperties( WebGLRenderer.prototype, {
console
.
warn
(
'
THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.
'
);
}
},
context
:
{
get
:
function
()
{
console
.
warn
(
'
THREE.WebGLRenderer: .context has been removed. Use .getContext() instead.
'
);
return
this
.
getContext
();
}
}
}
);
Object
.
defineProperties
(
WebGLShadowMap
.
prototype
,
{
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
329f5e60
...
...
@@ -76,7 +76,6 @@ function WebGLRenderer( parameters ) {
// public properties
this
.
domElement
=
_canvas
;
this
.
context
=
null
;
// Debug configuration container
this
.
debug
=
{
...
...
@@ -299,7 +298,6 @@ function WebGLRenderer( parameters ) {
info
.
programs
=
programCache
.
programs
;
_this
.
context
=
_gl
;
_this
.
capabilities
=
capabilities
;
_this
.
extensions
=
extensions
;
_this
.
properties
=
properties
;
...
...
src/renderers/webgl/WebGLProgram.js
浏览文件 @
329f5e60
...
...
@@ -238,7 +238,7 @@ function unrollLoops( string ) {
function
WebGLProgram
(
renderer
,
extensions
,
code
,
material
,
shader
,
parameters
,
capabilities
)
{
var
gl
=
renderer
.
context
;
var
gl
=
renderer
.
getContext
()
;
var
defines
=
material
.
defines
;
...
...
src/renderers/webvr/WebXRManager.js
浏览文件 @
329f5e60
...
...
@@ -15,7 +15,7 @@ function WebXRManager( renderer ) {
var
scope
=
this
;
var
gl
=
renderer
.
context
;
var
gl
=
renderer
.
getContext
()
;
var
session
=
null
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录