浏览代码

Optimize the GUI image drawing code

/Branch_Batching2
Evgenii Golubev 8 年前
当前提交
d4f421c8
共有 1 个文件被更改,包括 6 次插入16 次删除
  1. 22
      Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/SubsurfaceScatteringParameters.cs

22
Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/SubsurfaceScatteringParameters.cs


EditorGUILayout.PropertyField(profileThicknessScale, styles.profileThicknessScale);
EditorGUILayout.Space();
using (new EditorGUILayout.HorizontalScope())
{
// Draw the profile.
m_ProfileMaterial.SetColor("_StdDev1", profileStdDev1.colorValue);
m_ProfileMaterial.SetColor("_StdDev2", profileStdDev2.colorValue);
m_ProfileMaterial.SetFloat("_LerpWeight", profileLerpWeight.floatValue);
Graphics.Blit(null, m_ProfileImages[i], m_ProfileMaterial);
// Reset the active RT.
RenderTexture.active = null;
GUILayout.FlexibleSpace();
Rect r = GUILayoutUtility.GetRect(256, 256);
GUILayout.FlexibleSpace();
EditorGUI.DrawPreviewTexture(r, m_ProfileImages[i]);
}
// Draw the profile.
m_ProfileMaterial.SetColor("_StdDev1", profileStdDev1.colorValue);
m_ProfileMaterial.SetColor("_StdDev2", profileStdDev2.colorValue);
m_ProfileMaterial.SetFloat("_LerpWeight", profileLerpWeight.floatValue);
EditorGUI.DrawPreviewTexture(GUILayoutUtility.GetRect(256, 256), m_ProfileImages[i], m_ProfileMaterial, ScaleMode.ScaleToFit);
EditorGUI.indentLevel--;
}

正在加载...
取消
保存