Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
bca5b38e
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,发现更多精彩内容 >>
提交
bca5b38e
编写于
7月 11, 2021
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Material: Set alphaTest to null by default
上级
040d9297
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
15 addition
and
4 deletion
+15
-4
src/materials/Material.js
src/materials/Material.js
+2
-2
src/renderers/shaders/ShaderChunk/alphatest_fragment.glsl.js
src/renderers/shaders/ShaderChunk/alphatest_fragment.glsl.js
+2
-0
src/renderers/shaders/ShaderChunk/alphatest_pars_fragment.glsl.js
...erers/shaders/ShaderChunk/alphatest_pars_fragment.glsl.js
+2
-0
src/renderers/webgl/WebGLMaterials.js
src/renderers/webgl/WebGLMaterials.js
+6
-1
src/renderers/webgl/WebGLProgram.js
src/renderers/webgl/WebGLProgram.js
+1
-0
src/renderers/webgl/WebGLPrograms.js
src/renderers/webgl/WebGLPrograms.js
+2
-1
未找到文件。
src/materials/Material.js
浏览文件 @
bca5b38e
...
...
@@ -62,7 +62,7 @@ class Material extends EventDispatcher {
this
.
dithering
=
false
;
this
.
alphaTest
=
0
;
this
.
alphaTest
=
null
;
this
.
alphaToCoverage
=
false
;
this
.
premultipliedAlpha
=
false
;
...
...
@@ -308,7 +308,7 @@ class Material extends EventDispatcher {
if
(
this
.
dithering
===
true
)
data
.
dithering
=
true
;
if
(
this
.
alphaTest
>
0
)
data
.
alphaTest
=
this
.
alphaTest
;
if
(
this
.
alphaTest
!==
null
)
data
.
alphaTest
=
this
.
alphaTest
;
if
(
this
.
alphaToCoverage
===
true
)
data
.
alphaToCoverage
=
this
.
alphaToCoverage
;
if
(
this
.
premultipliedAlpha
===
true
)
data
.
premultipliedAlpha
=
this
.
premultipliedAlpha
;
...
...
src/renderers/shaders/ShaderChunk/alphatest_fragment.glsl.js
浏览文件 @
bca5b38e
export
default
/* glsl */
`
#ifdef USE_ALPHATEST
if ( diffuseColor.a < alphaTest ) discard;
#endif
`
;
src/renderers/shaders/ShaderChunk/alphatest_pars_fragment.glsl.js
浏览文件 @
bca5b38e
export
default
/* glsl */
`
#ifdef USE_ALPHATEST
uniform float alphaTest;
#endif
`
;
src/renderers/webgl/WebGLMaterials.js
浏览文件 @
bca5b38e
...
...
@@ -107,7 +107,6 @@ function WebGLMaterials( properties ) {
function
refreshUniformsCommon
(
uniforms
,
material
)
{
uniforms
.
alphaTest
.
value
=
material
.
alphaTest
;
uniforms
.
opacity
.
value
=
material
.
opacity
;
if
(
material
.
color
)
{
...
...
@@ -134,6 +133,12 @@ function WebGLMaterials( properties ) {
}
if
(
material
.
alphaTest
!==
null
)
{
uniforms
.
alphaTest
.
value
=
material
.
alphaTest
;
}
if
(
material
.
specularMap
)
{
uniforms
.
specularMap
.
value
=
material
.
specularMap
;
...
...
src/renderers/webgl/WebGLProgram.js
浏览文件 @
bca5b38e
...
...
@@ -607,6 +607,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
parameters
.
roughnessMap
?
'
#define USE_ROUGHNESSMAP
'
:
''
,
parameters
.
metalnessMap
?
'
#define USE_METALNESSMAP
'
:
''
,
parameters
.
alphaMap
?
'
#define USE_ALPHAMAP
'
:
''
,
parameters
.
alphaTest
?
'
#define USE_ALPHATEST
'
:
''
,
parameters
.
sheen
?
'
#define USE_SHEEN
'
:
''
,
parameters
.
transmission
?
'
#define USE_TRANSMISSION
'
:
''
,
...
...
src/renderers/webgl/WebGLPrograms.js
浏览文件 @
bca5b38e
...
...
@@ -38,7 +38,7 @@ function WebGLPrograms( renderer, cubemaps, extensions, capabilities, bindingSta
'
map
'
,
'
mapEncoding
'
,
'
matcap
'
,
'
matcapEncoding
'
,
'
envMap
'
,
'
envMapMode
'
,
'
envMapEncoding
'
,
'
envMapCubeUV
'
,
'
lightMap
'
,
'
lightMapEncoding
'
,
'
aoMap
'
,
'
emissiveMap
'
,
'
emissiveMapEncoding
'
,
'
bumpMap
'
,
'
normalMap
'
,
'
objectSpaceNormalMap
'
,
'
tangentSpaceNormalMap
'
,
'
clearcoatMap
'
,
'
clearcoatRoughnessMap
'
,
'
clearcoatNormalMap
'
,
'
displacementMap
'
,
'
specularMap
'
,
'
roughnessMap
'
,
'
metalnessMap
'
,
'
gradientMap
'
,
'
alphaMap
'
,
'
combine
'
,
'
vertexColors
'
,
'
vertexAlphas
'
,
'
vertexTangents
'
,
'
vertexUvs
'
,
'
uvsVertexOnly
'
,
'
fog
'
,
'
useFog
'
,
'
fogExp2
'
,
'
alphaMap
'
,
'
alphaTest
'
,
'
combine
'
,
'
vertexColors
'
,
'
vertexAlphas
'
,
'
vertexTangents
'
,
'
vertexUvs
'
,
'
uvsVertexOnly
'
,
'
fog
'
,
'
useFog
'
,
'
fogExp2
'
,
'
flatShading
'
,
'
sizeAttenuation
'
,
'
logarithmicDepthBuffer
'
,
'
skinning
'
,
'
maxBones
'
,
'
useVertexTexture
'
,
'
morphTargets
'
,
'
morphNormals
'
,
'
premultipliedAlpha
'
,
'
numDirLights
'
,
'
numPointLights
'
,
'
numSpotLights
'
,
'
numHemiLights
'
,
'
numRectAreaLights
'
,
...
...
@@ -197,6 +197,7 @@ function WebGLPrograms( renderer, cubemaps, extensions, capabilities, bindingSta
metalnessMap
:
!!
material
.
metalnessMap
,
specularMap
:
!!
material
.
specularMap
,
alphaMap
:
!!
material
.
alphaMap
,
aphaTest
:
material
.
alphaTest
!==
null
,
gradientMap
:
!!
material
.
gradientMap
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录