POV-Ray : Newsgroups : povray.binaries.images : Scattering media help Server Time
7 Nov 2024 13:39:14 EST (-0500)
  Scattering media help (Message 1 to 10 of 24)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Mike Horvath
Subject: Scattering media help
Date: 25 Jan 2016 03:41:51
Message: <56a5dfcf@news.povray.org>
I'm trying to add some haze as seen in the attached image I rendered a 
long time ago. Unfortunately, I lost the code I used at the time, and my 
current code is not working at all. Can anyone please assist? Here is my 
current non working code, thanks.

#local atmos_material = material
{
	// check TexQual here?
	texture {pigment {gamma_color_adjust(1) transmit 1}}
	interior
	{
		media
		{
			scattering
			{
				4, color rgb <0.2,0.4,1.0>/10000	// crappy approximaion of TerraPOV 
value
				extinction	1
			}
			samples	1,1
			density
			{
				cylindrical
				poly_wave	0.25
				color_map
				{
					[0	srgb 1.0]
					[1	srgb 0.0]
				}
			}
		}
	}
	scale	city_radius
	rotate	x * 90
}


Post a reply to this message


Attachments:
Download 'gh_scene_spinner_interior_06.png' (477 KB)

Preview of image 'gh_scene_spinner_interior_06.png'
gh_scene_spinner_interior_06.png


 

From: Kenneth
Subject: Re: Scattering media help
Date: 25 Jan 2016 04:30:06
Message: <web.56a5e94e53fb38f933c457550@news.povray.org>
Here's a 'complete' scene including your scattering media (with a camera and a
light-- having a LIGHT is important for seeing this media type) plus a HOLLOW
container object for the media to be enclosed in. (A simple sphere here.) At
least you'll see *something* now! ;-)

Note a few changes: I changed the material's pigment color to plain srgbt 1, for
simplicity. I eliminated the '10000' divisor in your media color, as that would
have made the media way too dark to see (or not enough 'density'). I also
commented-out the scale and rotation at the end of the material statement;
that's probably best done in the OBJECT instead. (But note that scaling an
object with media also scales the media density, which you may not want.
Here's a kind of rule-of-thumb: If you scale up the size of the final object,
say scale 10, then you should probably scale the media itself to 1/10, to
compensate. *Then* experiment with further scaling if you want.)

#version 3.7
global_settings{assumed_gamma 1.0}

camera {
  perspective
  location  <0, 0, -5>
  look_at   <0, 0,  0>
  right     x*image_width/image_height
  // angle 67
}

light_source {
  0*x  // light's position (translated below)
  color rgb <1,1,1>
  translate <-20, 40, -20>
}



#local atmos_material =
     material
     {
 // check TexQual here?
     texture {
       pigment {srgbt 1}}
       interior
        {
         media
        {
          scattering
         {
         4, color rgb <0.2,0.4,1.0>// crappy approximaion of TerraPOV value
          extinction 1
          }
          samples 1,1
          density
               {
               cylindrical
               poly_wave 0.25
              color_map
                {
                 [0 srgb 1.0]
                 [1 srgb 0.0]
                 }
              }
           }
        }
 //scale 10
 //rotate x * 90
}

sphere{0,1
 hollow // IMPORTANT!
 material{atmos_material}
 }


Post a reply to this message

From: Kenneth
Subject: Re: Scattering media help
Date: 25 Jan 2016 04:50:06
Message: <web.56a5ee9e53fb38f933c457550@news.povray.org>
Forgot to mention that your 'samples' values of 1,1 in the media are *really*
low. Increase them to, say, 50,50 for much better quality (but a slower render.)


Post a reply to this message

From: Thomas de Groot
Subject: Re: Scattering media help
Date: 25 Jan 2016 07:34:36
Message: <56a6165c$1@news.povray.org>
On 25-1-2016 10:46, Kenneth wrote:
>
> Forgot to mention that your 'samples' values of 1,1 in the media are *really*
> low. Increase them to, say, 50,50 for much better quality (but a slower render.)
>
>
>

Hardly slower, and only use 1 (one) parameter as defaults are: intervals 
1 and method 3.

You can easily use samples 100 without noticeable slowing down.

-- 
Thomas


Post a reply to this message

From: clipka
Subject: Re: Scattering media help
Date: 25 Jan 2016 09:05:01
Message: <web.56a62b6553fb38f9ad6fa18f0@news.povray.org>
Mike Horvath <mik### [at] gmailcom> wrote:
> I'm trying to add some haze as seen in the attached image I rendered a
> long time ago. Unfortunately, I lost the code I used at the time, and my
> current code is not working at all. Can anyone please assist? Here is my
> current non working code, thanks.

Did you make sure that the object containing the media has "hollow on"?


Post a reply to this message

From: Alain
Subject: Re: Scattering media help
Date: 25 Jan 2016 14:38:41
Message: <56a679c1@news.povray.org>
Le 16-01-25 03:42, Mike Horvath a écrit :
> I'm trying to add some haze as seen in the attached image I rendered a
> long time ago. Unfortunately, I lost the code I used at the time, and my
> current code is not working at all. Can anyone please assist? Here is my
> current non working code, thanks.
>
> #local atmos_material = material
> {
>      // check TexQual here?
>      texture {pigment {gamma_color_adjust(1) transmit 1}}
>      interior
>      {
>          media
>          {
>              scattering
>              {
>                  4, color rgb <0.2,0.4,1.0>/10000    // crappy
> approximaion of TerraPOV value
>                  extinction    1
>              }
>              samples    1,1

Ok ONLY if using sampling method 1 or 2.
For the default method 3, use only a single value NO SMALLER than 3. In 
your case, the default of 10 should be correct.
NEVER set intervals but rely on the default value of 1. Larger values 
dramaticaly slow you down and can introduce artefacts.

>              density
>              {
>                  cylindrical
>                  poly_wave    0.25
>                  color_map
>                  {
>                      [0    srgb 1.0]
>                      [1    srgb 0.0]
>                  }
>              }
>          }
>      }
>      scale    city_radius
>      rotate    x * 90
> }

