|
|
- 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("<size=40>requestedMipmapLevel " + t1.requestedMipmapLevel + "</size>");
- GUILayout.Label("<size=40>当前实际加载的mipmap等级 " + t1.desiredMipmapLevel + "</size>");
- GUILayout.Label("<size=40>streamingMipmaps " + t1.streamingMipmaps + "</size>");
- GUILayout.Label("<size=40>loadedMipmapLevel" + t1.loadedMipmapLevel + "</size>");
- GUILayout.Label("<size=40>loadingMipmapLevel " + t1.loadingMipmapLevel + "</size>");
- GUILayout.Label("<size=40>streamingMipmapsPriority " + t1.streamingMipmapsPriority + "</size>");
- GUILayout.Label("<size=40>mipMapBias " + t1.mipMapBias + "</size>");
-
- if (GUILayout.Button("<size=40>调整mipmap等级(模糊) +</size>"))
- {
- t1.mipMapBias += 1f; //更模糊
- }
- if (GUILayout.Button("<size=40>调整mipmap等级(清楚) -</size>"))
- {
- t1.mipMapBias -= 1f; //更清楚
- }
- }
- }
|