From 396b7ed6dc12b41c8c23e663f404300f3b799273 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Tue, 25 Mar 2025 11:33:37 +0800 Subject: [PATCH] add depth write material --- materials/linear_depth.mat | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 materials/linear_depth.mat diff --git a/materials/linear_depth.mat b/materials/linear_depth.mat new file mode 100644 index 00000000..2c57d17c --- /dev/null +++ b/materials/linear_depth.mat @@ -0,0 +1,17 @@ +material { + name : LinearDepth, + shadingModel : unlit, + requires : [ position, uv0 ], + shadingModel : unlit, + doubleSided : false, + blending: opaque, + depthWrite : true, + depthCulling : true, +} + +fragment { + void material(inout MaterialInputs material) { + prepareMaterial(material); + material.baseColor = vec4(gl_FragCoord.z, 0.0, 0.0, 1.0); + } +}