POV-Ray : Newsgroups : povray.binaries.images : Playing with Photons : Re: Playing with Photons Server Time
2 Aug 2024 02:21:51 EDT (-0400)
  Re: Playing with Photons  
From: Kenneth
Date: 27 Mar 2008 17:10:01
Message: <web.47ec17d6f97379d78dcad930@news.povray.org>
Alain <ele### [at] netscapenet> wrote:
>
> The artefacts seems to be related to the max_gradient, BUT, they are not holes
> in the isosurface. Tested with interior_texture{pigment rgb y}finish{ambient 1}}
> and there are no green pixels.
>

I agree.

Those pesky bright spots have continued to bug me (even though they have been
considerably lessened), so I've been running test after test to try and
pinpoint the cause. I hate mysteries! In the process, I've come across
something very odd, concerning media, the "water box" and some of the
isosurface parameters.

After determining (through tests) that I could "strip out" some non-essentials
from the scene, with no ill affect, I decided to run it using some very radical
values, on purpose, to *clearly* show the oddities. I also substituted a simple
small green sphere for the water box, to eliminate
extraneous variables. I've included the test images, and my stripped-down code.
No radiosity or photons in this experiment, and no surface normals.

Some of the "radical" values I used are an isosurface max_gradient of 7(!) and
an accuracy of .00001.  I also added an interior_texture to the isosurface, per
Alain's suggestion. All of this is to clearly show any isosurface holes. I
*want* them there, to distinguish them from the bright spots.  (You would
think--or at least I would-- that a finer iso accuracy value would actually
clean up the bright spots. Not so; it makes them worse!) I also set the media
samples value to 1(!), because samples affect these results only minimally, if
at all, and it's much faster to render. I originally had it at 100, and the
render tests were taking 1 hour each.  Ugh.

BTW, I took a look at the scene with a distant camera, and saw that the media
sphere size was *huge* in comparison to the relatively tiny isosurface box.
Seems kind of wasteful. ;-) So I reduced this sphere size to
6(!)--it still covers the isosurface well--and translated it in +z, to put the
sphere surface very slightly in front of the main camera--so as to put the
camera outside of it--thinking that the bright spots could somehow be an
artifact of the camera originally being inside the media.  But that didn't
help.

#1 is the isosurface by itself, no media or sphere object. The holes in the
isosurface are very apparent. But no bright spots.

#2 is with the sphere added. Still no bright spots.

#3 is with media but NO sphere.  Still OK.

#4 is with media AND the sphere.  Suddenly, there are LOTS of anomolies-- simply
from the addition of the sphere into the scene! Not isosurface holes, either.
That makes no sense--there is no CSG with the isosurface (which would have been
my first thought.)

#5 is that scene but with isosurface accuracy changed to .001 (the default.)
The anomolies disappear! (Well, there are now a *few* new isosurface holes,
nothing terrible.)

#6 is with iso accuracy back to .00001, but max_trace 2 added.  Again, the
anomolies disappear.  I find that very strange, because again, there is no CSG
in the scene, and AFAIK max_trace and all_intersections are meant for CSG. Yet
it works.

#7 is with iso accuracy .00001, but with all_intersections taking the place of
max_trace.  Again, no anomolies.

So in essence, adding the "water box" to the scene--while using media--seems to
be the root cause of the bright spots...coupled with isosurface parameters! I
don't know what to make of all that, but luckily there are solutions. Is there
an isosurface/CSG bug somewhere?

I hope this proves useful. Feel free to keep experimenting with the original
code (and to prove me wrong); there are so many permutations possible that I
could have missed something.

Ken W.

-------simplified code----

#declare IsoOk = 1;
#declare MediaOk = 0;

global_settings {
  assumed_gamma 1.0
  max_trace_level 100
  }

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [1.0 rgb <0.2,0.3,0.8>]
    }
    warp {repeat y flip y}
  }
}

light_source {
  <0, 0, 0>
  color rgb <1.5, 1.2, .6>*4
  translate <0, 20,  10>*1000
}


#if (MediaOk = on)
sphere {0,6
  hollow
  translate 4.3*z
  pigment {rgbt 1}
  interior {
    media {
    scattering { 1, rgb 0.015 }
     method 3
     intervals 1
     samples 1
      density {
        planar
        scale 10
        translate -5*y
        turbulence .2
      }
    }
  }
  photons {collect off pass_through}

}
#end


#default {
  texture { pigment {color rgb 1} finish{ambient 0.0} }
}



#declare MountPig =
  pigment {
    cells
    turbulence <1,.1,1>
    scale .24
    pigment_map{
      [0.0 rgb <.6,.3,.2>]
      [1.0 rgb <.5,.2,.1>]
    }

    scale <100,1,100>*3

  }


#declare MountainTex =
texture {pigment {MountPig}}


#declare Cany =
function {
  pigment {
        gradient x
        turbulence <.5,.0,.5>
        //lambda 0
        color_map {
          [0.0 rgb .59 ]
          [0.29 rgb .59 ]
          [0.3 rgb .51 ]
          [0.4 rgb .1 ]
          [0.5 rgb .05 ]
          [0.6 rgb .1 ]
          [0.7 rgb .55 ]
          [0.71 rgb .59 ]
          [1.0 rgb .59 ]
        }
  }
}


#declare Terrain =
isosurface {
  function { y - Cany(x,y*2,z).red*2 }
  contained_by { box { 0, <1.3,1,6> } }
  accuracy 0.00001  // or .001
  max_gradient 7
 // max_trace 2
 // all_intersections  // alternative to 'max_trace'

  translate <-.5,-1,-.5>
  scale 4
  texture {MountainTex scale .1}
  interior_texture{pigment{color rgb <0,1,1>} finish{ambient 1 diffuse 0}}
}

Terrain

#declare Obj = Terrain;
#declare Norm = <0,0,0>;
#declare Start = <  -0.3, 1000.5,   -1.8>;
#declare CPos = trace (
                  Obj,             // object to test
                  Start,           // starting point
                  -y,              // direction
                  Norm );          // normal

#declare Start2 = <1, 1000.5,  3>;
#declare CPos2 = trace (
                  Obj,             // object to test
                  Start2,           // starting point
                  -y,              // direction
                  Norm );          // normal


camera {
  location  CPos + <0,.3,0>
  direction 1.25*z
  look_at   CPos2 + <0,-.5,0>
  right     x*image_width/image_height
}

// green sphere
sphere{0,.05
 texture{
 pigment {rgb <0,1,0>}
   finish{ambient .5 diffuse 0}
   }
   translate <.2,-2,.3>
   }


Post a reply to this message


Attachments:
Download 'newsgroup_radical_exp.jpg' (353 KB)

Preview of image 'newsgroup_radical_exp.jpg'
newsgroup_radical_exp.jpg


 

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