Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
0ec36acd
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,发现更多精彩内容 >>
提交
0ec36acd
编写于
5月 05, 2020
作者:
F
Filipp Keks
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
WebGLMaterials also requires properties, pixelRatio and screen height
上级
511b2497
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
11 deletion
+17
-11
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+2
-2
src/renderers/webgl/WebGLMaterials.d.ts
src/renderers/webgl/WebGLMaterials.d.ts
+3
-2
src/renderers/webgl/WebGLMaterials.js
src/renderers/webgl/WebGLMaterials.js
+12
-7
未找到文件。
src/renderers/WebGLRenderer.js
浏览文件 @
0ec36acd
...
...
@@ -282,7 +282,7 @@ function WebGLRenderer( parameters ) {
objects
=
parameters
.
objects
!==
undefined
?
parameters
.
objects
:
new
WebGLObjects
(
_gl
,
geometries
,
attributes
,
info
);
morphtargets
=
parameters
.
morphtargets
!==
undefined
?
parameters
.
morphtargets
:
new
WebGLMorphtargets
(
_gl
);
programCache
=
parameters
.
programCache
!==
undefined
?
parameters
.
programCache
:
new
WebGLPrograms
(
_this
,
extensions
,
capabilities
);
materials
=
parameters
.
materials
!==
undefined
?
parameters
.
materials
:
new
WebGLMaterials
();
materials
=
parameters
.
materials
!==
undefined
?
parameters
.
materials
:
new
WebGLMaterials
(
properties
);
renderLists
=
parameters
.
renderLists
!==
undefined
?
parameters
.
renderLists
:
new
WebGLRenderLists
();
renderStates
=
parameters
.
renderStates
!==
undefined
?
parameters
.
renderStates
:
new
WebGLRenderStates
();
...
...
@@ -1865,7 +1865,7 @@ function WebGLRenderer( parameters ) {
}
materials
.
refreshUniforms
(
m_uniforms
,
material
,
environment
);
materials
.
refreshUniforms
(
m_uniforms
,
material
,
environment
,
_pixelRatio
,
_height
);
// RectAreaLight Texture
// TODO (mrdoob): Find a nicer implementation
...
...
src/renderers/webgl/WebGLMaterials.d.ts
浏览文件 @
0ec36acd
import
{
Material
}
from
"
../../materials/Material
"
;
import
{
Texture
}
from
"
../../textures/Texture
"
;
import
{
IFog
}
from
"
../../scenes/Fog
"
;
import
{
WebGLProperties
}
from
"
./WebGLProperties
"
;
export
class
WebGLMaterials
{
constructor
();
constructor
(
properties
:
WebGLProperties
);
refreshUniforms
(
uniforms
:
object
,
material
:
Material
,
environment
:
Texture
);
refreshUniforms
(
uniforms
:
object
,
material
:
Material
,
environment
:
Texture
,
pixelRatio
:
number
,
height
:
number
);
refreshUniformsFog
(
uniforms
:
object
,
fog
:
IFog
);
}
src/renderers/webgl/WebGLMaterials.js
浏览文件 @
0ec36acd
...
...
@@ -7,10 +7,15 @@ import { BackSide } from "../../constants";
* i.e. uniforms refresh before material is being rendered
*/
function
WebGLMaterials
()
{
var
_properties
;
function
WebGLMaterials
(
properties
)
{
_properties
=
properties
;
}
WebGLMaterials
.
prototype
.
refreshUniforms
=
function
(
uniforms
,
material
,
environment
)
{
WebGLMaterials
.
prototype
.
refreshUniforms
=
function
(
uniforms
,
material
,
environment
,
pixelRatio
,
height
)
{
if
(
material
.
isMeshBasicMaterial
)
{
...
...
@@ -77,7 +82,7 @@ WebGLMaterials.prototype.refreshUniforms = function ( uniforms, material, enviro
}
else
if
(
material
.
isPointsMaterial
)
{
this
.
refreshUniformsPoints
(
uniforms
,
material
);
this
.
refreshUniformsPoints
(
uniforms
,
material
,
pixelRatio
,
height
);
}
else
if
(
material
.
isSpriteMaterial
)
{
...
...
@@ -143,7 +148,7 @@ WebGLMaterials.prototype.refreshUniformsCommon = function ( uniforms, material,
uniforms
.
reflectivity
.
value
=
material
.
reflectivity
;
uniforms
.
refractionRatio
.
value
=
material
.
refractionRatio
;
uniforms
.
maxMipLevel
.
value
=
properties
.
get
(
envMap
).
__maxMipLevel
;
uniforms
.
maxMipLevel
.
value
=
_
properties
.
get
(
envMap
).
__maxMipLevel
;
}
...
...
@@ -280,12 +285,12 @@ WebGLMaterials.prototype.refreshUniformsDash = function ( uniforms, material ) {
};
WebGLMaterials
.
prototype
.
refreshUniformsPoints
=
function
(
uniforms
,
material
)
{
WebGLMaterials
.
prototype
.
refreshUniformsPoints
=
function
(
uniforms
,
material
,
pixelRatio
,
height
)
{
uniforms
.
diffuse
.
value
.
copy
(
material
.
color
);
uniforms
.
opacity
.
value
=
material
.
opacity
;
uniforms
.
size
.
value
=
material
.
size
*
_
pixelRatio
;
uniforms
.
scale
.
value
=
_
height
*
0.5
;
uniforms
.
size
.
value
=
material
.
size
*
pixelRatio
;
uniforms
.
scale
.
value
=
height
*
0.5
;
if
(
material
.
map
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录