|
|
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
|
|