d3d_set_zwriteenable(enable)

From ENIGMA
Jump to navigation Jump to search

Description

Sets whether or not to allow rendering to affect the depth buffer (also known as a Z-buffer). If disabled, objects will render as if hidden surface removal was not being used, but they won't effect values in the depth buffer. Definitely applicable when rendering 3D particles without artifacts or also for transparent billboards.

Parameters

Parameter Data Type Description
enable boolean whether or not to allow writing to the depth buffer for subsequent draw calls

Return Values

void: This function does not return anything.

Example Call

// demontrates rendering a transparent billboard without copying it to the zbuffer to keep it from having alpha-blending artifacts
d3d_set_zwriteenable(false);
d3d_draw_wall(0, 0, 0, 0, 1000, 600, background_get_texture(bg_example), 1, 1);