0
\$\begingroup\$

I would like compute normals vectors for a tessellated terrain generated procedurally, in order to use them for a basic lighting. I don't know how I could do it. I can do it in the Tessellation Evaluation Shader (TES)? or in the Geometry Shader? The Geometry Shader allows me to compute normals, but is it expensive, so I would like avoid him.

Someone can help me? Thanks a lot.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ What procedure do you use to generate the vertex positions or heights? \$\endgroup\$
    – DMGregory
    Mar 30, 2023 at 13:36
  • \$\begingroup\$ Basically I use an heightmap generated using the fratcal noise. The element of the heigthmap determines the height of each vertex.In the Application stage I send a flat terrain to the GPU that will be subdivideb by the tessellation shader. \$\endgroup\$
    – Giuseppe
    Mar 30, 2023 at 13:55
  • \$\begingroup\$ I assume your TES is sampling the height-map for the displacement, right? Normals can easily be calculated by sampling multiple points close to your current position, crossing some vectors and averaging the results. \$\endgroup\$
    – tkausl
    Mar 30, 2023 at 14:54

0

You must log in to answer this question.

Browse other questions tagged .