how about to change shadow logic, with some realistic shadow will be better trees and obects
idk how to build world editor shared version maybe need 2008 visual studio or smt?
bool CTerrainAccessor::SaveShadowFromD3DTexture8(const std::string & c_rstrMapName, LPDIRECT3DTEXTURE8 lpShadowTexture)
{
char szFileName[256];
DWORD ulID = (DWORD)(m_wX) * 1000L + (DWORD)(m_wY);
sprintf(szFileName, "%s\\%06u\\shadowmap.bmp", c_rstrMapName.c_str(), ulID);
D3DXSaveTextureToFile(szFileName, D3DXIFF_BMP, lpShadowTexture, NULL);
{
ilInit();
ilEnable(IL_FILE_OVERWRITE);
ILuint image;
ilGenImages(1, &image);
ilBindImage(image);
ilLoadImage(szFileName);
// Çözünürlügü artir
iluScale(4096, 4096, 1);
ilSaveImage(szFileName);
ilLoadImage(szFileName);
ilConvertImage(IL_RGBA, IL_BYTE);
iluFlipImage();
ILubyte * pRawData = ilGetData();
sprintf(szFileName, "%s\\%06u\\shadowmap.raw", c_rstrMapName.c_str(), ulID);
FILE * fp = fopen(szFileName, "w");
if (fp)
{
BYTE * pbData = (BYTE *)pRawData;
for (int h = 0; h < ilGetInteger(IL_IMAGE_HEIGHT); ++h)
{
for (int w = 0; w < ilGetInteger(IL_IMAGE_WIDTH); ++w)
{
BYTE r = *(pbData++);
BYTE g = *(pbData++);
BYTE b = *(pbData++);
BYTE a = *(pbData++);
WORD wColor = ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3);
fwrite(&wColor, sizeof(WORD), 1, fp);
}
}
fclose(fp);
}
ilDeleteImages(1, &image);
}
sprintf(szFileName, "%s\\%06u\\shadowmap.bmp", c_rstrMapName.c_str(), ulID);
DeleteFile(szFileName);
return true;
}
mapaccessorterrain.cpp file maybe this one will enhance shadow texture? I could not build the old shared source