浏览代码

Addressed PR's comments

/main
Felipe Lira 6 年前
当前提交
a953a3e3
共有 5 个文件被更改,包括 19 次插入21 次删除
  1. 6
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Data/LightweightPipelineAsset.cs
  2. 13
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Editor/LightweightAssetEditor.cs
  3. 5
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs
  4. 10
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipelineCore.cs
  5. 6
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightShadowPass.cs

6
ScriptableRenderPipeline/LightweightPipeline/LWRP/Data/LightweightPipelineAsset.cs


set { m_RenderScale = value; }
}
public bool IsDirectionalShadowsSupported
public bool SupportsDirectionalShadows
{
get { return m_DirectionalShadowsSupported; }
}

get { return m_Cascade4Split; }
}
public bool IsLocalShadowsSupported
public bool SupportsLocalShadows
{
get { return m_LocalShadowsSupported; }
}

get { return (int)m_LocalShadowsAtlasResolution; }
}
public bool IsSoftShadowsSupported
public bool SupportsSoftShadows
{
get { return m_SoftShadowsSupported; }
}

13
ScriptableRenderPipeline/LightweightPipeline/LWRP/Editor/LightweightAssetEditor.cs


public static GUIContent msaaContent = new GUIContent("Anti Aliasing (MSAA)", "Controls the global anti aliasing settings.");
public static GUIContent supportsSoftShadows = new GUIContent("Soft Shadows", "If enabled pipeline will perform shadow filtering. Otherwise all shadows will only perform a single shadow sample.");
public static GUIContent supportsDirectionalShadows = new GUIContent("Directional Shadows", "If disabled all directional lights won't cast shadows.");
public static GUIContent supportsSoftShadows = new GUIContent("Soft Shadows", "If enabled pipeline will perform shadow filtering. Otherwise all lights that cast shadows will fallback to perform a single shadow sample.");
public static GUIContent supportsDirectionalShadows = new GUIContent("Directional Shadows", "If enabled shadows will be supported for directional lights.");
public static GUIContent shadowDistance = new GUIContent("Distance", "Max shadow rendering distance.");

public static GUIContent shadowCascadeSplit = new GUIContent("Cascades Split",
"Percentages to split shadow volume");
public static GUIContent supportsLocalShadows = new GUIContent("Local Shadows", "If disabled all local lights won't cast shadows.");
public static GUIContent supportsLocalShadows = new GUIContent("Local Shadows", "If enabled shadows will be supported for spot lights.");
public static GUIContent localShadowsAtlasResolution = new GUIContent("Atlas Resolution",
"All local lights are packed into a single atlas. This setting controls the atlas size.");

void DrawShadowSettings()
{
bool directionalShadows = false;
bool localShadows = false;
directionalShadows = m_DirectionalShadowsSupportedProp.boolValue;
bool directionalShadows = m_DirectionalShadowsSupportedProp.boolValue;
if (directionalShadows)
{
EditorGUI.indentLevel++;

}
EditorGUILayout.PropertyField(m_LocalShadowSupportedProp, Styles.supportsLocalShadows);
localShadows = m_LocalShadowSupportedProp.boolValue;
bool localShadows = m_LocalShadowSupportedProp.boolValue;
if (localShadows)
{
EditorGUI.indentLevel++;

5
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs


CoreUtils.SetKeyword(cmd, LightweightKeywords.AdditionalLightsText, lightData.totalAdditionalLightsCount > 0);
CoreUtils.SetKeyword(cmd, LightweightKeywords.MixedLightingSubtractiveText, m_MixedLightingSetup == MixedLightingSetup.Subtractive);
CoreUtils.SetKeyword(cmd, LightweightKeywords.VertexLightsText, vertexLightsCount > 0);
//TIM: Not used in shader for V1 to reduce keywords
CoreUtils.SetKeyword(cmd, LightweightKeywords.MainLightCookieText, mainLightIndex != -1 && LightweightUtils.IsSupportedCookieType(visibleLights[mainLightIndex].lightType) && visibleLights[mainLightIndex].light.cookie != null);
// TODO: We have to discuss cookie approach on LWRP.
// CoreUtils.SetKeyword(cmd, LightweightKeywords.MainLightCookieText, mainLightIndex != -1 && LightweightUtils.IsSupportedCookieType(visibleLights[mainLightIndex].lightType) && visibleLights[mainLightIndex].light.cookie != null);
bool anyShadowsEnabled = m_ShadowPass.IsDirectionalShadowsEnabled || m_ShadowPass.IsLocalShadowsEnabled;
CoreUtils.SetKeyword(cmd, LightweightKeywords.DirectionalShadowsText, m_ShadowPass.DirectionalShadowsRendered);

10
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipelineCore.cs


{
s_PipelineCapabilities = 0U;
if (pipelineAsset.MaxPixelLights < 1 && !pipelineAsset.SupportsVertexLight)
if (pipelineAsset.MaxPixelLights > 1 || pipelineAsset.SupportsVertexLight)
if (pipelineAsset.IsDirectionalShadowsSupported)
if (pipelineAsset.SupportsDirectionalShadows)
if (pipelineAsset.IsLocalShadowsSupported)
if (pipelineAsset.SupportsLocalShadows)
bool anyShadows = pipelineAsset.IsDirectionalShadowsSupported || pipelineAsset.IsLocalShadowsSupported;
if (pipelineAsset.IsSoftShadowsSupported && anyShadows)
bool anyShadows = pipelineAsset.SupportsDirectionalShadows || pipelineAsset.SupportsLocalShadows;
if (pipelineAsset.SupportsSoftShadows && anyShadows)
s_PipelineCapabilities |= PipelineCapabilities.SoftShadows;
}
}

6
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightShadowPass.cs


bool supportsScreenSpaceShadows = SystemInfo.graphicsDeviceType != GraphicsDeviceType.OpenGLES2;
m_ShadowSettings = ShadowSettings.Default;
m_ShadowSettings.supportsDirectionalShadows = pipelineAsset.IsDirectionalShadowsSupported;
m_ShadowSettings.supportsDirectionalShadows = pipelineAsset.SupportsDirectionalShadows;
m_ShadowSettings.screenSpace = m_ShadowSettings.supportsDirectionalShadows && supportsScreenSpaceShadows;
m_ShadowSettings.directionalLightCascadeCount = (m_ShadowSettings.screenSpace) ? pipelineAsset.CascadeCount : 1;

break;
}
m_ShadowSettings.supportsLocalShadows = pipelineAsset.IsLocalShadowsSupported;
m_ShadowSettings.supportsLocalShadows = pipelineAsset.SupportsLocalShadows;
m_ShadowSettings.supportsSoftShadows = pipelineAsset.IsSoftShadowsSupported;
m_ShadowSettings.supportsSoftShadows = pipelineAsset.SupportsSoftShadows;
m_ShadowSettings.bufferBitCount = 16;

正在加载...
取消
保存