![]() You would use DDSTextureLoader instead of WICTextureLoader in this case. This will result in a larger DDS file on disk than a PNG, but will use less video memory when loaded. ![]() You can optionally convert the PNG to a DDS using DirectXTex's texconv tool or the Visual Studio texture content processor, ideally using BC2 or BC3 for runtime compression. If your minimum supported feature level is not 9.1 or 9.2, you can set it higher to make use of larger supported texture sizes for more efficient packing. The default Max size of 2048 x 2048 under Layout is suitable for all feature levels. For more flexible control over pixel format at runtime, you should convert to a. Due to limitations of the built-in Windows PNG codec, using other pixel formats does not reduce video memory usage only disk space usage. The default Pixel format of RGBA8888 is suitable for all feature levels, and will be loaded at runtime as DXGI_FORMAT_B8G8R8A8_UNORM. If you are using premultiplied alpha for your blending (the default for SpriteBatch), you should under Texture \ show advanced set the Premultiply alpha check box option. Note that you will not be making use of the '.cs' file TexturePacker generates as part of the "MonoGame" project type. txt that is defined as part of the "MonoGame" project. If you are making use of CodeAndWeb's TexturePacker tool, you will be writing out the sprite sheet texture as a PNG which you will be using at runtime along with the 'data file'. Sprites-> Draw( spriteBatch.get(), *frame, screenPos ) Sprites-> Load( texture.Get(), L"SpriteSheetSample.txt" ) Create an SpriteSheet helper class instance SpriteBatch = std::make_unique( context ) Hr = CreateWICTextureFromFile( device, L"SpriteSheetSample.png ", Create a texture using our sprite sheet The resulting sprite sheet is SpriteSheetSample.pngĪnd the resulting metadata SpriteSheetSample.txt This example uses a sprite sheet created from the content in the original C# XNA Game Studio SpriteSheetSample sample. void XM_CALLCONV Draw(DirectX::SpriteBatch* batch, const SpriteFrame
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |