Snapdragon™ Occlusion Culling (SDOC)
March 13, 2026 · View on GitHub
SDOC is a mobile-optimized version of the Open Source project https://github.com/rawrunprotected/rasterizer The related optimizations include
- Same frame skipping
- Interleave rendering
- Fast block traversal
- Mix use of triangle and quad rendering
- Checkerboard memory optimization
- Mesh rectangle simplification during baking
- Memory compression during baking
- Potential visibility for occluder occludee object
#Performance config
- The existence of the function is to guarantee the correctness of suntemple floor which is negative scaled. If no negative scaled occlude, for max performance, developers could directly return false for below function. static inline bool NeedFlipFace(const float * modelWorld) { if (modelWorld == nullptr) return false; //return true; //direct return true if no negative scale models float determinant = modelWorld[0] * (modelWorld[5] * modelWorld[10] - modelWorld[6] * modelWorld[9]) - modelWorld[1] * (modelWorld[4] * modelWorld[10] - modelWorld[6] * modelWorld[8]) + modelWorld[2] * (modelWorld[4] * modelWorld[9] - modelWorld[5] * modelWorld[8]); return determinant < 0; }
- if using RasterizeOccludeeMesh, for the fastest speed, minExtents should be provided
- if many static quad occludee, suggest using sdocQueryOccludeeQuad
- sdocQueryOccludeeSinglePoint might work for certain cases, up to users to explore
#Capture debug after engine integration
- Set up the visual studio project in Windows
- Set "developer_debug_capture" to the captured file, which should be put in the same data folder with exist captures
- following to debug 3.1 set "SDOC_DevelopMode" to 1 to enter debug mode 3.2 enable model checking, set "SaveSimplifyModel" to true, models may be saved to D:\TempSDOC 3.3 per draw depth checking, set "dumpDrawCall" to 1 3.4 assign value to "skipTheDraw" if a draw is too unreasonable
Guidance on building SDOC for Windows, Mac, Android and iOS.
Windows
- Install CMake 3.0 or higher.
- Install Visual Studio 2017 or higher.
- Open your source folder in Explorer and enter the
Source/app/FuzzyCulling/. RunGenerateProjectFiles.batto create project files for SOC. The Visual Studio project file will be generated inbuildfolder. - Unzip app\FuzzyCulling\GOLDEN_DATA\all.7z file
- Set the
SDOCReplayas StartUp Project in Visual Studio, - Visual studio opens Source\app\FuzzyCulling\build\SDOC-Lib.sln
- Set SDOCReplay project as start up project to test, compile and run
- For debug testing, set SDOC_DevelopMode to 1, set it as 0 when generating dynamic library libSDOC.quic.dll
Android use Android Studio 2024
Build the shared library
- Android Studio open the
Sourcefolder to load the project - Sync Project with Gradle Files, then setup the key for building the releasing application.
- Build->Generate Signed Bundle/APK, select release as the Build Variants.
- Unzip the APK for libSDOC.quic.so, the libSDOC.quic.so could be integrated with game engines.
Android demo to verify libSDOC.quic.so
- Put built android libSDOC.quic.so in Demo\Android\SDOCDemo\app\src\main\jnilibs
- Android Studio open Demo\Android\SDOCDemo and build the ready to run apk.
OSX
- Install CMake 3.0 or higher.
- Install the latest version of Xcode.
- Open the Terminal at the source folder and enter
Source/app/FuzzyCulling, execute the following command to generate Xcode project tobuildfolder.chmod 755 GenerateProjectFiles_Mac.command GenerateProjectFiles_Mac.command - Enter the
buildfolder and load the project into Xcode by double-clicking on theSDOC-Lib.xcodeproj. Select the ALL_BUILD as the target and then build the project. - To change the build configuration to Release, Edit Scheme in Main Menu->Product->Scheme, set the Run Executable to SDOCReplay and other
- Compile and execute. The libSDOC.quic.dylib is shared library could be integrated with game engines.
iOS
Build the static library
- Sync the submodule to get ios-cmake.
git submodule init
git submodule update
You might need to call "git submodule add https://github.com/leetal/ios-cmake.git" in the directory of Source\app\submodules if submodule init/update fail - Open the Terminal at the source folder and enter
Source/app/FuzzyCulling, execute the following command to generate Xcode project tobuildfolder.chmod 755 GenerateProjectFiles_ios.command GenerateProjectFiles_ios.command - Enter the
buildfolder and load the project into Xcode by double-clicking on theSDOC-Lib.xcodeproj. Select the ALL_BUILD as the target and then build the project. - To change the build configuration to Release, Edit Scheme in Main Menu->Product->Scheme.
iOS demo to verify
- Connect iphone
- iOS: open
Demo\iOS\iQOC.xcodeprojto build iQOC (QOC is the previous name of SDOC) - "Fail to load the file" message would show for the init run
- Cmd+shift+2 to summon iphone device UI
- from iphone device UI, select iQOC and click "App Container Action" and choose "Download Container"
- Right click the "Download Container" and choose "Show Package Contents"
- Copy files from Source\app\FuzzyCulling\GOLDEN_DATA\all to container's AppData/Documents
- From iphone device UI, click "App Container Action" and choose "Replace Container"
- Restart iQOC on the iphone
License
Snapdragon™ Occlusion Culling (SDOC) is licensed under the BSD 3-clause “New” or “Revised” License. Check out the LICENSE for more details.