POV-Ray : Newsgroups : povray.advanced-users : finding depth using Megapovray Server Time
24 Nov 2024 13:04:52 EST (-0500)
  finding depth using Megapovray (Message 1 to 1 of 1)  
From: kaushik
Subject: finding depth using Megapovray
Date: 30 Dec 2006 12:35:00
Message: <web.4596a21e77e29ed9bb40afbf0@news.povray.org>
Hi,
  I am interested in finding depth of the scene. I am using Megapovray's
Post Processing tool for this. I tried 2 ways of doing this:

1) post_process { PP_Depth(1,100000)
                  save_file "depth"}
Problem with this is:
  The depth values ranges from 1 to 100000. But the save_file is saving the
depth in  a .png file, which have range 1-256. Hence the depth values gets
saturated at 255

2)To get around this problem, I used :
global_settings {
  post_process {
    function { div(f_output_depth(x,y),256*256) }   // calc of red component
    function { div(mod(f_output_depth(x,y),256*256),256) } // calc of green
    function { mod(mod(f_output_depth(x,y),256*256),256) }  //calc of blue
    function { f_output_depth(x,y) } // calc of transparency component
    save_file "duplication.png"
  }
}
 I hoped to get a 256-ary representation of depth but somehow the div and
mod operations are not working properly.


 I will be really grateful for any suggestions regarding this.
thanks
kaushik


Post a reply to this message

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