POV-Ray : Newsgroups : povray.newusers : Emissive media "shadow" problem - please help Server Time
25 Apr 2024 09:37:32 EDT (-0400)
  Emissive media "shadow" problem - please help (Message 1 to 8 of 8)  
From: KurtB
Subject: Emissive media "shadow" problem - please help
Date: 29 Nov 2010 17:55:00
Message: <web.4cf42ece6a873a78f5f7d8980@news.povray.org>
Hi,

In developing my first POV-Ray scene I encountered a subtle artifact and I am
not sure how to get rid of it. I have a 100% transmissive cylinder containing
identically-transformed emissive media with a cylindrical distribution. When in
front of a dark reflective texture, the edges of the cylinder appear dark (a
little bit like a shadow, but obviously not a shadow). When in front of a
brighter or flatter texture, the edges of the cylinder do not appear darker than
the surroundings--the desired effect. This artifact seems a bit stronger when
the cylinder is partially embedded in the dark-textured object. This image shows
what I mean:

http://www.freeimagehosting.net/image.php?923dd7c03e.png

Could anyone suggest what causes this, and how I might get rid of it?

The following code reproduces this scene:

background { rgb 0 }
global_settings {
      max_trace_level 256 //just in case
}

//includes
#include "golds.inc"
#include "colors.inc"

//declare textures
#declare gold = texture
{
   T_Gold_1C
}

camera { location <2, 2, -7> look_at <0,0,0> }

light_source {<20, 40, 10>, rgb 1.5 media_interaction off shadowless }

plane { y,-3
        pigment { Blue }
        finish { ambient 0 diffuse .3}
}

box { <-1,-1,-1>, <1,1,1>
   texture {gold}
}

#declare med1 = media {
   emission 7
   intervals 1
   samples 10
   method 3
   density {
        cylindrical color_map {
         [0 rgb <0,0,0>]
         [1 rgb <1,0,0>]
      }
   }
}

#declare med1cont = cylinder {
         <0,1,0>, <0,-1,0>, 1
         pigment {rgbt 1}
}

merge {
   object { med1cont
      scale <.1,1.1,.1>
      translate <1,0,-1>
   }
   object { med1cont
      scale <.1,1.1,.1>
      translate <0,0,-2>
   }
   interior {
      media { med1
         scale <.1,1.1,.1>
         translate <1,0,-1>
      }
      media { med1
         scale <.1,1.1,.1>
         translate <0,0,-2>
      }
   }
   hollow
   no_shadow
}


Post a reply to this message

From: clipka
Subject: Re: Emissive media "shadow" problem - please help
Date: 29 Nov 2010 18:58:48
Message: <4cf43e38$1@news.povray.org>
Am 29.11.2010 23:53, schrieb KurtB:
> Hi,
>
> In developing my first POV-Ray scene I encountered a subtle artifact and I am
> not sure how to get rid of it. I have a 100% transmissive cylinder containing
> identically-transformed emissive media with a cylindrical distribution. When in
> front of a dark reflective texture, the edges of the cylinder appear dark (a
> little bit like a shadow, but obviously not a shadow). When in front of a
> brighter or flatter texture, the edges of the cylinder do not appear darker than
> the surroundings--the desired effect. This artifact seems a bit stronger when
> the cylinder is partially embedded in the dark-textured object. This image shows
> what I mean:
>
> http://www.freeimagehosting.net/image.php?923dd7c03e.png
>
> Could anyone suggest what causes this, and how I might get rid of it?

I don't see anything strange in that image. Are you sure it's not just a 
subtle optical illusion, or a peculiarity of your display?


Post a reply to this message

From: Alain
Subject: Re: Emissive media "shadow" problem - please help
Date: 29 Nov 2010 21:35:22
Message: <4cf462ea$1@news.povray.org>

> Hi,
>
> In developing my first POV-Ray scene I encountered a subtle artifact and I am
> not sure how to get rid of it. I have a 100% transmissive cylinder containing
> identically-transformed emissive media with a cylindrical distribution. When in
> front of a dark reflective texture, the edges of the cylinder appear dark (a
> little bit like a shadow, but obviously not a shadow). When in front of a
> brighter or flatter texture, the edges of the cylinder do not appear darker than
> the surroundings--the desired effect. This artifact seems a bit stronger when
> the cylinder is partially embedded in the dark-textured object. This image shows
> what I mean:
>
> http://www.freeimagehosting.net/image.php?923dd7c03e.png
>
> Could anyone suggest what causes this, and how I might get rid of it?
>

