D3DLOCKED_RECT sRect;
lightMap ->LockRect(0, &sRect, NULL, NULL);
D3DXFLOAT16 *bytes = (D3DXFLOAT16*)sRect.pBits;
for(int y=0;y<128;y++)
for(int x=0;x<128;x++)
{
D3DXFLOAT16 *b = bytes + y * (sRect.Pitch / 4) + x;
if (*b > 0)
{
uvCount++;
flat[2].pixPos[uvCount].x = *b.r;
flat[2].pixPos[uvCount].y = *b.g;
flat[2].pixPos[uvCount].z = *b.b;
}
}
lightMap->UnlockRect(0);
Some may look at the code above and say "What an idiot..." But, I have no clue what to do next. It's one of those little tidbits on google that seems to be impossible to find without some key word.
I can get the pixel information out of this floating point texture, but I don't seem to be able to access the specific color channels (rgb and a). Is there a special variable declaration I need? Is it possible to use a vector? I was told I needed to use D3DXFLOAT16 to get the info out.












