![]() ![]() Some stuff has been renamed and/or removed to make it easier to understand what's going on. It's mostly actual code from the engine, but it has been cleaned up to a certain extent. I'll use a lot of code to show how it's all done. In this post, I we will first look at the single threaded SIMD code and then how the culling is distributed over multiple threads. The workload is distributed over several threads.The sphere and the OOBB culling use SIMD and only load the minimum amount of needed data.The brute force culling is pretty fast, because: That might of course change in the future, but we'll take care of that when it's an actual problem. Brute force sphere culling followed by OOBB culling is fast enough for all cases we've encountered so far. Why go over all objects brute force instead of using some sort of spatial partition data structure? We like to keep things simple and with the current setup we have yet to encounter a case where we've been bound by the culling. By rejecting objects that fail sphere culling first, we have fewer objects to process in the more expensive OOBB pass. For each frustum plane, test plane vs OOBBįrustum vs sphere tests are significantly faster than frustum vs OOBB.For objects that pass sphere test, kick jobs to do frustum vs object-oriented bounding box (OOBB) culling.For each frustum plane, test plane vs sphere. ![]() Kick jobs to do frustum vs sphere culling.Stingray accelerates it by making heavy use of SIMD and distributing the workload over several threads. Frustum culling can be an expensive operation. ![]()
0 Comments
Leave a Reply. |