Change your reflective box with:
box { <-1,-1,-1>, <1,1,1>
    texture {pigment{Blue}finish{reflection 1 ambient 0 diffuse 0}}
}

Presto, you can no longer see where the front cylinder get in front of 
the box.

The reason: your ground plane is pure blue -> NO red and no green.
The gold box contribure a good amount of red and green.
The red media add some red.
Result: on front of the blue parts the only red comes from the media, 
while in front of the box, you have more red giving a brighter, less 
saturated, shade.

I'd change your container as follow:
#declare med1cont = cylinder {
          <0,1,0>, <0,-1,0>, 1
          pigment {rgbt 1}
interior{media {
    emission 7
    intervals 1
    samples 10
    method 3
    density {
         cylindrical color_map {
          [0 rgb <0,0,0>]
          [1 rgb <1,0,0>]
       }
    }
}
}

Then:

union{
    object { med1cont
       scale <.1,1.1,.1>
       translate <1,0,-1>
    }
    object { med1cont
       scale <.1,1.1,.1>
       translate <0,0,-2>
    }
}

Put the media in the container defined around the Y axis.
Then, as you translate the object, it's media will get translated with it.

You don't need media_interaction off and shadowless in your light 
source, as only the box can cast a shadow.

Also, the emissive media container already don't cast any shadow, so 
no_shadow is not usefull.


Alain


Post a reply to this message

From: KurtB
Subject: Re: Emissive media "shadow" problem - please help
Date: 3 Dec 2010 04:10:00
Message: <web.4cf8b33f65f17013f5f7d8980@news.povray.org>
Thank you both for your comments so far. I really appreciate your pointers,
Alain, but I must apologize as the example I posted was not very clear. I have
played around with this a bit more, and I discovered that the artifact becomes
more pronounced if I increase the quality settings for radiosity.

High quality radiosity: http://www.freeimagehosting.net/image.php?84dfca2887.png
Low quality radiosity: http://www.freeimagehosting.net/image.php?242bc9ec78.png

You can see the artifact where the green arrow points in the first image. It is
as if the "rgb 0" part of the emissive media is emitting black, but from all I
have read in the documentation that is not how POV-Ray is supposed to work. This
time, at least, I know it is not an optical illusion (you can zoom in and see it
quite clearly on the pixel scale) or a quirk of my display (I tried it on
another display, just to be sure).

What could cause this "shadow" to appear?

Here is the same scene as I originally posted, but with the two radiosity blocks
added and the density of the emissive media modified to highlight the
cylindrical "shadow". Low quality radiosity is "RADtest"; high quality is
"RADfinal". (This scene took a bit over an hour to render on my Intel E8400
using "RADfinal" and the "+a0.0 +am2 +r4" command-line options for
anti-aliasing.)

background { rgb 0 }

#declare RADfinal = off;
#declare RADtest = off;

  global_settings {
     #if(RADfinal)
       radiosity {
        pretrace_start 0.08
        pretrace_end   0.001
        count 1600

        nearest_count 20
        error_bound 0.05
        recursion_limit 20

        low_error_factor 0.5
        gray_threshold 0.0
        minimum_reuse 0.005
        brightness 2//3

        adc_bailout 1/255

        media on
        always_sample off
       }
       ambient_light 0.5
      #end

      #if(RADtest)
       radiosity {
        pretrace_start 0.08
        pretrace_end   0.04
        count 100

        nearest_count 5
        error_bound 1
        recursion_limit 20

        low_error_factor 0.7
        gray_threshold 0.0
        minimum_reuse 0.01
        brightness 2//3

        adc_bailout 0.01

        media on
        always_sample off
       }
       ambient_light 0.5
      #end

      max_trace_level 256
}
//includes
#include "golds.inc"
#include "colors.inc"

//declare textures
#declare gold = texture
{
   T_Gold_1C
}

