POV-Ray : Newsgroups : povray.newusers : Emitting media : Re: Emitting media Server Time
26 Apr 2024 17:01:02 EDT (-0400)
  Re: Emitting media  
From: omniverse
Date: 1 Sep 2017 09:05:00
Message: <web.59a95a94a4b127e99c5d6c810@news.povray.org>
"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

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