|
|
Author |
Thread |
GRUMBLE
Paranoid (IV) Mad Scientist
From: Omicron Persei 8 Insane since: Oct 2000
|
posted 09-29-2002 16:35
im still stuck with media in povray. its always the same. it seems like im missing a basic thing.
im tryin to do something like a torch. where you can see the lightbeam coming out.
ok, heres the code:
code:
//cylinder with light_source inside
cylinder {<0,-1,0> <0,1,0> 1 open hollow pigment{Green}}
light_source{
<0,0,0>1
}
//sphere containing media
sphere {<0,0,0> 100 hollow
interior{
media {
emission 0.2
density {
spherical
color_map {
[0 rgb .1]
[.25 rgb .4]
[.5 rgb .7]
[.75 rgb .9]
[1 rgb 1]
}
}
}
}
}
i already played with all the values, but im not getting the effect i want.
any ideas?
|
Slime
Lunatic (VI) Mad Scientist
From: Massachusetts, USA Insane since: Mar 2000
|
posted 09-29-2002 17:20
OK, for starters, I recommend you make your media container much smaller, like 1 or 2 units big, so that it's easier to test with it.
Second, if you want media to interact with light, you need to use *scattering* media. The three media types work like this:
Emission: emitting media *always* makes things brighter. The more emitting media you have, and the thicker it is, the brighter it looks. In real life, fire is a good example of emission media. It emits light.
Absorption: absorbing media makes things darker. It sucks up light, so the bigger a container you have, the blacker things are. I'm not sure there's anything in real life that is truly just absorption media.
Scattering: Scattering is, in a sense, a combination of the two. It contains absorption media, but any part of it that is not in shadow also has emitting media. That is, it emits light wherever a lightsource is hitting it. This creates the effect of rays of light in fog, which you can see sometimes if you get up at 6 AM on a foggy morning with a lot of trees around. Normally, because the sun is so bright (much more than rgb <1,1,1> ), the rays of light are much more noticeable than the absorption. However, the absorption creates the actual fog effect, making things harder to see as you look further away.
So what you probably want for a torch creating beams of light is two things: some reddish emission media with a reasonably high density (with a light source in it), and some low-density scattering media in a larger container around it.
*however*, this may not create the effect you're going for. There is nothing casting any shadows from the light source, so there won't be any rays of light coming from anywhere: *everywhere* will be lit.
Keep in mind that scattering media is horribly slow. (Every sample of every ray has to test for the light source.) Never use it with area lights =)
|
GRUMBLE
Paranoid (IV) Mad Scientist
From: Omicron Persei 8 Insane since: Oct 2000
|
posted 09-29-2002 17:59
thanks for your help,slime! (i knew i could count on you!)
"This creates the effect of rays of light in fog, which you can see sometimes if you get up at 6 AM on a foggy morning with a lot of trees around."
that's exactly the effect im going for!
ok, with the scattering media im at least getting near that effect, but it looks kinda weird. not transparent.
there is also a small sphere above the cylinder where the light should cast shadow into the media.
do i need an emitting media too now? or is the light_source enough?
|
Slime
Lunatic (VI) Mad Scientist
From: Massachusetts, USA Insane since: Mar 2000
|
posted 09-29-2002 18:15
Looks like you need to decrease the density a *lot*. The emission (actually the reflection of light) is so strong that it doesn't look transparent. =)
As for the small sphere, the reason it's not casting a shadow is probably a combination of its small size and bad sampling. Look at the media sampling parameters part of the documentation and increase the number of samples by a lot. You need to have at least one sample fall in the shadow of the sphere for it to affect the media.
BTW: if the effect you're going for is just two cones of light, then you may want to ditch the scattering media and manually make two cones of emitting media (where the scattering media would be illuminated) along with absorption media everywhere. This will create the *effect* of scattering media without having to actually test for light sources (so it'll be faster). The disadvantage is it won't react to shadows, but sometimes that's not noticeable.
|
GRUMBLE
Paranoid (IV) Mad Scientist
From: Omicron Persei 8 Insane since: Oct 2000
|
posted 09-29-2002 18:34
ok, how do i decrease density? im using this code:
density {
spherical
color_map {
[0.0 rgb <0,0,0.5>]
[0.5 rgb <0.8, 0.8, 0.4>]
[1.0 rgb <1,1,1>]
}
}
and in the povray documentation it says:
"The default values are samples 1,1."
so i added that to my media expecting nothing changes since its the default values, but with samples 1,1 i dont see any media at all. just black.
im going to try emitting media later.
|
Slime
Lunatic (VI) Mad Scientist
From: Massachusetts, USA Insane since: Mar 2000
|
posted 09-29-2002 18:45
Ah, i'm sorry, the documentation is a little bad for this. The default is samples 1,1 for sampling method 1, but the *default sampling methid is 3*, with default samples 5,5, I believe. They didn't make this clear.
To decrease density of media uniformly, just change the emission, abrsorption, or scattering color:
"emission .1"-> "emission .05" halves the density
scattering{1, <0,.5,1>} -> scattering{1, <0,.5,1>*2} doubles the density
basically you just multiply the media color by a constant.
The density{} block can be used after that to make the density *vary* from place to place. Basicallly, at any point, the density of the media is multiplied by the color value of the density{} block's color_map, and that's the color and density of the media.
This can be a little hard to understand, because you have to realize that emission 0 doesn't create blackness, but rather it creates the absense of color: complete transparency. So while emission *creates* light, and absorption *removes* light, to get a value inbetween (like the grey color of the clouds), you must have a combination of emission and absorption. Scattering media holds this combination in one package, making the emission only visible where it's illuminated.
|
GRUMBLE
Paranoid (IV) Mad Scientist
From: Omicron Persei 8 Insane since: Oct 2000
|
posted 09-29-2002 19:03
ahhhh. now im getting it! thank you so much!
it mainly depends on the quality settings:
samples
intervals
ratio
variance
confidence
do you have any recommendations for these settings for good quality at acceptable rendertime?
|
Slime
Lunatic (VI) Mad Scientist
From: Massachusetts, USA Insane since: Mar 2000
|
posted 09-29-2002 19:11
With method 3, I rarely fiddle with intervals. (With method 1, which was the only method in v3.1, I used them all the time, not understanding how samples worked.) Ratio, confidence and variance only apply to method 1. (not sure about ratio actually. I never use it.)
So basically, just start raising the sample count until you get enough samples for it to look right. I've gone up to a few hundred samples in some cases.
I think method 1 is a lot more powerful than people think it is. It uses the same statistical calculations that focal blur uses, so it can look grainy, but with good settings I think it has the potential to create the best results with the fewest number of samples.
|
GRUMBLE
Paranoid (IV) Mad Scientist
From: Omicron Persei 8 Insane since: Oct 2000
|
posted 09-29-2002 19:25
yes, method 1 gives me grains mostly.
im playing with method 3 now, samples at 100 and intervals at 5. it seems to me as if intervals would somehow determine the "color-depth" of the media.
|
Slime
Lunatic (VI) Mad Scientist
From: Massachusetts, USA Insane since: Mar 2000
|
posted 09-29-2002 19:29
I believe it will take 100 samples for each interval, for a total of 500 samples. I'm not really sure how intervals work in method 3, though.
|
GRUMBLE
Paranoid (IV) Mad Scientist
From: Omicron Persei 8 Insane since: Oct 2000
|
posted 09-30-2002 13:03
ok, 2 more Qs:
im using
warp { turbulence <1,0.6,0.1> octaves 5 lambda 1.5 omega 0.5 }
in my density, but i dont see any difference.
am i missing something? i want to get a foggy effect. like cigarette smoke.
do you know, of any possibilities to render an alpha-channel into the picture (tif or png)?
(without the possibility to manually make the alpha-channel version of the picture.)
thanks.
|