Code: Select all
/* Calculation of smooth-shading and bump-map in one go */
if (i==M_TIREBUMP)
{
KMBumpShade (&Matrx, Mesh[M_TIREBUMP].nNumVertex, pBump[M_TIREBUMP], Mesh[M_TIREBUMP].pNormals,
KmVert[M_TIREBUMP], KmVert[M_TIRE], LightDirection, BUMP_METHOD_TRANSLUCENT);
}
Code: Select all
/* Setting UV values and colors for all the meshes */
for (i=0; i<NUM_MESHES;i++)
{
for (j=0; j<Mesh[i].nNumVertex; j++)
{
/*
* UVs have been multiplied by a number to get a more wide
* range. It's neccessary for the tire model ONLY.
*/
if(i==M_TIREBUMP || i==M_TIRE)
{
(KmVert[i]+j)->fU = *(Mesh[i].pUV+j*2+0)*8.0f;
(KmVert[i]+j)->fV = *(Mesh[i].pUV+j*2+1);
}
else
{
(KmVert[i]+j)->fU = (Mesh[i].pUV) ? *(Mesh[i].pUV+j*2+0) : 0.0f;
(KmVert[i]+j)->fV = (Mesh[i].pUV) ? *(Mesh[i].pUV+j*2+1) : 0.0f;
}
(KmVert[i]+j)->uBaseRGB.dwPacked = (i==M_PLATES || i==M_GROUND)?0xFFFFFFFF:0xFFA0A0A0;
(KmVert[i]+j)->uOffsetRGB.dwPacked = 0x00000000;
}
}
Code: Select all
void InitBumpmapMesh (int Object)
{
/*
* Local coordenates system for bump-mapping.
* 3 floats for Tanget axis and 3 floats for Binormal Axis
*/
pBump[Object] = (float *)MemPtr;
MemPtr += ((KMDWORD)(Mesh[Object].nNumVertex*sizeof(float)*6) + 0x1F) & ~0x1F; /* 32Byte Alignment */
/*
* That is the function that calculates the local coordenate system
* for every single vertex. The information is stored in pBump[]
*/
KMBumpCalculateLocalCoords (pBump[Object], BUMP_COORDS_ANYDIRECTION,
Mesh[Object].nNumVertex, Mesh[Object].pVertex, Mesh[Object].pNormals, Mesh[Object].pUV,
Mesh[Object].nNumFaces, Mesh[Object].pFaces);
}
would be a bitch to hack it into monaco though
Edit:
Code: Select all
/* Base texture for the wheel (opaque for 'translucent bumpmapping')*/
KMShellLoadTexture (&Tex[5],(unsigned long *)Tire, 128, KM_TEXTURE_TWIDDLED_MM | KM_TEXTURE_RGB565);
KMShellInitVertexContext (&VertexContext[M_TIRE], &Tex[5], VC_OPAQUE);
/* BUMP MATERIALS */
/* Tire (translucent for 'translucent bumpmapping')*/
KMShellLoadTexture (&Tex[1],(unsigned long *)TireBump, 256, KM_TEXTURE_TWIDDLED | KM_TEXTURE_BUMP );
KMShellInitVertexContext (&VertexContext[M_TIREBUMP], &Tex[1], VC_TRANS | VC_SPECULAR);
Double Edit: thats all confidential and shit so watch your back for Sega and VideoLogic Limited. LOLOLOL