画3d纹理的长方形 - 没有纹理

时间:2015-05-27 18:58:08

标签: c# xna monogame

我试图在this msdn示例中绘制一个纹理矩形,但我只得到一个没有纹理的黑色矩形。

输出: enter image description here

我的抽奖方法:

protected override void Draw(GameTime gameTime)
{
    GraphicsDevice.Clear(Color.CornflowerBlue);

    effect.EnableDefaultLighting();
    effect.World = Matrix.Identity;
    effect.Projection = camera.Projection;
    effect.View = camera.View;
    effect.TextureEnabled = true;
    effect.Texture = grass;

    foreach (var pass in effect.CurrentTechnique.Passes)
    {
        pass.Apply();

        GraphicsDevice.DrawUserIndexedPrimitives(PrimitiveType.TriangleList, quad.Vertices, 0, 4, AlignedQuad.Indexes, 0, 2);
    }

    base.Draw(gameTime);
}

effect与msdn示例中的BasicEffect类似。正确加载grass并且不是黑色纹理。

我做错了什么?

0 个答案:

没有答案
相关问题