Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
968e0e79
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 搜索 >>
提交
968e0e79
编写于
4月 13, 2016
作者:
W
WestLangley
提交者:
Mr.doob
4月 14, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added alphaTest support (#8629)
上级
df5d55f5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
34 addition
and
8 deletion
+34
-8
src/materials/MeshDepthMaterial.js
src/materials/MeshDepthMaterial.js
+14
-0
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+2
-3
src/renderers/shaders/ShaderLib.js
src/renderers/shaders/ShaderLib.js
+2
-5
src/renderers/shaders/ShaderLib/depth_frag.glsl
src/renderers/shaders/ShaderLib/depth_frag.glsl
+16
-0
未找到文件。
src/materials/MeshDepthMaterial.js
浏览文件 @
968e0e79
...
...
@@ -2,10 +2,16 @@
* @author mrdoob / http://mrdoob.com/
* @author alteredq / http://alteredqualia.com/
* @author bhouston / https://clara.io
* @author WestLangley / http://github.com/WestLangley
*
* parameters = {
*
* opacity: <float>,
*
* map: new THREE.Texture( <Image> ),
*
* alphaMap: new THREE.Texture( <Image> ),
*
* displacementMap: new THREE.Texture( <Image> ),
* displacementScale: <float>,
* displacementBias: <float>,
...
...
@@ -26,6 +32,10 @@ THREE.MeshDepthMaterial = function ( parameters ) {
this
.
skinning
=
false
;
this
.
morphTargets
=
false
;
this
.
map
=
null
;
this
.
alphaMap
=
null
;
this
.
displacementMap
=
null
;
this
.
displacementScale
=
1
;
this
.
displacementBias
=
0
;
...
...
@@ -49,6 +59,10 @@ THREE.MeshDepthMaterial.prototype.copy = function ( source ) {
this
.
skinning
=
source
.
skinning
;
this
.
morphTargets
=
source
.
morphTargets
;
this
.
map
=
source
.
map
;
this
.
alphaMap
=
source
.
alphaMap
;
this
.
displacementMap
=
source
.
displacementMap
;
this
.
displacementScale
=
source
.
displacementScale
;
this
.
displacementBias
=
source
.
displacementBias
;
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
968e0e79
...
...
@@ -1890,7 +1890,8 @@ THREE.WebGLRenderer = function ( parameters ) {
if
(
material
instanceof
THREE
.
MeshBasicMaterial
||
material
instanceof
THREE
.
MeshLambertMaterial
||
material
instanceof
THREE
.
MeshPhongMaterial
||
material
instanceof
THREE
.
MeshStandardMaterial
)
{
material
instanceof
THREE
.
MeshStandardMaterial
||
material
instanceof
THREE
.
MeshDepthMaterial
)
{
refreshUniformsCommon
(
m_uniforms
,
material
);
...
...
@@ -1929,8 +1930,6 @@ THREE.WebGLRenderer = function ( parameters ) {
}
else
if
(
material
instanceof
THREE
.
MeshDepthMaterial
)
{
m_uniforms
.
opacity
.
value
=
material
.
opacity
;
if
(
material
.
displacementMap
)
{
m_uniforms
.
displacementMap
.
value
=
material
.
displacementMap
;
...
...
src/renderers/shaders/ShaderLib.js
浏览文件 @
968e0e79
...
...
@@ -171,11 +171,8 @@ THREE.ShaderLib = {
uniforms
:
THREE
.
UniformsUtils
.
merge
(
[
THREE
.
UniformsLib
[
'
displacementmap
'
],
{
"
opacity
"
:
{
type
:
"
1f
"
,
value
:
1.0
}
}
THREE
.
UniformsLib
[
'
common
'
],
THREE
.
UniformsLib
[
'
displacementmap
'
]
]
),
...
...
src/renderers/shaders/ShaderLib/depth_frag.glsl
浏览文件 @
968e0e79
...
...
@@ -6,12 +6,28 @@
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void
main
()
{
#include <clipping_planes_fragment>
vec4
diffuseColor
=
vec4
(
1
.
0
);
#if DEPTH_PACKING == 3200
diffuseColor
.
a
=
opacity
;
#endif
#include <map_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <logdepthbuf_fragment>
#if DEPTH_PACKING == 3200
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录