# Non-Polygonal 3D cube rasterization

Given a cube defined as:

struct Cube
{
float min[3];
float size;
};


What would be the fastest rasterization method? On the internet I only found methods that used polygons, but I think for only drawing a cube thats extremely ineffective. I don't need any depth information, I want the result to be a shadeless silhouette.

• Is this rasterization happening on CPU or GPU? Also I'm curious if there's a reason you need it to be faster than polygons as it might help shape an answer. Thanks! – Alan Wolfe Nov 13 '16 at 15:56
• GPU, OpenCL. Also why shouldn't it be faster than polygons? Why should I be looking for an algorithm, that's slower than polygons? :) – Addi Nov 13 '16 at 17:13
• Faster vs just using polygons hehe. As in... Do you have an actual usage case where you need an algorithm faster than triangles? If so, what are the details of that usage case. If it's just curiosity though, that's fine too. – Alan Wolfe Nov 13 '16 at 17:22
• Im trying to rewrite my voxel octree raycaster to a work without raycasting..if you know, what i mean. I dont want to use polygons since it seems stupid, rendering 12 individual triangles for the sake of rendering a cube, that by itself is only defined by 4 numbers and has itself some limitation of course, like rotation being impossible to be applied directly to the cube, which on the other hand is something i dont need for my renderer. – Addi Nov 13 '16 at 17:44
• it feels like maybe you could translate the 3d points and project them into 2d (think: x/z, y/z types of transforms), and then you could use some "convex hull" finding algorithm on the points to come up with a 2d poly, instead of starting with triangles. The fact that it's symmetric (since it's a cube) likely means you can do less work than transforming all of it's 8 points, or even rasterizing the whole thing. You can likely rasterize half or a quarter, and mirror it or something. – Alan Wolfe Nov 16 '16 at 1:07