Consider using a mental ray shader of type "texture".

Texture shaders are the miscellaneous category of mental ray shaders that can 
be applied in any context.  If you only want visible polygons, then create a 
renderpass and apply your shader as an override to the partition containing all 
the objects you're interested in.

The advantage to this technique is the shader will only be called for polygons 
that have to be rendered taking care of your occlusion issue as well as objects 
outside the near/far clip planes.  Your shader code only needs to build a data 
structure containing the IDs of the rendered triangles and dump the results.


Matt




From: [email protected] 
[mailto:[email protected]] On Behalf Of Jared Glass
Sent: Tuesday, June 12, 2012 12:02 AM
To: [email protected]
Subject: Get objects visible by camera

Hi
I know this may be a bit ambitious but I am looking for a way to get all the 
objects or a count of faces visible by the camera. I don't want all the objects 
within the camera's near and far clip planes because some objects may not be 
visible due to being behind other objects and therefore will not contribute to 
render times. I've done a bit of research and so far the simplest solution 
looks like I'd need to write my own simple ray-tracer which emits rays from the 
camera and then returns the objects that the rays hit...though I must admit 
with my current programming and xsi knowledge this is a bit over my head (for 
now ;)

Can anyone point me in the right direction, or does someone have any idea how I 
could acheive this please?
--
Kind Regards,
Jared Glass<mailto:[email protected]> | Technical Lead
Triggerfish Animation Studios<http://www.triggerfish.co.za>
Zambezia Movie<http://www.zambeziamovie.com/> | Khumba 
Movie<http://www.triggerfish.co.za/khumba/>

Reply via email to