Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Implement Texture Importer/Processor/Writer #1214

Closed
tomspilman opened this Issue Jan 23, 2013 · 8 comments

Comments

Projects
None yet
4 participants
Owner

tomspilman commented Jan 23, 2013

Implement the TextureImporter, TextureProcessor, texture writers, and associated content classes:

http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.content.pipeline.textureimporter.aspx
http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.content.pipeline.processors.textureprocessor.aspx

The texture writers are internal classes and not publicly documented. This means we don't have to follow anything but just derive from ContentTypeWriter for 2D, 3D, and Cube texture content. The file format should match what MonoGame TextureReader expects and stick to stock for Windows/Xbox/WP7, but we can make changes as we need for other platforms.

@ghost ghost assigned abock Jan 23, 2013

Owner

tomspilman commented Jan 23, 2013

@RayBatts - Is working on this... I just cannot assign this issue to him which sucks.

Contributor

KonajuGames commented Jan 23, 2013

There are public classes for BitmapContent, DxtBitmapContent (and the specific Dxt1,3,5 formats). We should aim to implement those along with PvrBitmapContent, EtcBitmapContent, etc.

Owner

tomspilman commented Jan 23, 2013

Makes total sense to me. Can't wait to get texture compression solved for Android.

Contributor

KonajuGames commented Jan 23, 2013

I had already added TextureProcessorOutputFormat.Compressed in readiness for general texture compression rather than DXTCompressed as it had in XNA. We can expand this so the developer can request specific texture compression if desired (PVRCompressed, ETCCompressed, etc). I figure the Compressed enum value could include the multiple texture compression types for Android that we had discussed previously.

Owner

tomspilman commented Jan 23, 2013

I had already added TextureProcessorOutputFormat.Compressed

Yea... that is tricky.

We need to support the DXTCompressed enum value in some way... ideally existing .contentproj would load correctly without changes.

I think in general the user doesn't want to choose the specific compression. So by default TextureProcessorOutputFormat.Compressed is good. We can in addition add specific formats for DXT, PVR, ETC for those that want to control it instead of letting us guess based on the input content. A TextureProcessorOutputFormat.16bitColor would be good too.

compression types for Android

Yea.... I still think for Android we need an option that packages multiple compressed formats and picks the right one at runtime. This could be the behavior of TextureProcessorOutputFormat.Compressed by default.

Owner

tomspilman commented Jan 23, 2013

So maybe something like...

enum TextureProcessorOutputFormat
{
   NoChange, // copy the bits directly to the output without changes
   Color, // uncompressed color matching input bitdepth
   Color16Bit, // Force to uncompressed 16bit color.
   Compressed, // Pick the best compression for the target platform
   DXTCompressed, // Best DXT compression
   PVRCompressed, // Best PVR compression
   ETCCompressed, // ETC1 compression
};

The pipeline could error the build if you selected the wrong format for a particular platform... like ETC for iOS.

Contributor

KonajuGames commented Jan 23, 2013

It's a plan. Make it so.

Contributor

danzel commented Apr 18, 2014

Pretty certain this is all implemented, content pipeline seems to work for textures fine AFAIK.

@tomspilman tomspilman closed this Apr 18, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment