|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hello,
I'm having great difficult getting emitting media (glowing red media, as in a
laser), in my scenes. First, a simple example which doesn't work:
-------------
// #include "shapes.inc"
// #include "colors.inc"
//
// camera {
// location 10
// look_at 0
// angle 45
// }
// light_source { 10
// color rgb<1, 1, 1> }
// sphere { 0, 1 color rgb<1,0,0> }
#include "colors.inc"
background { color White }
camera {
location <0, 2, -3>
look_at <0, 1, 2>
}
sphere {
<0, 1, 2>, 2
texture {
pigment { color rgbf 1 }
}
hollow
interior{
media{ emission Red intervals 30 samples 100,100 }
}
}
light_source { <2, 4, -3> color White}
-------------
even though it does work without the "media". What I'd really like to do is add
a red laser to the following scene, but all I get is a hollow tube. I've tried
both emitting and scattering media with no success. See especially the cylinder
that I've marked with a [+]. Please help me,
-------------
// This work is licensed under the Creative Commons Attribution 3.0 Unported
License.
// To view a copy of this license, visit
http://creativecommons.org/licenses/by/3.0/
// or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain
View,
// California, 94041, USA.
// Persistence Of Vision raytracer sample file.
// Utah Teapot w/ Bezier patches
// adapted by Alexander Enzmann
//
// -w320 -h240
// -w800 -h600 +a0.3
// Updated: 09Aug2008 (jh) for v3.7 distribution
// Updated: 28Sep2008 (cjc): change texture, checker color, background color.
#version 3.6;
global_settings {
assumed_gamma 1.0
photons {
spacing 0.2
autostop 1
media 60
max_trace_level 6
}
}
#include "shapes.inc"
#include "shapesq.inc"
#include "colors.inc"
#include "textures.inc"
#include "metals.inc"
#declare Use_Photons = yes;
#declare Teapot_Texture = T_Chrome_5E;
#declare Teapot_Orientation = <260., 0., 0.>;
#include "teapot.inc"
camera {
location <0.0, 0.0, -10.0>
angle 95 // direction <0.0, 0.0, 1.0>
up <0.0, 1.5, 0.0>
right x*image_width/image_height
}
light_source { 0.25*<10.0, 40.0, -30.0> colour White media_interaction on}
//light_source { <-5.0, -5.0, -5.0> colour White media_interaction on}
object{teapot translate -7.95*y-4*x}
/* Floor */
plane {
y, -8
texture {
pigment {
color red 0.9822 green 0.9015 blue 0.7695
scale 5
}
}
}
/* Back wall */
plane {
z, 100
hollow on
texture { pigment { color red 0.9903 green 0.9618 blue 0.9584 } }
}
/* Scattering media */
#declare M1 = <-0.5, -5.25, 0.5>;
light_source { M1+5*y
color rgb <1.,0.,0.> // ,0.3>
cylinder
// spotlight
point_at M1
radius 0.5
falloff 0.5
tightness 0 }
//box{
// M1 - 2*(x+y+z), M1 + 2*(x+y+z)
// pigment {rgbt <0.,0.4,0.4,0.9> } hollow
// interior
// { media
// { scattering { 1, rgb <0.1,0.1,0.1> extinction 0.9 }
// samples 300, 1000
// }
// }
//}
[+] cylinder{ M1+5*y, M1, 0.1 pigment {rgbf 1} hollow // texture { pigment {
color red 1.0 green 0.0 blue 0.0 } finish { ambient 1.0 } }
interior
{ media { emission <1.0,0.0,0.0>*72000 samples 5000,5000 } }
//{ media { scattering {1, rgb <1,0,0> extinction 0.01 } } }
}
/* Molecule */
//#declare M1 = <13., 11., -2.>;
object {molecule
scale 0.25 translate M1}
// light_source { <0,0,0> color rgb <1.,0.,0.> cylinder point_at <5,5,5> radius
10 falloff 10 tightness 0 photons {reflection on} }
#declare TRAN = <1., 1., 3.>*0.5;
#declare RS = seed(1069);
//sphere {<0,0,0>, 1. texture{ pigment{ color Yellow }} translate M1} //rgb
<51.,28.,88.>/256.}}}
//sphere {<0,0,0>, 1. texture{ pigment{ color Yellow }} translate M1+TRAN} //rgb
<51.,28.,88.>/256.}}}
union{
#for (cntr, 0, 2)
#declare randv = (<rand(RS), rand(RS), rand(RS)>-0.5)*8;
#declare randrot = <rand(RS), rand(RS), rand(RS)>*360.;
object {molecule rotate randrot translate randv}
#end
scale 0.15 translate M1 + <1., 1., -1.>*2
}
#declare TRAN = M1*10-z*2;
#declare RS = seed(1069);
//sphere {<0,0,0>, 1. texture{ pigment{ color Yellow }} translate M1} //rgb
<51.,28.,88.>/256.}}}
//sphere {<0,0,0>, 1. texture{ pigment{ color Yellow }} translate M1+TRAN} //rgb
<51.,28.,88.>/256.}}}
union{
#for (cntr, 0, 9)
#declare randv = (<rand(RS), rand(RS), rand(RS)>-0.5)*8.;
#declare randrot = <rand(RS), rand(RS), rand(RS)>*360.;
object {molecule rotate randrot translate randv}
#end
scale 0.10 translate M1 + <1., 1., -1.>*3.5
}
#declare debugin = false;
#declare My_Water = material {
texture {
pigment{ rgbf <0.9, 0.95, 1.0, 0.7> }
normal {
ripples 0.5
frequency 5
}
finish {
reflection {0.5, 1 fresnel}
conserve_energy
}
}
interior { ior 1.33 }
}
//make close drops
// #declare r1=seed(19873445);
// #declare i = 200;
// #while (i < 550)
// sphere{
// <-500*rand(r1)+250,-300*rand(r1)+300+10,450*rand(r1)+20>,4.5*rand(r1)+1
// #if (debugin = false)
// material{My_Water scale 4*rand(r1)+3 rotate<360*rand(r1),
// 360*rand(r1), 360*rand(r1)>}
// #else
// //must use random numbers so sequency will stay same as when not
// debugin
// #declare dummy1=rand(r1);
// #declare dummy2=rand(r1);
// #declare dummy3=rand(r1);
// #declare dummy4=rand(r1);
// pigment{Blue}
// #end
// translate z-30
// rotate x*40
// }
// #declare i = i + 1;
// #end
#declare drop = quartic{ <
0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 0, 0, 0, 0,
-1, 2, 0, -2, 1> }
object{ drop material{My_Water scale 1.0 rotate 22.0} scale 0.25 rotate -90*x
translate M1 + <1., 1., -1.>*5}
-------------------------
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Loren" <gre### [at] umnedu> wrote:
>
> I'm having great difficult getting emitting media (glowing red media, as in a
> laser), in my scenes. First, a simple example which doesn't work:
>
> background { color White }
>
> sphere {
> <0, 1, 2>, 2
> texture {
> pigment { color rgbf 1 }
> }
> hollow
> interior{
> media{ emission Red intervals 30 samples 100,100 }
> }
> }
The pure white background is the trouble there, the emitting media can't
subtract from that, yet scattering or absorbing media would.
> even though it does work without the "media". What I'd really like to do is add
> a red laser to the following scene, but all I get is a hollow tube. I've tried
> both emitting and scattering media with no success. See especially the cylinder
> that I've marked with a [+].
Although the parameters have been needlessly cranked up, which I presume you did
to try gaining a visible media, the problem is apparently the quartic "drop"
object at the end of the scene file.
If you add 'inverse' keyword to the "drop" the following will appear okay. I
don't know much of anything about quartic but somehow it's applying its material
to everything else without inverse being there.
While hollow will also fix that emitting media visibility it doesn't rid the
water material wrapping around the laser cylinder in version 3.7 (and 3.7.1-rc),
however material isn't seen on this cylinder in v3.6.
cylinder{ M1+5*y, M1, 0.1 pigment {rgbf 1}
hollow on
interior
{ media { emission <10,0.0,0.0> absorption <0,1,1> samples 5} }
}
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"omniverse" <omn### [at] charternet> wrote:
> "Loren" <gre### [at] umnedu> wrote:
> >
> > I'm having great difficult getting emitting media (glowing red media, as in a
> > laser), in my scenes. First, a simple example which doesn't work:
> >
> > background { color White }
> >
> > sphere {
> > <0, 1, 2>, 2
> > texture {
> > pigment { color rgbf 1 }
> > }
> > hollow
> > interior{
> > media{ emission Red intervals 30 samples 100,100 }
> > }
> > }
>
> The pure white background is the trouble there, the emitting media can't
> subtract from that, yet scattering or absorbing media would.
>
> > even though it does work without the "media". What I'd really like to do is add
> > a red laser to the following scene, but all I get is a hollow tube. I've tried
> > both emitting and scattering media with no success. See especially the cylinder
> > that I've marked with a [+].
>
> Although the parameters have been needlessly cranked up, which I presume you did
> to try gaining a visible media, the problem is apparently the quartic "drop"
> object at the end of the scene file.
>
> If you add 'inverse' keyword to the "drop" the following will appear okay. I
> don't know much of anything about quartic but somehow it's applying its material
> to everything else without inverse being there.
>
> While hollow will also fix that emitting media visibility it doesn't rid the
> water material wrapping around the laser cylinder in version 3.7 (and 3.7.1-rc),
> however material isn't seen on this cylinder in v3.6.
>
> cylinder{ M1+5*y, M1, 0.1 pigment {rgbf 1}
> hollow on
> interior
> { media { emission <10,0.0,0.0> absorption <0,1,1> samples 5} }
> }
Realizing now I left 'absorption' in there (copy paste), laser light won't cause
a shadow like that.
And I should have mentioned you could use a cylindrical density map too, for
making the beam edges fade. Only need to scale appropriately.
Bob
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Loren" <gre### [at] umnedu> wrote:
> Hello,
>
> I'm having great difficult getting emitting media (glowing red media, as in a
> laser), in my scenes. First, a simple example which doesn't work:
>
[snip]
> hollow
> interior{
> media{ emission Red intervals 30 samples 100,100 }
> }
> }
[I'm using v3.7.1 beta 9]
This may not be exactly on-topic, but I've also discovered some unexpected
behavior when trying to get a PURE-color media to render properly. (That is, a
pure-color SINGLE media.) The result shows 'transparent color', with no opacity.
For example, colors like <1,0,0> or even <1,1,0>. It happens with all three
media types-- emission, absorption and scattering (with or without extinction.)
Cranking up the 'density' of the media doesn't help.
An example with extreme values...
interior{
media{
scattering{1, 300*<1,0,0> extinction 300}
..... still shows no true opacity.
Adding an identical pure-color ABSORPTION media (or even its complementary
color)-- to try and *force* some opacity-- doesn't work either.
However, this CAN be worked around by adding absorption media with NO color (or
rather, to absorb *all* colors equally)...
absorption 5 (or whatever) -- with no zeros in the color vector
.....OR, by making the zero value(s) of the original color some small positive
value instead. (But strickly speaking, the color will no longer be 'pure.')
Just from experimenting, it's obvious that one or more zero values in the color
are the cause of this. But I'm actually more curious to know the mechanism of
why this happens. My only guess is that a zero value is somehow multiplying the
'opacity' part of the underlying code by zero(?), either as part of the original
design of the media code long ago, or perhaps as a detail that was overlooked.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Kenneth" <kdw### [at] gmailcom> wrote:
> "Loren" <gre### [at] umnedu> wrote:
> > Hello,
> >
> > I'm having great difficult getting emitting media (glowing red media, as in a
> > laser), in my scenes. First, a simple example which doesn't work:
> >
> [snip]
> > hollow
> > interior{
> > media{ emission Red intervals 30 samples 100,100 }
> > }
> > }
>
> [I'm using v3.7.1 beta 9]
> This may not be exactly on-topic, but I've also discovered some unexpected
> behavior when trying to get a PURE-color media to render properly. (That is, a
> pure-color SINGLE media.) The result shows 'transparent color', with no opacity.
> For example, colors like <1,0,0> or even <1,1,0>. It happens with all three
> media types-- emission, absorption and scattering (with or without extinction.)
> Cranking up the 'density' of the media doesn't help.
>
> An example with extreme values...
> interior{
> media{
> scattering{1, 300*<1,0,0> extinction 300}
>
> ..... still shows no true opacity.
>
> Adding an identical pure-color ABSORPTION media (or even its complementary
> color)-- to try and *force* some opacity-- doesn't work either.
>
> However, this CAN be worked around by adding absorption media with NO color (or
> rather, to absorb *all* colors equally)...
> absorption 5 (or whatever) -- with no zeros in the color vector
>
> .....OR, by making the zero value(s) of the original color some small positive
> value instead. (But strickly speaking, the color will no longer be 'pure.')
>
> Just from experimenting, it's obvious that one or more zero values in the color
> are the cause of this. But I'm actually more curious to know the mechanism of
> why this happens. My only guess is that a zero value is somehow multiplying the
> 'opacity' part of the underlying code by zero(?), either as part of the original
> design of the media code long ago, or perhaps as a detail that was overlooked.
Might only be a 'density' thing. Does seem obvious to me that without density
applied it will never be opaque while a background color exists.
Luckily I have been rendering the media sample scenes this past week by
coincidence (to see v3.7 updated in scene files), and I was thinking emissive
media seemed wrong. But maybe it isn't, not if the idea is to add colors. Which
is what happens for multiple media statements in a single object, and I guess
the same applies for a single media object as shown against a background color
other than black.
For multiplying colors, it should only be happening with single media statement
containing more than one density statement.
See sample file ..\scenes\interior\media\media4.pov
Trying things the following scene looks like it works okay, except for edges
where I attempted to keep it from being like a solid object. You can see the
additive nature of those colors. In this case density rgb 5, instead of only 1,
could be good enough.
// test laser beam
#version 3.7;
global_settings {
assumed_gamma 1
}
light_source {
-z*9, 1
rotate <60,60,0>
}
camera {
location <0,2,-8>
look_at 0
}
box { // test background
-1,1
hollow on
scale <10,10,10>
pigment {
hexagon color red 1 color green 1 color blue 1
rotate <90,0,45>
}
finish { // equalize colors to emissive media
ambient 0 diffuse 0 emission 1
}
}
#local BeamLength = 4;
#local BeamWidth = 0.5; // try 5 to 0.01 (render res. 640X480)
cylinder {
-y, y, 1 // for vertical cylindrical pattern
hollow on
pigment {rgbf 1}
finish {ambient 0 diffuse 0}
interior {
media {
emission <1,0,0> absorption <0,1,1>
//scattering {1, <1,0,0> extinction 1}
density {
cylindrical
density_map {
[0 rgb 0] // soft edges
[1 rgb 5/BeamWidth] // counteract scale
}
}
}
}
scale <BeamWidth,BeamLength,BeamWidth>
rotate z*90 // make horizontal
no_shadow // essential for laser light without shadow
}
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"omniverse" <omn### [at] charternet> wrote:
>
> Might only be a 'density' thing. Does seem obvious to me that without density
> applied it will never be opaque while a background color exists.
It has always been my understanding that a 'density' block is optional-- to
*vary* the density (and/or color) of the media, instead of having FULL density
everywhere. I.e.: no optional density block means full density in the media
object.
Looking at your laser example (nice, by the way), it does *seem* to be opague--
but that's due to the 'matching'/equalizing choice of colors for the hexagon
background. (I actually wasn't aware of this little trick.) But if you change
those colors, the red laser may or may not appear to have opacity.
Here's an example scene that shows the lack of opacity that I was talking about,
when using a pure color. (It uses a single absorption media as an example.)
Although the media appears to be 'solid' (opague) against the background, it
actually isn't, as seen on the floor plane. It's just a trick of the various
colors that are used. Then change the absorption media color to 20*<1,1,.5>, to
see the real opacity come in with a bang ;-) I.e., no zeros in the color
vector.
#version 3.71; // or 3.7
global_settings{assumed_gamma 1.0 max_trace_level 5}
camera {
perspective
location <0, .1, -8>
look_at <0, 0, 0>
right x*image_width/image_height
angle 25
}
light_source {
0*x
color rgb 1
translate <-20, 40, -10>
}
// ground plane
plane{y,-1.05
texture{pigment{checker scale 1}finish {ambient 0 emission 1 diffuse 0}}
}
// background
box{<-.5,-.5,0>,<.5,.5,0>
scale 10
texture{
pigment{
checker rgb <0,0,1> rgb 1
scale .5
}
finish{ambient 0 emission 1 diffuse 0}
}
translate 20*z
}
// media sphere
sphere{0,1
hollow on
texture{
pigment{rgbt 1
finish{ambient 0 diffuse 0}
}
interior{
media{
absorption 20*<1,1,0> // change to 20*<1,1,.5>
method 3
intervals 1
samples 50
density{
spherical
color_map{
[.25 rgb 0]
[.30 rgb 1]
}
scale 3
warp{turbulence .7 omega .5}
scale 1/3
}
} // end of media
} // end of interior
}
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Kenneth" <kdw### [at] gmailcom> wrote:
> Here's an example scene that shows the lack of opacity that I was talking
> about...
>
Forgot to mention: The light source in the code is in case you want to change my
absorption media to scattering{...}
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"omniverse" <omn### [at] charternet> wrote:
> "Kenneth" <kdw### [at] gmailcom> wrote:
> >
> > Adding an identical pure-color ABSORPTION media (or even its complementary
> > color)-- to try and *force* some opacity-- doesn't work either.
> >
>
> Trying things the following scene looks like it works okay, except for edges
> where I attempted to keep it from being like a solid object... In this case
> density rgb 5, instead of only 1, could be good enough.
>
> // test laser beam
I just discovered that you're right (and I was wrong, about this particular
case): A pure-color emitting media like <1,0,0>, along with an additional
absorption media of the COMPLEMENTARY color (<0,1,1>) and same density, does
indeed show true opacity, when both densities are made high enough. I guess I
didn't crank up the density enough in my original experiment(?). I see that the
same also applies to absorption + absorption (!), and
scattering + absorption, when using the complementary color. Thanks for your
scene code; I probably wouldn't have noticed this otherwise, in my own test
code.
Perhaps the 1's and 0's in both medias serve to 'cancel' any 'zero effect', when
used together.
So, the 'transparent color' effect (no opacity) is apparent only when using a
SINGLE pure-color media (or when adding the *same*-color absorption media to
it.)
But I'm still curious about the effect of zero(s) in a single media... ;-)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Le 17-08-31 à 18:58, Loren a écrit :
> Hello,
>
> I'm having great difficult getting emitting media (glowing red media, as in a
> laser), in my scenes. First, a simple example which doesn't work:
>
>
> -------------
> // #include "shapes.inc"
> // #include "colors.inc"
> //
> // camera {
> // location 10
> // look_at 0
> // angle 45
> // }
> // light_source { 10
> // color rgb<1, 1, 1> }
> // sphere { 0, 1 color rgb<1,0,0> }
>
> #include "colors.inc"
>
> background { color White }
Emissive media can't show against a white background. Try something MUCH
darker.
background { Cyant/5 }
or
background { Black }
>
> camera {
> location <0, 2, -3>
> look_at <0, 1, 2>
> }
>
> sphere {
> <0, 1, 2>, 2
> texture {
> pigment { color rgbf 1 }
> }
> hollow
> interior{
> media{ emission Red intervals 30 samples 100,100 }
Yuck! That WAS ok in version 3.5 and older that used sampling method 2
as the default. As of version 3.6, the sampling method is method 3 and
it must use intervals 1 (the default value).
Using method 3, more intervals only dramatically slow you down. It can
also cause some artefacts.
Also :
1) It only use a single value for samples. If a second value is used,
it's silently ignored.
2) confidance and variance are also silently ignored as they are
meaningless when you have only a single interval.
Use :
media{ emission Red samples 100 }
> }
> }
>
> light_source { <2, 4, -3> color White}
>
Defaults for media in version 3.6+
method 3
samples 10
confidance Not Applicable
variance N/A
intervals 1
jitter 1
Alain
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Kenneth" <kdw### [at] gmailcom> wrote:
> "omniverse" <omn### [at] charternet> wrote:
> > "Kenneth" <kdw### [at] gmailcom> wrote:
>
> > >
> > > Adding an identical pure-color ABSORPTION media (or even its complementary
> > > color)-- to try and *force* some opacity-- doesn't work either.
> > >
> >
> > Trying things the following scene looks like it works okay, except for edges
> > where I attempted to keep it from being like a solid object... In this case
> > density rgb 5, instead of only 1, could be good enough.
> >
> > // test laser beam
>
> I just discovered that you're right (and I was wrong, about this particular
> case): A pure-color emitting media like <1,0,0>, along with an additional
> absorption media of the COMPLEMENTARY color (<0,1,1>) and same density, does
> indeed show true opacity, when both densities are made high enough. I guess I
> didn't crank up the density enough in my original experiment(?). I see that the
> same also applies to absorption + absorption (!), and
> scattering + absorption, when using the complementary color. Thanks for your
> scene code; I probably wouldn't have noticed this otherwise, in my own test
> code.
>
> Perhaps the 1's and 0's in both medias serve to 'cancel' any 'zero effect', when
> used together.
>
> So, the 'transparent color' effect (no opacity) is apparent only when using a
> SINGLE pure-color media (or when adding the *same*-color absorption media to
> it.)
>
> But I'm still curious about the effect of zero(s) in a single media... ;-)
Well, let's think about it here.
Additive only if singular densities exist in the singular media, so zero plus
whatever other color equals the other color(s).
Yet pair up density statements in the single media and those
colors(density*absorption, or emission or both) multiply densities, therefore
zero anywhere makes same color 0. Or rather factored by that, depending on type
of media.
Or so I believe. Seems the more I talk the less sense I make to myself, possibly
everyone else too!
Where I get most confused is that factoring in of background colors, which I
think always remain additive (emitting) or subtractive (absorbing) regardless of
the media itself.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|