unity, shader中获得当前像素深度

frag shader中直接访问i.pos.z就是深度,不必除以i.pos.w,因为系统已经自动进行过了透视除法且已将i.pos.w置为0。

 

posted on 2017-05-29 21:31  wantnon  阅读(1074)  评论(0编辑  收藏  举报

导航