DRW: Change clip planes API.
The draw manager now just set the number of active clip planes. It's now up to the engine to specify the plane equations as uniform/ubo/constant.
This commit is contained in:
@@ -1294,7 +1294,7 @@ static void render_scene_to_planar(
|
||||
* to invert the facing for backface culling to be the same. */
|
||||
DRW_state_invert_facing();
|
||||
|
||||
DRW_state_clip_planes_add(ped->planer_eq_offset);
|
||||
DRW_state_clip_planes_count_set(1);
|
||||
|
||||
/* Attach depth here since it's a DRW_TEX_TEMP */
|
||||
DRW_framebuffer_texture_layer_attach(fbl->planarref_fb, txl->planar_depth, 0, layer, 0);
|
||||
|
||||
@@ -480,7 +480,7 @@ void DRW_state_lock(DRWState state);
|
||||
|
||||
void DRW_state_invert_facing(void);
|
||||
|
||||
void DRW_state_clip_planes_add(float plane_eq[4]);
|
||||
void DRW_state_clip_planes_count_set(unsigned int plane_ct);
|
||||
void DRW_state_clip_planes_reset(void);
|
||||
|
||||
/* Culling, return true if object is inside view frustum. */
|
||||
|
||||
@@ -366,10 +366,10 @@ void DRW_state_invert_facing(void)
|
||||
* and if the shaders have support for it (see usage of gl_ClipDistance).
|
||||
* Be sure to call DRW_state_clip_planes_reset() after you finish drawing.
|
||||
**/
|
||||
void DRW_state_clip_planes_add(float plane_eq[4])
|
||||
void DRW_state_clip_planes_count_set(unsigned int plane_ct)
|
||||
{
|
||||
BLI_assert(DST.num_clip_planes < MAX_CLIP_PLANES-1);
|
||||
// copy_v4_v4(DST.view_data.clip_planes_eq[DST.num_clip_planes++], plane_eq);
|
||||
BLI_assert(plane_ct <= MAX_CLIP_PLANES);
|
||||
DST.num_clip_planes = plane_ct;
|
||||
}
|
||||
|
||||
void DRW_state_clip_planes_reset(void)
|
||||
|
||||
Reference in New Issue
Block a user