Skip to main content
gamedev.net
🔒 Locked

Problem using cube texture as render target

Started by yzzid Jan 8, 2007 at 6:14 AM 4 replies 2.1k views
Original Post
yzzid
yzzid
I am having a problem with cube textures as render targets. I have an application which is using a cube texture for a cubic shadow map. WHen I create it, I also create a depth stencil surface the same size as one face of the cube texture. When the height of my window is less than the size of the cube map and depth stencil surface, all is well. However, when I resize the window to a height greater than that my rendering fails. Unfortunately, Direct3D isn't giving me any errors at the highest output level so I am not really sure why it is not working properly. Has anyone seen this behavior before and how did you fix it? Thanks.
-dizzyGame Institute InternPlease rate me. :)
Schrompf
Schrompf
Sounds like you forget to switch to that depth stencil surface. Or better: sounds like you forget to switch back after rendering the shadow map.
----------
Gonna try that "Indie" stuff I keep hearing about. Let's start with Splatter.
yzzid
yzzid
OK I think I figured out the problem but I am still unclear of a solution.

Basically, I am drawing my scene using an ambient pass first which should establish the proper depth in the depth buffer.
What it looks like is it is invvalid after I switch to the render target depth buffer and back.
My question is this:
Why wouldn't Direct3D preserve the depth buffer when I am not releasing the interface?
I am having D3D automatically create a depth stencil surface.
Do I need to do it myself manually to get around this problem?

Thanks.
-dizzyGame Institute InternPlease rate me. :)
yzzid
yzzid
Nevermind it seems like it is only a problem when using the debug version of Direct3D. When I switched back to the release version it works fine.
-dizzyGame Institute InternPlease rate me. :)
JasonBlochowiak
JasonBlochowiak
If it doesn't work in the debug version of DirectX, that almost certainly means that there's a mistake in your rendering code that just happens to not trip up in the release version. This, in turn, means that you'll likely have different, not-fun-to-track-down other problems later, so I'd suggest figuring out what's going wrong.

That said, from your description I can't really guess what's going wrong, so you might have more luck if you post your code (remember to use the tags).
yzzid
yzzid
Yeah I figured there is something wrong that is not reporting correctly.

Unfortunately, since I used someone else's framework to get started quickly on this application I am not at liberty to share any code.

What I might do is just start over with my own framework since I have proven everything else works.

Thanks for the reply.
-dizzyGame Institute InternPlease rate me. :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.