POV-Ray : Newsgroups : povray.binaries.images : Playing with Photons Server Time
2 Aug 2024 00:15:45 EDT (-0400)
  Playing with Photons (Message 23 to 32 of 32)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Thomas de Groot
Subject: Re: Playing with Photons: Found the solution!
Date: 25 Mar 2008 04:05:48
Message: <47e8c06c$1@news.povray.org>
"Kirk Andrews" <kir### [at] tektonartcom> schreef in bericht 
news:web.47dd7cf19ebc6382a5d4a01d0@news.povray.org...
>I began playing with this scene, with no particular final result in mind, 
>so it
> has developed on its own.  But in the end, I decided I'd like to have the
> caustics of light reflected from the water playing on the bottom surfaces 
> of
> the canyon, so I added photons.  I've never really played with photons, so 
> I'm
> hoping someone more experienced with them might assist me--I'm not getting
> quite what I hoped for.
>
> I used standard photon settings.
>
> You'll notice strange artifacts along the walls of bright specks--they do 
> not
> appear until both photons and radiosity are turned on.
>
EUREKA! FOUND IT!

TEST 1: switching only media on, makes the artefacts appear again. Even with 
max_gradient 100 they do not disappear... The solution for this seems to be 
the max_trace level (see the warning in the message window). The default (1) 
is too low. Either use 2 (or higher), or switch all_intersections on. With 
max_gradient 60, no artefacts appear.

TEST 2: Switching also radiosity on, no artefacts!

TEST 3: Switching also photons on, no artefacts!

CONCLUSION: the max_trace level.

Image being rendered presently. I shall post it when finished.

Thomas


Post a reply to this message

From: Thomas de Groot
Subject: Re: Playing with Photons: Found the solution!
Date: 25 Mar 2008 07:19:19
Message: <47e8edc7@news.povray.org>
Here is the image.

Thomas


Post a reply to this message


Attachments:
Download 'Test Scene.jpg' (61 KB)

Preview of image 'Test Scene.jpg'
Test Scene.jpg


 

From: Kirk Andrews
Subject: Re: Playing with Photons: Found the solution!
Date: 25 Mar 2008 07:50:00
Message: <web.47e8f3cda7a656a9a5d4a01d0@news.povray.org>
"Thomas de Groot" <t.d### [at] internlDOTnet> wrote:
> Here is the image.
>
> Thomas

Thanks Thomas!

You get the genius of the week award!


Post a reply to this message

From: Thomas de Groot
Subject: Re: Playing with Photons: Found the solution!
Date: 25 Mar 2008 08:22:59
Message: <47e8fcb3$1@news.povray.org>
"Kirk Andrews" <kir### [at] tektonartcom> schreef in bericht 
news:web.47e8f3cda7a656a9a5d4a01d0@news.povray.org...
> "Thomas de Groot" <t.d### [at] internlDOTnet> wrote:
>> Here is the image.
>>
>> Thomas
>
> Thanks Thomas!
>
> You get the genius of the week award!
>

Glad to have been of help :-)  I got that feeling that it was something 
simple, but I was unable to remember what it was till this morning. I 
remember now that I had a similar problem some years ago, but the solution 
got buried below tons of other POV refuse :-)

I suppose your scene could use some better radiosity settings, maybe media 
too, but you knew that already of course.

Thomas


Post a reply to this message

From: Alain
Subject: Re: Playing with Photons
Date: 25 Mar 2008 09:35:47
Message: <47e90dc3$1@news.povray.org>
Mike Sobers nous apporta ses lumieres en ce 2008/03/24 19:59:
> Alain <ele### [at] netscapenet> wrote:
> 
>> He clearly say the the effect *ONLY* apears when using *BOTH* radiosity AND
photons.
>> NO effect using only radiosity.
>> NO effect using only photons.
> 
> And here's one the same (no photons, no radiosity, no media) with max_gradient
> dropped to 10 (as opposed to 60 previously).   The maximum gradient reported
> was 52.950. The problem is worse with lower max_gradient, but appears to be of
> similar form.  Shouldn't setting max_gradient higher than the maximum gradient
> of the function fix the problem?
> 
> Mike
> 
> 
> 
> ------------------------------------------------------------------------
> 
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.


-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when people around you are astounded by 
the computer-animated tails they put on babies in The X-Files. You complain that 
it looks fake because they didn't bother to put in the tails' shadows.
Jeff Lee


Post a reply to this message

From: Kenneth
Subject: Re: Playing with Photons
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


 

From: Kenneth
Subject: Re: Playing with Photons
Date: 27 Mar 2008 17:50:00
Message: <web.47ec238cf97379d78dcad930@news.povray.org>
I just ran another easy test: With media on and the green sphere visible, I
translated the green sphere to be FAR outside the media sphere...

translate <.2,-2,-1000>

and the anomolies are still there, just like in image #4.  Weird! So it seems
that adding any kind of extra object to the scene--anywhere!--causes this
effect.

Ken W.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Playing with Photons
Date: 28 Mar 2008 03:11:38
Message: <47eca83a$1@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> schreef in bericht 
news:web.47ec238cf97379d78dcad930@news.povray.org...
>I just ran another easy test: With media on and the green sphere visible, I
> translated the green sphere to be FAR outside the media sphere...
>
> translate <.2,-2,-1000>
>
> and the anomolies are still there, just like in image #4.  Weird! So it 
> seems
> that adding any kind of extra object to the scene--anywhere!--causes this
> effect.
>

See my message with solution, lower down.... :-)

Thomas


Post a reply to this message

From: Kenneth
Subject: Re: Playing with Photons
Date: 28 Mar 2008 13:40:00
Message: <web.47ed38cef97379d78dcad930@news.povray.org>
"Thomas de Groot" <t.d### [at] internlDOTnet> wrote:

>
> See my message with solution, lower down.... :-)
>
> Thomas

Yes, you were absolutely right! (Alain has mentioned the same, in other recent
posts.) *Had* to do some rigorous tests of my own, though, digging deep, just
to set my mind at ease. :-)

It's definitely a strange situation, adding that extra green sphere. It has to
be some kind of deeply-hidden bug. In the isosurface code? The object media
code? Some other mysterious thing??

Up until now, I had thought that max_trace and all_intersections only had an
effect when there was CSG with the isosurface. I guess that just ain't so! A
very useful discovery.

Ken W.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Playing with Photons
Date: 30 Mar 2008 04:28:39
Message: <47ef5d47@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> schreef in bericht 
news:web.47ed38cef97379d78dcad930@news.povray.org...
>
> Yes, you were absolutely right! (Alain has mentioned the same, in other 
> recent
> posts.) *Had* to do some rigorous tests of my own, though, digging deep, 
> just
> to set my mind at ease. :-)
>
> It's definitely a strange situation, adding that extra green sphere. It 
> has to
> be some kind of deeply-hidden bug. In the isosurface code? The object 
> media
> code? Some other mysterious thing??
>
> Up until now, I had thought that max_trace and all_intersections only had 
> an
> effect when there was CSG with the isosurface. I guess that just ain't so! 
> A
> very useful discovery.
>

Yes, it seems weird indeed. My first reaction was also that as there was no 
use of the isosurface in a CSG, the max_trace could remain at its default 
value. Either we misunderstand something (I wouldn't be surprised) or it is 
a bug with the isosurface code. Maybe an expert could light our lantern...?

Thomas


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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