Archived

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

lly20000

make a shadow with tiny.x

Recommended Posts

Now I want make a shadow with tiny.x but when I was lock vertex buffer my animate is too slowly I want found a method to add some speed please tell what can I do???

Share this post


Link to post
Share on other sites
I think you must put your vertex buffer in correct pool.
e.g.D3DPOOL_SYSTEMMEMORY,because read from video memory is very very slow!

Share this post


Link to post
Share on other sites
Constantly locking/unlocking vertex buffers constantly is going to be slow to a degree, no matter what pool you create it in.

So, what is your question, exactly? Have you already implemented a type of shadow system, or not? I recommend that you look at the shadow volume sample in the SDK or on this site. Also, just try a quick search on google or of this forum. It will give you a lot of info on the subject.


Dustin Franklin
Mircrosoft DirectX MVP

Share this post


Link to post
Share on other sites
Look up D3DXMatrixShadow in the documentation. This only works well if you are always casting the shadow onto a flat surface. If not, you need stencil shadowing.

___________________________________________________________
Where to find the intensity (Updated Mar 20, 2004)

Share this post


Link to post
Share on other sites
To circlesoft:
the Directx sample locks the vertex buffer of the mesh once each frame to generate the shadow volume,and the same code is used by the codesampler sample (he is taking the same code as a copy paste even with comments).to make a shadow using shadow volume without locking vertex buffers,vertex shader is the only solution.you can see the sample at www.booyah.com. it runs at a very high frame rate and uses vertex shader to generate the shadow volume.
To amish1234:
D3DXMatrixShadow is used to project the object into a plane,so it can be used to generate the shadow on the ground for example but not on complex object.for example it cannot handle a character shadowing another character or a the self shadowing.
this technique was used in MaxPayne 2 with sampling the shadow based on the light direction and distance to generate soft shadows.

Share this post


Link to post
Share on other sites