POV-Ray : Newsgroups : povray.general : Strange artifact on mesh rendering : Re: Strange artifact on mesh rendering Server Time
21 Mar 2023 23:49:42 EDT (-0400)
  Re: Strange artifact on mesh rendering  
From: Bald Eagle
Date: 21 Jan 2023 16:15:00
Message: <web.63cc54f98c778ce31f9dae3025979125@news.povray.org>
"yesbird" <nomail@nomail> wrote:
> Hi, guys !
>
> While working on my Matlab toolbox project
>
(https://www.mathworks.com/matlabcentral/fileexchange/123520-pov-lab-matlab-interface-to-pov-ray)
> I found strange artifact that looks like mesh collision when rendering (scene
> and example attached).
>
> Could anyone suggest to me how to avoid it or at least make it less perceptible
> ?


So, there are a multitude of problems with how the scene is constructed.

First, you are using a clear texture (glass) for half of the triangles, and so I
think what you are seeing is part of the perspective of looking _through_ those
triangles, and getting shadows.

Rotate your camera or the mesh to look right at that section and see if it still
looks ok.

You could also just use simple pigments and see if the problem "goes away".

You're using regular triangles instead of smooth_triangles, and so you get a
noticeable "crease" diagonally across your squares.

In your mesh definition you have a large collection of triangles.  You could
probably do that more efficiently by defining a list of vertices and using a
small macro to make triangles out of them, yielding a smaller scene file.


These are your scene files, so proceed as you wish, but I have tended to get
away from using too many include files if at all possible.   If you only have a
few textures or functions that you need for your scene, it might be better for
portability, historical archiving, and debugging if you copied the bits of code
from the include files into your scene so that they are permanent and
inseperable.  You could add a comment "copied from 'somefile.inc'" so that
people could know where you got the code from, etc.

Along those lines, mesh2 would be better to edit the mesh, since you'd be
defining triangles with references to vertices, not the native coordinates for
every shared vertex.  I'd also strongly consider declaring texture variables
that are used in the mesh, that way you could edit a single line at the
beginning of the scene file, and not have to edit or search/find/replace every
single instance.

You'll likely want to start a versioning system now, before things get too far
along.   Add a comment block that states what software generates the SDL scene
file, what version, date, author, POV-Ray version being used, etc.
Binary copying a png or jpg image and the scene text file into a PDF
(post-render) permanently ties them together so that the code that generated the
image never gets lost.



Overall, small easy things to fix, and you're looking good right out of the
gate!   I hope to see more fun shapes and surfaces, and maybe even new visitors.
 :)


Post a reply to this message

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