浏览代码

HDRenderPipeline: Move some item to submenu + add comment on velocity for GBfuffer pass

/RenderPassXR_Sandbox
sebastienlagarde 8 年前
当前提交
dffcbac5
共有 5 个文件被更改,包括 28 次插入23 次删除
  1. 20
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs
  2. 6
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/UpgradeStandardShaderMaterials.cs
  3. 15
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipelineAsset.cs
  4. 8
      Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderConfig.cs
  5. 2
      ProjectSettings/ProjectVersion.txt

20
Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs


using UnityEngine.SceneManagement;
using UnityEngine.Experimental.Rendering.HDPipeline;
using System.IO;
using UnityEngine.Experimental.Rendering;
[UnityEditor.MenuItem("HDRenderPipeline/Add \"Additional Light Data\" (if not present)")]
static void AddAdditionalLightData()
{
Light[] lights = GameObject.FindObjectsOfType(typeof(Light)) as Light[];
foreach (Light light in lights)
{
// Do not add a component if there already is one.
if (light.GetComponent<AdditionalLightData>() == null)
{
light.gameObject.AddComponent<AdditionalLightData>();
}
}
}
// This script is a helper for the artists to re-synchronise all layered materials
[MenuItem("HDRenderPipeline/Synchronize all Layered materials")]
static void SynchronizeAllLayeredMaterial()

// 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/Reset all materials keywords")]
[MenuItem("HDRenderPipeline/Test/Reset all materials keywords")]
static void ResetAllMaterialKeywords()
{
try

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

6
Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/UpgradeStandardShaderMaterials.cs


return upgraders;
}
[MenuItem("HDRenderPipeline/Upgrade Materials - Project")]
[MenuItem("HDRenderPipeline/Upgrader/Upgrade Materials - Project")]
[MenuItem("HDRenderPipeline/Upgrade Materials - Selection")]
[MenuItem("HDRenderPipeline/Upgrader/Upgrade Materials - Selection")]
[MenuItem("HDRenderPipeline/Modify Light Intensity for Upgrade - Scene Only")]
[MenuItem("HDRenderPipeline/Upgrader/Modify Light Intensity for Upgrade - Scene Only")]
static void UpgradeLights()
{
Light[] lights = Light.GetLights(LightType.Directional, 0);

15
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipelineAsset.cs


// If it exist, load renderPipelineResources
instance.renderPipelineResources = AssetDatabase.LoadAssetAtPath<RenderPipelineResources>(RenderPipelineResources.renderPipelineResourcesPath);
}
[UnityEditor.MenuItem("HDRenderPipeline/Add \"Additional Light Data\" (if not present)")]
static void AddAdditionalLightData()
{
Light[] lights = FindObjectsOfType(typeof(Light)) as Light[];
foreach (Light light in lights)
{
// Do not add a component if there already is one.
if (light.GetComponent<AdditionalLightData>() == null)
{
light.gameObject.AddComponent<AdditionalLightData>();
}
}
}
#endif
private HDRenderPipelineAsset()

8
Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderConfig.cs


[GenerateHLSL(PackingRules.Exact)]
public enum ShaderOptions
{
// TODO: Currently it is not yet possible to use this feature, we need to provide previousPositionCS to the vertex shader as part of Attribute for GBuffer pass
// TODO: How to enable this feature only on mesh that effectively require it like skinned and moving mesh (other can be done with depth reprojection. But TAA can be an issue)
// TODO: It is not possible to use VelocityInGBuffer feature yet. This feature allow to render motion vectors during Gbuffer pass. However Unity have limitation today that forbid to do that.
// 1) Currently previousPositionCS is provide to the vertex shader with a hard coded NORMAL semantic (in the vertex declaration - See MeshRenderingData.cpp "pSecondaryFormat = gMotionVectorRenderFormat.GetVertexFormat();") mean it will overwrite the normal
// 2) All current available semantic (see ShaderChannelMask) are used in our Lit shader. Mean just changing the semantic is not enough, Unity need to unlock other Texcoord semantic
// 3) When this is solve (i.e move previousPositionCS to a free attribute semantic), Unity only support one pSecondaryFormat. Mean if we ahve a vertex color instance stream and motion vector, motion vector will overwrite vertex color stream. See MeshRenderingData.cpp
// All this could be fix we a new Mesh API not ready yet. Note that this feature only affect animated mesh (vertex or skin) as others use depth reprojection.
// TODO: not working yet, waiting for UINT16 RT format support
PackGBufferInU16 = 0
};

2
ProjectSettings/ProjectVersion.txt


m_EditorVersion: 2017.2.0a4
m_EditorVersion: 2017.2.0b1
正在加载...
取消
保存