Skip to content

DebugShaders

Johannes Deml edited this page Apr 18, 2020 · 3 revisions

Debug Shaders

The Debug Shaders in Configurable Shaders are meant to help checking properties of Meshes as well as documenting shader functionality through examples.

World Normal Shader (Source)

Configurable/Debug/WorldNormals

WorldNormal Demo

This shader shows the normal data of an mesh, represented in world space. It is meant as an easy way to check if the normals of a mesh are as expected.

Depth01 Shader (Source)

Configurable/Debug/Depth01

Depth01 Demo Depth01 Material Mapping

This Shader visualized the depth information of a mesh normalized in the near-far clipping planes of the camera. The shader allows remapping the relative range in order to support drawing more subtle depth changes in a subset of the camera frustum.

  • Near Clipping Plane distance = White
  • Far Clipping Plane distance = Black

The near/far clipping plane of the game view camera is used, so the material will most probably show up as black in the scene view.

Properties

Depth01 Material

  • Invert Depth: Invert the depth color so near objects get white and far objects get black.
  • Remap Depth: Change the color spectrum for black to white to a subset of the near far clipping plane.

VFace Shader (Source)

Configurable/Debug/VFace

Shows in which direction a face is pointing at. By default the side pointing to the camera (Front Face) is red, while the side pointing away (Backface) is blue. VFace is an efficient way to get the information about the face direction supported for shader targets >= 3.0

Clone this wiki locally