diff options
Diffstat (limited to 'src/mesh.h')
-rw-r--r-- | src/mesh.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -148,6 +148,23 @@ __global__ void set_colors(unsigned int *colors) g_colors = colors; } +__global__ void color_solids(int nthreads, unsigned int ntriangles, int *solid_id_map, int *solid_ids, unsigned int *solid_colors) +{ + int id = blockIdx.x*blockDim.x + threadIdx.x; + + if (id >= nthreads) + return; + + int solid_id = solid_ids[id]; + unsigned int color = solid_colors[id]; + + for (int i=0; i < ntriangles; i++) + { + if (solid_id_map[i] == solid_id) + g_colors[i] = color; + } +} + } // extern "c" #endif |