hacked lighting into im3d

This commit is contained in:
aap
2022-09-22 17:59:20 +02:00
parent d2f54a2471
commit f7e7841e1c
13 changed files with 140 additions and 30 deletions

View File

@@ -42,12 +42,16 @@ void setD3dMaterial(D3DMATERIAL9 *mat9);
struct Im3DVertex
{
V3d position;
V3d normal; // librw extension
uint32 color;
float32 u, v;
void setX(float32 x) { this->position.x = x; }
void setY(float32 y) { this->position.y = y; }
void setZ(float32 z) { this->position.z = z; }
void setNormalX(float32 x) { this->normal.x = x; }
void setNormalY(float32 y) { this->normal.y = y; }
void setNormalZ(float32 z) { this->normal.z = z; }
void setColor(uint8 r, uint8 g, uint8 b, uint8 a) { this->color = COLOR_ARGB(a, r, g, b); }
void setU(float32 u) { this->u = u; }
void setV(float32 v) { this->v = v; }
@@ -55,11 +59,16 @@ struct Im3DVertex
float getX(void) { return this->position.x; }
float getY(void) { return this->position.y; }
float getZ(void) { return this->position.z; }
float getNormalX(void) { return this->normal.x; }
float getNormalY(void) { return this->normal.y; }
float getNormalZ(void) { return this->normal.z; }
RGBA getColor(void) { return makeRGBA(this->color>>16 & 0xFF, this->color>>8 & 0xFF,
this->color & 0xFF, this->color>>24 & 0xFF); }
float getU(void) { return this->u; }
float getV(void) { return this->v; }
};
extern RGBA im3dMaterialColor;
extern SurfaceProperties im3dSurfaceProps;
struct Im2DVertex
{
@@ -386,6 +395,7 @@ enum
void lightingCB_Fix(Atomic *atomic);
int32 lightingCB_Shader(Atomic *atomic);
int32 lightingCB_Shader(void);
// for VS
void uploadMatrices(void); // no world transform
void uploadMatrices(Matrix *worldMat);