 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |