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:
@@ -33,7 +33,6 @@ typedef enum {
|
||||
GWN_UNIFORM_WORLDNORMAL, // mat3 WorldNormalMatrix
|
||||
GWN_UNIFORM_CAMERATEXCO, // vec4 CameraTexCoFactors
|
||||
GWN_UNIFORM_ORCO, // vec3 OrcoTexCoFactors[]
|
||||
GWN_UNIFORM_CLIPPLANES, // vec4 ClipPlanes[]
|
||||
|
||||
GWN_UNIFORM_COLOR, // vec4 color
|
||||
GWN_UNIFORM_EYE, // vec3 eye
|
||||
|
||||
@@ -45,7 +45,6 @@ static const char* BuiltinUniform_name(Gwn_UniformBuiltin u)
|
||||
[GWN_UNIFORM_WORLDNORMAL] = "WorldNormalMatrix",
|
||||
[GWN_UNIFORM_CAMERATEXCO] = "CameraTexCoFactors",
|
||||
[GWN_UNIFORM_ORCO] = "OrcoTexCoFactors",
|
||||
[GWN_UNIFORM_CLIPPLANES] = "ClipPlanes",
|
||||
|
||||
[GWN_UNIFORM_COLOR] = "color",
|
||||
[GWN_UNIFORM_EYE] = "eye",
|
||||
|
||||
@@ -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