Issue with transparent texture on 3D primitive, XNA 4.0

后端 未结 4 916
礼貌的吻别
礼貌的吻别 2021-01-01 05:50

I need to draw a large set of cubes, all with (possibly) unique textures on each side. Some of the textures also have parts of transparency. The cubes that are behind ones w

4条回答
  •  失恋的感觉
    2021-01-01 06:21

    XNA (and DirectX and all major 3D libraries) take in consideration something called culling. Although from your code I cannot tell for sure, from the images I think this is your problem. The polygons that you don't see have the vertices in the wrong order. If this is the problem, you have two solutions:

    • either turn culling off (device.RenderState.CullMode = CullMode.None; if I remember correctly)
    • apply your texture twice, with the points of the polygon both in clockwise order and counter clockwise

提交回复
热议问题