浏览代码

Move things around in preview generator

/main
Peter Bay Bastian 7 年前
当前提交
5b4c9be5
共有 1 个文件被更改,包括 8 次插入8 次删除
  1. 16
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphPreviewGenerator.cs

16
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphPreviewGenerator.cs


Light1.color = new Color(.4f, .4f, .45f, 0f) * .7f;
m_CheckerboardMaterial = new Material(Shader.Find("Hidden/Checkerboard"));
m_CheckerboardMaterial.SetFloat("_X", 32);
m_CheckerboardMaterial.SetFloat("_Y", 32);
if (s_Meshes[0] == null)
{

return;
m_Camera.targetTexture = renderTexture;
Unsupported.SetOverrideRenderSettings(m_Scene);
RenderTexture.active = renderTexture;
GL.Clear(true, true, Color.black);
m_CheckerboardMaterial.SetFloat("_X", 32);
m_CheckerboardMaterial.SetFloat("_Y", 32);
Graphics.Blit(Texture2D.whiteTexture, renderTexture, m_CheckerboardMaterial);
if (mode == PreviewMode.Preview3D)
{
m_Camera.transform.position = -Vector3.forward * 5;

m_Camera.orthographic = true;
}
Unsupported.SetOverrideRenderSettings(m_Scene);
RenderTexture.active = renderTexture;
GL.Clear(true, true, Color.black);
Graphics.Blit(Texture2D.whiteTexture, renderTexture, m_CheckerboardMaterial);
EditorUtility.SetCameraAnimateMaterialsTime(m_Camera, time);
Light0.enabled = true;

正在加载...
取消
保存