Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 9e371f9a authored by bkerbl's avatar bkerbl
Browse files

Updated to version with real-time culling

parent aa1455e2
No related branches found
No related tags found
1 merge request!40core/utils: fix installDirectory method in linux
......@@ -12,7 +12,7 @@ project(sibr_${SIBR_PROJECT} LANGUAGES CXX)
sibr_gitlibrary(TARGET CudaRasterizer
GIT_REPOSITORY "https://github.com/graphdeco-inria/diff-gaussian-rasterization.git"
GIT_TAG "3a07ac2e39b9ba7043ffc8bb98397c3ba6e2532d"
GIT_TAG "1fe347d3dc87ab8b538e3d09d3b1105fc8fae4be"
)
find_package(CUDAToolkit REQUIRED)
......
......@@ -281,6 +281,7 @@ sibr::GaussianView::GaussianView(const sibr::BasicIBRScene::Ptr & ibrScene, uint
cudaMalloc((void**)&proj_cuda, sizeof(sibr::Matrix4f));
cudaMalloc((void**)&cam_pos_cuda, 3 * sizeof(float));
cudaMalloc((void**)&background_cuda, 3 * sizeof(float));
cudaMalloc((void**)&rect_cuda, 2 * P * sizeof(int));
float bg[3] = { white_bg ? 1.f : 0.f, white_bg ? 1.f : 0.f, white_bg ? 1.f : 0.f };
cudaMemcpy(background_cuda, bg, 3 * sizeof(float), cudaMemcpyHostToDevice);
......@@ -354,6 +355,7 @@ void sibr::GaussianView::onRenderIBR(sibr::IRenderTarget & dst, const sibr::Came
cudaGraphicsResourceGetMappedPointer((void**)&image_cuda, &bytes, imageBufferCuda);
// Rasterize
int* rects = _fastCulling ? rect_cuda : nullptr;
CudaRasterizer::Rasterizer::forward(
geomBufferFunc,
binningBufferFunc,
......@@ -375,7 +377,9 @@ void sibr::GaussianView::onRenderIBR(sibr::IRenderTarget & dst, const sibr::Came
tan_fovx,
tan_fovy,
false,
image_cuda
image_cuda,
nullptr,
rects
);
// Unmap OpenGL resource for use with OpenGL
......@@ -410,6 +414,7 @@ void sibr::GaussianView::onGUI()
{
ImGui::SliderFloat("Scaling Modifier", &_scalingModifier, 0.001f, 1.0f);
}
ImGui::Checkbox("Fast culling", &_fastCulling);
ImGui::End();
}
......@@ -426,6 +431,7 @@ sibr::GaussianView::~GaussianView()
cudaFree(proj_cuda);
cudaFree(cam_pos_cuda);
cudaFree(background_cuda);
cudaFree(rect_cuda);
cudaGraphicsUnregisterResource(imageBufferCuda);
glDeleteBuffers(1, &imageBuffer);
......
......@@ -85,6 +85,7 @@ namespace sibr {
std::string currMode = "Splats";
bool _fastCulling = true;
int _device = 0;
int count;
......@@ -93,6 +94,7 @@ namespace sibr {
float* scale_cuda;
float* opacity_cuda;
float* shs_cuda;
int* rect_cuda;
GLuint imageBuffer;
cudaGraphicsResource_t imageBufferCuda;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment