本文整理汇总了C#中Texture.Unload方法的典型用法代码示例。如果您正苦于以下问题:C# Texture.Unload方法的具体用法?C# Texture.Unload怎么用?C# Texture.Unload使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Texture
的用法示例。
在下文中一共展示了Texture.Unload方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LevelMap
public LevelMap(Texture texture, Texture colMap)
{
this.texture = texture;
this.width = texture.Size.Width;
this.height = texture.Size.Height;
vertices = new float[]
{
0, height,
0, 0,
width, 0,
width, height
};
texcoords = new float[]
{
0, 1,
0, 0,
1, 0,
1, 1
};
indices = new byte[]
{
0, 1, 2,
0, 2, 3
};
collisionMap = new bool[height][];
float[] alphas = new float[width * height];
GL.BindTexture(TextureTarget.Texture2D, colMap);
GL.GetTexImage(TextureTarget.Texture2D, 0, PixelFormat.Alpha, PixelType.Float, alphas);
for (int i = 0; i < collisionMap.Length; i++)
{
bool[] ba = new bool[width];
for (int j = 0; j < ba.Length; j++)
{
ba[j] = alphas[i * width + j] <= 0.1f;
}
collisionMap[i] = ba;
}
GL.BindTexture(TextureTarget.Texture2D, 0);
colMap.Unload();
}
示例2: SkyScatteringCubeRenderer_Loading
void SkyScatteringCubeRenderer_Loading(object sender, EventArgs e)
{
SetupCubeMap();
var tex = new Texture(SkyRes, SkyRes, TextureTarget.Texture2D, PixelInternalFormat.Rgb16f, PixelFormat.Rgb,PixelType.HalfFloat);
tex.UploadEmpty();
// TODO: need to find and fix the FBO IncompleteMissingAttachment error
gb.SetOutputTexture(0, "out_Sky", tex, TextureTarget.Texture2D);
gb.Init(@"SkyScatterCube.vert", @"SkyScatterCube.frag");
gb.ClearOutputTexture(0);
tex.Unload();
}