POV-Ray : Newsgroups : povray.general : Interpolate 2 with density file Server Time
30 Jul 2024 18:23:47 EDT (-0400)
  Interpolate 2 with density file (Message 1 to 1 of 1)  
From: Jellby
Subject: Interpolate 2 with density file
Date: 24 Jun 2008 04:40:00
Message: <pal6j5-fpo.ln1@badulaque.unex.es>
Hi all,

I posted this to povray.bugreports, but I realize I should have posted here
before:

According to the documentation
(<http://www.povray.org/documentation/view/3.6.1/374/>), using density
files as pattern accepts "interpolate 2". However, this gives wrong density
values: in areas of very low density, large-density edges appear.

This has been previously reported:

<http://news.povray.org/povray.beta-test.binaries/thread/%3CXns94DB21714ABBraf256com%40203.29.75.35%3E/>

and recently:

<http://news.povray.org/povray.binaries.images/thread/%3C48118fca@news.povray.org%3E/>

I've tried using some "mask function", but, although it can be useful in
some cases, it's not the best option, and it's slower. Consider this
example:

//---------------------------------------------------
// START EXAMPLE
#declare F = function {
  pattern {
    density_file df3 "spiral.df3"
    interpolate 2
  }
}

#declare F_mask = function {
  pattern {
    density_file df3 "spiral.df3"
    interpolate 1
  }
}

#declare Threshold = 0.01;
#declare F_masked = function {
  (F_mask(x,y,z)>Threshold)*F(x,y,z) +
  (F_mask(x,y,z)<=Threshold)*F_mask(x,y,z)
}

camera {location -z look_at 0}

plane { z, 0.0
  pigment {
    function { F(x,y,z) }
    color_map {
      [0.00 rgb <0,0,0>]
      [0.33 rgb <0,0,1>]
      [0.67 rgb <0,1,0>]
      [1.00 rgb <1,0,0>]
    }
    translate -0.5
  }
  finish { ambient 1 }
}
// END EXAMPLE
//---------------------------------------------------

Using F(x,y,z) in the pattern (interpolate 2) gives the red edges around the
spiral, wile F_mask(x,y,z) (interpolate 1) yields a good result. Trying to
combine both, with F_masked(x,y,z), I have to rise the value of "Threshold"
up to 0.025.

I'm using POV-Ray 3.6.1 under linux (both a custom compilation, and the
Mandriva release), but apparently it is the same in 3.7.

-- 

            / /\
Linux user / /  \  PGP Pub Key
#289967   / / /\ \  0x01A95F99
         / / /\ \ \
   http://djelibeibi.unex.es
       /________\ \ \
jellby \___________\/ yahoo.com


Post a reply to this message

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