Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way to have the texture of a model loaded from a Png ?

I have a simple prism to test it on, but i just want to be able to edit an image and have the model's texture change.


share|improve this question
Start here and extrapolate your solution. – Jonathan Dickinson Dec 7 '11 at 11:12
Crap, I once wrote the perfect tutorial on this for you but it was on Ziggyware which unfortunately went down and I don't have a backup :(. – Roy T. Dec 8 '11 at 9:22
up vote 1 down vote accepted

You can use a png as a texture. First you have to add it to the game project content :

And then you call Load method of ContentManager :

You can access the ContentManager through the Content properties of Game class :

share|improve this answer
But how can i actually render it onto the model? Also how can i know what configuration the texture should be in to fit onto the model? – Randomman159 Dec 7 '11 at 10:15
To render a texture on a model, it had to have uv coordinate. Does your model comes from a graphics software? The easiest solution to do this is to use a graphics software such as 3DS Max, Maya or Blender. You will draw a model and then apply a texture to it. Then these software will give you a file containing all informations about your model. After you just have to add it to your project and load it. – Takumi Dec 7 '11 at 10:30
It was done in Sketchup as a 2 second throw together. I guess i'll load it in 3ds or whatever now to check it out. – Randomman159 Dec 7 '11 at 10:31
By searching google i find these links wich can help you :… and – Takumi Dec 7 '11 at 10:36
Ahh there we go, didn't know that the textures would be stored outside the .x Thanks for the links :) – Randomman159 Dec 7 '11 at 13:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.