Team Ai
Apppublic

OpenMotionLab/MotionGPT

sourceHugging Facemitupdated 1y agoView on Hugging Face
118likes
vertex_normals_pc.geom30 linesDownload Raw Back to shaders
1#version 330 core2 3layout (points) in;4 5layout (line_strip, max_vertices = 2) out;6 7in VS_OUT {8    vec3 position;9    vec3 normal;10    mat4 mvp;11} gs_in[];12 13uniform float normal_magnitude;14 15void GenerateVertNormal(int index)16{17    vec4 p0 = gs_in[index].mvp * vec4(gs_in[index].position, 1.0);18    vec4 p1 = gs_in[index].mvp * vec4(normal_magnitude * normalize(gs_in[index].normal) + gs_in[index].position, 1.0);19    gl_Position = p0;20    EmitVertex();21    gl_Position = p1;22    EmitVertex();23    EndPrimitive();24}25 26void main()27{28    GenerateVertNormal(0);29}30