|
|
I am looking for a possibility to render only the visible parts of some
selected objects of a scene.
The idea is, to render a given scene and place it as background in a viewer.
Selected objects, i.e. #declare(d) als 2ND_LAYER should'nt been rendered.
After that, a second render pass should render only the visible pixels of
the selected objects.
In this second pass, POV-Ray should test each ray of the image, wether it
hits one of the selected objects or not.
- If none of the selected objects is hitted by the ray, Background (Alpha 1)
or even better, the corresponding pixel of the prerendered 1ST_LAYER should
be written to the img.
- If one of the selected objects is hitted, POV-Ray should test not only the
selected objects, also the objects of 1ST-LAYER. If the selected object is
hided by one of 1ST_LAYER, background is set, else the visible pixel of the
selected object is set.
At least, the 2nd render pass is layered over the prerendered background in
the viewer.
Of course, shadows and reflection's wouldn't work correctly with this, but
it is'nt neccesary.
I work a lot with big scenes with more than 10-15k objects an even a "quick"
preview render can take a lot of time to render.
So the idea was to #declare all objects to be modified or added to the scene
as 2ND_LAYER. As long the camera and the resolution settings are'nt
changed, the prerendered background has no need to be done again.
As well, for the parts of the images, unaffected by the selected objects,
the ray tests could be skipped.
I thought about something like this:
1ST_LAYER.INC
camera
lights
#declare complete scene objects
2ND_LAYER.POV
#include "1ST_LAYER.inc"
#declare selected_objects
for each vis_ray:
#if vis_ray hits selected_object {
test vis_ray in 1ST_LAYER and selected_objects
#if vis_ray hits object_of_1ST_Layer => background
#if vis_ray hits selected_objects =>
union { selected_objects }
}
Since I'm not very familiar with #macros, I don't know if this is possible?
Otherwise, to implement this in the C-sourcecode?
Looking a little bit further, this could be quite helpful to place and
modify objects interactive in a POV-Frontend (just a thought)
Any ideas?
P.S.: I'm working on UNIX-Systems, perl-scripting etc should be OK for me
too:-)
Post a reply to this message
|
|