POV-Ray : Newsgroups : povray.general : Artifacts when tracing somewhat high degree poly Server Time
27 Dec 2024 03:52:29 EST (-0500)
  Artifacts when tracing somewhat high degree poly (Message 1 to 10 of 16)  
Goto Latest 10 Messages Next 6 Messages >>>
From: Adrien
Subject: Artifacts when tracing somewhat high degree poly
Date: 6 Dec 2022 04:05:00
Message: <web.638f05556eb8b15275a7ea2178e7deb4@news.povray.org>
Hi,

I'm trying to use Povray to plot a surface defined by a polynomial equation
spitted out by an auxiliary program. However, whenever the degree of that
polynomial is 10 or more I get a bunch of artifacts/black dots. Is there a way
to fix that ? Either directly in Povray, or in the auxiliary program ?

I guess I could try to write a program that produces a mesh from my equation,
but this feels somewhat unefficient, my understanding is that raytracing
something defined by polynomial equations is "easy" because it's easy to check
whether a given point is a solution (as opposed to actually solve the equation).

Any hint or suggestion would be greatly appreciated ! Below is an example and
attached it the result.


    #version version;
#include "colors.inc"
#include "rad_def.inc"
background { color White}
    #declare maxG=100000000;
#declare maxC=10;


camera
  {
  location <0, 0, -6.5>
//  location <0, 0, -0.1>
//  focal_point <0,0,0>
 // aperture 1.5
  right x*image_width/image_height up <0,1,0>
  look_at  <0.0, 0.0, 0.0>
  angle 20
 // blur_samples 5
  }


light_source
  {
  2*<5, 10, -40>
  color White
  area_light <5, 0, 0>, <0, 5, 0>, 5, 5
  adaptive 1
/*  fade_power 1
  fade_distance 30*/
  }


        #declare surf= texture{
     finish {
    ambient 0.0
   diffuse 0.3
    specular 0.2
    roughness 0.1
    reflection {0.0 metallic}
    }
}
poly{10,
 <1.0,0.0,0.0,0.0,5.0,0.0,0.0,5.0,-288.4708948753144,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,10.0,0.0,0.0,20.0,-11
53.8835795012576,-4.0,0.0,0.0,0.0,0.0,10.0,-1153.8835795012576,-16.0,0.0,-2.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0
.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1538.5114393350102,10.0,0.0,0.0,30.0,-1730.8253692518865,-6.0,0.0,0.0,0.0,0.0,3
0.0,-3461.650738503773,-48.0,0.0,-6.0,0.0,0.0,0.0,0.0,0.0,160.0,10.0,-1730.8253692518865,-42.0,384.62785983375255,-18.0
,576.9417897506288,2.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,15385.1143933501
03,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,5.0,0.0,0.0,20.0,-1153.8835795012576,-4.0,0.0,0.0,0.0,0.
0,30.0,-3461.650738503773,-48.0,0.0,-6.0,0.0,0.0,0.0,0.0,0.0,-320.0,20.0,-3461.650738503773,-84.0,769.2557196675051,-36
.0,1153.8835795012576,4.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,5.0,-1153.8835795012576,-40.0,769.2557196675051,-30.0,1923.13
92991687628,16.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-7692.55719667
5051,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.
0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,5.0,-288.4708948753144,-1.0,0.0,0.0,0.0,0.0,10.0,-1153.8835795012576,-16.0,0.0,-2.0,0
.0,0.0,0.0,0.0,0.0,32.0,10.0,-1730.8253692518865,-42.0,384.62785983375255,-18.0,576.9417897506288,2.0,0.0,0.0,0.0,0.0,0
.0,0.0,0.0,0.0,5.0,-1153.8835795012576,-40.0,769.2557196675051,-30.0,1923.1392991687628,16.0,0.0,1.0,0.0,0.0,0.0,0.0,0.
0,0.0,0.0,0.0,0.0,0.0,1.0,-288.4708948753144,-13.0,384.62785983375255,-14.0,1346.197509418134,14.0,384.62785983375255,1
3.0,-288.4708948753144,-1.0>
sturm on
 texture {surf}
 pigment {color Blue}
scale -0.4

rotate <0,45,0>
translate <0,0,-0.5>
scale -0.9}


