mikhmha / terrain_generator

Procedural 3D terrain generator using Bezier surfaces and Perlin noise.
0 stars 0 forks source link

TerrainMesh class question #2

Open francescobrischetto opened 2 years ago

francescobrischetto commented 2 years ago

Why in the TerrainMesh class you don't have the list of faces but only the list of vertices? What to you use to display the mesh in OpenGL?

francescobrischetto commented 2 years ago

In particular, why you don't have EBO in the Terrain Mesh? It should contain the list of all faces. How you are able to render the bezier surface?

mikhmha commented 2 years ago

It is rendered using a tessellation shader. The bezier surface is represented as a patch primitive.

https://www.khronos.org/opengl/wiki/Tessellation

It has been some time since i worked on this. I will have to review before I can give a more detailed answer. But from what I remember, no EBO is required due to the use of the tesselation shader.

francescobrischetto commented 2 years ago

Is there a way to compute also principal curvature directions and curvature values at each tessellated vertex? Can you help me to figure out how to do it in tessellation shader (.tese file)?

mikhmha commented 2 years ago

https://web.engr.oregonstate.edu/~mjb/cs519/Handouts/tessellation.1pp.pdf

Yes, it is possible. Refer to slides 26-33 on this page, additionally slides 44-48. It is a very good presentation - I recommend going through all of it to get an overview of Tesselation shaders in OpenGL.

Do you own a copy of the textbook "Real-time Rendering"? It also explains how it can be calculated.

francescobrischetto commented 1 year ago

Hi, sorry for re-opening this question. I still have a lot of other questions related to the project. Can i send them through email?