hidden_surface(3G)
NAME
hidden_surface − enable/disable hidden surface removal
SYNOPSIS
C Syntax:
int hidden_surface(fildes,hsr_on,cull);
int fildes,hsr_on,cull;
FORTRAN77 Syntax:
integer*4 function hidden_surface(fildes,hsr_on,cull)
integer*4 fildes,hsr_on,cull
Pascal Syntax:
function hidden_surface(fildes,hsr_on,cull:integer):integer;
DESCRIPTION
Input Parameters
fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened.
hsr_on Flag to enable/disable hidden surface processing. If hsr_on is TRUE (1), hidden surface processing is enabled. If FALSE (0), hidden surface processing is disabled.
cull Flag to enable/disable backfacing polygon culling. If cull is TRUE (1), culling is enabled; if FALSE (0), culling is disabled.
Discussion
Hidden_surface specifies whether or not hidden surface removal is to be performed. If hsr_on is FALSE (0), output primitives are drawn without regard to hidden surface processing. If hsr_on is TRUE (1), output primitives are drawn using z-buffer hidden surface removal.
Hidden_surface returns the number of times polygon information must be sent for a complete picture. If the function returns a number greater than one, the data must be sent n times and calls must be made to zbuffer_switch to render the entire area. This number is a function of the size of the display area to be used for hidden-surface-removal rendering and the size of the z-buffer. The portion of the display surface to be used for hidden-surface-removal rendering is defined by the viewport limits (see view_port), and the size of the z-buffer can be set in a device-dependent manner using gescape.
When hidden_surface is enabled on a device that has a z-buffer smaller than the entire display, the clip limits are set to the intersection of the z-buffer limits, the view port (as set by view_port), and the current clip limits (as set by clip_indicator). On devices which have a z-buffer the same size as the display, the clip limits are left as the current clip limits set by clip_indicator.
The z-buffer may be cleared with calls to zbuffer_switch or clear_view_surface. See these two routines and clear_control for details.
When hidden surface removal is enabled, functions that alter the z-buffer configuration (and hence, possibly the number of passes needed for hidden surface removal) are not allowed. This includes any functions that change vdcs (also changing the size of the view_port). Functions that generate an error if called with hidden surface enabled are shade_mode, double_buffer, view_port, vdc_extent, mapping_mode, set_p1_p2, and vdc_justification.
If cull is TRUE (1) and the graphics device has been opened in MODEL_XFORM mode (see gopen), polygons with normals facing away from the viewer are not rendered. The normals may be generated or supplied with each polygon (see vertex_format). If cull is FALSE (0), all polygons are rendered. Note that backface color as set by the color parameter of backface_control(3G) has no effect on backfacing polygons unless cull is FALSE.
In order for back culling to work properly with perspective views, the position of the viewer must be set with either view_camera or viewpoint. If the user is not using view_camera, but is doing his own perspective viewing matrix using view_matrix3d, the viewpoint function must be called with a POSITIONAL viewpoint to set the position of the viewer. See viewpoint(3G).
Recommendation
Enable front and back clipping (use depth_indicator) when depth cueing is enabled.
DEFAULTS
hsr_on = FALSE (0):draw output primitives without hidden surface removal
cull = FALSE (0):all polygons rendered
SEE ALSO
backface_control(3G), clear_control(3G), clear_view_surface(3G), gopen(3G), vertex_format(3G), view_camera(3G), view_port(3G), viewpoint(3G), zbuffer_switch(3G), Starbase Device Drivers Library Manual, Starbase Graphics Techniques.
Hewlett-Packard Company — HP-UX Release 9.10: April 1995