Link Search Menu Expand Document

Filter Ecosystem

PCGEx’ handy filter system

The Filter Ecosystem is a collection of filter factory nodes that can be leveraged by numerous PCGEx nodes in a powerful and creative ways.


Table of content


PCGEx comes with its own filter ecosystem, that is used by a lot of nodes to check if specific conditions or requirements are met on a node in order to process it. It also has two standalone, very handy nodes that lets you combine any number of filters in the same spot.

PCGEx’ filter system can be slightly slower than the regular filters but saves a LOT of the extra nodes that would be required to achieve the same results.


Filtering Nodes


Uber Filter

Combine multiple filters

Uber Filter (Collection)

Combine multiple filters


Available Filters


🝖 AND / OR (Group)

Group multiple filters to set up complex AND/OR branches.

🝖 Compare Nearest (Numeric)

The Numeric Comparison Filter compares the arithmetic value of an attribute against the closest point from another dataset.

🝖 Compare (Numeric)

The Numeric Comparison Filter compares the arithmetic value of two attributes

🝖 Compare (String)

Compares two string-like attributes against each other.

🝖 Bool

Performs a simple boolean comparison, converting numeric values to true (> 0) or false (<= 0).

🝖 Within Range

Checks if an attribute value falls within a specified range.

🝖 Dot Product

Compares the dot product of two direction vectors against a third value.

🝖 Modulo Comparison

Compares the modulo of two attributes against a third operand, with configurable comparisons and tolerance.

🝖 Bounds

Checks if a point is inside or outside the provided bounds, with options for bounds types and an epsilon adjustment.

🝖 Bitmask

Checks specific flags in an int64 bitmask attribute with configurable mask types, comparisons, and an option to invert results.

🝖 Random

Random filter.

🝖 Mean Value

The Mean Value Filter compares per-point values of an attribute against the mean statistical value of that same attribute.

🝖 Self Compare (Numeric)

Compares the numeric value at one index against the same attribute at another index.

🝖 Self Compare (String)

Compares the string value at one index against the same attribute at another index.

🝖 Spline Inclusion

Checks against how a point is included in a spline.

🝖 Path Inclusion

Checks against how a point is included in a path.


Cluster-specific filters


Some nodes support-cluster specific filters, leveraging intrinsic cluster properties that are not otherwise accessible. See Cluster Filters for more details.

🝖 Adjacency (Node)

Check if adjacent node meet specific conditions

🝖 Edge Direction (Node)

Check if adjacent node meet specific conditions

🝖 Neighbors Count (Node)

Check a node’ neighbors count

🝖 Edge Direction (Edge)

Check if the edge direction is within a given range.

🝖 Endpoints Compare (Numeric)

Compare the value of an attribute on each of the edge endpoint.

🝖 Endpoints Compare (String)

Compare the value of an attribute on each of the edge endpoint.

🝖 Neighbors Count (Edge)

Check a node’ neighbors count


Optimizing

The biggest overhead of filtering is fetching attribute values : testing a lot of different attributes if much more expensive that a lot of different tests on the same attributes, as PCGEx caches attribute values before testing!

All filters come with a Priority property: that property is used internally to order filters in ascending order.
The default filtering behavior is to exit the test loop as soon as possible, whether it has an OR or AND behavior. Because of that, you should always order the tests that are the most likely to fail first.

Not all filters are created equal, and some can be much more expensive than other to test against. Simple comparisons are cheap, but on the other end a filter like 🝖 Bounds involves various transformations to be accurate.
On the other end, 🝖 Mean Value is a simple comparison but needs to first process all the available values to build statistics; hence there is no way to really compress the bulk of its cost.