Re: Texturing fails silently, objects are all white

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Jack Hoxley (Jack.Hoxley_at_ntlworld.com)
Date: 08/18/04


Date: Wed, 18 Aug 2004 09:14:32 +0100

There was a thread on this newsgroup some time ago about detecting the
amount of VRAM... Basically you had to drop back to a legacy DD7 interface
and query it from there. You could do that once, subtract the relevent
front/back/depth buffer sizes and store a value that represents how much
space you have to "play" with. Some trickery using logarithms and square
roots (iirc) can tell you what the largest texture dimensions are..

hth
Jack

"Clafou" <Clafou@discussions.microsoft.com> wrote in message
news:CC748B28-9E34-46C6-8272-35EF120C099C@microsoft.com...
> Absolutely! 4MB doesn't leave me much space at all. I'm running at
1152x864
> in 16-bit mode so multiplied by 2 to account for a back buffer, I actually
> only have about 200KB of VRAM left. That pretty much concurs with the
limits
> I'm hitting (128x256 24 bit is OK, I even have two of those displayed at a
> time). I would like where necessary to downsample, or output an error
message
> if the situation is just too bad, but I need to be able to detect the
> problem, and I'm not sure how!
>
> "Jack Hoxley" wrote:
>
> > As a thought... even with the managed pool where it pages it in/out of
VRAM
> > as/when needed, surely it still must be in VRAM when the Draw*( ) call
is
> > made? With 4mb of RAM you'd struggle to fit a 24bit 1024x1024 texture in
> > (3mb exactly iirc). The front/back buffers will probably knock the
usable
> > space down to ~2mb at a guesstimate.
> >
> > Thus if the image simply cannot fit in at all, then there isn't anything
> > that can be done about it... Maybe the only solution then would be to
> > downsample the image until it fits? or tile-it so that only a small %age
of
> > it needs to be in memory at each Draw*( ) call?
> >
> > hth
> > Jack
> >
> >
> > "Clafou" <Clafou@discussions.microsoft.com> wrote in message
> > news:88358A09-840D-470B-B6BA-F964E8B4731C@microsoft.com...
> > > Hi
> > >
> > > I am using D3DXCreateTextureFromFileEx to load textures into the
managed
> > > pool. These textures are big photos, and on old graphics cards with
low
> > > memory (4Mb of VRAM), the textures are not displayed at all and my
objects
> > > are all white. I imagine this is because the video memory is too low?
Is
> > > there a workaround?
> > >
> > > I would need to at least detect that texturing fails (currently,
rendering
> > > executes without returning any error code), so that I can try to
reduce
> > the
> > > size of the texture or output a meaningful error message. But so far
I
> > > couldn't find any way to detect failure. Should I used the default
pool
> > > instead of the managed pool, would that help me detect a failure?
> > >
> > > Many thanks in advance!
> > > Clafou
> >
> >
> >