Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
259c344
[HDRP] Fix coat normal space (#2888)
alelievr Dec 15, 2020
e5e7c25
Merge branch 'master' into hd/bugfix
sebastienlagarde Dec 15, 2020
b68ce13
Avoid issues causing faulty transitions in shadows (resulting in no s…
FrancescoC-unity Dec 15, 2020
9cf8ac1
Merge branch 'master' into hd/bugfix
sebastienlagarde Dec 15, 2020
53096ec
Fixed invalid loop length for probe baking (case 1289680) (#2830)
fredericv-unity3d Dec 15, 2020
7339d48
Fix volumetric fog with XR single-pass (#2823)
fabien-unity Dec 15, 2020
85f8877
[HDRP] Fix rendering issues for the first frame (#2836)
pmavridis Dec 15, 2020
2653b9c
Update 5001_Fog_FogFallback.png
sebastienlagarde Dec 15, 2020
95eb52e
Revert "Update 5001_Fog_FogFallback.png"
sebastienlagarde Dec 15, 2020
33e6948
Update 5001_Fog_FogFallback.unity
sebastienlagarde Dec 15, 2020
fcd7472
Fix AOV API for render graph (#2909)
pmavridis Dec 16, 2020
94f3898
Fix a small discrepancy in the marker placement in light intensity sl…
pmavridis Dec 17, 2020
7767a31
Merge branch 'master' into hd/bugfix
sebastienlagarde Dec 17, 2020
fb1ec50
Update CHANGELOG.md
sebastienlagarde Dec 17, 2020
abb5bb5
Fix issue with VT spewing errors when transparent and opaque are disa…
FrancescoC-unity Dec 17, 2020
6a47be7
Fixed a bug in the sphere-aabb light cluster (case 1294767). (#2920)
anisunity Dec 17, 2020
4b1ac9c
Move EndCameraRendering callback out of the profiling scope (#2917)
adrien-de-tocqueville Dec 17, 2020
980307b
Fixed baked light being included into the ray tracing light cluster (…
anisunity Dec 17, 2020
f738893
Handle all enums the same way for UI (#2913)
adrien-de-tocqueville Dec 17, 2020
a20e885
Changed the message when the graphics device doesn't support ray trac…
anisunity Dec 17, 2020
2784ac6
[HDRP] Fix default blocks for Hair and Eye shader graphs (#2919)
alelievr Dec 17, 2020
b42cae6
Init scene camera debug framesettings (#2931)
adrien-de-tocqueville Dec 17, 2020
2064794
Fixed using the wrong method to define if a light should be included …
anisunity Dec 17, 2020
2fccfa9
[HDRP] Change the behavior of custom passes when the volume is disabl…
alelievr Dec 17, 2020
4befd38
Fixed display of LOD Bias and maximum level in frame settings when us…
JulienIgnace-Unity Dec 17, 2020
1d8d6c5
Fixed an issue when trying to open a look dev env library when Look D…
JulienIgnace-Unity Dec 17, 2020
f0ae90b
Enable Reflector for Spotlight by default
sebastienlagarde Dec 17, 2020
c4ea601
- Fixed shader graph not supporting indirectdxr multibounce (case 129…
anisunity Dec 17, 2020
7276431
Fixed the planar depth texture not being properly created and rendere…
anisunity Dec 18, 2020
4bfd01d
Fixed C# 8 compilation issue with turning on nullable checks (case 13…
sebastienlagarde Dec 18, 2020
0881491
Fixed C# 8 compilation issue with turning on nullable checks - bis (#…
sebastienlagarde Dec 18, 2020
4e4bbcc
Fix scripting light test with enableReflector true by default
sebastienlagarde Dec 18, 2020
226619f
Fixed affects AO for deacl materials (#2950)
adrien-de-tocqueville Dec 18, 2020
bbc60fc
Fixed case where material keywords would not get setup before usage (…
adrien-de-tocqueville Dec 18, 2020
ca4113b
Merge branch 'master' into hd/bugfix
sebastienlagarde Dec 21, 2020
822dca5
Update CHANGELOG.md
sebastienlagarde Dec 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Collections.Generic;
using UnityEngine.UIElements;
using System.IO;
using UnityEditor;
using UnityEditor.UIElements;

namespace UnityEditor.Rendering.LookDev
Expand Down Expand Up @@ -117,26 +118,38 @@ public int IndexOf(Environment environment)
[CustomEditor(typeof(EnvironmentLibrary))]
class EnvironmentLibraryEditor : Editor
{
VisualElement root;
VisualElement m_Root;
VisualElement m_OpenButton;

public sealed override VisualElement CreateInspectorGUI()
{
var library = target as EnvironmentLibrary;
root = new VisualElement();
m_Root = new VisualElement();

Button open = new Button(() =>
m_OpenButton = new Button(() =>
{
if (!LookDev.open)
LookDev.Open();
LookDev.currentContext.UpdateEnvironmentLibrary(library);
LookDev.currentEnvironmentDisplayer.Repaint();
})
{
text = "Open in LookDev window"
text = "Open in Look Dev window"
};
m_OpenButton.SetEnabled(LookDev.supported);

root.Add(open);
return root;
m_Root.Add(m_OpenButton);
return m_Root;
}

void OnEnable() => EditorApplication.update += Update;
void OnDisable() => EditorApplication.update -= Update;

void Update()
{
// Current SRP can be changed at any time so we need to do this at every update.
if (m_OpenButton != null)
m_OpenButton.SetEnabled(LookDev.supported);
}

// Don't use ImGUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,15 @@ bool IntersectRayCone(float3 rayOrigin, float3 rayDirection,
return hit;
}

bool IntersectSphereAABB(float3 position, float radius, float3 aabbMin, float3 aabbMax)
{
float x = max(aabbMin.x, min(position.x, aabbMax.x));
float y = max(aabbMin.y, min(position.y, aabbMax.y));
float z = max(aabbMin.z, min(position.z, aabbMax.z));
float distance2 = ((x - position.x) * (x - position.x) + (y - position.y) * (y - position.y) + (z - position.z) * (z - position.z));
return distance2 < radius * radius;
}

//-----------------------------------------------------------------------------
// Miscellaneous functions
//-----------------------------------------------------------------------------
Expand Down
19 changes: 19 additions & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,29 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed NullPointerException when baking probes from the lighting window (case 1289680)
- Fixed volumetric fog with XR single-pass rendering.
- Fixed issues with first frame rendering when RenderGraph is used (auto exposure, AO)
- Fixed AOV api in render graph (case 1296605)
- Fixed a small discrepancy in the marker placement in light intensity sliders (case 1299750)
- Fixed issue with VT resolve pass rendergraph errors when opaque and transparent are disabled in frame settings.
- Fixed a bug in the sphere-aabb light cluster (case 1294767).
- Fixed issue when submitting SRPContext during EndCameraRendering.
- Fixed baked light being included into the ray tracing light cluster (case 1296203).
- Fixed enums UI for the shadergraph nodes.
- Fixed ShaderGraph stack blocks appearing when opening the settings in Hair and Eye ShaderGraphs.
- Fixed white screen when undoing in the editor.
- Fixed display of LOD Bias and maximum level in frame settings when using Quality Levels
- Fixed an issue when trying to open a look dev env library when Look Dev is not supported.
- Fixed shader graph not supporting indirectdxr multibounce (case 1294694).
- Fixed the planar depth texture not being properly created and rendered to (case 1299617).
- Fixed C# 8 compilation issue with turning on nullable checks (case 1300167)
- Fixed affects AO for deacl materials.
- Fixed case where material keywords would not get setup before usage.

### Changed
- Rename HDRP sub menu in Assets/Create/Shader to HD Render Pipeline for consistency.
- Replaced last package version checker in Wizard to a link on Package Manager
- Changed the message when the graphics device doesn't support ray tracing (case 1287355).
- When a Custom Pass Volume is disabled, the custom pass Cleanup() function is called, it allows to release resources when the volume isn't used anymore.
- Enable Reflector for Spotlight by default

## [10.2.1] - 2020-11-30

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAsse
//due to FB 1175514, this not work. It is being fixed though.
//delayed call of the following work in some case and cause infinite loop in other cases.
AssetDatabase.AddObjectToAsset(assetVersion, asset);

// Init material in case it's used before an inspector window is opened
HDShaderUtils.ResetMaterialKeywords(material);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ static class SliderConfig
public const float k_MarkerHeight = 2;
public const float k_MarkerTooltipScale = 4;
public const float k_ThumbTooltipSize = 10;
public const float k_KnobSize = 10;
}

protected static class SliderStyles
Expand Down Expand Up @@ -118,11 +119,16 @@ void DoSliderMarker(Rect rect, float position, float value, string tooltip)
// Vertically align with slider.
markerRect.y += (EditorGUIUtility.singleLineHeight / 2f) - 1;

// Horizontally place on slider.
const float halfWidth = width * 0.5f;
markerRect.x = rect.x + rect.width * position;
// Horizontally place on slider. We need to take into account the "knob" size when doing this, because position 0 and 1 starts
// at the center of the knob when it's placed at the left and right corner respectively. We don't do this adjustment when placing
// the marker at the corners (to avoid havind the slider slightly extend past the marker)
float knobSize = (position > 0f && position < 1f) ? SliderConfig.k_KnobSize : 0f;
float start = rect.x + knobSize / 2f;
float range = rect.width - knobSize;
markerRect.x = start + range * position;

// Center the marker on value.
const float halfWidth = width * 0.5f;
markerRect.x -= halfWidth;

// Clamp to the slider edges.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@ protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialPro
// All Setup Keyword functions must be static. It allow to create script to automatically update the shaders with a script if code change
static public void SetupCommonDecalMaterialKeywordsAndPass(Material material)
{
bool affectsMaskmap = false;
affectsMaskmap |= material.HasProperty(kAffectMetal) && material.GetFloat(kAffectMetal) == 1.0f;
affectsMaskmap |= material.HasProperty(kAffectAO) && material.GetFloat(kAffectAO) == 1.0f;
affectsMaskmap |= material.HasProperty(kAffectSmoothness) && material.GetFloat(kAffectSmoothness) == 1.0f;

CoreUtils.SetKeyword(material, "_MATERIAL_AFFECTS_ALBEDO", material.HasProperty(kAffectAlbedo) && material.GetFloat(kAffectAlbedo) == 1.0f);
CoreUtils.SetKeyword(material, "_MATERIAL_AFFECTS_NORMAL", material.HasProperty(kAffectNormal) && material.GetFloat(kAffectNormal) == 1.0f);
CoreUtils.SetKeyword(material, "_MATERIAL_AFFECTS_MASKMAP", material.HasProperty(kAffectMetal) && material.GetFloat(kAffectMetal) == 1.0f);
CoreUtils.SetKeyword(material, "_MATERIAL_AFFECTS_MASKMAP", material.HasProperty(kAffectAO) && material.GetFloat(kAffectAO) == 1.0f);
CoreUtils.SetKeyword(material, "_MATERIAL_AFFECTS_MASKMAP", material.HasProperty(kAffectSmoothness) && material.GetFloat(kAffectSmoothness) == 1.0f);
CoreUtils.SetKeyword(material, "_MATERIAL_AFFECTS_MASKMAP", affectsMaskmap);

// Albedo : RT0 RGB, A - sRGB
// Normal : RT1 RGB, A
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public static void CreateEyeGraph()
BlockFields.VertexDescription.Tangent,
BlockFields.SurfaceDescription.BaseColor,
BlockFields.SurfaceDescription.NormalTS,
HDBlockFields.SurfaceDescription.IrisNormalTS,
HDBlockFields.SurfaceDescription.BentNormal,
BlockFields.SurfaceDescription.Smoothness,
HDBlockFields.SurfaceDescription.IOR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public static void CreateHairGraph()
HDBlockFields.SurfaceDescription.SecondarySpecularTint,
HDBlockFields.SurfaceDescription.SecondarySmoothness,
HDBlockFields.SurfaceDescription.SecondarySpecularShift,
BlockFields.SurfaceDescription.Emission,
};

GraphUtil.CreateNewGraphWithOutputs(new[] {target}, blockDescriptors);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,11 @@ public static PassDescriptor GenerateLitRaytracingPrepass()

#region Raytracing Indirect

public static KeywordCollection IndirectDiffuseKeywordCollection = new KeywordCollection
{
{ CoreKeywordDescriptors.multiBounceIndirect },
};

public static PassDescriptor GenerateRaytracingIndirect(bool supportLighting)
{
return new PassDescriptor
Expand All @@ -891,6 +896,7 @@ public static PassDescriptor GenerateRaytracingIndirect(bool supportLighting)
// Collections
pragmas = CorePragmas.RaytracingBasic,
defines = supportLighting ? RaytracingIndirectDefines : null,
keywords = supportLighting ? IndirectDiffuseKeywordCollection : null,
includes = GenerateIncludes(),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1324,6 +1324,15 @@ static class CoreKeywordDescriptors
definition = KeywordDefinition.ShaderFeature,
scope = KeywordScope.Local,
};

public static KeywordDescriptor multiBounceIndirect = new KeywordDescriptor
{
displayName = "Multi Bounce Indirect",
referenceName = "MULTI_BOUNCE_INDIRECT",
type = KeywordType.Boolean,
definition = KeywordDefinition.MultiCompile,
scope = KeywordScope.Global,
};
}
#endregion
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,7 @@ protected void AddProperty<Data>(GUIContent displayName, Func<Data> getter, Acti
case bool b: elem = new Toggle { value = b, tooltip = displayName.tooltip } as BaseField<Data>; break;
case int i: elem = new IntegerField { value = i, tooltip = displayName.tooltip } as BaseField<Data>; break;
case float f: elem = new FloatField { value = f, tooltip = displayName.tooltip } as BaseField<Data>; break;
case SurfaceType e: elemEnum = new EnumField(e) { value = e, tooltip = displayName.tooltip } as BaseField<Enum>; break;
case RenderQueueType e: elemEnum = new EnumField(e) { value = e, tooltip = displayName.tooltip } as BaseField<Enum>; break;
case BlendMode e: elemEnum = new EnumField(e) { value = e, tooltip = displayName.tooltip } as BaseField<Enum>; break;
case CompareFunction e: elemEnum = new EnumField(e) { value = e, tooltip = displayName.tooltip } as BaseField<Enum>; break;
case TransparentCullMode e: elemEnum = new EnumField(e) { value = e, tooltip = displayName.tooltip } as BaseField<Enum>; break;
case DoubleSidedMode e: elemEnum = new EnumField(e) { value = e, tooltip = displayName.tooltip } as BaseField<Enum>; break;
case NormalDropOffSpace e: elemEnum = new EnumField(e) { value = e, tooltip = displayName.tooltip } as BaseField<Enum>; break;
case HDLitData.MaterialType e: elemEnum = new EnumField(e) { value = e, tooltip = displayName.tooltip } as BaseField<Enum>; break;
case DistortionMode e: elemEnum = new EnumField(e) { value = e, tooltip = displayName.tooltip } as BaseField<Enum>; break;
case ScreenSpaceRefraction.RefractionModel e: elemEnum = new EnumField(e) { value = e, tooltip = displayName.tooltip } as BaseField<Enum>; break;
case SpecularOcclusionMode e: elemEnum = new EnumField(e) { value = e, tooltip = displayName.tooltip } as BaseField<Enum>; break;
case FabricData.MaterialType e: elemEnum = new EnumField(e) { value = e, tooltip = displayName.tooltip } as BaseField<Enum>; break;
case EyeData.MaterialType e: elemEnum = new EnumField(e) { value = e, tooltip = displayName.tooltip } as BaseField<Enum>; break;
case StackLit.BaseParametrization e: elemEnum = new EnumField(e) { value = e, tooltip = displayName.tooltip } as BaseField<Enum>; break;
case StackLit.DualSpecularLobeParametrization e: elemEnum = new EnumField(e) { value = e, tooltip = displayName.tooltip } as BaseField<Enum>; break;
case OpaqueCullMode e: elemEnum = new EnumField(e) { value = e, tooltip = displayName.tooltip } as BaseField<Enum>; break;
case Enum e: elemEnum = new EnumField(e) { value = e, tooltip = displayName.tooltip }; break;
default: throw new Exception($"Can't create UI field for type {getter().GetType()}, please add it if it's relevant. If you can't consider using TargetPropertyGUIContext.AddProperty instead.");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public class GeneralSection
public static readonly GUIContent supportRaytracing = EditorGUIUtility.TrTextContent("Realtime Raytracing (Preview)");
public static readonly GUIContent supportedRayTracingMode = EditorGUIUtility.TrTextContent("Supported Ray Tracing Mode (Preview)");
public static readonly GUIContent rayTracingUnsupportedWarning = EditorGUIUtility.TrTextContent("Ray tracing is not supported on your device. Please refer to the documentation.");
public static readonly GUIContent rayTracingDX12OnlyWarning = EditorGUIUtility.TrTextContent("Ray tracing is currently only supported on DX12.");
public static readonly GUIContent maximumLODLevel = EditorGUIUtility.TrTextContent("Maximum LOD Level");
public static readonly GUIContent LODBias = EditorGUIUtility.TrTextContent("LOD Bias");
internal static readonly GUIContent supportProbeVolumeContent = EditorGUIUtility.TrTextContent("Probe Volume", "When enabled, HDRP allocates Shader variants and memory for probe volume based GI. This allows you to use probe volumes in your Unity Project.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,14 @@ static void Drawer_SectionRenderingUnsorted(SerializedHDRenderPipelineAsset seri
EditorGUILayout.PropertyField(serialized.renderPipelineSettings.supportedRayTracingMode, Styles.supportedRayTracingMode);
if (serialized.renderPipelineSettings.supportRayTracing.boolValue && !UnityEngine.SystemInfo.supportsRayTracing)
{
EditorGUILayout.HelpBox(Styles.rayTracingUnsupportedWarning.text, MessageType.Warning, wide: true);
if (PlayerSettings.GetGraphicsAPIs(EditorUserBuildSettings.activeBuildTarget)[0] != GraphicsDeviceType.Direct3D12)
{
EditorGUILayout.HelpBox(Styles.rayTracingDX12OnlyWarning.text, MessageType.Warning, wide: true);
}
else
{
EditorGUILayout.HelpBox(Styles.rayTracingUnsupportedWarning.text, MessageType.Warning, wide: true);
}
}
--EditorGUI.indentLevel;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ static void Drawer_SectionRenderingSettings(SerializedFrameSettings serialized,
hasMixedValues: serialized.lodBiasQualityLevel.hasMultipleDifferentValues);

area.AmmendInfo(FrameSettingsField.LODBias,
overridedDefaultValue: QualitySettings.lodBias,
overridedDefaultValue: hdrpSettings.lodBias[serialized.lodBiasQualityLevel.intValue],
customGetter: () => serialized.lodBias.floatValue,
customSetter: v => serialized.lodBias.floatValue = (float)v,
customOverrideable: () => serialized.lodBiasMode.GetEnumValue<LODBiasMode>() != LODBiasMode.FromQualitySettings,
Expand All @@ -287,7 +287,7 @@ static void Drawer_SectionRenderingSettings(SerializedFrameSettings serialized,
hasMixedValues: serialized.maximumLODLevelQualityLevel.hasMultipleDifferentValues);

area.AmmendInfo(FrameSettingsField.MaximumLODLevel,
overridedDefaultValue: QualitySettings.maximumLODLevel,
overridedDefaultValue: hdrpSettings.maximumLODLevel[serialized.maximumLODLevelQualityLevel.intValue],
customGetter: () => serialized.maximumLODLevel.intValue,
customSetter: v => serialized.maximumLODLevel.intValue = (int)v,
customOverrideable: () => serialized.maximumLODLevelMode.GetEnumValue<MaximumLODLevelMode>() != MaximumLODLevelMode.FromQualitySettings,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System;
using System.Reflection;
using UnityEngine.Rendering.HighDefinition.Attributes;

namespace UnityEngine.Rendering.HighDefinition
Expand Down Expand Up @@ -154,9 +155,7 @@ static MaterialDebugSettings()
// className include the additional "/"
static void FillWithProperties(Type type, ref List<GUIContent> debugViewMaterialStringsList, ref List<int> debugViewMaterialValuesList, string className)
{
var attributes = type.GetCustomAttributes(true);
// Get attribute to get the start number of the value for the enum
var attr = attributes[0] as GenerateHLSL;
var attr = type.GetCustomAttribute<GenerateHLSL>();

if (!attr.needParamDebug)
{
Expand Down Expand Up @@ -359,8 +358,7 @@ static void BuildDebugRepresentation()

// builtins parameters
Type builtin = typeof(Builtin.BuiltinData);
var attributes = builtin.GetCustomAttributes(true);
var generateHLSLAttribute = attributes[0] as GenerateHLSL;
var generateHLSLAttribute = builtin.GetCustomAttribute<GenerateHLSL>();
int materialStartIndex = generateHLSLAttribute.paramDefinesStart;

int localIndex = 0;
Expand All @@ -379,8 +377,7 @@ static void BuildDebugRepresentation()
// specific shader parameters
foreach (MaterialItem materialItem in materialItems)
{
attributes = materialItem.surfaceDataType.GetCustomAttributes(true);
generateHLSLAttribute = attributes[0] as GenerateHLSL;
generateHLSLAttribute = materialItem.surfaceDataType.GetCustomAttribute<GenerateHLSL>();
materialStartIndex = generateHLSLAttribute.paramDefinesStart;

if (!generateHLSLAttribute.needParamDebug)
Expand All @@ -404,8 +401,7 @@ static void BuildDebugRepresentation()
if (materialItem.bsdfDataType == null)
continue;

attributes = materialItem.bsdfDataType.GetCustomAttributes(true);
generateHLSLAttribute = attributes[0] as GenerateHLSL;
generateHLSLAttribute = materialItem.bsdfDataType.GetCustomAttribute<GenerateHLSL>();
materialStartIndex = generateHLSLAttribute.paramDefinesStart;

if (!generateHLSLAttribute.needParamDebug)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public float intensity

// Only for Spotlight, should be hide for other light
[SerializeField, FormerlySerializedAs("enableSpotReflector")]
bool m_EnableSpotReflector = false;
bool m_EnableSpotReflector = true;
/// <summary>
/// Get/Set the Spot Reflection option on spot lights.
/// </summary>
Expand Down
Loading