Jump to content
  • Advertisement

Archived

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

BugzzBunny

Zbuffer Shadows - rendertarget

This topic is 6191 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´m trying to do shadows as described in nvidias developer site: http://developer.nvidia.com/view.asp?IO=d3dshadowmap What I´m trying to do is to use texturestages instead of vertex/pixelshaders as they do in that demo. For the most part the program works fine, except where it´s really important that it does. This probably because im a sucky programmer but to describe the problem in more detail: trying to render from lights point of view: When i set my textures to be used as rendertargets,which i created as in that demo, the "color"texture works fine (enabled it to see that something happens), but the zbuffer "texture" is blank(white). I can´t find any reason why it shouldn´t work. Everything is as in that demo, except the code which initializes the 3ddevice, because that original demo works in a "parent" window. I create a "normal" zbuffer for my 3ddevice like: d3dpp.EnableAutoDepthStencil = TRUE; d3dpp.AutoDepthStencilFormat = D3DFMT_D24S8; I also tested it with a D3DFMT_D16 zbuffer. Has anybody had the same problem and solved it or does anybody know by looking at my problemdescription what i´m doing wrong. I will post some code later.

Share this post


Link to post
Share on other sites
Advertisement
Are you creating the Z texture with the proper flags?

ie. is the texture correct but "blank" or was it dead from the beginning...

Is there any particular reason you''re not using shaders? Any hardware that will support this method (well) will be capable of shaders.

Share this post


Link to post
Share on other sites
It´s created as in the demo ie:

m_pD3DDev->CreateTexture(TEXDEPTH_WIDTH, TEXDEPTH_HEIGHT, 1, D3DUSAGE_DEPTHSTENCIL, zFormat, D3DPOOL_DEFAULT, &m_pSMZTexture);

The reason for not using shaders is the sucky programmer part. I trying to learn these things just for the sake of being slightly creative, and i thought that it would be easier to learn how to use texturestages at this point. I´m gonna start learning shaders after i learn these more traditional ways of getting things done. In short, straigtening out the learning curve.

Is the 3DXMatrixPerspectiveFovLH´s far and near planes relevant for the zbuffer? is there any case where it would be logical ,normal or expected that the zbuffer would turn out white? how bout the clearings of the zbuffer or the swapping? Could there be somekind of problem when setting those rendering targets that the previous zbuffer is used?

BTW the zbuffering works fine otherwise.

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.

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!