POV-Ray : Newsgroups : povray.advanced-users : Interference in media Server Time
1 Nov 2024 05:21:46 EDT (-0400)
  Interference in media (Message 1 to 9 of 9)  
From: Timothy Groves
Subject: Interference in media
Date: 1 Feb 2008 06:17:43
Message: <47a2ffd7@news.povray.org>
I've been trying to generate a warp-field type effect, and whenever the 
two spheres containing the media intersect, unpleasant things happen.

I've tried both a union and a merge of the two spheres, but the results 
are the same.  And equally poor either way.

I'll attach a code snippet and a picture of the problem.

Any suggestions on how to fix it?


#declare cherenkov_radiation = sphere {
	<0, 0, 0>, 1
	hollow
	pigment {
		rgbf 1
		}
	interior {
		media {
			emission rgb 1
			absorption rgb <0, 0, 0.5>			
			density {
				spherical
				color_map {
					[0 rgb 0]
					[0.25 rgb <0, 0.0005, 0.001>]
					[0.5 rgb <0, 0.001, 0.002>]
					[0.75 rgb <0.001, 0.002, 0.002>]
					[1 rgb 0]
					}
				}
			}
		}
	}
	

union {
	object {
		kepler // The Starship Model
		}
	#if (c_size > 0)
		merge {
			object {
				cherenkov_radiation
				scale <70, 70, 2000>
				translate <65, 15, -54>
				}
			object {
				cherenkov_radiation
				scale <70, 70, 2000>
				translate <-65, 15, -54>
				}
			}
	#end
	translate loc
	}


Post a reply to this message


Attachments:
Download 'kepler-warpout-143.png' (177 KB)

Preview of image 'kepler-warpout-143.png'
kepler-warpout-143.png


 

From: nemesis
Subject: Re: Interference in media
Date: 1 Feb 2008 10:28:01
Message: <47a33a81$1@news.povray.org>
yes, I've had that problem as well, with two clouds contained in two 
spheres.  I was hoping to get the clouds shapes merged as well:  the 
coinciding surfaces is very visible.  If anyone knows how to solve this...


Post a reply to this message

From: Alain
Subject: Re: Interference in media
Date: 1 Feb 2008 14:09:22
Message: <47a36e62$1@news.povray.org>
Timothy Groves nous apporta ses lumieres en ce 2008/02/01 06:17:
> I've been trying to generate a warp-field type effect, and whenever the 
> two spheres containing the media intersect, unpleasant things happen.
> 
> I've tried both a union and a merge of the two spheres, but the results 
> are the same.  And equally poor either way.
> 
> I'll attach a code snippet and a picture of the problem.
> 
> Any suggestions on how to fix it?
> 
> 
> #declare cherenkov_radiation = sphere {
>     <0, 0, 0>, 1
>     hollow
>     pigment {
>         rgbf 1
>         }
>     interior {
>         media {
>             emission rgb 1
>             absorption rgb <0, 0, 0.5>           
>             density {
>                 spherical
>                 color_map {
>                     [0 rgb 0]
>                     [0.25 rgb <0, 0.0005, 0.001>]
>                     [0.5 rgb <0, 0.001, 0.002>]
>                     [0.75 rgb <0.001, 0.002, 0.002>]
>                     [1 rgb 0]
>                     }
>                 }
>             }
>         }
>     }
>     
> 
> union {
>     object {
>         kepler // The Starship Model
>         }
>     #if (c_size > 0)
>         merge {
>             object {
>                 cherenkov_radiation
>                 scale <70, 70, 2000>
>                 translate <65, 15, -54>
>                 }
>             object {
>                 cherenkov_radiation
>                 scale <70, 70, 2000>
>                 translate <-65, 15, -54>
>                 }
>             }
>     #end
>     translate loc
>     }
> 
> ------------------------------------------------------------------------
> 
I'd use a flatened sphere just large enough to completely contain the two medias.
The render time will be somewhat longer, but emissive media is prety fast.

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when you can no longer tell the 
difference between the top raytracing book and the "Raytracing for Dummies" 
book. To you, they're both hopelessly uninformed.
     -- Taps a.k.a. Tapio Vocadlo


Post a reply to this message

From: nemesis
Subject: Re: Interference in media
Date: 1 Feb 2008 14:15:54
Message: <47a36fea@news.povray.org>
Alain wrote:
> I'd use a flatened sphere just large enough to completely contain the 
> two medias.
> The render time will be somewhat longer, but emissive media is prety fast.

sometimes, the simplest solutions are hard to see.  You're very right: 
putting two medias, each one translated from the other, should work. 
Somehow, I got into thinking that, because the media shape is spherical, 
they should each be contained in its own sphere... :P

Thanks, Columbus...


