Research:
- Fixed depth error. Should initialize depth buffer after obj load
- Fixed drawing triangles for the cut line:
- I wrongly set the “layout (triangle_strip, max_vertices = 3) out”, if max_vertices = 3, only one triangle will be outputted!
- Should use vertex, tess, geom, frag shaders together now! Let recall the whole pipeline…https://www.khronos.org/opengl/wiki/Rendering_Pipeline_Overview
- (09/08 added) I met an error for tessellation:
- Correct: https://www.dropbox.com/s/99cp7kk1ja0nbg6/correct.png?dl=0
- Mine: https://www.dropbox.com/s/4o7h3u4fir2j8oc/wrong.png?dl=0
- The reason is: I did coordinate transformation in vertex shader (before tessellation). If coordinate transformation happens before tessellation, the gl_TessCoord would be affected by the transformation.
- Should do: do nothing in vertex shader and do coordinate transformation after the last step in tessellation eval shader.
- Use tessellation CTRL shader to determine the level of tessellation:
- how to determine the level dynamically? Can do this
- Ensure that the shared edge(s) between the patches use the same level of tessellation
- Use tessellation eval shader to calculate the area of the triangle.
- ——————————————————————————————————————————
- How to dynamically solve the problem of tessellation?
- Central Triangle??
Others:
…悲剧就是将美好的东西毁灭给人看…