浏览代码

Refactor and renaming

/main
John 7 年前
当前提交
ec8b4a6b
共有 3 个文件被更改,包括 12 次插入12 次删除
  1. 6
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Data/LightweightPipelineAsset.cs
  2. 10
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Editor/LightweightAssetEditor.cs
  3. 8
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs

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


[SerializeField] private bool m_SupportsVertexLight = false;
[SerializeField] private bool m_RequireDepthTexture = false;
[SerializeField] private bool m_RequireSoftParticles = false;
[SerializeField] private bool m_UsesScreenSpaceShadows = false;
[SerializeField] private bool m_RequireScreenSpaceShadows = false;
[SerializeField] private bool m_SupportsHDR = false;
[SerializeField] private MSAAQuality m_MSAA = MSAAQuality._4x;
[SerializeField] private float m_RenderScale = 1.0f;

get { return m_RequireSoftParticles; }
}
public bool UsesScreenSpaceShadows
public bool RequireScreenSpaceShadows
get { return m_UsesScreenSpaceShadows; }
get { return m_RequireScreenSpaceShadows; }
}
public bool SupportsHDR

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


public static GUIContent requireSoftParticles = new GUIContent("Soft Particles", "If enabled the pipeline will enable SOFT_PARTICLES keyword.");
public static GUIContent usesScreenSpaceShadows = new GUIContent("Screen Space Shadows", "TODO");
public static GUIContent requireScreenSpaceShadows = new GUIContent("Screen Space Shadows", "TODO");
public static GUIContent shadowType = new GUIContent("Type",
"Global shadow settings. Options are NO_SHADOW, HARD_SHADOWS and SOFT_SHADOWS.");

private SerializedProperty m_MaxPixelLights;
private SerializedProperty m_SupportsVertexLightProp;
private SerializedProperty m_RequireDepthTextureProp;
private SerializedProperty m_UsesScreenSpaceShadowsProp;
private SerializedProperty m_RequireScreenSpaceShadowsProp;
private SerializedProperty m_RequireSoftParticlesProp;
private SerializedProperty m_ShadowTypeProp;
private SerializedProperty m_ShadowNearPlaneOffsetProp;

m_SupportsVertexLightProp = serializedObject.FindProperty("m_SupportsVertexLight");
m_RequireDepthTextureProp = serializedObject.FindProperty("m_RequireDepthTexture");
m_RequireSoftParticlesProp = serializedObject.FindProperty("m_RequireSoftParticles");
m_UsesScreenSpaceShadowsProp = serializedObject.FindProperty("m_UsesScreenSpaceShadows");
m_RequireScreenSpaceShadowsProp = serializedObject.FindProperty("m_RequireScreenSpaceShadows");
m_ShadowTypeProp = serializedObject.FindProperty("m_ShadowType");
m_ShadowNearPlaneOffsetProp = serializedObject.FindProperty("m_ShadowNearPlaneOffset");
m_ShadowDistanceProp = serializedObject.FindProperty("m_ShadowDistance");

m_ShowSoftParticles.value = m_RequireSoftParticlesProp.boolValue;
m_ShowScreenSpaceShadows.valueChanged.AddListener(Repaint);
m_ShowScreenSpaceShadows.value = m_UsesScreenSpaceShadowsProp.boolValue;
m_ShowScreenSpaceShadows.value = m_RequireScreenSpaceShadowsProp.boolValue;
}
void OnDisable()

EditorGUILayout.PropertyField(m_ShadowCascade2SplitProp, Styles.shadowCascadeSplit);
}
DrawAnimatedProperty(m_UsesScreenSpaceShadowsProp, Styles.usesScreenSpaceShadows, m_ShowScreenSpaceShadows);
DrawAnimatedProperty(m_RequireScreenSpaceShadowsProp, Styles.requireScreenSpaceShadows, m_ShowScreenSpaceShadows);
EditorGUI.indentLevel--;

8
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs


private bool m_RequireDepthTexture;
private bool m_RequireCopyColor;
private bool m_DepthRenderBuffer;
private bool m_UseScreenSpaceShadows;
private bool m_RequireScreenSpaceShadows;
private MixedLightingSetup m_MixedLightingSetup;
private const int kDepthStencilBufferBits = 32;

if (LightweightUtils.HasFlag(frameRenderingConfiguration, FrameRenderingConfiguration.DepthPrePass))
{
DepthPass(ref context);
if(m_UseScreenSpaceShadows) //NOTE: Should this be added to the FrameRenderingConfiguration?
if(m_RequireScreenSpaceShadows) //NOTE: Should this be added to the FrameRenderingConfiguration?
ShadowCollectPass(ref context, visibleLights, ref lightData);
}

}
}
m_UseScreenSpaceShadows = m_Asset.UsesScreenSpaceShadows && LightweightUtils.HasFlag(configuration, FrameRenderingConfiguration.DepthPrePass);
m_RequireScreenSpaceShadows = m_Asset.RequireScreenSpaceShadows && LightweightUtils.HasFlag(configuration, FrameRenderingConfiguration.DepthPrePass);
Rect cameraRect = m_CurrCamera.rect;
if (!(Math.Abs(cameraRect.x) > 0.0f || Math.Abs(cameraRect.y) > 0.0f || Math.Abs(cameraRect.width) < 1.0f || Math.Abs(cameraRect.height) < 1.0f))

if (m_Asset.CascadeCount > 1)
m_MainLightKeywordString.Append("_CASCADE");
if(m_UseScreenSpaceShadows)
if(m_RequireScreenSpaceShadows)
m_MainLightKeywordString.Append("_SCREEN");
}
else

正在加载...
取消
保存