7/6/2023 0 Comments Java lwjgl spotlightsUsing the geometry shader it is also possible to visualize the inner creases/edges by computing the dot product between the normals of the two adjacent triangles of an edge and use some threshold when to show the edge or use some color/intensity interpolation to highlight the edge. Then it uses the geometry shader to check which triangle edges are outlines of the mesh by checking whether both triangles sharing that same edge face the camera / are front-facing.ĮDIT: Currently, that demo only highlights edges that are shared by both a frontfacing and a backfacing triangle. It first computes triangle adjacency information based on the index buffer of a simple triangles mesh. I added another demo to the lwjgl3-demos repository, showing a technique to render the outline of a mesh using the geometry shader.
0 Comments
Leave a Reply. |