XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

Optimal textures

Last post 04-21-2008 7:41 AM by ArenAzul. 2 replies.
  • 04-20-2008 8:00 PM

    Optimal textures

    Hi...

    I'm trying to decide optimal texture types to work with in my aplication.

    Can anybody give me a reference to a post or an article treating this subject in a quite complete way?

    I'm searching the answer to these questions:

    1.- Is it cheaper for the graphics card working with textures with no alpha information? What is the base format for those textures ?(I mean the type for directx) Which is the best texture extension for that purpose? .jpg?

    2.- Which is the best format for textures with alpha information (file extension and directx format type)?

    3.- Is .dds the only file format that stores mipmapping?

    4.- Can i store an image without alpha information in .dds file format? If i can't, is there other format with mipmapping storage without alpha information?

    5.- Which are the best formats for mask textures (only black and white)? Which are the ones for a grayscale?

    6.- Which would be a recommended rendertarget format for a high quality graphics game? Which format is best for the depthbuffer?

    I would apreciate any other advice or clarification ^^. Sorry about so many questions.

  • 04-20-2008 11:01 PM In reply to

    Re: Optimal textures

    Answer

    1.       It could be cheaper using a texture format without alpha. You should look how many bits’ a format needs per texture element (texel). Fewer bits are in general more cache and GPU friendly. As some formats replace the missing alpha with unused bits you would not win anything at all.

    2.       The file type can only have an impact on loading time. As stated the best format is that one with as less bit’s as possible that is supported and still looks good enough for you. In general you should try using one of the DXT formats.

    3.       From the file formats that D3DX supports: yes. But you can always write your own loader that supports your own formats.

    4.       Sure. The DDS file format supports texture formats without alpha channel.

    5.       DXT1 works well for mask textures. Grey scales could be stored as DXT2 or DXT3 if the limited precession is enough. Otherwise D3DFMT_A8 should be a good solution.

    6.       Render target formats depends on your needs. In general D3DFMT_A8R8G8B8 is often a good choice.  But as always it depend on what you render to this target.
    As depth buffer format most today games use D3DFMT_D24S8 or D3DFMT_D24X8.

    When it comes to format decisions you need always keep the following in mind:

    1.       Try to use a format that need as less bit per texel as possible.

    2.       Check if the hardware supports the format for that use case. If not have a fallback chain with other formats.

    The ConfigSystem sample includes a table that can give you an overview of the formats that current hardware supports. This should help you to define your formats and fallback chains.

  • 04-21-2008 7:41 AM In reply to

    Re: Optimal textures

    Well... I guess that i don't need more than you wrote :D. Thanks.
Page 1 of 1 (3 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG