/* Shuffle writes in povray-general on 8-11-2018: I need to place an object inside a (scattering) media and have the media so dense I cannot see the object from outside the media. But, and that part is giving me trouble, the media could be any color, including "dark" ones. What I actually try to achieve is to model a planet with a dense atmosphere. Like Venus or, in my case, Saturn's moon Titan. The camera will approach the body and dive into the atmosphere, revealing the terrain only at lower altitudes. You can get a pretty good idea of what I'm trying to achieve by following this link: https://www.youtube.com/watch?v=9L471ct7YDo&t=55s What I could not find is a way to set the density using a function{} block and still be able to control the color independently. Is that feasible? Bonus points if the color can be set using another function or a color map, but I could manage with a fixed color and use multiple medias. No matter what I try, I always end up seeing the body through the atmosphere. Brighter media color seems more opaque, but that is probably just an artifact and is not desirable anyway. Maybe my approach is totally wrong? Here is the most simple scene I could make to demonstrate my problem. */ //My changes to the original scene: #version 3.7; global_settings{ assumed_gamma 1.0 } camera { location <0.0 , 0.0 ,-3.0> right x*image_width/image_height look_at <0.0 , 0.0 , 0.0> } light_source { <1000, 1000, -500> color rgb 2 } //planet sphere { <0, 0, 0>, 1 pigment { color srgb <1,0,0> } scale 0.85 } //atmosphere #local AbsCol = srgb <0.1, 0.3, 0.5>; #local ScatCol = srgb <0.3, 0.2, 0.1>; #local AtmosScale = 1.3; #local MediaScale1 = 200; sphere { <0, 0, 0>, 1 pigment {rgbt 1} interior { media { absorption AbsCol*MediaScale1/AtmosScale scattering {1, ScatCol*MediaScale1/AtmosScale} density { spherical density_map { [0.01 rgb 0] //outer atmosphere boundary [0.30 rgb 1] [0.85 rgb 1] //surface of planet } } } } hollow scale AtmosScale } //cloud layer #local AbsCol = srgb <0.3, 0.3, 0.3>; #local ScatCol = srgb <0.3, 0.3, 0.3>; #local MediaScale2 = 1000; difference { sphere {0, 1.2} //top cloud layer sphere {0, 1.0} //basis cloud layer pigment {rgbt 1} interior { media { absorption AbsCol*MediaScale2 scattering {1, ScatCol*MediaScale2} density { granite density_map { [0.40 rgb 0] //no clouds [0.80 rgb 1] //clouds } warp {turbulence 0.5} scale 0.75 } } } hollow }