Make absolutely sure that you set any container object to hollow.
Also, if enclosed into another object that is not the container, that 
object to need to be set as hollow.
If you use a world sphere, that MUST be set as hollow.

Alain


Post a reply to this message

From: Mike Horvath
Subject: Re: Scattering media help
Date: 25 Jan 2016 15:06:17
Message: <56a68039$1@news.povray.org>
On 1/25/2016 4:28 AM, Kenneth wrote:
>
> Here's a 'complete' scene including your scattering media (with a camera and a
> light-- having a LIGHT is important for seeing this media type) plus a HOLLOW
> container object for the media to be enclosed in. (A simple sphere here.) At
> least you'll see *something* now! ;-)

I should have clarified. I can *see* the media, it is either the right 
color but too dense if I set the scattering to <0.2,0.4,1.0>, or it is 
properly dense but too dark. There seems to be no way to set the density 
independently of the color.


> Note a few changes: I changed the material's pigment color to plain srgbt 1, for
> simplicity. I eliminated the '10000' divisor in your media color, as that would
> have made the media way too dark to see (or not enough 'density'). I also
> commented-out the scale and rotation at the end of the material statement;
> that's probably best done in the OBJECT instead. (But note that scaling an
> object with media also scales the media density, which you may not want.
> Here's a kind of rule-of-thumb: If you scale up the size of the final object,
> say scale 10, then you should probably scale the media itself to 1/10, to
> compensate. *Then* experiment with further scaling if you want.)

I can't scale the container object because the container object is 
already the correct size to begin with. Scaling it any further would 
make it the wrong size.


Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: Scattering media help
Date: 25 Jan 2016 15:07:47
Message: <56a68093$1@news.povray.org>
Here is the code for the container object:


#local atmos_object = difference
{
	merge
	{
		cylinder {+z*(city_length/2), -z*(city_length/2), city_radius}
		Spheroid(+z*(city_length/2), 
<inner_shell_radius3,inner_shell_radius3,inner_shell_bulge>)
		Spheroid(-z*(city_length/2), 
<inner_shell_radius3,inner_shell_radius3,inner_shell_bulge>)
		hollow
	}
	hollow
	material {atmos_material}
}


Post a reply to this message

From: Kenneth
Subject: Re: Scattering media help
Date: 25 Jan 2016 15:30:01
Message: <web.56a6839753fb38f933c457550@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:
> On 25-1-2016 10:46, Kenneth wrote:


>
> Hardly slower...
>
> You can easily use samples 100 without noticeable slowing down.
>

Interesting. On my old single-core Windows machine, samples of 50 is definitely
slower than samples of 1-- which I'm used to seeing anyway, in POV-Ray versions
3.61 and v3.62. As I understand, v3.7 was basically designed for multi-core
machines, not my old 'clunker.' (In fact, I've noticed that all of my older 3.62
scenes render a bit slower in v3.7, across the board.)

*Someday*, I'll upgrade to a multi-core machine, and join the 20th century
(oops, I mean the 21st century.)  ;-)


Post a reply to this message

From: clipka
Subject: Re: Scattering media help
Date: 25 Jan 2016 15:47:00
Message: <56a689c4$1@news.povray.org>
Am 25.01.2016 um 21:06 schrieb Mike Horvath:
> On 1/25/2016 4:28 AM, Kenneth wrote:
>>
>> Here's a 'complete' scene including your scattering media (with a
>> camera and a
>> light-- having a LIGHT is important for seeing this media type) plus a
>> HOLLOW
>> container object for the media to be enclosed in. (A simple sphere
>> here.) At
>> least you'll see *something* now! ;-)
> 
> I should have clarified. I can *see* the media, it is either the right
> color but too dense if I set the scattering to <0.2,0.4,1.0>, or it is
> properly dense but too dark. There seems to be no way to set the density
> independently of the color.

The question to be examined here is this:

Is the media not to your liking because it differs from the original
image, or because you think it looks wrong?

Your original image may have been generated by a version of POV-Ray that
got the maths wrong, for instance because it didn't use proper gamma
handling or because of certain bugs that have been eliminated by now.

If you use "assumed_gamma 1" in the global settings, and "extinction 1"
in the scattering media declaration, then the results will be physically
accurate under the given lighting conditions and for a medium that is
purely scattering. There is no additional tweakable -- nor is there any
physical justification for one -- that you could use to mess with the
brightness.

Unless the medium is supposed to be partially absorbing (in which case
you could model this by setting the "extinction" parameter to a value
>1, or explicitly adding an absorbing component to the media statement)
or glowing (which you could model by setting the "extinction" parameter
to a value <1, or explicitly adding an emitting component).

So if you want realism, you should stick to the current settings. If on
the other hand you want a certain effect and screw realism, you are free
to mess with the "extinction" parameter to brighten up the haze.


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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