POV-Ray : Newsgroups : povray.binaries.images : abyss.pov media study. : abyss.pov media study. Server Time
18 Apr 2024 18:27:40 EDT (-0400)
  abyss.pov media study.  
From: William F Pokorny
Date: 18 Feb 2018 11:01:52
Message: <5a89a370@news.povray.org>
Most of my media experience is with emitting media. In an attempt to 
better understand scattering media I spent some time looking at our 
abyss.pov sample scene. I knew it to have some significant media shadow 
artifacts due the media settings. Namely multiple intervals of 3 and 
default sampling 3 and recursion 3. Turned out to be a way to look at 
assumed_gamma settings and the +ag anti-alias control with respect to 
highlights too.

Attached are two images. One is a study comprising 9 images:

1) The original 3.6 abyss.pov as rendered by 3.6.1.
2) (1) but modifying the media container so the light is outside.
3) (1) but changing the assumed_gamma to 1.0. You can get (3) to (1) 
easily in external software like gimp by applying a 1/2.2 gamma 
correction - except for tiny highlights and AA differences.
4) Is our current 3.7+ scene very like (3) except the camera view changed.
5) Some media corrections and camera view restored base upon (4).
6) (5) but modifying the media container so the light is outside.
7) (5) but gamma adjusting colors for assumed_gamma 1.0.
8) (7) but modifying the media container so the light is outside.
9) For artistic reasons using assumed_gamma srgb +ag4.4 for highlights / AA.

The other image is just comparing (1) to (9) at a larger resolution. I 
was thinking about submitting (9) on github as a replacement for our 
current abyss.pov sample scene, but I'm unsure? Probably posting my 
annotations here is enough for folks to find them on a search.

I expect Gilles knew the path he took to his artistic result. While my 
result (9) might better fit scattering media to the scene geometry in a 
way avoiding artifacts - it changes the look substantially.

Anyway, adding the very top of bottom of my current updated and 
annotated abyss.pov. I'd appreciate any review and especially 
corrections to my now somewhat improved understanding of scattering 
media behavior and +ag feature use.

Bill P.


Corrections not shown:
- Camera view restored to Gilles original. Added aspect warning check.
- Position of 'Persistence' text correct as top previously clipped.
- Rounded isosurface max gradients up as with some AA / media settings 
the current scene tripped max gradient warnings.

// Persistence Of Vision raytracer sample file.
//============================================
// The field, new improved version  October. 2001
// Copyright Gilles Tran 2001
// http://www.oyonale.com
// Simplified version of scene updated and annotated
// for v3.8. Feb 10, 2018.
//--------------------------------------------
// Render with a 2.67 ratio such as 320*120, 640*240,
// 1024*384, 1280*480
//--------------------------------------------
// -w320 -h120
// -w640 -h240 +a0.1
// -w768 -h288 +a0.1
// -w1024 -h384 +a0.1
//
//
// Note. For high quality result suggest adjusted media settings in
// comments at bottom of this file. Also aggressive adaptive
// anti-aliasing with dithering to avoid banding in the output
// image:
//     +a0.1 +am2 +r4 +thfs
//
// Note. Uncomment AreaOK=true below to turn on the area light. This
// will blur the shadow under the submarine but the rendering time
// will be extremely slow. The area light also compensates to some
// degree for any media under-sampling being itself a kind of
// additional sampling.
//
// Note. An 'assumed_gamma srgb' is being used for an artistic final
// result. With media especially, scene development is less
// confusing if done at the usual assumed_gamma of 1.0. At 1,
// densities and adjustments are more aligned with the visual
// result. For assumed_gamma other than 1.0 the visual result is
// distorted relative to the actual media densities and colors.
//
// Note. The srgb assumed_gamma essentially adds a second
// pow(color,2.2) adjustment from the internal color values on top
// of the usual one for the output file and display. POV-Ray's
// internal anti-aliasing works with a default 2.5 gamma in line
// with the usual srgb output. To handle colors - and highlights
// especially - in a manner aligned to the srgb color working space
// use +ag4.4 or similar. It's costly run time wise with deep
// adaptive anti-aliasing.

#version 3.8;

global_settings{ assumed_gamma srgb }

... (bulk of scene omitted some reformatting for posting) ...

//--------------------------------------------
// submarine and media
//--------------------------------------------
union{
   object{Submarine scale 3/4 translate z*-10 translate y*10}

//Original media container was sphere{0,1...
//In the update for the v3.8 release now using a difference so the
//light interacting with the media is outside the container.
//Perhaps intentional, perhaps not, but since v3.5 it has been the
//case with shape contained media the light being outside turns on
//media_attenuation and when inside media_attenuation is off no
//matter the setting on the light itself. When attenuation is off
//this image appears washed out.

   difference {
     // x,z scale by 2 eliminates shadow artifacts at rear of
     // media container.
     sphere{0,1 scale <2,1,2>}
     sphere{<0,1,0>,1/1.5}
     texture{pigment{Clear}}
     scale 410 hollow
     interior{
      media{
           //   Note. Tweaked media over original to not depend on
           //   weak sampling and artifacts for result.
              scattering {5,0.00133 eccentricity 0.90 extinction 1.0}
           //   Note. Original took mostly green out of the
           //   scattered light result by absorption.
           // absorption <255-23,255-171,255-239>*0.0005/255
           // intervals 1
           // method 3
           //   Note. Samples should be chosen with the media range
           //   and the size of the shapes casting shadows in mind.
           //   The old scene samples 9 equivalent worked for the sub
           //   itself, though with significant shadow artifacts, due
           //   the camera to inside media container distance being
           //   about 2000 and the sub length being maybe 700 as
           //   rotated. 2000/700 ~= 3.
           //
           //   Camera to far extent range for updated container ~=
           //   6225. Min rectangular sub extent about 130. 6225 / 130
           //   ~= 48.225. Picked 67 to allow for sub shape.
           // samples 67
           //   Note. Use the settings below for high quality renders.
           //   Need to be aggressive with adaptive sampling to
           //   minimize banding in result. A higher samples setting
           //   necessary to better resolve shadows given dimensions.
           //
           //   Min rectangular mine body extent about 13. 6225 / 13
           //   ~= 480. Picked 667 to allow for round mine body.
           // samples 667
           // aa_level 9
           // aa_threshold 0.05
      }
     }
   }

   scale 4.0
   rotate y*rotSub  translate posSub


Post a reply to this message


Attachments:
Download 'abyssbeforeafter.jpg' (172 KB) Download 'abyssmediastudy.jpg' (222 KB)

Preview of image 'abyssbeforeafter.jpg'
abyssbeforeafter.jpg

Preview of image 'abyssmediastudy.jpg'
abyssmediastudy.jpg


 

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