Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
anisunity committed Mar 23, 2021
1 parent 323bf56 commit 5832b3a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 49 deletions.
Expand Up @@ -16,8 +16,6 @@ MonoBehaviour:
rotation:
m_OverrideState: 0
m_Value: 0
min: 0
max: 360
skyIntensityMode:
m_OverrideState: 0
m_Value: 0
Expand All @@ -27,11 +25,9 @@ MonoBehaviour:
multiplier:
m_OverrideState: 0
m_Value: 1
min: 0
upperHemisphereLuxValue:
m_OverrideState: 0
m_Value: 5.20731
min: 0
upperHemisphereLuxColor:
m_OverrideState: 0
m_Value: {x: 0.4714623, y: 0.4714616, z: 0.5}
Expand All @@ -44,7 +40,6 @@ MonoBehaviour:
updatePeriod:
m_OverrideState: 0
m_Value: 0
min: 0
includeSunInBaking:
m_OverrideState: 0
m_Value: 0
Expand All @@ -66,12 +61,9 @@ MonoBehaviour:
scrollDirection:
m_OverrideState: 0
m_Value: 0
min: 0
max: 360
scrollSpeed:
m_OverrideState: 0
m_Value: 2
min: 0
enableBackplate:
m_OverrideState: 0
m_Value: 0
Expand All @@ -87,31 +79,21 @@ MonoBehaviour:
projectionDistance:
m_OverrideState: 0
m_Value: 16
min: 0.0000001
plateRotation:
m_OverrideState: 0
m_Value: 0
min: 0
max: 360
plateTexRotation:
m_OverrideState: 0
m_Value: 0
min: 0
max: 360
plateTexOffset:
m_OverrideState: 0
m_Value: {x: 0, y: 0}
blendAmount:
m_OverrideState: 0
m_Value: 0
min: 0
max: 100
shadowTint:
m_OverrideState: 0
m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1}
hdr: 0
showAlpha: 1
showEyeDropper: 1
pointLightShadow:
m_OverrideState: 0
m_Value: 0
Expand Down Expand Up @@ -145,17 +127,12 @@ MonoBehaviour:
maxDepth:
m_OverrideState: 0
m_Value: 4
min: 1
max: 10
rayLength:
m_OverrideState: 0
m_Value: 10
min: 0
minSmoothness:
m_OverrideState: 0
m_Value: 0.5
min: 0
max: 1
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -223,13 +200,9 @@ MonoBehaviour:
m_MinSmoothness:
m_OverrideState: 1
m_Value: 0
min: 0
max: 1
m_SmoothnessFadeStart:
m_OverrideState: 0
m_Value: 0.9
min: 0
max: 1
reflectSky:
m_OverrideState: 0
m_Value: 1
Expand All @@ -239,44 +212,35 @@ MonoBehaviour:
depthBufferThickness:
m_OverrideState: 0
m_Value: 0.01
min: 0
max: 1
screenFadeDistance:
m_OverrideState: 0
m_Value: 0.1
min: 0
max: 1
accumulationFactor:
m_OverrideState: 0
m_Value: 0.75
min: 0
max: 1
m_RayMaxIterations:
m_OverrideState: 0
m_Value: 32
min: 0
layerMask:
m_OverrideState: 0
m_Value:
serializedVersion: 2
m_Bits: 4294967295
textureLodBias:
m_OverrideState: 1
m_Value: 0
m_RayLength:
m_OverrideState: 1
m_Value: 50
min: 0.001
m_ClampValue:
m_OverrideState: 0
m_Value: 1
min: 0.001
max: 10
m_Denoise:
m_OverrideState: 1
m_Value: 0
m_DenoiserRadius:
m_OverrideState: 0
m_Value: 8
min: 1
max: 32
m_AffectSmoothSurfaces:
m_OverrideState: 0
m_Value: 0
Expand All @@ -289,14 +253,9 @@ MonoBehaviour:
sampleCount:
m_OverrideState: 0
m_Value: 1
min: 1
max: 32
bounceCount:
m_OverrideState: 0
m_Value: 1
min: 1
max: 31
m_RayMaxIterationsRT:
m_OverrideState: 0
m_Value: 32
min: 0
Expand Up @@ -93,7 +93,7 @@ public override void OnEnable()
static public readonly GUIContent k_ScreenFaceDistanceText = EditorGUIUtility.TrTextContent("Screen Edge Fade Distance", "Controls the distance at which HDRP fades out SSR near the edge of the screen.");
static public readonly GUIContent k_AccumulationFactorText = EditorGUIUtility.TrTextContent("Accumulation Factor", "Controls Controls the amount of accumulation (0 no accumulation, 1 just accumulate).");
static public readonly GUIContent k_DepthBufferThicknessText = EditorGUIUtility.TrTextContent("Object Thickness", "Controls the typical thickness of objects the reflection rays may pass behind.");
static public readonly GUIContent k_RayMaxIterationsText = EditorGUIUtility.TrTextContent("Max Ray Steps", "Sets the maximum number of steps HDRP uses for raytracing. Affects both correctness and performance.");
static public readonly GUIContent k_RayMaxIterationsText = EditorGUIUtility.TrTextContent("Max Ray Steps", "Sets the maximum number of steps HDRP uses for ray marching. Affects both correctness and performance.");
static public readonly GUIContent k_RayLengthText = EditorGUIUtility.TrTextContent("Max Ray Length", "Controls the maximal length of reflection rays. The higher this value is, the more expensive ray traced reflections are.");
static public readonly GUIContent k_ClampValueText = EditorGUIUtility.TrTextContent("Clamp Value", "Clamps the exposed intensity.");
static public readonly GUIContent k_SampleCountText = EditorGUIUtility.TrTextContent("Sample Count", "Number of samples for reflections.");
Expand All @@ -103,6 +103,7 @@ public override void OnEnable()
static public readonly GUIContent k_FullResolutionText = EditorGUIUtility.TrTextContent("Full Resolution", "Enables full resolution mode.");
static public readonly GUIContent k_DenoiseRadiusText = EditorGUIUtility.TrTextContent("Denoiser Radius", "Controls the radius of reflection denoiser.");
static public readonly GUIContent k_AffectsSmoothSurfacesText = EditorGUIUtility.TrTextContent("Affect Smooth Surfaces", "When enabled, the denoiser affects perfectly smooth surfaces.");
static public readonly GUIContent k_MaxHybridRaySteps = EditorGUIUtility.TrTextContent("Max Hybrid Ray Steps", "Sets the maximum number of steps HDRP uses for hybrid ray marching.");