Post a reply to this message

From: Timothy Groves
Subject: Re: Interference in media
Date: 1 Feb 2008 15:05:52
Message: <47a37ba0$1@news.povray.org>
nemesis wrote:
> Alain wrote:
>> I'd use a flatened sphere just large enough to completely contain the 
>> two medias.
>> The render time will be somewhat longer, but emissive media is prety 
>> fast.
> 
> sometimes, the simplest solutions are hard to see.  You're very right: 
> putting two medias, each one translated from the other, should work. 
> Somehow, I got into thinking that, because the media shape is spherical, 
> they should each be contained in its own sphere... :P

And I was silly enough to think you could only have one media effect per 
object.

> Thanks, Columbus...

Indeed.


Post a reply to this message

From: Alain
Subject: Re: Interference in media
Date: 1 Feb 2008 16:02:20
Message: <47a388dc$1@news.povray.org>
Timothy Groves nous apporta ses lumieres en ce 2008/02/01 15:05:
> nemesis wrote:
>> Alain wrote:
>>> I'd use a flatened sphere just large enough to completely contain the 
>>> two medias.
>>> The render time will be somewhat longer, but emissive media is prety 
>>> fast.
>>
>> sometimes, the simplest solutions are hard to see.  You're very right: 
>> putting two medias, each one translated from the other, should work. 
>> Somehow, I got into thinking that, because the media shape is 
>> spherical, they should each be contained in its own sphere... :P
> 
> And I was silly enough to think you could only have one media effect per 
> object.
> 
>> Thanks, Columbus...
> 
> Indeed.
One container can contain multiple medias. They will add.
One media can have multiple densities. They will multiply.

-- 
Alain
-------------------------------------------------
Atheism: I can't believe this shit!


Post a reply to this message

From: Tim Nikias
Subject: Re: Interference in media
Date: 2 Feb 2008 18:04:05
Message: <47a4f6e5$1@news.povray.org>
Timothy Groves wrote:
> I've been trying to generate a warp-field type effect, and whenever the 
> two spheres containing the media intersect, unpleasant things happen.
> 
> I've tried both a union and a merge of the two spheres, but the results 
> are the same.  And equally poor either way.

Have you tried raising the max_trace_level in the global settings? 
That's sometimes a cause for such problems.

Another is the media-type you're using. I've found method 2 to be more 
time-consuming renderwise, because *you* set it up and that's the way 
it'll be rendered for every pixel that contains the media, whereas 
method 3 might go easier on the calculations if the samples allow it.

And finally: take one big object and put both medias inside, that might 
work better as well, but render slower, because there's more volume to 
check for media.

Regards,
Tim


Post a reply to this message

From: Slime
Subject: Re: Interference in media
Date: 3 Feb 2008 01:58:41
Message: <47a56621$1@news.povray.org>
> yes, I've had that problem as well, with two clouds contained in two
> spheres.  I was hoping to get the clouds shapes merged as well:  the
> coinciding surfaces is very visible.  If anyone knows how to solve this...

If you're not taking enough media samples, you get incorrect results, but
sometimes it looks good enough that you don't know or worry about it.
Unfortunately, when you intersect another transparent object with the media,
you get *different* incorrect results depending on whether the ray passes
through the second object or not. You can tell if this is the problem by
seeing if it goes away when you raise the samples a lot ("samples 1000").
Sometimes you can find an ideal number of samples that looks good and
renders fast enough... sometimes you can't.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Kenneth
Subject: Re: Interference in media
Date: 8 Feb 2008 11:45:00
Message: <web.47ac859e97e6188778dcad930@news.povray.org>
"Slime" <fak### [at] emailaddress> wrote:

> If you're not taking enough media samples, you get incorrect results, but
> sometimes it looks good enough that you don't know or worry about it.
> Unfortunately, when you intersect another transparent object with the media,
> you get *different* incorrect results depending on whether the ray passes
> through the second object or not. You can tell if this is the problem by
> seeing if it goes away when you raise the samples a lot ("samples 1000").
> Sometimes you can find an ideal number of samples that looks good and
> renders fast enough... sometimes you can't.
>

That has been my experience as well, and raising the samples value does work, as
you mentioned. Took me a long time to figure that out.  :-(

Something else to note: If you have two media container objects where one is
totally enclosed in the other, the enclosing object's samples *override* the
values for the interior media object. They seem to be totally ignored. In fact,
it seems that samples count, method and intervals for that interior object are
all ignored, and can be left out. That has its pros and cons: If for some
reason you actually *want* the interior object's media to have a different
samples count (for its visual results, for example), it can't be done. I assume
that POV-Ray just "works that way" when dealing with multiple overlapping
medias.

Ken W.


Post a reply to this message

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