Team Ai
Apppublic

OpenMotionLab/MotionGPT

sourceHugging Facemitupdated 1y agoView on Hugging Face
118likes
debug_quad.frag24 linesDownload Raw Back to shaders
1#version 330 core2out vec4 FragColor;3 4in vec2 TexCoords;5 6uniform sampler2D depthMap;7//uniform float near_plane;8//uniform float far_plane;9//10//// required when using a perspective projection matrix11//float LinearizeDepth(float depth)12//{13//    float z = depth * 2.0 - 1.0; // Back to NDC 14//    return (2.0 * near_plane * far_plane) / (far_plane + near_plane - z * (far_plane - near_plane));15//}16 17void main()18{19    float depthValue = texture(depthMap, TexCoords).r;20    // FragColor = vec4(vec3(LinearizeDepth(depthValue) / far_plane), 1.0); // perspective21    FragColor = vec4(vec3(depthValue), 1.0); // orthographic22    //FragColor = vec4(1.0, 1.0, 0.0, 1.0);23}24