Jump to content
  • Advertisement
Sign in to follow this  
jzpijiang

soft-edged shadow

This topic is 4232 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,I'm a Chinese learner of soft shadow.I have read your article about soft-edged shadow.The effect looks very nice,so I want to apply this method to my project to add the soft shadow effect.But now,I have some questions about that. First ,when bluring the screenmap,why need draw the two quard. Second ,I don't make out the basic idea about gaussian filter ,can you give me some article about that? g_pd3dDevice->SetRenderTarget( 0, g_pBlurSurf[1] ); g_pd3dDevice->SetDepthStencilSurface( g_pNewDepthRT ); // Clear the viewport g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00000000, 1.0f, 0 ); // Set the technique g_pEffect->SetTechnique( "techBlurV" ); // Compute the Gaussian offsets GetGaussianOffsets(FALSE, D3DXVECTOR2(1.0f / (FLOAT)SHADOW_MAP_SIZE, 1.0f / (FLOAT)SHADOW_MAP_SIZE), g_vSampleOffsets, g_fSampleWeights); g_pEffect->SetValue("g_vSampleOffsets", g_vSampleOffsets, 15 * sizeof(D3DXVECTOR2)); g_pEffect->SetValue("g_fSampleWeights", g_fSampleWeights, 15 * sizeof(FLOAT)); // Set the textures g_pEffect->SetTexture( "tBlurHMap", g_pBlurMap[0] ); // Render the effect uPasses = 0; g_pEffect->Begin( &uPasses, 0 ); for( uPass = 0; uPass < uPasses; uPass++ ) { // Set the current pass g_pEffect->BeginPass( uPass ); // Draw the quad g_pd3dDevice->SetStreamSource( 0, g_pQuadVB, 0, sizeof(QuadVertex) ); g_pd3dDevice->SetFVF( FVF_QUADVERTEX ); g_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLESTRIP, 0, 2 ); // End the current pass g_pEffect->EndPass(); } // End the effect g_pEffect->End();

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!