summaryrefslogtreecommitdiff
path: root/src/mesh.h
diff options
context:
space:
mode:
authorStan Seibert <stan@mtrr.org>2011-08-08 15:37:21 -0400
committerStan Seibert <stan@mtrr.org>2011-08-08 15:37:21 -0400
commitfd2cba0f96e2d145e6a2b6e3df91cb6e942c114c (patch)
treebcb6b902c10d8cafa00e228b634e5a0fbd6bf6ae /src/mesh.h
parent09e042b8888342ed8fc7a8c5b05ea1caa47a3842 (diff)
parented642493fccbcf13efef5491f73241c6a9434ad8 (diff)
downloadchroma-fd2cba0f96e2d145e6a2b6e3df91cb6e942c114c.tar.gz
chroma-fd2cba0f96e2d145e6a2b6e3df91cb6e942c114c.tar.bz2
chroma-fd2cba0f96e2d145e6a2b6e3df91cb6e942c114c.zip
Merge Tony's changes.
Diffstat (limited to 'src/mesh.h')
-rw-r--r--src/mesh.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesh.h b/src/mesh.h
index ec5a508..e0170ff 100644
--- a/src/mesh.h
+++ b/src/mesh.h
@@ -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