我需要将Vector3或Vector4的数组传递给我的像素着色器。有没有类似一维纹理的东西,我可以从CPU和GPU上的样本中设置?
发布于 2011-11-28 19:37:22
没有你可以使用的内置类,但是你可以创建一个你自己的(未测试的):
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;
}
}https://stackoverflow.com/questions/8153614
复制相似问题