Hi. I’ve been trying to wrap my head around this problem for a couple of days.
I have a pointcloud from a kinect.
I send one point from an Add sop into a convert sop (convert to particle) and then into a geo, and then do the instancing “manually” with GLSL as described in Markus Heckmann’s helpful 2018 glsl turorial (Introduction to GLSL - Markus Heckmann - YouTube).
From here, I’ve added several conditional rules for isolating a subset of the pointcloud, and then sending the surviving points to a geometry shader, which then draws a mesh from each point to each of its neighbors (provided no edges are longer than a certain max length parameter, to break off the isolated object from the background and foreground at the boundary…)
So this all works. the geometry shader takes in the surviving points, and draws triangles between this point and its neighbors…
But what I am struggling with is getting lights to work. Even in Marcus’s tutorial, where we spend time getting the normals to work with the displaced grid, earlier in the tutorial (tbnmatrix, etc.), with the point cloud example, the lights similarly do not work…
So what is the strategy for turning the lights on? I figure I need to compute normals for each of the triangles I’m drawing, by taking the cross product of the two angles. But I’m not sure how to use these normals again in the pixel shader. What is the appropriate method for getting the lights to see my triangles?