BYTE r = GetRValue(tempSphere->color)*DIFFUSE_COEF * lambert;
where i multiply everything as I should in the first place I get this:
BYTE r = GetRValue(tempSphere->color)*DIFFUSE_COEF * lambert;
Quote:
BYTE r = GetRValue(tempSphere->color)+DIFFUSE_COEF * lambert;
BYTE g = GetGValue(tempSphere->color)+DIFFUSE_COEF * lambert;
BYTE b = GetBValue(tempSphere->color)+DIFFUSE_COEF * lambert;
tempSphere->color = RGB(r, g, b);
Quote:
Hi, first of all, I highly suggest you to use normalized color values (0-1). This not only simplifies the whole pipeline, but also let you represent higher than white value (bright lights, or why not? HDR rendering).
Quote:
cignox1
BYTE r = GetRValue(tempSphere->color) * DIFFUSE_COEF * lambert;
BYTE g = GetGValue(tempSphere->color) * DIFFUSE_COEF * lambert;
BYTE b = GetBValue(tempSphere->color) * DIFFUSE_COEF * lambert;
Quote:
Are you sure you want to store the final rgb in the objects rgb? Wouldn't that rewrite the color, then screw the whole thing to hell?