码迷,mamicode.com
首页 > 其他好文 > 详细

如何在UE4材质中判断物体是否开启了渲染Custom Depth Pass?

时间:2018-08-31 19:27:38      阅读:233      评论:0      收藏:0      [点我收藏+]

标签:inf   dep   alt   判断   如何   tom   技术分享   .com   分享图片   

两种判断CustomDepth是否开启的办法

根据前面的文章,没有开启时,CustomDepth的值为10^8,开启之后,CustomDepth的值为SceneDepth。

SceneDepth远远小于10^8,所以可以用两种办法来判断。

一种是拿CustomDepth和10^8(或者10^7)比较,一种是拿CustomDepth和SceneDepth比较。两个办法都可以。

技术分享图片

技术分享图片

如何在UE4材质中判断物体是否开启了渲染Custom Depth Pass?

标签:inf   dep   alt   判断   如何   tom   技术分享   .com   分享图片   

原文地址:https://www.cnblogs.com/henzhe/p/9567241.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!