Archived

This topic is now archived and is closed to further replies.

radiosity in Direct3D

This topic is 5111 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

http://www.wordware.com/files/dx9/

advanced 3d game programming

chapter 9 pages 401

up here its the direct link to sources code.

the drawstring function in cGraphicLayer dont work replace with this

void cGraphic::DrawTextString(int x, int y, DWORD color, const char* str)
{
HRESULT r = 0;

if( !m_pBackSurf )
return;

// Get a handle for the font to use
HFONT hFont = (HFONT)GetStockObject( SYSTEM_FONT );

LPD3DXFONT pFont = 0;
// Create the D3DX Font
r = D3DXCreateFont( m_pD3DDevice,
14,
0,
FW_BOLD,
0,
FALSE,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH | FF_DONTCARE,
_T("Arial"),
&pFont
);
if( FAILED( r ) )
return;

// Rectangle where the text will be located
RECT TextRect = { x, y, 0, 0 };


// Calculate the rectangle the text will occupy
pFont->DrawText(NULL, str, -1, &TextRect, DT_CALCRECT, 0 );

// Output the text, left aligned
pFont->DrawText(NULL, str, -1, &TextRect, DT_LEFT, color );


// Release the font
pFont->Release();
}

Share this post


Link to post
Share on other sites
The general way to do realtime lighting on the scale of radiosity is to use lightmapping. But for the most part, that only works for static lighting, or at least fixed-position lights. Still, if you were clever, interpolating in time between two or more lightmaps might be an acceptable way to go about it, especially if combined with projective lights for direct rays.


"Sneftel is correct, if rather vulgar." --Flarelocke

Share this post


Link to post
Share on other sites