Add a CPU based frustum culling that's good enough for flow use case

This commit is contained in:
luisangelsm
2026-01-20 08:09:01 +01:00
parent d4fbbd5603
commit d913fa137e
2 changed files with 74 additions and 1 deletions

View File

@ -38,6 +38,9 @@ struct YACReader3DImageRHI {
float width;
float height;
// Precomputed bounding sphere radius (world-space) for fast culling
float boundingRadius;
int index;
YACReader3DVector current;
@ -245,6 +248,8 @@ protected:
void prepareDrawData(const YACReader3DImageRHI &image, bool isReflection, bool isMark,
const QMatrix4x4 &viewProjectionMatrix, float *outInstanceData,
UniformData &outUniformData);
QMatrix4x4 buildModelMatrix(const YACReader3DImageRHI &image, bool isReflection, bool isMark);
QMatrix4x4 buildModelMatrixNoScale(const YACReader3DImageRHI &image, bool isReflection, bool isMark);
void executeDrawWithOffset(QRhiCommandBuffer *cb, QRhiTexture *texture,
const float *instanceData, int uniformSlot);