本文整理汇总了C#中ITexture.GetMipMap方法的典型用法代码示例。如果您正苦于以下问题:C# ITexture.GetMipMap方法的具体用法?C# ITexture.GetMipMap怎么用?C# ITexture.GetMipMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITexture
的用法示例。
在下文中一共展示了ITexture.GetMipMap方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetMipMapAndTransformedCoordinates
protected override void GetMipMapAndTransformedCoordinates(
ITexture texture, ref Number4 location,
int level, out ITextureMipMap mipMap,
out Number4 textureCoordinates)
{
mipMap = texture.GetMipMap(0, level);
textureCoordinates = new Number4(
location.Float0 * mipMap.Width,
location.Float1 * mipMap.Height,
0, 0);
}
示例2: GetMipMapAndTransformedCoordinates
protected override void GetMipMapAndTransformedCoordinates(
ITexture texture, ref Number4 location,
int level, out ITextureMipMap mipMap,
out Number4 textureCoordinates)
{
var arraySlice = MathUtility.Round(location.Float2);
mipMap = texture.GetMipMap(arraySlice, level);
textureCoordinates = new Number4(
location.Float0 * mipMap.Width,
location.Float1 * mipMap.Height,
0, 0);
}
示例3: GetMipMapAndTransformedCoordinates
protected override void GetMipMapAndTransformedCoordinates(
ITexture texture, ref Number4 location,
int level, out ITextureMipMap mipMap,
out Number4 textureCoordinates)
{
int arrayIndex;
CubeMapUtility.GetCubeMapCoordinates(ref location,
out arrayIndex, out textureCoordinates);
mipMap = texture.GetMipMap(arrayIndex, level);
textureCoordinates.X *= mipMap.Width;
textureCoordinates.Y *= mipMap.Height;
}
示例4: CalculateLevelOfDetail
public override float CalculateLevelOfDetail(
ITexture texture, SamplerState samplerState,
ref Number4 ddx, ref Number4 ddy)
{
var mostDetailedMipMap = texture.GetMipMap(0, 0);
int width = mostDetailedMipMap.Width;
int height = mostDetailedMipMap.Height;
float xBound2 = width * width;
float yBound2 = height * height;
float dudx2 = ddx.Float0 * ddx.Float0 * xBound2;
float dvdx2 = ddx.Float1 * ddx.Float1 * yBound2;
float dudy2 = ddy.Float0 * ddy.Float0 * xBound2;
float dvdy2 = ddy.Float1 * ddy.Float1 * yBound2;
// Proportional to the amount of a texel on display in a single pixel
float pixelSizeTexelRatio2 = Math.Max(dudx2 + dvdx2, dudy2 + dvdy2);
// Uses formula for p410 of Essential Mathematics for Games and Interactive Applications
float result = 0.5f * MathUtility.Log2(pixelSizeTexelRatio2);
// Clamp to >= 0.
return Math.Max(result, 0.0f);
}