Hi, In XNA, how do I load in a texture or mesh from a file without using the content pipeline?
+1
A:
I believe Texture2D.FromFile(); is what you are looking for.
It does not look like you can do this with a Model though.
http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.graphics.texture2d.fromfile.aspx
Cory
2008-09-18 18:55:51
+2
A:
The .FromFile method will not work on xbox or zune. You have two choices:
- Just use the content pipeline ... on xbox or zune (if you care about them), you can't have user-supplied content anyways, so it doesn't matter if you only use the content pipeline.
- Write code to load the texture (using .SetData), or of course to parse the model file and load the appropriate vertexbuffers, etc.
Joel Martinez
2008-09-18 21:48:51
+1
A:
For anyone interested in loading a model from a file check out this tutorial:
+1
A:
This is a windows only Way to load a texture without loading it through the pipeline, As Cory stated above, all content must be compiled before loading it on the Xbox, and Zune.
Texture2D texture = Texture2D.FromFile(GraphicsDeviceManager.GraphicsDevice, @Location of your Texture Here.png);
Acedia
2010-01-14 01:12:05