Jump to content
  • Advertisement

Archived

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

adriano_usp

radiosity in Direct3D

This topic is 5451 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

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.

Share this post


Link to post
Share on other sites
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();
}

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!