diff --git a/material_depth_texture/Assets/checker_rough.png b/material_depth_texture/Assets/checker_rough.png new file mode 100644 index 0000000..5fad6a5 Binary files /dev/null and b/material_depth_texture/Assets/checker_rough.png differ diff --git a/material_depth_texture/Assets/grid.png b/material_depth_texture/Assets/grid.png new file mode 100644 index 0000000..84c984b Binary files /dev/null and b/material_depth_texture/Assets/grid.png differ diff --git a/material_depth_texture/README.md b/material_depth_texture/README.md new file mode 100644 index 0000000..9d868f7 --- /dev/null +++ b/material_depth_texture/README.md @@ -0,0 +1,9 @@ +Wall with a material that's reading from a depth texture, which is copied from the depth buffer before drawing the wall as the last object in the scene. + +#### To use this in your own projects: + +1. Enable `Material Properties > Armory Props > Read Depth` +2. Make sure `Render Properties > Armory Render Path > Renderer > Depth Texture` is set to `Auto` or `On` +3. Add a `Shader Data` node with a uniform sampler2D with the name `depthtex` and separate the x value from the color output + +Note that the depth values depend on the camera far/near values! Also the compositor needs to be enabled on forward render path in order to work. \ No newline at end of file diff --git a/material_depth_texture/material_depth_texture.blend b/material_depth_texture/material_depth_texture.blend new file mode 100644 index 0000000..d4fd5e9 Binary files /dev/null and b/material_depth_texture/material_depth_texture.blend differ