源战役客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.5 KiB

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class MipmapsTest : MonoBehaviour
  5. {
  6. public static MeshRenderer mr;
  7. public static Texture2D t1;
  8. // Start is called before the first frame update
  9. void Start()
  10. {
  11. mr = (MeshRenderer)GetComponent(typeof(MeshRenderer));
  12. t1 = mr.material.mainTexture as Texture2D;
  13. //t1.requestedMipmapLevel = 5; //加载第5等级mipmap
  14. //t1.ClearRequestedMipmapLevel();可以清空加载mipmap的等级
  15. }
  16. void OnGUI()
  17. {
  18. GUILayout.Label("<size=40>requestedMipmapLevel " + t1.requestedMipmapLevel + "</size>");
  19. GUILayout.Label("<size=40>当前实际加载的mipmap等级 " + t1.desiredMipmapLevel + "</size>");
  20. GUILayout.Label("<size=40>streamingMipmaps " + t1.streamingMipmaps + "</size>");
  21. GUILayout.Label("<size=40>loadedMipmapLevel" + t1.loadedMipmapLevel + "</size>");
  22. GUILayout.Label("<size=40>loadingMipmapLevel " + t1.loadingMipmapLevel + "</size>");
  23. GUILayout.Label("<size=40>streamingMipmapsPriority " + t1.streamingMipmapsPriority + "</size>");
  24. GUILayout.Label("<size=40>mipMapBias " + t1.mipMapBias + "</size>");
  25. if (GUILayout.Button("<size=40>调整mipmap等级(模糊) +</size>"))
  26. {
  27. t1.mipMapBias += 1f; //更模糊
  28. }
  29. if (GUILayout.Button("<size=40>调整mipmap等级(清楚) -</size>"))
  30. {
  31. t1.mipMapBias -= 1f; //更清楚
  32. }
  33. }
  34. }