Jitter raster occlusion camera to reduce false positives.
Due to the low resolution of the occlusion buffer, small gaps between occluders can be closed and incorrectly occlude instances which should show through the gaps. To ameliorate this problem, this PR jitters the occlusion buffer over time, making it more likely an instance will be seen through a gap. This is used in conjunction with an occlusion timer per instance, to prevent instances flickering on and off rapidly.
This commit is contained in:
@@ -286,6 +286,13 @@ public:
|
||||
Instance *instance = nullptr;
|
||||
int32_t parent_array_index = -1;
|
||||
int32_t visibility_index = -1;
|
||||
|
||||
// Each time occlusion culling determines an instance is visible,
|
||||
// set this to occlusion_frame plus some delay.
|
||||
// Once the timeout is reached, allow the instance to be occlusion culled.
|
||||
// This creates a delay for occlusion culling, which prevents flickering
|
||||
// when jittering the raster occlusion projection.
|
||||
uint64_t occlusion_timeout = 0;
|
||||
};
|
||||
|
||||
struct InstanceVisibilityData {
|
||||
|
||||
Reference in New Issue
Block a user