0

我需要将 Vector3 或 Vector4 的数组传递给我的像素着色器。有没有可以从 CPU 设置并在 GPU 上采样的一维纹理?

4

1 回答 1

0

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

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;
    }
}
于 2011-11-28T11:37:21.833 回答