 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Can someone tell me why this virtually identical scene to that in the docs
doesn't show the 2 media spheres?
#version 3.8;
global_settings {assumed_gamma 1.0 }
camera {
location <0, 10, -20>
right x*image_width/image_height
up y
look_at <0, 0, 0>
}
light_source {<100, 50, -100> rgb 1}
#declare BS = 1;
plane {z, 2 texture {pigment {checker rgb 0, rgb 1 scale BS} finish {diffuse
1}} }
plane {y, -2 texture {pigment {checker rgb 0, rgb 1 scale BS} finish {diffuse
1}} }
// show all permutations of solo and mixed media
// Emitting, Absorbing, Scattering
// 15 combinations
// 5 across, 3 down
sphere {0, 1
hollow
pigment {rgbt 1}
interior {
media {
emission 1
density {
spherical
density_map {
[0 rgb 0]
[0.4 rgb <1,0,0>]
[0.8 rgb <1,1,0>]
[1 rgb 1]
}
}
}
}
translate -x*2
}
sphere {0, 1 texture {pigment {rgb 1} finish {emission 1}} }
sphere {0, 1
pigment {rgbt 1}
hollow
interior {
media {
absorption 1
density {
spherical
density_map {
[0 rgb 0]
[0.4 rgb <1,0,0>]
[0.8 rgb <1,1,0>]
[1 rgb 1]
}
}
}
}
translate x*2
}
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
This plane needs to be made 'hollow' for the media to appear:
plane {z, 2... }
That's because the spheres are located 'inside' it. (The same effect could be
achieved by using 'inverse' instead.)
Whereas, the plane{y, -2...} doesn't need the hollow keyword, as the spheres are
'outside' it.
Personally, I have always wondered why a z-plane doesn't have it's 'outside'
facing the -z direction by default, rather than the other way around. I suppose
that there are old and deep reasons for this.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Kenneth" <kdw### [at] gmail com> wrote:
> This plane needs to be made 'hollow' for the media to appear:
> plane {z, 2... }
>
> That's because the spheres are located 'inside' it. (The same effect could be
> achieved by using 'inverse' instead.)
>
> Whereas, the plane{y, -2...} doesn't need the hollow keyword, as the spheres are
> 'outside' it.
>
> Personally, I have always wondered why a z-plane doesn't have it's 'outside'
> facing the -z direction by default, rather than the other way around. I suppose
> that there are old and deep reasons for this.
Aha.
I snoozed and forgot that a plane is actually a half-space with an inside and an
outside...
So I needed a hollow plane, as ridiculous as that first sounds.
I also didn't quite know that any overlapping container needed to be hollow as
well.
I was actually starting to make some helper macros to make using media easier,
and keep track of all of the recommendations that Alain has offered over the
years.
Thanks, Kenneth!
- BW
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Bald Eagle" <cre### [at] netscape net> wrote:
> "Kenneth" <kdw### [at] gmail com> wrote:
> >
> > Personally, I have always wondered why a z-plane doesn't have it's 'outside'
> > facing the -z direction by default, rather than the other way around. I
> > suppose that there are old and deep reasons for this.
Hmm, not so deep as I thought. In the documentation for a plane:
"...most planes are defined with surface normals in the direction of an axis
[meaning the positive direction, which is not specifically mentioned.]"
"By definition the normal vector points to the outside of the plane."
So all of the three (simple) x-y-z planes have their 'outsides' in the positive
directions of the axes. That's logically consistent-- but has to be taken into
account when media is used *inside* the planes. It's a subtle "Gotcha!"
>
> I also didn't quite know that any overlapping container needed to be hollow as
> well.
>
Yeah, this situation has tripped me up in the past as well, when using planes.
We don't usually run into such problems with typical media-filled objects, or
even CSG constructs that have the proper 'master' hollow keyword.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Kenneth" <kdw### [at] gmail com> wrote:
> This plane needs to be made 'hollow' for the media to appear:
> plane {z, 2... }
>
> That's because the spheres are located 'inside' it. (The same effect could be
> achieved by using 'inverse' instead.)
>
> Whereas, the plane{y, -2...} doesn't need the hollow keyword, as the spheres
> are 'outside' it.
>
I just discovered something interesting, that I didn't know until now.
Given your enclosed 'universe' of two planes, where the media spheres (and
camera) are inside one plane (z) but outside the other (y):
If I add 'hollow' to the z-plane as mentioned, the media shows up. HOWEVER, if I
also 'inverse' the y-plane-- thus making the enclosed space 'inside' from *both*
plane's perspectives-- the media disappears again. Apparently, the space is now
sort of a mix of hollow and non-hollow. I have to add 'hollow' to the inverted
y-plane as well, to get the media to reappear.
Naively, I would have assumed that the z-plane's sole 'hollow' would have
sufficed to make the space 'safe for media' (ha), and that it would somehow
override the non-hollow y-plane space. But not so!
I'm not so sure that using planes that enclose small media objects is a good
idea anyway, but for a different reason: AFAIU, every camera-ray/pixel shot into
such a scene would have to be tested for the presence of media-- not just by
testing the small spheres themselves, but over the entire camera view. Lots of
unnecessary computational overhead, in other words. But I could be wrong(?)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Following up on this, as I was debugging / rewriting one of 00face's scenes (to
better learn about handling media myself), I ran into a curious problem where
when I halved the unnecessarily gigantic media container, it all went black.
After much experimenting, I determined that when the camera was inside the
container, it all looked fine.
When the box edge was moved in front of the camera to exclude it, the container
looked black.
I was in the middle of 3 other things at the time, and didn't have the
opportunity to whittle down the complex scene to a minimum, showing the problem
- but maybe tonight.
Until then - can anyone speculate on a potential cause?
Basically just a big box with scattering media and some light coming through a
ceiling with a lot of holes.
- BW
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Le 2025-02-24 à 09:16, Bald Eagle a écrit :
> Following up on this, as I was debugging / rewriting one of 00face's scenes (to
> better learn about handling media myself), I ran into a curious problem where
> when I halved the unnecessarily gigantic media container, it all went black.
>
> After much experimenting, I determined that when the camera was inside the
> container, it all looked fine.
> When the box edge was moved in front of the camera to exclude it, the container
> looked black.
>
> I was in the middle of 3 other things at the time, and didn't have the
> opportunity to whittle down the complex scene to a minimum, showing the problem
> - but maybe tonight.
>
> Until then - can anyone speculate on a potential cause?
>
> Basically just a big box with scattering media and some light coming through a
> ceiling with a lot of holes.
>
> - BW
>
Does increasing the mat_trace_level help ? It defaults to 5. Try
something like 7 or 8.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Alain Martel <kua### [at] videotron ca> wrote:
> Does increasing the mat_trace_level help ? It defaults to 5. Try
> something like 7 or 8.
Perhaps.
If it does, then I don't recall there being anything in the documentation or any
newsgroups threads mentioning this problem or this solution.
It's also perplexing, because I see no significant difference between the
interior block for the huge box, and those of the few test scenes that I've run
where the camera is outside of the media container.
If I have the opportunity, I'll post a trimmed-down scene later this evening.
(Unless 00face beats me to it)
- BW
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Bald Eagle" <cre### [at] netscape net> wrote:
> If I have the opportunity, I'll post a trimmed-down scene later this evening.
Here you go.
Post a reply to this message
Attachments:
Download 'mediaproblemsnippet.pov.txt' (2 KB)
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
You forgot to give your big media box a transparent pigment-- rgbt 1. Otherwise,
when the camera is outside of it, it sees a 'solid black' opaque box, the black
most likely being v3.7's default black pigment. (The v3.8 betas changed that to
white, btw.) When the camera is inside the box, it has no black walls to look
through, and sees the media anyway.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |