Archived

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

Drop shadow effects

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

I am building a user interface using managed DirectX and need to know how to do drop shadows like the ones in OS X... http://www.pocketmac.net/OSX_PM_browse.jpg It''s basically a gaussian blur by the look of it. Should I use a pixel shader for this, and if so does anyone know of any examples that I can look at that might be helpful? I am a total novice when it comes to shaders. thanks!

Share this post


Link to post
Share on other sites
Do you want it only for rectangle stuff ?
You could generate a texture with gaussian values in it and draw quads around your objects. Depending on the height and light direction, simply stretch or shirnk the textures.

[edited by - Coincoin on November 10, 2003 7:13:52 PM]

Share this post


Link to post
Share on other sites
No unfortunately it''s not just for rectangles - the user interface elements can be any 2d polygon.

I guess I could try your idea of using a texture with gaussian values mapped on to my 2d polygon but I think it might look a bit strange for non-rectangular shapes?

Share this post


Link to post
Share on other sites
In that case you can filter your texture from the flat object and generate a shadow map with it. Then simply modulate this map with the background before rendering your object.

You can do it with a pixel shader, but it will only be worth it if your geometry is very dynamic. If the shape or object never changes, you would be better to calculate the shadow maps at the beginging in CPU and always reuse the same texture.

Share this post


Link to post
Share on other sites