The hemicube algorithm renders the scene to 5 sides of a half-cube, from the perspective of each polygon.
Assume you place the hemicube around me and render to the 5 sides. The idea is, we can see exactly how much of each other polygon in the scene I see, and so determine the amount of light I receive from those respective polygons.
The way I did this before was using DWORD colors, and assign a different (integer) color to each poly, called its id. This allows for 16M colors using DWORDS. It worked fine with the fixed function pipeline, because I was able to choose
D3DDECLTYPE_D3DCOLOR in the vertex declaration, render to texture, and tally up the polygon coverage counts.
Now that I've switched over to shaders, I can't seem to make DWORD colors work anymore. All that works is 3x 32-bit
float-type colors (I am using Cg, so
Is there a way to force D3D9 or D3D11 to use integer colors in a shader, and if not, how can I guarantee the colors I choose as "ids" for the respective polygons will end up being distinct colors in the texture I render to?