radiosity in Direct3D

Started by
1 comment, last by adriano_usp 20 years, 4 months ago
Hi, Is there a way to simulate radiosity in Direct3D? I''m trying to simulate a sun light (static) using a directional light, but the effect is not very realistic... Has anyone a good hint to simulate the sun light? Thanks, Adriano.
Advertisement
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();
}
************THOUE*****Spec:Intel: 2.8GHzAti Radeon 9800 pro1024mg RAMDevelopping C# DX 9.0c appsThx you!
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

This topic is closed to new replies.

Advertisement