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

Tutorial 08: Change in Behavior between November 2007 and March 2008

Last post 09-03-2008 6:34 PM by Hyrtwol. 3 replies.
  • 04-30-2008 1:37 PM

    Tutorial 08: Change in Behavior between November 2007 and March 2008

    I just installed the March 2008 DirectX SDK and built project Tutorial 08, a project I had previously built from the November 2007 SDK.  I immediately noticed a big difference in appearance.  I happened to have an executable that I had built from the November SDK, and the screenshot below shows the difference.  November 2007 is on the right, and March 2008 is on the left.  In both cases, the ClearColor is (0, .125, .3, 1).  The other difference is that the cube texture is washed out.  It appears that, overall, everything is lighter.

    I wonder if anyone else has experienced this and what might be causing the difference.

  • 05-27-2008 11:40 AM In reply to

    Re: Tutorial 08: Change in Behavior between November 2007 and March 2008

    Hey i'm also having problem with the colors, is also using March 2008... if i swap between dx9 and dx10 the colors changes, after alot a searching i didn't find a good explanation, but i was reading about dx10 is calculating coloer in linar color space, so the textures have so be in that format, i tried to use the texconv10 with no luck. i have the feeling that when i load a texture it's gamma corected twice?! not sure why... as a small test i tried to compensate in the shader by color.rgb = pow(color.rgb, 2.2) (got the gamma value 2.2 for a wikiarticle), and it actually look right!!. my second test was to fill the texture with a gradient at runtime, it looked ok if i used DXGI_FORMAT_R8G8B8A8_UNORM_SRGB and not DXGI_FORMAT_R8G8B8A8_UNORM, tried all kind of tricks to get the texture loader to use another format again with no luck.... so i was hoping somebody could point me in the right direction, 'cause i'm close to give up now... property a stupid setting somewere, and i can't believe i have to compensate in the shader like the example given.
  • 07-12-2008 7:09 PM In reply to

    Re: Tutorial 08: Change in Behavior between November 2007 and March 2008

    I'm sorry, Hyrtwol, that I missed your post of a month and a half ago.  That's good detective work.

    I've gotten reports that it's okay on ATI GPUs and not on Nvidia.  In the meantime, I've stayed with the Nov07 DXUT headers and source.  I concluded the problem was in DXUT.

    Walt

  • 09-03-2008 6:34 PM In reply to

    Re: Tutorial 08: Change in Behavior between November 2007 and March 2008

    This must one of the slowest going threads...
    But to give a kind of answer to this theread here is what I discovered:

    DXUT will default to to SRGB if it's available. To avoid this you can call DXUTSetIsInGammaCorrectMode( false ); before making the device. But SRGB have some nice benefits so I'll stick to that. (I'm not sure if there is any penalties calling DXUTSetIsInGammaCorrectMode( false ); but I don't think so)

    I had problems loading dds textures they turned up dark (like in the image above)
    A call to CreateDDSTextureFromFile() won't use the right format (or said in another way I gave up trying) so I wrote my own loader in the following way:
    1. Describe the file with D3DX10GetImageInfoFromFile();
    2. Make a D3DX10_IMAGE_LOAD_INFO and use a macro to change the format to typeless LoadInfo.Format = MAKE_TYPELESS( imageLoadInfo.Format );
    3. Load the file by calling D3DX10CreateTextureFromResource() with the loadinfo
    4. Make a D3D10_SHADER_RESOURCE_VIEW_DESC and use a macro to change the format to SRGB (the macro MAKE_SRGB will check if it's running in SRGB)SRVDesc.Format = MAKE_SRGB( desc.Format );
    5. Create the ShaderResourceView by calling CreateShaderResourceView() with the shaderResourceViewDesc

    Properly there is a better way to do this but after fighting with this for some time i setteled on this solution.
    Hope this can help somebody to get started. But looking back I should properly have read more about DX10 before starting coding it could have save me alot of time but now i learned the hard way...

    Btw I'm using the latest SDK from august it behave in the same way as the one from march.

    p.s. If this is making no sense and/or there is a demand I can post the code.
Page 1 of 1 (4 items) Previous Next