POV-Ray : Newsgroups : povray.advanced-users : Moire patterns when trying to create isosurface of earth using image maps Server Time
23 Nov 2024 07:35:37 EST (-0500)
  Moire patterns when trying to create isosurface of earth using image maps (Message 1 to 9 of 9)  
From: COMPATT
Subject: Moire patterns when trying to create isosurface of earth using image maps
Date: 2 Jan 2019 02:20:00
Message: <web.5c2c65dc75f38fcf3008c61f0@news.povray.org>
Even when I use an accuracy of 0.0001 I continue to get moire patterns at the
"terminator" of my planet when the light rays would be striking at a very low
angle to the isosurface I am not getting a max gradient error but I am using a
very high resolution greyscale topographic image map any ideas on how to make
them go away completely? I am not interested in using a mesh instead I would
like to do this just using the image map as an isosurface function. Not sure
what to include in this post to help you help me so please let me know what
other info will be helpful


Post a reply to this message

From: jr
Subject: Re: Moire patterns when trying to create isosurface of earth using image ma=
Date: 2 Jan 2019 09:00:01
Message: <web.5c2cc339a0a3f1b948892b50@news.povray.org>
hi,

"COMPATT" <com### [at] hotmailcom> wrote:
> Even when I use an accuracy of 0.0001 I continue to get moire patterns at the
> "terminator" of my planet when the light rays would be striking at a very low
> angle to the isosurface I am not getting a max gradient error but I am using a
> very high resolution greyscale topographic image map any ideas on how to make
> them go away completely? ...

only guessing, but would moving the camera, by a tiny amount, not result in that
pattern changing/disappearing?


regards, jr.


Post a reply to this message

From: Alain
Subject: Re: Moire patterns when trying to create isosurface of earth using image maps
Date: 2 Jan 2019 12:29:56
Message: <5c2cf514$1@news.povray.org>
Le 19-01-02 à 02:18, COMPATT a écrit :
> Even when I use an accuracy of 0.0001 I continue to get moire patterns at the
> "terminator" of my planet when the light rays would be striking at a very low
> angle to the isosurface I am not getting a max gradient error but I am using a
> very high resolution greyscale topographic image map any ideas on how to make
> them go away completely? I am not interested in using a mesh instead I would
> like to do this just using the image map as an isosurface function. Not sure
> what to include in this post to help you help me so please let me know what
> other info will be helpful
> 
> 

Please post a sample image to povray.binaries.images.
You may crop it to specifically show the problem areas.

It may be an antialiasing issue. If that's the case, the followings may 
help :

Use antialiasing method 2 : add +am2 to the command line
Reduce the threshold : Add +a0.1 or an even smaller value.
Increase the antialias depth : add +r4 or +r5

Use antialiasing method 3 : +am3 +a0.01 +r5 +ac0.9

Method 3 normally demand a smaller threshold and a higher recursion 
level. Here, the threshold control the variance. The +ac parameter is 
the accuracy. It works in about the same way as accuracy in a camera 
using focal blur.


Post a reply to this message

From: Bald Eagle
Subject: Re: Moire patterns when trying to create isosurface of earth using image ma=
Date: 2 Jan 2019 13:35:01
Message: <web.5c2d03c0a0a3f1b9765e06870@news.povray.org>
"COMPATT" <com### [at] hotmailcom> wrote:

> Not sure
> what to include in this post to help you help me so please let me know what
> other info will be helpful

The code always helps, especially if we can run it "stand-alone" right out of
the gate.
A file attachment is usually preferred over copy/paste unless lines are all
short.

Not seeing the code, image, or result,
the first two things I'd suggest are adding "sturm" and moving your camera away
from the center of the sphere, or angling it slightly differently.

Try some camera movements as an animation and see if some frames are
significantly better than others.


Post a reply to this message

From: COMPATT
Subject: Re: Moire patterns when trying to create isosurface of earth using image ma=
Date: 3 Jan 2019 00:40:01
Message: <web.5c2d9f29a0a3f1b93008c61f0@news.povray.org>
"COMPATT" <com### [at] hotmailcom> wrote:
> Even when I use an accuracy of 0.0001 I continue to get moire patterns at the
> "terminator" of my planet when the light rays would be striking at a very low
> angle to the isosurface I am not getting a max gradient error but I am using a
> very high resolution greyscale topographic image map any ideas on how to make
> them go away completely? I am not interested in using a mesh instead I would
> like to do this just using the image map as an isosurface function. Not sure
> what to include in this post to help you help me so please let me know what
> other info will be helpful

Thank You So Much jr, Alain, & Bald Eagle for your rapid responses. It turns out
in my trying to "simplify" my scene file so I could share it with you that the
Moire Pattern has nothing to do with the image map as I get it even when my
isosurface is a smooth sphere. please see sample code below:

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#version 3.7;
global_settings{ assumed_gamma 1.0 }
#default{ finish{ ambient 0.0 diffuse 1.0 }}

#include "colors.inc"
#include "shapes.inc"

#declare scaleFactor = 1.00e-1;

