Home Technical Talk

How to texture a level for an XNA game

Cyph3r
polycounter lvl 9
Offline / Send Message
Cyph3r polycounter lvl 9
Hey guys, i need to texture this level:

Test_Level_new6.jpg

for an XNA game, right now its using vertex painting via the 3dsmax modifier and it doesnt seem to want to play ball when loaded up.

how should i go about doing it?

Replies

  • Farfarer
    Could you not tweak an existing shader to give you the effect you want?
  • Cyph3r
    Offline / Send Message
    Cyph3r polycounter lvl 9
    Talon wrote: »
    Could you not tweak an existing shader to give you the effect you want?

    erm, not a clue. hah.
  • Farfarer
    Once you've prodded around the code, it's fairly simple to alter an exsting shader.
  • gamedev
    Offline / Send Message
    gamedev polycounter lvl 12
    w/ XNA's basic effect class though you probably won't be able to get your vertex paint working in 'engine'. You or your coder will need write an .fx shader to use or maybe checkout shaderFX and see if you can't make something that will work. I'm pretty sure it an export to XNA as wel.

    Once you have a shader though, you'll have to write some code to get the model class to actually use that shader.

    Best of luck!

    -Tyler
  • Cyph3r
    Offline / Send Message
    Cyph3r polycounter lvl 9
    hey guys, im going to remake the level using heightmaps for simplicitys sake in reference to the physics engine.

    I know how to make a heightmap to define the shape of the mesh.

    but is it possible to make a black/white image that shows where the two textures would be? black = grass, white = dirt. like a heightmap, for textures.
  • ParoXum
    Offline / Send Message
    ParoXum polycounter lvl 9
    Should be. That's mainly how terrains work with Unreal3and other games, a color map which defines the blendings.

    Correct me if I'm wrong tho.
  • Daaark
    Offline / Send Message
    Daaark polycounter lvl 17
    Cyph3r wrote: »
    but is it possible to make a black/white image that shows where the two textures would be? black = grass, white = dirt. like a heightmap, for textures.
    Yes, if whoever is coding your app knows how to get it done. You can do whatever you like. If you want vertex painting, get the programmer to write the proper rendering technique.

    XNA is not an engine. It's a framework/wrapper around Direct3D9 for C#. The phrase, "how do I texture for an XNA level" doesn't compute.

    You'll want to make sure the data that you are importing into whatever structures you have is including the per vertex color, and then have a shader that uses that color to alpha blend the texture layers together. Or you might use another texture layer with colors to define the blendings.
Sign In or Register to comment.