POV-Ray : Newsgroups : povray.general : Media question : Re: Media question Server Time
8 Aug 2024 08:13:09 EDT (-0400)
  Re: Media question  
From: Margus Ramst
Date: 21 Jan 2001 13:25:08
Message: <3A6B29E9.9C0DCF1A@peak.edu.ee>
Jonathan Hunt wrote:
> 
> But the problem I'm having is that with the original halo, the color_map
> gave me a graduation from 'completely transparent red' (ie. black if viewed
> on a black surface) to yellow and back again.
> 
> Where as with the media, I'm getting red to yellow to red. i.e It's
> ignoring the transparency completely, and I get a mainly red sphere
> rather than a mainly transparent one.
> 

Media does not use the filter/transmit components of the colour. Density
(transparency) is determined by the brightness of the colour(s) used, i.e. rgb
<.1,0,0> gives a much more transparent (red) media than rgb <1,0,0>

Also remember that the smaller the media container, the denser (higher rgb
value) you should make your media. This is because the smaller the container,
the less media there is to "see through", and thus the more transparent the
media will appear (at the same density).

Anyway, this should do close to what you want (untested):

media{
  emission rgb 1 //set higher to get denser (more opaque) media
  density{
    spherical
    colour_map{
      [0 rgb <0, 0, 0>] //completely transparent
      [0.25 rgb <0.5, 0, 0>] //50% density red
      [0.5 rgb <1,1,0>] //yellow
      [0.75 rgb <0.5, 0, 0>] //50% density red
      [1 rgb <0, 0, 0>] //completely transparent
    }
  }
}

-- 
Margus Ramst

Personal e-mail: mar### [at] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg
Home page http://www.hot.ee/margusrt


Post a reply to this message

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