How big is *your* texture...

Well I can't talk about the project, but I *can* talk about stupid things I do.

We all know that switching textures while you are rendering is a bad thing so last night I did a quick calculation of all the textures I need and realised that they would all fit in a single 4k x 4k texture. Great - no switching at all. I even tried taking the 1k x 1k texture I was working with and making it 4k x 4k. It loaded just fine. 4k seemed like it was the sort of thing that modern cards should support.

Just to make sure I asked someone who knows more about this than me. He agreed that 4k should be fine so I told the artist to put the graphics in a 4k format. Turns out we were both making some assumptions - this is manager speak for "we were wrong".

This evening I got the 1st sample of the graphics. The effect was quite odd. Some of the textures were black. After some experimentation I discovered that after loading I was getting the top left 2k just fine. The remainder of the texture was the right and bottom edges being clamped. Doesn't make sense does it. Well yes it does - my card only supports 2k textures even though its an ATI 9800 (pretty modern right!). Of course in the great DirectX tradition you get no errors. After looking in the SDK document that lists caps for a pretty decent set of cards I discovered that 2k is the DX9 minimum and there are more cards that *don't* support 4k than *do* support it. Even worse there are no ATI cards that support it - which might piss off future customers. "Sorry we don't support ATI!!!".

The artist won't be too happy - he has to move things around. Still at least I tested it when he was less than 1/8th through the graphics.

So today's lessons learned:

  1. Never assume anything especially when there is a perfectly good document in the SDK that would have told me the answer
  2. Always check your caps they may not be perfect but they are a better than guessing
  3. 4k textures are still a thing of the future
  4. The documentation for graphics cards caps is *not* in the documentation directory, it's in 'Microsoft DirectX SDK (February 2006)\Samples\C++\Direct3D\ConfigSystem'. Yeah that's obvious....
Published 06 March 2006 12:26 AM by zman

Comments

No Comments

Search

Go

This Blog

Syndication