浏览代码

[ReflectionProbeEditor] Support for realtime probe

/feature-ReflectionProbeFit
Frédéric Vauchelles 7 年前
当前提交
d2e6484a
共有 2 个文件被更改,包括 12 次插入3 次删除
  1. 13
      ScriptableRenderPipeline/HDRenderPipeline/Editor/Lighting/HDCubemapInspector.cs
  2. 2
      ScriptableRenderPipeline/HDRenderPipeline/Editor/Lighting/HDReflectionProbeEditor.Preview.cs

13
ScriptableRenderPipeline/HDRenderPipeline/Editor/Lighting/HDCubemapInspector.cs


public override void OnPreviewSettings()
{
var mipmapCount = 0;
var cubemap = target as Cubemap;
var rt = target as RenderTexture;
if (cubemap != null)
mipmapCount = cubemap.mipmapCount;
if (rt != null)
mipmapCount = rt.useMipMap
? (int)(Mathf.Log(Mathf.Max(rt.width, rt.height)) / Mathf.Log(2))
: 1;
GUI.enabled = true;
GUILayout.Box(s_ExposureLow, s_PreLabel, GUILayout.MaxWidth(20));

GUILayout.Box(s_MipMapHigh, s_PreLabel, GUILayout.MaxWidth(20));
GUI.changed = false;
mipLevelPreview = GUILayout.HorizontalSlider(mipLevelPreview, 0, ((Cubemap)target).mipmapCount, GUILayout.MaxWidth(80));
mipLevelPreview = GUILayout.HorizontalSlider(mipLevelPreview, 0, mipmapCount, GUILayout.MaxWidth(80));
GUILayout.Box(s_MipMapLow, s_PreLabel, GUILayout.MaxWidth(20));
}

m_PreviewUtility.camera.farClipPlane = 20.0f;
m_PreviewUtility.camera.transform.position = new Vector3(0, 0, 2);
m_PreviewUtility.camera.transform.LookAt(Vector3.zero);
//m_PreviewUtility.camera.clearFlags = CameraClearFlags.Skybox;
}
bool HandleMouse(Rect Viewport)

2
ScriptableRenderPipeline/HDRenderPipeline/Editor/Lighting/HDReflectionProbeEditor.Preview.cs


if (ValidPreviewSetup())
{
Editor editor = m_CubemapEditor;
CreateCachedEditor(((ReflectionProbe)target).texture, null, ref editor);
CreateCachedEditor(((ReflectionProbe)target).texture, typeof(HDCubemapInspector), ref editor);
m_CubemapEditor = editor as HDCubemapInspector;
}

正在加载...
取消
保存