POV-Ray : Newsgroups : povray.general : Mesh rendering artifacts Server Time
18 Apr 2024 12:08:47 EDT (-0400)
  Mesh rendering artifacts (Message 11 to 20 of 63)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: yesbird
Subject: Re: Mesh rendering artifacts
Date: 30 Jan 2023 10:45:00
Message: <web.63d7e4f8249f0076988cc0cb10800fb2@news.povray.org>
> What is your XY grid resolution for that mesh ?

50x50:
....
    t = linspace (-8, 8, 50);
    [x, y] = meshgrid (t, t);
    r = sqrt (x .^ 2 + y .^ 2) + eps;
    z = 18 * sin (r) ./ r;
    s = surf(x,y,z, FaceColor = 'interp', EdgeColor = 'interp');
....

>
> How are you calculating the vertex normals and the vertex colors ?
>
Matlab do it for me)

> - And have you been careful to have the same clockwise or anticlockwise
> order of the vertices in all the triangles?
I will check it, thanks.

> 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).

May be it will help, but for this method I would like to stay sticked to
Matlab's generated geometry. Little bit late I will implement method that
completely replace 'surf' with POV-only techiques. I am sure, that it will work
much faster, et least.

Present implementation was only the first experiment, which helps me to start
working with POV and explore Matlab's geometry structures.


Post a reply to this message

From: yesbird
Subject: Re: Mesh rendering artifacts
Date: 30 Jan 2023 12:25:00
Message: <web.63d7fc76249f0076988cc0cb10800fb2@news.povray.org>
> What is your XY grid resolution for that mesh ?

50x50:
....
    t = linspace (-8, 8, 50);
    [x, y] = meshgrid (t, t);
    r = sqrt (x .^ 2 + y .^ 2) + eps;
    z = 18 * sin (r) ./ r;
    s = surf(x,y,z, FaceColor = 'interp', EdgeColor = 'interp');
....

>
> How are you calculating the vertex normals and the vertex colors ?
>
Matlab do it for me)

> - And have you been careful to have the same clockwise or anticlockwise
> order of the vertices in all the triangles?
I will check it, thanks.

> 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).

May be it will help, but for this method I would like to stay sticked to
Matlab's generated geometry. Little bit late I will implement method that
completely replace 'surf' with POV-only techiques. I am sure, that it will work
much faster, et least.

Present implementation was only the first experiment, which helps me to start
working with POV and explore Matlab's geometry structures.


Post a reply to this message

From: Bald Eagle
Subject: Re: Mesh rendering artifacts
Date: 30 Jan 2023 14:05:00
Message: <web.63d8142d249f00761f9dae3025979125@news.povray.org>
"yesbird" <nomail@nomail> wrote:

> 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).

One of the easiest things to do when looking for "wrong" surface normals is to
use an interior_texture {} which will color the opposite face of the triangles a
different color.   Then you don't have to even look at the code - just look at
the triangles in the render.


Post a reply to this message

From: yesbird
Subject: Re: Mesh rendering artifacts
Date: 30 Jan 2023 14:35:00
Message: <web.63d81b22249f0076df04b5ff10800fb2@news.povray.org>
> One of the easiest things to do when looking for "wrong" surface normals is to
> use an interior_texture {} which will color the opposite face of the triangles a
> different color.   Then you don't have to even look at the code - just look at
> the triangles in the render.

Thanks for this tip, I will check surface with it !


Post a reply to this message

From: yesbird
Subject: Re: Mesh rendering artifacts
Date: 30 Jan 2023 14:55:00
Message: <web.63d81f6f249f0076df04b5ff10800fb2@news.povray.org>
"yesbird" <nomail@nomail> wrote:
> > One of the easiest things to do when looking for "wrong" surface normals is to
> > use an interior_texture {} which will color the opposite face of the triangles a
> > different color.   Then you don't have to even look at the code - just look at
> > the triangles in the render.
>
> Thanks for this tip, I will check surface with it !

..... but only if I will be able. Can't figure out how to push interior_texture
into texture_list, this way is not working:

smooth_triangle {<-8.00, -8.00, -1.51>, <0.19, 0.19, 0.96>,
                 <-8.00, -7.67, -1.62>, <0.07, 0.07, 1.00>,
                 <-7.67, -7.67, -1.64>, <-0.06, -0.06, 1.00>

       #declare t1=texture { pigment {rgb<1.00, 0.66, 0.00>} finish {f} }
       #declare t2=texture { pigment {rgb<1.00, 0.61, 0.00>} finish {f} }
       #declare t3=texture { pigment {rgb<1.00, 0.61, 0.00>} finish {f} }

       #declare it1=interior_texture  { pigment {rgb<0, 0, 0>} }
       #declare it2=interior_texture  { pigment {rgb<0, 0, 0>} }
       #declare it3=interior_texture  { pigment {rgb<0, 0, 0>} }

       texture_list {t1 t2 t3}
       texture_list {it1 it2 it3}
}


Post a reply to this message

From: jr
Subject: Re: Mesh rendering artifacts
Date: 30 Jan 2023 15:20:00
Message: <web.63d82561249f0076fbdc16836cde94f1@news.povray.org>
hi,

"yesbird" <nomail@nomail> wrote:
> ...
>        #declare it1=interior_texture  { pigment {rgb<0, 0, 0>} }
>        #declare it2=interior_texture  { pigment {rgb<0, 0, 0>} }
>        #declare it3=interior_texture  { pigment {rgb<0, 0, 0>} }

only one interior, per mesh.  insert just before the scale.
<https://wiki.povray.org/content/Reference:Interior_Texture>


regards, jr.


Post a reply to this message

From: jr
Subject: Re: Mesh rendering artifacts
Date: 30 Jan 2023 15:25:00
Message: <web.63d826b9249f0076fbdc16836cde94f1@news.povray.org>
oops, forgot.  you may need to make the object "hollow", too.

> only one interior, per mesh.  insert just before the scale.
> <https://wiki.povray.org/content/Reference:Interior_Texture>

<https://wiki.povray.org/content/Reference:Hollow_Object_Modifier>


regards, jr.


Post a reply to this message

From: yesbird
Subject: Re: Mesh rendering artifacts
Date: 30 Jan 2023 19:00:00
Message: <web.63d8594a249f0076df04b5ff10800fb2@news.povray.org>
> only one interior, per mesh.  insert just before the scale.
> <https://wiki.povray.org/content/Reference:Interior_Texture>
Thanks, I'v checked it - normals are normal.

It's strange: flat surface looks good, oposite to peaked.


Post a reply to this message


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

Preview of image 'surface3.png'
surface3.png


 

From: yesbird
Subject: Re: Mesh rendering artifacts
Date: 30 Jan 2023 19:05:00
Message: <web.63d85a46249f0076df04b5ff10800fb2@news.povray.org>
"yesbird" <nomail@nomail> wrote:
> > only one interior, per mesh.  insert just before the scale.
> > <https://wiki.povray.org/content/Reference:Interior_Texture>
> Thanks, I'v checked it - normals are normal.
Scene


Post a reply to this message


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

From: Bald Eagle
Subject: Re: Mesh rendering artifacts
Date: 30 Jan 2023 19:05:00
Message: <web.63d85a77249f00761f9dae3025979125@news.povray.org>
So, I worked out my own scene, using your equation, storing the <x, f(r), z> in
a 2D array, analytically calculating the vertex normals using fast forward
differencing to get the tangents by numerically approximating the partial
derivatives, then taking the vector cross product, and then making a mesh with
smooth_triangles with per-vertex normals.

(After horribly botching that 5 times in a row, I got the normals, and therefore
the triangles all working nicely.)

No textures for any of the triangles.

mesh {
 loop over arrays to make triangles
texture {gradient y}
interior_texture
}

I get a much steeper curve than you do, so I don't know if there's some kind of
scaling going on somewhere in the process.

I hard-coded the pigment_map for the texture, but it could probably be
calculated from the HSV2RGB macro in colors.inc


Post a reply to this message


Attachments:
Download 'ripple.png' (768 KB)

Preview of image 'ripple.png'
ripple.png


 

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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