#declare planetRadius = scaleFactor * 6356.7523;      //in kilometers
#declare maxHeightAboveSea = scaleFactor * 8.849868;  //in kilometers

light_source {
  0*x
  color rgb <1,1,1>
  translate <-20*planetRadius, 40*planetRadius, -20*planetRadius>
}

camera {
  location  <0.0, 0.0, -2.25*planetRadius>
  look_at   <0.0, 0.0,  0.0>
  right     x*image_width/image_height
}

#declare isoSmooth = isosurface {
  function {f_sphere(x, y, z, planetRadius)}
  contained_by { sphere { 0, planetRadius+maxHeightAboveSea} }
  threshold 0.0
  accuracy 0.1
  max_gradient 1.1
  max_trace 1
}

object{
    isoSmooth
    pigment {White}

}

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

jr - regardless of where I look at the sphere with the camera the Moire patterns
always show up at the "terminator" where the sphere will be going into darkness

Alain - I am not sure where to specify the anti-alising on the scene file is
that a command line or ini file setting?

Bald Eagle - could not figure out how to specify sturm for an isosurface

I am posting an image generated by the code above in povray.binaries.images with
the name [Moire patterns when trying to create isosurface sphere as Alain
suggested I hope this helps clarify the issue for all of us


Post a reply to this message

From: Bald Eagle
Subject: Re: Moire patterns when trying to create isosurface of earth using image ma=
Date: 3 Jan 2019 06:40:00
Message: <web.5c2df3f0ae148c98765e06870@news.povray.org>
camera {
  location  <0.0, 0.0, -2.25*planetRadius>
  look_at   <0.0, 0.0,  0.0>
  right     x*image_width/image_height
}


Change your x and y for look_at a bit and see what happens


#declare isoSmooth = isosurface {
  function {f_sphere(x, y, z, planetRadius)}
  contained_by { sphere { 0, planetRadius+maxHeightAboveSea} }
  threshold 0.0
  accuracy 0.1
  max_gradient 1.1
  max_trace 1
}

I'd say my first instinct is to drastically reduce accuracy to 0.0000001

I'd also see about giving the sphere a slightly different finish to reduce the
harsh shadow effect.  Play with diffuse, etc.


Post a reply to this message

From: clipka
Subject: Re: Moire patterns when trying to create isosurface of earth using image maps
Date: 3 Jan 2019 08:29:01
Message: <5c2e0e1d$1@news.povray.org>
Am 02.01.2019 um 08:18 schrieb COMPATT:
> Even when I use an accuracy of 0.0001 I continue to get moire patterns at the
> "terminator" of my planet when the light rays would be striking at a very low
> angle to the isosurface I am not getting a max gradient error but I am using a
> very high resolution greyscale topographic image map any ideas on how to make
> them go away completely? I am not interested in using a mesh instead I would
> like to do this just using the image map as an isosurface function. Not sure
> what to include in this post to help you help me so please let me know what
> other info will be helpful

As Bald Eagle already suggests, you need a much lower accuracy setting.

In isosurfaces, intersection points are not computed in a single step 
using a formula, but rather via a bisection-based iterative algorithm 
that narrows down the location of the intersection point until it is at 
most `accuracy` units off the mathematically correct surface.

Due to how the bisection works, you essentially get "terracing" on your 
isosurface, and the pattern you see are the terrace steps casting shadows.

You need to reduce `accuracy` to a value low enough that the height of 
the terrace steps falls within POV-Ray's precision bounds for shadow 
calculations. 1e-6 will do for the scene you posted.


(The moire pattern is a moire pattern indeed, but in this case does not 
arise from interaction between image content and the pixel structure of 
the image, but from the interaction between the shape and the bisection 
intervals. Not sure how you got anti-aliasing to affect it, but I 
suspect you may have toyed with other settings as well and simply forgot.)


Post a reply to this message

From: Alain
Subject: Re: Moire patterns when trying to create isosurface of earth using image ma=
Date: 3 Jan 2019 12:52:14
Message: <5c2e4bce$1@news.povray.org>
Le 19-01-03 à 00:36, COMPATT a écrit :

> Alain - I am not sure where to specify the anti-alising on the scene file is
> that a command line or ini file setting?
> 

Antialiasing is controlled from the command line or trough an ini file.

The parameters that I proposed are for the command line, but can be 
placed in an ini file.
In an ini file, you can use the long, more obvious versions of those.

If you are using the Windows version, the «command line» is the text box 
just to the right of the resolution list. That list is used to select a 
section from the quickres.ini file.


Alain


Post a reply to this message

From: jr
Subject: Re: Moire patterns when trying to create isosurface of earth using image ma=
Date: 4 Jan 2019 19:00:00
Message: <web.5c2ff26bae148c9848892b50@news.povray.org>
hi,

"COMPATT" <com### [at] hotmailcom> wrote:
> jr - regardless of where I look at the sphere with the camera the Moire patterns
> always show up at the "terminator" where the sphere will be going into darkness

I'm sure it isn't "the correct way" of doing, but I've added "polarity on" in
the declaration of isoSmooth, and voila.  see image posted.


regards, jr.


Post a reply to this message

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