浏览代码

Merge branch 'master' of https://github.com/Unity-Technologies/ScriptableRenderLoop into feature/realtimeCubemap

# Conflicts:
#	TestbedPipelines/OnTileDeferredPipeline/OnTileDeferredRenderPipeline.cs
/Add-support-for-light-specular-color-tint
Julien Ignace 7 年前
当前提交
1a5590ab
共有 14 个文件被更改,包括 46 次插入40 次删除
  1. 7
      ScriptableRenderPipeline/Core/CoreUtils.cs
  2. 5
      ScriptableRenderPipeline/Core/Debugging/Editor/DebugMenuEditor.cs
  3. 4
      ScriptableRenderPipeline/Core/ShaderGenerator/Editor/ShaderGeneratorMenu.cs
  4. 5
      ScriptableRenderPipeline/HDRenderPipeline/Editor/HDAssetFactory.cs
  5. 28
      ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs
  6. 7
      ScriptableRenderPipeline/HDRenderPipeline/Editor/UpgradeStandardShaderMaterials.cs
  7. 6
      ScriptableRenderPipeline/LightweightPipeline/Editor/LegacyShadersToLightweightPipelineUpgrader.cs
  8. 5
      ScriptableRenderPipeline/LightweightPipeline/Editor/StandardToLightweightMaterialUpgrader.cs
  9. 2
      ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineAsset.cs
  10. 4
      TestbedPipelines/BasicRenderPipeline/BasicRenderPipeline.cs
  11. 2
      TestbedPipelines/Fptl/FptlLighting.cs
  12. 4
      TestbedPipelines/OnTileDeferredPipeline/OnTileDeferredRenderPipeline.cs
  13. 5
      Tests/GraphicsTests/Framework/Editor/TestFrameworkCustomBuild.cs
  14. 2
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/CommonAssets/Scripts/Editor/GraphicTestTools.cs

7
ScriptableRenderPipeline/Core/CoreUtils.cs


using System;
using System;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;

// Note: Color.Black have alpha channel set to 1. Most of the time we want alpha channel set to 0 as we use black to clear render target
public static Color clearColorAllBlack { get { return new Color(0f, 0f, 0f, 0f); } }
public const int editMenuPriority1 = 320;
public const int editMenuPriority2 = 331;
public const int assetCreateMenuPriority1 = 230;
public const int assetCreateMenuPriority2 = 241;
// Render Target Management.
public static void SetRenderTarget(CommandBuffer cmd, RenderTargetIdentifier buffer, ClearFlag clearFlag, Color clearColor, int miplevel = 0, CubemapFace cubemapFace = CubemapFace.Unknown)

5
ScriptableRenderPipeline/Core/Debugging/Editor/DebugMenuEditor.cs


using UnityEngine;
using UnityEditor;
namespace UnityEngine.Experimental.Rendering

[SerializeField]
private DebugMenuState m_DebugMenuState;
[MenuItem("HDRenderPipeline/Debug Window")]
[MenuItem("Edit/Render Pipeline/Tools/High Definition/Debug Window", priority = CoreUtils.editMenuPriority2)]
static void DisplayDebugMenu()
{
var window = EditorWindow.GetWindow<DebugMenuEditor>("Debug Window");

}
}
}
}

4
ScriptableRenderPipeline/Core/ShaderGenerator/Editor/ShaderGeneratorMenu.cs


