Files
filament/libs/filamentapp/materials/depthVisualizer.mat
Philip Rideout 37e2f46e10 Move FilamentApp into libs/filamentapp.
This will make it easier to migrate gltf_viewer into tools.

This is not a rewrite of FilamentApp, just a baby step.
2020-04-03 16:28:38 -07:00

15 lines
354 B
Plaintext

material {
name : depthVisualizer,
shadingModel : unlit,
}
fragment {
void material(inout MaterialInputs material) {
prepareMaterial(material);
const float n = 0.1;
const float f = 35.0;
float linearZ = (2.0 * n) / (f + n - gl_FragCoord.z * (f - n));
material.baseColor.rgb = float3(linearZ);
}
}