Post a reply to this message


Attachments:
Download 'mwe.png' (188 KB)

Preview of image 'mwe.png'
mwe.png


 

From: jr
Subject: Re: Artifacts when tracing somewhat high degree poly
Date: 6 Dec 2022 04:45:00
Message: <web.638f0e6399cae61ac0ce110b6cde94f1@news.povray.org>
hi,

"Adrien" <nomail@nomail> wrote:
> ...
> Any hint or suggestion ...

adding antialiasing options will help, as may playing with the lighting.
<https://wiki.povray.org/content/Reference:Tracing_Options#Anti-Aliasing_Options>


regards, jr.


Post a reply to this message

From: Adrien
Subject: Re: Artifacts when tracing somewhat high degree poly
Date: 6 Dec 2022 05:00:00
Message: <web.638f11ef99cae61a75a7ea2178e7deb4@news.povray.org>
Thanks for your answer. I should have said, I did try to play around with
various anti-aliasing options, but I get pretty much the same thing. Rendering
at a higher resolution doesn't help either.


Post a reply to this message

From: jr
Subject: Re: Artifacts when tracing somewhat high degree poly
Date: 6 Dec 2022 05:30:00
Message: <web.638f190999cae61ac0ce110b6cde94f1@news.povray.org>
hi,

"Adrien" <nomail@nomail> wrote:
> Thanks for your answer. I should have said, I did try to play around with
> various anti-aliasing options, but I get pretty much the same thing. Rendering
> at a higher resolution doesn't help either.

I added the recommended 'global_settings {assumed_gamma 1}' line to your code
and rendered it (using a v3.8 alpha) with
  $ povray file.pov +a +am3 +a0.05 +ac0.99 +ag1 -j +q9

while there still are some artefacts, and, fwiw, I'm not an expert on textures
and lights etc, the settings helped, see attached.  am confident others can
offer additional (better) advice.

regards, jr.


Post a reply to this message


Attachments:
Download '221206-adrien-polyn.png' (353 KB)

Preview of image '221206-adrien-polyn.png'
221206-adrien-polyn.png


 

From: Bald Eagle
Subject: Re: Artifacts when tracing somewhat high degree poly
Date: 6 Dec 2022 07:00:00
Message: <web.638f2dc099cae61a1f9dae3025979125@news.povray.org>
It looks like you're doing everything right, and jr's use of the rendering
option sure helped.

The only other things I can think of are changing the incident ray angles a bit
by moving the poly or camera

But I think that maybe this is an accuracy thing with the roots of the equation,
so maybe since the surface is infinitely thin, do something like creating a very
thin shell using "abs(Function (x, y, z)) - a very small value".

The other thing you could try is make it an isosurface and see if somehow that
works any better.  You can also employ the shell method with that as well.

That's all I've got right now.

Very cool surface, by the way   :)
I might look at this for inspiration if I ever fool around with refining my
modeling of the "schist disk" again.


Post a reply to this message

From: Adrien
Subject: Re: Artifacts when tracing somewhat high degree poly
Date: 6 Dec 2022 07:25:00
Message: <web.638f33d199cae61a75a7ea2178e7deb4@news.povray.org>
>
> I added the recommended 'global_settings {assumed_gamma 1}' line to your code
> and rendered it (using a v3.8 alpha) with
>   $ povray file.pov +a +am3 +a0.05 +ac0.99 +ag1 -j +q9
>

Fantastic, thanks a lot ! I was being dumb, I tried the +AM3 otion, but didn't
realized I also had to add +A, this is already much better with this ! I'll try
and play with these other settings as well.


Post a reply to this message

