浏览代码

Removed UI code for PR

/main
Antoine Lelievre 7 年前
当前提交
9d62831c
共有 6 个文件被更改,包括 10 次插入34 次删除
  1. 8
      com.unity.render-pipelines.core/CoreRP/ShaderLibrary/Shadow/ShadowSampling.hlsl
  2. 7
      com.unity.render-pipelines.core/CoreRP/Shadow/AdditionalShadowData.cs
  3. 3
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/AdditionalShadowDataEditor.cs
  4. 14
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/HDLightEditor.cs
  5. 3
      com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoop.cs
  6. 9
      com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/Shadow.hlsl

8
com.unity.render-pipelines.core/CoreRP/ShaderLibrary/Shadow/ShadowSampling.hlsl


//1) Blocker Search
real averageBlockerDepth = 0.0;
real numBlockers = 0.0;
if (!BlockerSearch(averageBlockerDepth, numBlockers, shadowSoftnesss + 0.001, tcs, sampleBias, shadowContext, slice, texIdx, sampIdx, sampleCount))
if (!BlockerSearch(averageBlockerDepth, numBlockers, shadowSoftnesss + 0.000001, tcs, sampleBias, shadowContext, slice, texIdx, sampIdx, sampleCount))
filterSize = max(filterSize, 0.001);
filterSize = max(filterSize, 0.000001);
//3) Filter
return PCSS(tcs, filterSize, scaleOffset, slice, sampleBias, shadowContext, texIdx, sampIdx, sampleCount);

//1) Blocker Search
real averageBlockerDepth = 0.0;
real numBlockers = 0.0;
if (!BlockerSearch(averageBlockerDepth, numBlockers, shadowSoftnesss + 0.001, tcs, slice, sampleBias, tex, samp, sampleCount))
if (!BlockerSearch(averageBlockerDepth, numBlockers, shadowSoftnesss + 0.000001, tcs, slice, sampleBias, tex, samp, sampleCount))
filterSize = max(filterSize, 0.001);
filterSize = max(filterSize, 0.000001);
//3) Filter
return PCSS(tcs, filterSize, scaleOffset, slice, sampleBias, tex, compSamp, sampleCount);

7
com.unity.render-pipelines.core/CoreRP/Shadow/AdditionalShadowData.cs


return DefaultShadowResolution;
}
// PCSS specific parameters (can be moved somewhere else)
[Range(0.0f, 1.0f)]
public float shadowSoftness = 0.5f;
[Range(1, 64)]
public int sampleCount = 32;
// End of PCSS parameters
[Range(0.0f, 1.0f)]
public float shadowDimmer = 1.0f;
public float shadowFadeDistance = 10000.0f;

3
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/AdditionalShadowDataEditor.cs


namespace UnityEditor.Experimental.Rendering.HDPipeline
{
[CanEditMultipleObjects]
// TODO: uncomment this when the pcss implementation will be finished
// [CustomEditor(typeof(AdditionalShadowData))]
[CustomEditor(typeof(AdditionalShadowData))]
class AdditionalShadowDataEditor : Editor
{
public override void OnInspectorGUI()

14
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/HDLightEditor.cs


public SerializedProperty fadeDistance;
public SerializedProperty resolution;
public SerializedProperty contactShadows;
public SerializedProperty softness;
public SerializedProperty pcssSampleCount;
// Bias control
public SerializedProperty viewBiasMin;

fadeDistance = o.Find(x => x.shadowFadeDistance),
resolution = o.Find(x => x.shadowResolution),
contactShadows = o.Find(x => x.contactShadows),
softness = o.Find(x => x.shadowSoftness),
pcssSampleCount = o.Find(x => x.sampleCount),
viewBiasMin = o.Find(x => x.viewBiasMin),
viewBiasMax = o.Find(x => x.viewBiasMax),

EditorGUILayout.Space();
EditorGUILayout.LabelField("Additional Settings", EditorStyles.boldLabel);
EditorGUI.indentLevel++;
int shadowAlgorithm, variant, precision;
(target as Light).GetComponent< AdditionalShadowData >().GetShadowAlgorithm(out shadowAlgorithm, out variant, out precision);
if (shadowAlgorithm == (int)ShadowAlgorithm.PCSS)
{
//TOOD: check the current shadowing algorithm and hide these fields
EditorGUILayout.Slider(m_AdditionalShadowData.softness, 0.0f, 1.0f, s_Styles.shadowSoftness);
EditorGUILayout.IntSlider(m_AdditionalShadowData.pcssSampleCount, 1, 64, s_Styles.pcssSampleCount);
}
EditorGUILayout.PropertyField(m_AdditionalShadowData.contactShadows, s_Styles.contactShadows);

3
com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoop.cs


m_ShadowMgr = new ShadowManager(shadowSettings, ref scInit, ref budgets, m_Shadowmaps);
// set global overrides - these need to match the override specified in LightLoop/Shadow.hlsl
//TODO: reset this to true
bool useGlobalOverrides = false;
bool useGlobalOverrides = true;
m_ShadowMgr.SetGlobalShadowOverride(GPUShadowType.Point , ShadowAlgorithm.PCF, ShadowVariant.V2, ShadowPrecision.High, useGlobalOverrides);
m_ShadowMgr.SetGlobalShadowOverride(GPUShadowType.Spot , ShadowAlgorithm.PCF, ShadowVariant.V2, ShadowPrecision.High, useGlobalOverrides);

9
com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/Shadow.hlsl


// directional
#define SHADOW_DISPATCH_DIR_TEX 0
#define SHADOW_DISPATCH_DIR_SMP 0
//TODO: do not push this in the final PR !
#define SHADOW_DISPATCH_DIR_ALG GPUSHADOWALGORITHM_PCSS // all cascades
#define SHADOW_DISPATCH_DIR_ALG GPUSHADOWALGORITHM_PCF_TENT_5X5 // all cascades
#define SHADOW_DISPATCH_DIR_ALG_0 GPUSHADOWALGORITHM_PCF_TENT_7X7 // 1st cascade
#define SHADOW_DISPATCH_DIR_ALG_1 GPUSHADOWALGORITHM_PCF_TENT_5X5 // 2nd cascade
#define SHADOW_DISPATCH_DIR_ALG_2 GPUSHADOWALGORITHM_PCF_TENT_3X3 // 3rd cascade

#define SHADOW_DISPATCH_POINT_SMP 0
#define SHADOW_DISPATCH_POINT_ALG GPUSHADOWALGORITHM_PCSS
#define SHADOW_DISPATCH_POINT_ALG GPUSHADOWALGORITHM_PCF_TENT_3X3
#define SHADOW_DISPATCH_SPOT_ALG GPUSHADOWALGORITHM_PCSS
#define SHADOW_DISPATCH_SPOT_ALG GPUSHADOWALGORITHM_PCF_TENT_3X3
#define SHADOW_DISPATCH_PUNC_ALG GPUSHADOWALGORITHM_PCSS
#define SHADOW_DISPATCH_PUNC_ALG GPUSHADOWALGORITHM_PCF_TENT_3X3
// example of overriding directional lights
#ifdef SHADOW_DISPATCH_USE_CUSTOM_DIRECTIONAL

正在加载...
取消
保存