using UnityEngine.Experimental.Rendering;
[UnityEditor.MenuItem("RenderPipeline/Generate Shader Includes")]
[UnityEditor.MenuItem("Edit/Render Pipeline/Tools/Generate Shader Includes", priority = CoreUtils.editMenuPriority1)]
static void GenerateShaderIncludes()
{
CSharpToHLSL.GenerateAll();

5
ScriptableRenderPipeline/HDRenderPipeline/Editor/HDAssetFactory.cs


using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering.HDPipeline

get { return HDEditorUtils.GetHDRenderPipelinePath() + "RenderPipelineResources/HDRenderPipelineResources.asset"; }
}
[MenuItem("RenderPipeline/HDRenderPipeline/Create Pipeline Asset", false, 16)]
[MenuItem("Assets/Create/Render Pipeline/High Definition/Render Pipeline", priority = CoreUtils.assetCreateMenuPriority1)]
static void CreateHDRenderPipeline()
{
var instance = ScriptableObject.CreateInstance<HDRenderPipelineAsset>();

// TODO skybox/cubemap
[MenuItem("RenderPipeline/HDRenderPipeline/Create Resources Asset", false, 15)]
[MenuItem("Assets/Create/Render Pipeline/High Definition/Render Pipeline Resources", priority = CoreUtils.assetCreateMenuPriority2)]
static void CreateRenderPipelineResources()
{
string HDRenderPipelinePath = HDEditorUtils.GetHDRenderPipelinePath();

28
ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs


public class HDRenderPipelineMenuItems
{
[MenuItem("HDRenderPipeline/Add \"Additional Light-shadow Data\" (if not present)")]
[MenuItem("Internal/HDRenderPipeline/Add \"Additional Light-shadow Data\" (if not present)")]
static void AddAdditionalLightData()
{
var lights = UnityObject.FindObjectsOfType(typeof(Light)) as Light[];

}
}
[MenuItem("HDRenderPipeline/Add \"Additional Camera Data\" (if not present)")]
[MenuItem("Internal/HDRenderPipeline/Add \"Additional Camera Data\" (if not present)")]
static void AddAdditionalCameraData()
{
var cameras = UnityObject.FindObjectsOfType(typeof(Camera)) as Camera[];

}
// This script is a helper for the artists to re-synchronize all layered materials
[MenuItem("HDRenderPipeline/Synchronize all Layered materials")]
[MenuItem("Internal/HDRenderPipeline/Synchronize all Layered materials")]
static void SynchronizeAllLayeredMaterial()
{
var materials = Resources.FindObjectsOfTypeAll<Material>();

// In case the shader code have change and the inspector have been update with new kind of keywords we need to regenerate the set of keywords use by the material.
// This script will remove all keyword of a material and trigger the inspector that will re-setup all the used keywords.
// It require that the inspector of the material have a static function call that update all keyword based on material properties.
[MenuItem("HDRenderPipeline/Test/Reset all materials keywords")]
[MenuItem("Edit/Render Pipeline/Upgrade/High Definition/Reset All Materials Keywords (Loaded Materials)", priority = CoreUtils.editMenuPriority2)]
static void ResetAllMaterialKeywords()
{
try

}
}
[MenuItem("HDRenderPipeline/Test/Reset all materials keywords in project")]
[MenuItem("Edit/Render Pipeline/Upgrade/High Definition/Reset All Materials Keywords (Materials in Project)", priority = CoreUtils.editMenuPriority2)]
static void ResetAllMaterialKeywordsInProject()
{
try

}
}
[MenuItem("HDRenderPipeline/Update/Update SSS profile indices")]
[MenuItem("Internal/HDRenderPipeline/Update/Update SSS profile indices")]
static void UpdateSSSProfileIndices()
{
try

}
// Function used only to check performance of data with and without tessellation
[MenuItem("HDRenderPipeline/Test/Remove tessellation materials (not reversible)")]
[MenuItem("Internal/HDRenderPipeline/Test/Remove tessellation materials (not reversible)")]
static void RemoveTessellationMaterials()
{
var materials = Resources.FindObjectsOfTypeAll<Material>();

}
}
[MenuItem("HDRenderPipeline/Export Sky to Image")]
[MenuItem("Edit/Render Pipeline/Tools/High Definition/Export Sky to Image", priority = CoreUtils.editMenuPriority2)]
static void ExportSkyToImage()
{
var renderpipeline = RenderPipelineManager.currentPipeline as HDRenderPipeline;

}
}
[MenuItem("GameObject/HD Render Pipeline/Scene Settings", false, 10)]
[MenuItem("GameObject/Render Pipeline/High Definition/Scene Settings", priority = 10)]
static void CreateCustomGameObject(MenuCommand menuCommand)
{
var sceneSettings = new GameObject("Scene Settings");

class DoCreateNewAssetProceduralSkySettings : DoCreateNewAsset<ProceduralSkySettings> {}
class DoCreateNewAssetSubsurfaceScatteringSettings : DoCreateNewAsset<SubsurfaceScatteringSettings> {}
[MenuItem("Assets/Create/HDRenderPipeline/Common Settings", priority = 700)]
[MenuItem("Assets/Create/Render Pipeline/High Definition/Common Settings", priority = CoreUtils.assetCreateMenuPriority2)]
static void MenuCreateCommonSettings()
{
var icon = EditorGUIUtility.FindTexture("ScriptableObject Icon");

[MenuItem("Assets/Create/HDRenderPipeline/Subsurface Scattering Settings", priority = 702)]
[MenuItem("Assets/Create/Render Pipeline/High Definition/Subsurface Scattering Settings", priority = CoreUtils.assetCreateMenuPriority2)]
static void MenuCreateSubsurfaceScatteringProfile()
{
var icon = EditorGUIUtility.FindTexture("ScriptableObject Icon");

[MenuItem("Assets/Create/HDRenderPipeline/HDRISky Settings", priority = 750)]
[MenuItem("Assets/Create/Render Pipeline/High Definition/HDRISky Settings", priority = CoreUtils.assetCreateMenuPriority2)]
static void MenuCreateHDRISkySettings()
{
var icon = EditorGUIUtility.FindTexture("ScriptableObject Icon");

[MenuItem("Assets/Create/HDRenderPipeline/BlacksmithSky Settings", priority = 751)]
[MenuItem("Assets/Create/Render Pipeline/High Definition/BlacksmithSky Settings", priority = CoreUtils.assetCreateMenuPriority2)]
static void MenuCreateBlacksmithSkySettings()
{
var icon = EditorGUIUtility.FindTexture("ScriptableObject Icon");

[MenuItem("Assets/Create/HDRenderPipeline/ProceduralSky Settings", priority = 752)]
[MenuItem("Assets/Create/Render Pipeline/High Definition/ProceduralSky Settings", priority = CoreUtils.assetCreateMenuPriority2)]
static void MenuCreateProceduralSkySettings()
{
var icon = EditorGUIUtility.FindTexture("ScriptableObject Icon");

7
ScriptableRenderPipeline/HDRenderPipeline/Editor/UpgradeStandardShaderMaterials.cs


using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
namespace UnityEditor.Experimental.Rendering.HDPipeline
{

return upgraders;
}
[MenuItem("RenderPipeline/HDRenderPipeline/Material Upgraders/Upgrade Standard Materials to Lit Materials - Project Folder", false, 1)]
[MenuItem("Edit/Render Pipeline/Upgrade/High Definition/Upgrade Standard Materials to Lit Materials (Project)", priority = CoreUtils.editMenuPriority2)]
[MenuItem("RenderPipeline/HDRenderPipeline/Material Upgraders/Upgrade Standard Materials to Lit Materials - Selection", false, 2)]
[MenuItem("Edit/Render Pipeline/Upgrade/High Definition/Upgrade Standard Materials to Lit Materials (Selection)", priority = CoreUtils.editMenuPriority2)]
[MenuItem("RenderPipeline/HDRenderPipeline/Material Upgraders/Modify Light Intensity for Upgrade - Scene Only", false, 3)]
[MenuItem("Edit/Render Pipeline/Upgrade/High Definition/Modify Light Intensity for Upgrade (Scene Only)", priority = CoreUtils.editMenuPriority2)]
static void UpgradeLights()
{
Light[] lights = Light.GetLights(LightType.Directional, 0);

6
ScriptableRenderPipeline/LightweightPipeline/Editor/LegacyShadersToLightweightPipelineUpgrader.cs


{
public class LegacyShadersToLightweightPipelineUpgrader
{
//[MenuItem("RenderPipeline/Lightweight Pipeline/Material Upgraders/Upgrade Legacy Materials to LightweightPipeline - Project", false, 3)]
//[MenuItem("Edit/Render Pipeline/Upgrade/Lightweight/Upgrade Legacy Materials to Lightweight Pipeline (Project)", priority = CoreUtils.editMenuPriority)]
//[MenuItem("RenderPipeline/Lightweight Pipeline/Material Upgraders/Upgrade Legacy Materials to LightweightPipeline - Selection", false, 4)]
//[MenuItem("Edit/Render Pipeline/Upgrade/Lightweight/Upgrade Legacy Materials to Lightweight Pipeline (Selection)", priority = CoreUtils.editMenuPriority)]
// MaterialUpgrader.UpgradeSelection(materialUpgraders, "Upgrade to Lightweight Materials");
//}

5
ScriptableRenderPipeline/LightweightPipeline/Editor/StandardToLightweightMaterialUpgrader.cs


using System.Collections.Generic;
using UnityEngine.Experimental.Rendering;
[MenuItem("RenderPipeline/Lightweight Pipeline/Material Upgraders/Upgrade Project Materials", false, 1)]
[MenuItem("Edit/Render Pipeline/Upgrade/Lightweight/Upgrade Standard Materials to Lightweight Pipeline (Project)", priority = CoreUtils.editMenuPriority2)]
private static void UpgradeMaterialsToLDProject()
{
List<MaterialUpgrader> upgraders = new List<MaterialUpgrader>();

}
[MenuItem("RenderPipeline/Lightweight Pipeline/Material Upgraders/Upgrade Selected Materials", false, 2)]
[MenuItem("Edit/Render Pipeline/Upgrade/Lightweight/Upgrade Standard Materials to Lightweight Pipeline (Selection)", priority = CoreUtils.editMenuPriority2)]
private static void UpgradeMaterialsToLDSelection()
{
List<MaterialUpgrader> upgraders = new List<MaterialUpgrader>();

2
ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineAsset.cs


[SerializeField] private Shader m_DefaultShader;
#if UNITY_EDITOR
[UnityEditor.MenuItem("RenderPipeline/Lightweight Pipeline/Create Pipeline Asset", false, 15)]
[UnityEditor.MenuItem("Assets/Create/Render Pipeline/Lightweight/Render Pipeline", priority = CoreUtils.assetCreateMenuPriority1)]
static void CreateLightweightPipeline()
{
var instance = ScriptableObject.CreateInstance<LightweightPipelineAsset>();

4
TestbedPipelines/BasicRenderPipeline/BasicRenderPipeline.cs


public bool UseIntermediateRenderTargetBlit;
#if UNITY_EDITOR
[UnityEditor.MenuItem("RenderPipeline/Create BasicRenderPipeline")]
[UnityEditor.MenuItem("Assets/Create/Render Pipeline/Basic/Render Pipeline", priority = CoreUtils.assetCreateMenuPriority1)]
static void CreateBasicRenderPipeline()
{
var instance = ScriptableObject.CreateInstance<BasicRenderPipeline>();

CommandBufferPool.Release(blitIntermediateRTCmd);
}
// Main entry point for our scriptable render loop
public static void Render(ScriptableRenderContext context, IEnumerable<Camera> cameras, bool useIntermediateBlitPath)

2
TestbedPipelines/Fptl/FptlLighting.cs


public class FptlLighting : RenderPipelineAsset
{
#if UNITY_EDITOR
[UnityEditor.MenuItem("RenderPipeline/Create FPTLRenderPipeline")]
[UnityEditor.MenuItem("Assets/Create/Render Pipeline/FPTL/Render Pipeline", priority = CoreUtils.assetCreateMenuPriority1)]
static void CreateRenderLoopFPTL()
{
var instance = ScriptableObject.CreateInstance<FptlLighting>();

4
TestbedPipelines/OnTileDeferredPipeline/OnTileDeferredRenderPipeline.cs


public class OnTileDeferredRenderPipeline : RenderPipelineAsset {
#if UNITY_EDITOR
[UnityEditor.MenuItem("RenderPipeline/OnTileDeferredPipeline/Create Pipeline Asset", false, 17)]
[UnityEditor.MenuItem("Assets/Create/Render Pipeline/On Tile Deferred/Render Pipeline", priority = CoreUtils.assetCreateMenuPriority1)]
static void CreateDeferredRenderPipeline()
{
var instance = ScriptableObject.CreateInstance<OnTileDeferredRenderPipeline> ();

[UnityEditor.MenuItem("RenderPipeline/OnTileDeferredPipeline/Material Upgraders/Upgrade Standard Shader Materials")]
[UnityEditor.MenuItem("Edit/Render Pipeline/Upgrade/On Tile Deferred/Upgrade Standard Shader Materials", priority = CoreUtils.editMenuPriority2)]
static void SetupDeferredRenderPipelineMaterials()
{
Renderer[] _renderers = Component.FindObjectsOfType<Renderer> ();

5
Tests/GraphicsTests/Framework/Editor/TestFrameworkCustomBuild.cs


private static readonly string s_TestSceneFolder = "/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes";
private static readonly string s_BuildFolder = "/TestScenesBuild";
[MenuItem("RenderPipeline/TestFramework/Build-iOS")]
[MenuItem("Internal/RenderPipeline/TestFramework/Build-iOS")]
public static void BuildiOS()
{
TestFrameworkCustomBuild builder = new TestFrameworkCustomBuild();

[MenuItem("RenderPipeline/TestFramework/Build-iOS", true)]
[MenuItem("Internal/RenderPipeline/TestFramework/Build-iOS", true)]
public static bool ValidateBuildiOS()
{
#if UNITY_STANDALONE_OSX

2
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/CommonAssets/Scripts/Editor/GraphicTestTools.cs


public class GraphicTestTools
{
[MenuItem("GraphicTest Tools/Make Material Scene Instance")]
[MenuItem("Internal/GraphicTest Tools/Make Material Scene Instance")]
public static void MakeMaterialSceneInstance()
{
foreach(Object obj in Selection.objects)

正在加载...
取消
保存