From: Adrien
Subject: Re: Artifacts when tracing somewhat high degree poly
Date: 6 Dec 2022 07:40:00
Message: <web.638f371999cae61a75a7ea2178e7deb4@news.povray.org>
> But I think that maybe this is an accuracy thing with the roots of the equation,
> so maybe since the surface is infinitely thin, do something like creating a very
> thin shell using "abs(Function (x, y, z)) - a very small value".
>
> The other thing you could try is make it an isosurface and see if somehow that
> works any better.  You can also employ the shell method with that as well.
>
> That's all I've got right now.

I actually wrote this a while ago, and at that time I think I tried with an
isosurface but can't remember what was not working (on the top of my head I'd
say it was unpractically slow ?)

>
> Very cool surface, by the way   :)
> I might look at this for inspiration if I ever fool around with refining my
> modeling of the "schist disk" again.

Thanks :) This is kind of a classic actually, a so-called Seifert surface for a
torus knot. I isolated the problematic part when asking this question but if
you're curious here is what I actually wanted to plot (using jr tweaks ! Thought
I get an error from the +ac0.99 option, I'll try to figure out why).


Post a reply to this message


Attachments:
Download 'out.png' (196 KB)

Preview of image 'out.png'
out.png


 

From: jr
Subject: Re: Artifacts when tracing somewhat high degree poly
Date: 6 Dec 2022 08:50:00
Message: <web.638f476899cae61ac0ce110b6cde94f1@news.povray.org>
hi,

"Adrien" <nomail@nomail> wrote:
> > ...
> Fantastic, thanks a lot ! ...

great.  (and, pleasure)


> ... Thought I get an error from the +ac0.99 option, I'll try to figure out why.

you do use a v3.8?


regards, jr.


Post a reply to this message

From: William F Pokorny
Subject: Re: Artifacts when tracing somewhat high degree poly
Date: 6 Dec 2022 09:57:22
Message: <638f5852$1@news.povray.org>
On 12/6/22 04:03, Adrien wrote:
> I'm trying to use Povray to plot a surface defined by a polynomial equation
> spitted out by an auxiliary program. However, whenever the degree of that
> polynomial is 10 or more I get a bunch of artifacts/black dots. Is there a way
> to fix that ? Either directly in Povray, or in the auxiliary program ?

As per others, stronger AA in official POV-Ray is probably your best / 
quick solution.


---
FWIW.

a) The box-ish fails in your original image are very likely related to 
the shadow cache bugs (there are 2.5 of these in official releases).

b) The general spotty result is at lest somewhat related to issues with 
the official sturmiam based solver.

c) Some of the spotty result is shadow tolerance related coupled to how 
accurate the sturm solver results are.

d) The results are somewhat inaccurate simply because it's a tenth order 
poly.

Attached an image using my current povr branch where a and b already 
better due fixes.

The issue (c) can be made better with povr's shadow_tolerance keyword 
changing the default from 1e-3 to 1e-2 in this particular case. Here the 
results just are a little inaccurate due the 10th order and we pick up 
at surface roots during shadow testing as real blockage when the roots 
are inaccurate representations of the ray origin root(d)...

Attached a povr result using no AA, default shadow tolerance of 1e-3.

Bill P.


Post a reply to this message


Attachments:
Download 'adrien_povrnoaa.png' (149 KB)

Preview of image 'adrien_povrnoaa.png'
adrien_povrnoaa.png


 

From: Thomas de Groot
Subject: Re: Artifacts when tracing somewhat high degree poly
Date: 6 Dec 2022 11:14:08
Message: <638f6a50$1@news.povray.org>
Op 6-12-2022 om 14:45 schreef jr:
> hi,
> 
> "Adrien" <nomail@nomail> wrote:
>>> ...
>> Fantastic, thanks a lot ! ...
> 
> great.  (and, pleasure)
> 
> 
>> ... Thought I get an error from the +ac0.99 option, I'll try to figure out why.
> 
> you do use a v3.8?
> 
> 
Artefacts (almost) disappear with:

+am3 +a0.01 +ac0.99 +r4


-- 
Thomas


Post a reply to this message

Goto Latest 10 Messages Next 6 Messages >>>

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