camera { location <2, 2, -7> look_at <0,0,0> }

light_source {<20, 40, 10>, rgb 1.5 media_interaction off shadowless }

plane { y,-3
        pigment { rgb 0.5 }
        finish { ambient 0 diffuse .3}
}

box { <-1,-1,-1>, <1,1,1>
   texture {gold}
}

#declare med1 = media {
   emission 7
   intervals 1
   samples 10
   method 3
   density {
        cylindrical color_map {
         [0 rgb <0,0,0>]
         [0.8 rgb <1,0,0>]
         [1 rgb 1]
      }
   }
   density {
      function {sin((y+1)*pi*5)*sin((y+1)*pi*5)*0.8+0.2}
      color_map {
         [0 rgb 0]
         [0.5 rgb 1]
         [1 rgb 1]
      }
   }
}

#declare med1cont = cylinder {
         <0,1,0>, <0,-1,0>, 1
         pigment {rgbt 1}
}

merge {
   object { med1cont
      scale <.1,1.1,.1>
      translate <1,0,-1>
   }
   object { med1cont
      scale <.1,1.1,.1>
      translate <0,0,-2>
   }
   interior {
      media { med1
         scale <.1,1.1,.1>
         translate <1,0,-1>
      }
      media { med1
         scale <.1,1.1,.1>
         translate <0,0,-2>
      }
   }
   hollow
   no_shadow
}


Post a reply to this message

From: clipka
Subject: Re: Emissive media "shadow" problem - please help
Date: 3 Dec 2010 09:26:42
Message: <4cf8fe22$1@news.povray.org>
Am 03.12.2010 10:07, schrieb KurtB:
> Thank you both for your comments so far. I really appreciate your pointers,
> Alain, but I must apologize as the example I posted was not very clear. I have
> played around with this a bit more, and I discovered that the artifact becomes
> more pronounced if I increase the quality settings for radiosity.

It still took me some time to recognize it, but yes, it's there: What at 
first glance looks like the edge of the cube is indeed an artifact.

Unfortunately, all I can think of right now is: "My that's weird!"

My current favorite culprit would be a problem in the radiosity code 
causing the media to illuminate only geometry outside its container. But 
that's just a guess.


Post a reply to this message

From: Alain
Subject: Re: Emissive media "shadow" problem - please help
Date: 3 Dec 2010 22:03:00
Message: <4cf9af64@news.povray.org>

> Am 03.12.2010 10:07, schrieb KurtB:
>> Thank you both for your comments so far. I really appreciate your
>> pointers,
>> Alain, but I must apologize as the example I posted was not very
>> clear. I have
>> played around with this a bit more, and I discovered that the artifact
>> becomes
>> more pronounced if I increase the quality settings for radiosity.
>
> It still took me some time to recognize it, but yes, it's there: What at
> first glance looks like the edge of the cube is indeed an artifact.
>
> Unfortunately, all I can think of right now is: "My that's weird!"
>
> My current favorite culprit would be a problem in the radiosity code
> causing the media to illuminate only geometry outside its container. But
> that's just a guess.

Your guess seems to be comfirmed in my latest test. The dark line 
disapears when you cut out the part of the cylinder that intersect the 
box and you make sure there is a narrow gap between the container and 
the box.



Alain


Post a reply to this message

From: clipka
Subject: Re: Emissive media "shadow" problem - please help
Date: 4 Dec 2010 01:24:37
Message: <4cf9dea5@news.povray.org>
Am 04.12.2010 04:02, schrieb Alain:

> Your guess seems to be comfirmed in my latest test. The dark line
> disapears when you cut out the part of the cylinder that intersect the
> box and you make sure there is a narrow gap between the container and
> the box.

Would you mind submitting a bug report on http://bugs.povray.org so this 
issue doesn't get lost?


Post a reply to this message

From: KurtB
Subject: Re: Emissive media "shadow" problem - please help
Date: 7 Dec 2010 01:05:07
Message: <web.4cfdcd6265f17013f5f7d8980@news.povray.org>
I have really enjoyed using POV-Ray so far and I am glad to see it is being
continually improved. Alain, your suggestion allowed me to remove the artifact
from my scene! Thank you both again for your help.


Post a reply to this message

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