Is there a Texture1D in XNA?



我需要将Vector3或Vector4的数组传递给我的像素着色器。是否有类似于一维纹理的东西,我可以从CPU和GPU上的样本设置?

没有可以使用的内置类,但是您可以创建自己的类(未经测试):

public class Texture1D
{
    GraphicsDevice device;
    Vector4[] pixels;
    bool mipMap = false;
    SurfaceFormat Format;
    public Texture1D (GraphicsDevice Device, int Length)
    {
        pixels = new Vector4[Length];
        device = Device;
        Format = SurfaceFormat.Color;
    }
    public Texture1D (GraphicsDevice Device, int Length, bool mipMap, SurfaceFormat format)
    {
        pixels = new Vector4[Length];
        device = Device;
        this.mipMap = mipMap;
        Format = format;
    }
}

最新更新