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
Available Filters
🝖 Compare Nearest (Numeric)
The Numeric Comparison Filter compares the arithmetic value of an attribute against the closest point from another dataset.
🝖 Bool
Performs a simple boolean comparison, converting numeric values to true (> 0) or false (<= 0).
🝖 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.
🝖 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.
Cluster-specific filters
Some nodes support-cluster specific filters, leveraging intrinsic cluster properties that are not otherwise accessible. See Cluster Filters for more details.
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.