Sign in to follow this  
TheKrust

[SOLVED] Unable to create render targets greater than 640x480

Recommended Posts

TheKrust    104
I'm trying to create some render targets. Now for some reason, and I've hade this problem for a while, I can NOT make the redner targets larger than 640x480. If I do, nothing simply renders to them. Now what's happening is that whenever I make a render target bigger than that, my display driver crashes. No, this is not a problem with hardware, I have the most up to date graphics card of anyone I know. What on earth is the deal with render targets? They cause more unknown problems than any one component I've ever seen in my life. d3ddev->CreateTexture(640,480,1,D3DUSAGE_RENDERTARGET, D3DFMT_A16B16G16R16F ,D3DPOOL_DEFAULT,&pRenderTexture,NULL); pRenderTexture->GetSurfaceLevel(0,&pRenderSurface); This is what everyone tells me to use and it's just not working. EDIT: "what... is... going ... on" is not even close to being a descriptive subject line. Please use something more appropriate in future. Thanks! [Edited by - TheKrust on November 25, 2007 9:48:27 PM]

Share this post


Link to post
Share on other sites
SiCrane    11839
Your CreateTexture() and GetSurfaceLevel() function calls you've shown look fine by themselves (though I tend to be suspicious of 16-bit texture formats). Are you checking the return value of your DirectX calls? Running with the debug version of DirectX and checking the to see if there's any informational output in the Output window of your debugger?

Share this post


Link to post
Share on other sites
TheKrust    104
Nope, no errors, It just says everything works perfectly. Even though my moniter goes black and my graphics card goes on the fritz. I understand the skeptisism about the 16 bit format, but I've tried it with everything. No other format works either.

Share this post


Link to post
Share on other sites
TheKrust    104
I guess I'm not sure what you mean.

d3ddev->SetRenderState( D3DRS_ZENABLE, TRUE );
d3ddev->SetRenderState( D3DRS_ZENABLE, D3DZB_USEW);
d3ddev->SetRenderState( D3DRS_ZWRITEENABLE, TRUE );

zMin = 0.1f
zMax = 400.0f

As sad as it is, that's basicly all the code I have that mentions my Z buffer

Share this post


Link to post
Share on other sites
jollyjeffers    1570
I concur with the depth buffer suggestion - but the debug runtime would be screaming and shouting at you for this one. Are you sure you have them enabled and are checking the output?

Is your window or display set to 640x480 by any chance? The D3DPRESENT_PARAMETERS create the implicit swap chain and the depth buffer will match the size you set the backbuffer. If you think about it you have to have a 1:1 mapping between depth and colour pixels - a smaller render target is fine, but a bigger one violates this rule.

Create a depth/stencil texture to go with your render target and you should be absolutely fine.

hth
Jack

Share this post


Link to post
Share on other sites
TheKrust    104
I see you took the liberty of changing the title. Oh well, better fit anyway.

Depth texture huh? Come to think of it, I have seen those before. Never quite figured them out though. I modified the SDK program to run without it and it seemed to do just fine... wierd.

Share this post


Link to post
Share on other sites
Quote:
If you think about it you have to have a 1:1 mapping between depth and colour pixels - a smaller render target is fine, but a bigger one violates this rule.


This was my first thought also.. but why would it crash just because he uses a bigger depth buffer? I've done that before and in fact it works fine...

Share this post


Link to post
Share on other sites
SiCrane    11839
Quote:
Original post by Matt Aufderheide
This was my first thought also.. but why would it crash just because he uses a bigger depth buffer? I've done that before and in fact it works fine...


Uh. He said bigger render target, not a bigger depth buffer.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this