POV-Ray : Newsgroups : povray.general : Mesh rendering artifacts Server Time
28 Dec 2024 05:09:06 EST (-0500)
  Mesh rendering artifacts (Message 1 to 10 of 63)  
Goto Latest 10 Messages Next 10 Messages >>>
From: yesbird
Subject: Mesh rendering artifacts
Date: 26 Jan 2023 03:15:00
Message: <web.63d2365db6289f681ffa55cd10800fb2@news.povray.org>
Hi, guys.
May be am asking too many questions, but I am new to POV and before asking
trying everything I can not for only one hour.

Could you suggest the way of getting rid of artifact, markered on this image,
without increasing mesh density ? I would like to minimize rendering time and
achieve best quality.

Thanks in advance.


Post a reply to this message


Attachments:
Download 'surface3.png' (180 KB)

Preview of image 'surface3.png'
surface3.png


 

From: yesbird
Subject: Re: Mesh rendering artifacts
Date: 26 Jan 2023 03:20:00
Message: <web.63d236cb249f00761ffa55cd10800fb2@news.povray.org>
Scene is here


Post a reply to this message


Attachments:
Download 'surface3.pov.txt' (2343 KB)

From: Bald Eagle
Subject: Re: Mesh rendering artifacts
Date: 26 Jan 2023 06:25:00
Message: <web.63d262b8249f00761f9dae3025979125@news.povray.org>
"yesbird" <nomail@nomail> wrote:
> Hi, guys.
> May be am asking too many questions, but I am new to POV and before asking
> trying everything I can not for only one hour.
>
> Could you suggest the way of getting rid of artifact, markered on this image,


>
> Thanks in advance.

I would say that the easiest way would be to get rid of all the pigment
statements and make a pigment {gradient y} and give it the color map that you
want.  Then apply that to the entire mesh.


Post a reply to this message

From: yesbird
Subject: Re: Mesh rendering artifacts
Date: 26 Jan 2023 06:35:00
Message: <web.63d264ef249f00761ffa55cd10800fb2@news.povray.org>
> I would say that the easiest way would be to get rid of all the pigment
> statements and make a pigment {gradient y} and give it the color map that you
> want.  Then apply that to the entire mesh.

Thanks, I will try it.


Post a reply to this message

From: Bald Eagle
Subject: Re: Mesh rendering artifacts
Date: 26 Jan 2023 06:45:00
Message: <web.63d2674c249f00761f9dae3025979125@news.povray.org>
You're also making the scene/workflow uneccessarily complicated, since you're
starting off with an equation, converting to a mesh, and then having to deal
with lots of little triangles.

Likely your smoothest option would be to use an isosurface object and "graph"
the equation directly.  You would then get the smoothness of a continuous
surface and not have to worry about artifacts caused by mismatched face/vertex
normals, especially when using reflection, and it would be "self-documenting"
since the equation would be in the code for the isosurface.

But admittedly, the approach to how you represent the surface depends on the end
use.

Nice that you have those smooth_triangles in there  :)


Post a reply to this message

From: yesbird
Subject: Re: Mesh rendering artifacts
Date: 26 Jan 2023 09:00:00
Message: <web.63d28410249f0076419688c110800fb2@news.povray.org>
> Likely your smoothest option would be to use an isosurface object and "graph"
> the equation directly.

Thanks for this suggestion, I know about isosurface and this approach would be
the best, but the idea is to get data from Matlab's generated surface, including
colormap and render ray-traced equivalent. Now it looks following:

......
size = 60;
[X,Y,Z] = peaks(size);
s = surf(X,Y,Z);

pl.surface('surface', s, 'colormap', 'turbo', 'scale', [1, 1, 3/10]);
......

where 'pl' is POV object.

As you can see it works and results are acceptable, but not perfect.

I am planing to wrap _all_ POV entities entities in future and seriously extend
not only Matlab's visualization capabilities, but the way Matlab's users are
working with surfaces.

> Nice that you have those smooth_triangles in there  :)
Yes, I have a special option for than in my API. )


Post a reply to this message

