using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MipmapsTest : MonoBehaviour
{
public static MeshRenderer mr;
public static Texture2D t1;
// Start is called before the first frame update
void Start()
{
mr = (MeshRenderer)GetComponent(typeof(MeshRenderer));
t1 = mr.material.mainTexture as Texture2D;
//t1.requestedMipmapLevel = 5; //加载第5等级mipmap
//t1.ClearRequestedMipmapLevel();可以清空加载mipmap的等级
}
void OnGUI()
{
GUILayout.Label("requestedMipmapLevel " + t1.requestedMipmapLevel + "");
GUILayout.Label("当前实际加载的mipmap等级 " + t1.desiredMipmapLevel + "");
GUILayout.Label("streamingMipmaps " + t1.streamingMipmaps + "");
GUILayout.Label("loadedMipmapLevel" + t1.loadedMipmapLevel + "");
GUILayout.Label("loadingMipmapLevel " + t1.loadingMipmapLevel + "");
GUILayout.Label("streamingMipmapsPriority " + t1.streamingMipmapsPriority + "");
GUILayout.Label("mipMapBias " + t1.mipMapBias + "");
if (GUILayout.Button("调整mipmap等级(模糊) +"))
{
t1.mipMapBias += 1f; //更模糊
}
if (GUILayout.Button("调整mipmap等级(清楚) -"))
{
t1.mipMapBias -= 1f; //更清楚
}
}
}