webgl中关于深度测试
开启深度测试是gl.enable(gl.DEPTH_TEST);
关闭深度测试是gl.disable(gl.DEPTH_TEST);
设置深度测试函数是
gl.depthFunc
可选的类型有
NEVER、LESS、EQUAL、LEQUAL、GREATER、NOTEQUAL、GEQUAL、ALWAYS
设置是否开启深度写入
gl.depthMask(true/false)
还有一个gl.depthRange(min,max);不清除作用
unity中关于深度测试
是在ShaderLab中有ZTest和ZWrite
参考文档https://docs.unity3d.com/cn/current/Manual/shader-shaderlab-commands.html