From: jr
Subject: Re: Mesh rendering artifacts
Date: 27 Jan 2023 01:05:00
Message: <web.63d3696c249f0076fbdc16836cde94f1@news.povray.org>
hi,

"yesbird" <nomail@nomail> wrote:
> ...
> I am planing to wrap _all_ POV entities entities in future and seriously extend
> not only Matlab's visualization capabilities, but the way Matlab's users are
> working with surfaces.

that sounds like a real nice project.  good luck + keep "us" in the loop,
please.


regards, jr.


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Mesh rendering artifacts
Date: 29 Jan 2023 18:35:00
Message: <web.63d701f2249f0076b75bdad789db30a9@news.povray.org>
"yesbird" <nomail@nomail> wrote:
> Hi, guys.
> May be am asking too many questions, but I am new to POV and before asking
> trying everything I can not for only one hour.
>
> Could you suggest the way of getting rid of artifact, markered on this image,



It seems to me that the artifact is present in every second triangle pair.

What is your XY grid resolution for that mesh ?

How are you calculating the vertex normals and the vertex colors ?

- And have you been careful to have the same clockwise or anticlockwise
order of the vertices in all the triangles?

I've tried to recrate your scene with my own macros and a pigment with
a gradient pattern, as Bill Walker suggested. See the attached image
for the result. The XY grid resolution is 50x50.

I can not see any such artifacts in that image.

If the problem persists after making sure that everything else is ok,
you can try to divide each quadrilateral into two triangles along it's
shortest diagonal. Alternatively you can divide it into two triangles
according to which of the two ways of doing it deviates less from the
surface (e.g. at the center of the quadrilateral).

--
Tor Olav
http://subcube.com
https://github.com/t-o-k


Post a reply to this message


Attachments:
Download 'surface3_tok.png' (247 KB)

Preview of image 'surface3_tok.png'
surface3_tok.png


 

From: Bald Eagle
Subject: Re: Mesh rendering artifacts
Date: 29 Jan 2023 19:05:00
Message: <web.63d708a1249f00761f9dae3025979125@news.povray.org>
TOK,

He posted his scene here :
http://news.povray.org/povray.general/attachment/%3Cweb.63d236cb249f00761ffa55cd10800fb2%40news.povray.org%3E/surface3.
pov.txt

I'm not sure how the data is generated from MatLab in order to be exported to
triangles for POV-Ray, but I'm thinking that it might be better to export the
geometry for the mesh separately, and then run a macro in POV-Ray to calculate
the normals and color interpolation - or use the gradient y pigment.

I'm guessing that the normals are probably ok (?) and it's just the hard-coded
colors getting interpolated that throws it all off.

I'd have to dig through it all to see - but after I just did some more sorting
macro stuff to handle the function timing (other thread), maybe I could try to
sort the triangle vertices into a grid so that they can be put into a 2D array
and then reprocessed.

Purely as a sorting macro exercise for myself, which might prove useful to
someone else int he future.


Post a reply to this message

From: yesbird
Subject: Re: Mesh rendering artifacts
Date: 30 Jan 2023 10:30:00
Message: <web.63d7e18f249f0076988cc0cb10800fb2@news.povray.org>
Tor, Bill,

Thanks for your attention to this problem.

> I'm not sure how the data is generated from MatLab in order to be exported to
> triangles for POV-Ray, but I'm thinking that it might be better to export the
> geometry for the mesh separately, and then run a macro in POV-Ray to calculate
> the normals and color interpolation - or use the gradient y pigment.

Probably a good idea, now all data: geometry, normals and colors is fetched
directly from structure returned by surface method without any modifications.

I will play with vertex order as Tor suggested, but please take into account
that effect is mostly visible on high elevation (along the vertical axis).

Playing with surface parameters:
.....
s = surf(x,y,z, FaceColor = 'interp', EdgeColor = 'interp');
.....
gives nothing, also increasing mesh density eliminates this effect, as was
expected.
> Purely as a sorting macro exercise for myself, which might prove useful to
> someone else int he future.
No doubt )


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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