Jump to content
  • Advertisement
Sign in to follow this  
abdellah

shadow mapping

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

in this snippet code , it is located in many articles

 

// Create the shadow map
if( FAILED( g_pd3dDevice->CreateTexture( SHADOW_MAP_SIZE, SHADOW_MAP_SIZE, 1,
                                         D3DUSAGE_RENDERTARGET, D3DFMT_R32F,
                                         D3DPOOL_DEFAULT, &g_pShadowMap,
                                         NULL ) ) )
{
MessageBox( g_hWnd, "Unable to create shadow map!",
             "Error", MB_OK | MB_ICONERROR );
return E_FAIL;
}

// Grab the texture's surface
g_pShadowMap->GetSurfaceLevel( 0, &g_pShadowSurf );

 

my question is : Is this code is located into the render loop or it is located outside of it? (i mean it must be located or not into the render loop)

Edited by abdellah

Share this post


Link to post
Share on other sites
Advertisement

You never want to be creating resources inside of your render loop. Creating resources is slow, and best done during initialization or loading.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!