I am facing a challenging situation while trying to implement conservative depth rendering, as described in CPU gems. My primary obstacle is enlarging the triangle, and it seems like I might have encountered the "stupid" phase.
To illustrate the current state of affairs, please refer to this link: (In this visualization, the black triangle represents the input, the red dots indicate the enlarged vertices, and the squares represent the sampling grid)
Utilizing webgl with three.js, I've included the 2 companion vertices as attributes for each vertex. My goal is to enlarge the triangles within the vertex shader. However, due to my camera setup (an orthographic view with certain constraints), directly applying the code from CPU gems designed for a perspective camera is proving to be a challenge.
My attempted solution involves generating normals for adjacent edges based on the considered vertex. Despite my efforts, achieving consistent results has been elusive. Implementing various strategies to determine the optimal direction for vertex displacement has yielded mixed outcomes, with some points clearly deviating from the intended location.
If you'd like to explore the complete code and delve deeper into the intricacies of this issue, please visit: https://github.com/nraynaud/webgcode/blob/01550668fdedba5ab61e2fbf5ed9917ca06b5e75/test_3D_conservative_rendering.html
In summary, my attempts so far have resulted in only one vertex moving correctly, while discrepancies remain for the other two. How can I successfully offset a triangle without falling victim to geometric challenges?