void RayTracingQualityModeGUI()
{
Expand Down Expand Up @@ -138,7 +139,7 @@ void RayTracingPerformanceModeGUI(bool hybrid)
PropertyField(m_ClampValue, k_ClampValueText);
PropertyField(m_FullResolution, k_FullResolutionText);
if (hybrid)
PropertyField(m_RayMaxIterationsRT);
PropertyField(m_RayMaxIterationsRT, k_MaxHybridRaySteps);
PropertyField(m_Denoise, k_DenoiseText);
using (new HDEditorUtils.IndentScope())
{
Expand Down
Expand Up @@ -295,7 +295,7 @@ static RTHandle RequestRayTracedReflectionsHistoryTexture(HDCamera hdCamera)
ReflectionHistoryBufferAllocatorFunction, 1);
}

DeferredLightingRTParameters PrepareReflectionDeferredLightingRTParameters(HDCamera hdCamera)
DeferredLightingRTParameters PrepareReflectionDeferredLightingRTParameters(HDCamera hdCamera, bool transparent)
{
DeferredLightingRTParameters deferredParameters = new DeferredLightingRTParameters();

Expand All @@ -315,7 +315,7 @@ DeferredLightingRTParameters PrepareReflectionDeferredLightingRTParameters(HDCam
deferredParameters.lodBias = settings.textureLodBias.value;

// Ray Marching parameters
deferredParameters.hybridTracing = settings.tracing.value == RayCastingMode.Hybrid && hdCamera.frameSettings.litShaderMode == LitShaderMode.Deferred;
deferredParameters.hybridTracing = (settings.tracing.value == RayCastingMode.Hybrid && hdCamera.frameSettings.litShaderMode == LitShaderMode.Deferred) && !transparent;
deferredParameters.raySteps = settings.rayMaxIterationsRT;
deferredParameters.nearClipPlane = hdCamera.camera.nearClipPlane;
deferredParameters.farClipPlane = hdCamera.camera.farClipPlane;
Expand Down Expand Up @@ -369,7 +369,7 @@ DeferredLightingRTParameters PrepareReflectionDeferredLightingRTParameters(HDCam

TextureHandle directionBuffer = DirGenRTR(renderGraph, hdCamera, settings, prepassOutput.depthPyramidTexture, prepassOutput.stencilBuffer, prepassOutput.normalBuffer, clearCoatTexture, transparent);

DeferredLightingRTParameters deferredParamters = PrepareReflectionDeferredLightingRTParameters(hdCamera);
DeferredLightingRTParameters deferredParamters = PrepareReflectionDeferredLightingRTParameters(hdCamera, transparent);
TextureHandle lightingBuffer = DeferredLightingRT(renderGraph, in deferredParamters, directionBuffer, prepassOutput, skyTexture, rayCountTexture);

rtrResult = AdjustWeightRTR(renderGraph, hdCamera, settings, prepassOutput.depthPyramidTexture, prepassOutput.normalBuffer, clearCoatTexture, lightingBuffer, directionBuffer);
Expand Down

0 comments on commit 5832b3a

Please sign in to comment.