Commit 677e32c9 by Bernhard Kerbl

Revert "Support for fill color"

This reverts commit af946bea.
parent af946bea
...@@ -264,7 +264,6 @@ __global__ void renderCUDA( ...@@ -264,7 +264,6 @@ __global__ void renderCUDA(
float* __restrict__ final_T, float* __restrict__ final_T,
uint32_t* __restrict__ n_contrib, uint32_t* __restrict__ n_contrib,
const float* __restrict__ bg_color, const float* __restrict__ bg_color,
const float* __restrict__ fill_bg_color,
float* __restrict__ out_color) float* __restrict__ out_color)
{ {
// Identify current tile and associated min/max pixel range. // Identify current tile and associated min/max pixel range.
...@@ -363,13 +362,8 @@ __global__ void renderCUDA( ...@@ -363,13 +362,8 @@ __global__ void renderCUDA(
{ {
final_T[pix_id] = T; final_T[pix_id] = T;
n_contrib[pix_id] = last_contributor; n_contrib[pix_id] = last_contributor;
for (int ch = 0; ch < CHANNELS; ch++)
if(last_contributor == 0) out_color[ch * H * W + pix_id] = C[ch] + T * bg_color[ch];
for (int ch = 0; ch < CHANNELS; ch++)
out_color[ch * H * W + pix_id] = fill_bg_color[ch];
else
for (int ch = 0; ch < CHANNELS; ch++)
out_color[ch * H * W + pix_id] = C[ch] + T * bg_color[ch];
} }
} }
...@@ -384,7 +378,6 @@ void FORWARD::render( ...@@ -384,7 +378,6 @@ void FORWARD::render(
float* final_T, float* final_T,
uint32_t* n_contrib, uint32_t* n_contrib,
const float* bg_color, const float* bg_color,
const float* fill_bg_color,
float* out_color) float* out_color)
{ {
renderCUDA<NUM_CHANNELS> << <grid, block >> > ( renderCUDA<NUM_CHANNELS> << <grid, block >> > (
...@@ -397,7 +390,6 @@ void FORWARD::render( ...@@ -397,7 +390,6 @@ void FORWARD::render(
final_T, final_T,
n_contrib, n_contrib,
bg_color, bg_color,
fill_bg_color,
out_color); out_color);
} }
......
...@@ -48,7 +48,6 @@ namespace FORWARD ...@@ -48,7 +48,6 @@ namespace FORWARD
float* final_T, float* final_T,
uint32_t* n_contrib, uint32_t* n_contrib,
const float* bg_color, const float* bg_color,
const float* fill_bg_color,
float* out_color); float* out_color);
} }
......
...@@ -38,8 +38,7 @@ namespace CudaRasterizer ...@@ -38,8 +38,7 @@ namespace CudaRasterizer
const float tan_fovx, float tan_fovy, const float tan_fovx, float tan_fovy,
const bool prefiltered, const bool prefiltered,
float* out_color, float* out_color,
int* radii = nullptr, int* radii = nullptr);
const float* fill_background = nullptr);
static void backward( static void backward(
const int P, int D, int M, int R, const int P, int D, int M, int R,
......
...@@ -205,8 +205,7 @@ int CudaRasterizer::Rasterizer::forward( ...@@ -205,8 +205,7 @@ int CudaRasterizer::Rasterizer::forward(
const float tan_fovx, float tan_fovy, const float tan_fovx, float tan_fovy,
const bool prefiltered, const bool prefiltered,
float* out_color, float* out_color,
int* radii, int* radii)
const float* fill_background)
{ {
const float focal_y = height / (2.0f * tan_fovy); const float focal_y = height / (2.0f * tan_fovy);
const float focal_x = width / (2.0f * tan_fovx); const float focal_x = width / (2.0f * tan_fovx);
...@@ -216,10 +215,9 @@ int CudaRasterizer::Rasterizer::forward( ...@@ -216,10 +215,9 @@ int CudaRasterizer::Rasterizer::forward(
GeometryState geomState = GeometryState::fromChunk(chunkptr, P); GeometryState geomState = GeometryState::fromChunk(chunkptr, P);
if (radii == nullptr) if (radii == nullptr)
{
radii = geomState.internal_radii; radii = geomState.internal_radii;
}
if (fill_background == nullptr)
fill_background = background;
dim3 tile_grid((width + BLOCK_X - 1) / BLOCK_X, (height + BLOCK_Y - 1) / BLOCK_Y, 1); dim3 tile_grid((width + BLOCK_X - 1) / BLOCK_X, (height + BLOCK_Y - 1) / BLOCK_Y, 1);
dim3 block(BLOCK_X, BLOCK_Y, 1); dim3 block(BLOCK_X, BLOCK_Y, 1);
...@@ -320,7 +318,6 @@ int CudaRasterizer::Rasterizer::forward( ...@@ -320,7 +318,6 @@ int CudaRasterizer::Rasterizer::forward(
imgState.accum_alpha, imgState.accum_alpha,
imgState.n_contrib, imgState.n_contrib,
background, background,
fill_background,
out_color); out_color);
return num_rendered; return num_rendered;
...@@ -363,7 +360,9 @@ void CudaRasterizer::Rasterizer::backward( ...@@ -363,7 +360,9 @@ void CudaRasterizer::Rasterizer::backward(
ImageState imgState = ImageState::fromChunk(img_buffer, width * height); ImageState imgState = ImageState::fromChunk(img_buffer, width * height);
if (radii == nullptr) if (radii == nullptr)
{
radii = geomState.internal_radii; radii = geomState.internal_radii;
}
const float focal_y = height / (2.0f * tan_fovy); const float focal_y = height / (2.0f * tan_fovy);
const float focal_x = width / (2.0f * tan_fovx); const float focal_x = width / (2.0f * tan_fovx);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment