POV-Ray : Newsgroups : povray.general : Mesh rendering artifacts : Re: Mesh rendering artifacts Server Time
1 May 2024 20:04:11 EDT (-0400)
  Re: Mesh rendering artifacts  
From: Bald Eagle
Date: 30 Jan 2023 19:20:00
Message: <web.63d85e82249f00761f9dae3025979125@news.povray.org>
"yesbird" <nomail@nomail> wrote:

> Thanks, I'v checked it - normals are normal.

So, I'd say that you need to check your pigments for adjacent triangles, and
make sure that your vertex normals match for all triangles that share that
vertex.

Although the normals may point in the proper "facing" direction, they may not
all be pointing in the same precise direction where neighboring triangles all
meet at a corner vertex.

The thing that I'm most concerned about at this point is that there are so many
different approaches to accomplishing something in SDL, that you may be coding a
large number of single-use cases.

If you started a new thread, and gave a broad overview of all the different
types of things that you're wanting your rendering package to do, then we could
look at it and find some commonalities and propose some more generally
applicable approaches.

Not everything translates smoothly, or well, to SDL.

So, you could write your vertices to an array, and then calculate face normals,
and use the array to make the mesh.
You could loop over the array a second time, and sum all of the normals for the
SIX faces that share (almost) every vertex (except edges), then normalize that
sum.
You could write all your vertices to an array and write the normals to an array
- but rather than overwrite shared vertex normals, add to what's already there,
then do a final pass to normalize them all, or normalize it in the triangle
normal code.

There are lots and lots of different options.

- BW


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.