Line Art: Discard out of frame edges.
For scenes that have a lot of edges, this could potentially save some time generating individual strokes that are outside camera frustum. Reviewed By: Sebastian Parborg (zeddb) Differential Revision: https://developer.blender.org/D11525
This commit is contained in:
Submodule release/datafiles/locale updated: ab283053ab...4833954c0a
Submodule release/scripts/addons updated: ec07ed4c2e...f86f25e622
@@ -1372,6 +1372,24 @@ static void lineart_main_perspective_division(LineartRenderBuffer *rb)
|
||||
}
|
||||
}
|
||||
|
||||
static void lineart_main_discard_out_of_frame_edges(LineartRenderBuffer *rb)
|
||||
{
|
||||
LineartEdge *e;
|
||||
int i;
|
||||
|
||||
#define LRT_VERT_OUT_OF_BOUND(v) \
|
||||
(v && (v->fbcoord[0] < -1 || v->fbcoord[0] > 1 || v->fbcoord[1] < -1 || v->fbcoord[1] > 1))
|
||||
|
||||
LISTBASE_FOREACH (LineartElementLinkNode *, eln, &rb->line_buffer_pointers) {
|
||||
e = (LineartEdge *)eln->pointer;
|
||||
for (i = 0; i < eln->element_count; i++) {
|
||||
if ((LRT_VERT_OUT_OF_BOUND(e[i].v1) && LRT_VERT_OUT_OF_BOUND(e[i].v2))) {
|
||||
e[i].flags = LRT_EDGE_FLAG_CHAIN_PICKED;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Transform a single vert to it's viewing position.
|
||||
*/
|
||||
@@ -3911,6 +3929,8 @@ bool MOD_lineart_compute_feature_lines(Depsgraph *depsgraph,
|
||||
/* Do the perspective division after clipping is done. */
|
||||
lineart_main_perspective_division(rb);
|
||||
|
||||
lineart_main_discard_out_of_frame_edges(rb);
|
||||
|
||||
/* Triangle intersections are done here during sequential adding of them. Only after this,
|
||||
* triangles and lines are all linked with acceleration structure, and the 2D occlusion stage
|
||||
* can do its job. */
|
||||
|
Reference in New Issue
Block a user