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

Started by
8 comments, last by TheKrust 16 years, 4 months ago
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]
---------------------------------------- There's a steering wheel in my pants and it's drivin me nuts
Advertisement
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?
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.
---------------------------------------- There's a steering wheel in my pants and it's drivin me nuts
How big is your Z-buffer?
Sirob Yes.» - status: Work-O-Rama.
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
---------------------------------------- There's a steering wheel in my pants and it's drivin me nuts
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

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.
---------------------------------------- There's a steering wheel in my pants and it's drivin me nuts
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...

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.
ah, seems to work now. Well that's a relief. Thanks all.
---------------------------------------- There's a steering wheel in my pants and it's drivin me nuts

This topic is closed to new replies.

Advertisement