浏览代码

Used autoformat tool on all changed files.

/main
Felipe Lira 6 年前
当前提交
cee6f8f7
共有 11 个文件被更改,包括 24 次插入27 次删除
  1. 2
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Data/LightweightPipelineAsset.cs
  2. 12
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Editor/LightweightAssetEditor.cs
  3. 13
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Editor/ShaderPreprocessor.cs
  4. 6
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs
  5. 3
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipelineCore.cs
  6. 1
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightShadowPass.cs
  7. 2
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightStandardParticlesUnlit.shader
  8. 2
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/Terrain/LightweightStandardTerrain.shader
  9. 2
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/Terrain/LightweightStandardTerrainAddPass.shader
  10. 4
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/Terrain/LightweightWavingGrass.shader
  11. 4
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/Terrain/LightweightWavingGrassBillboard.shader

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


// Deprecated
[SerializeField] private ShadowType m_ShadowType = ShadowType.HARD_SHADOWS;
#if UNITY_EDITOR
[NonSerialized]
private LightweightPipelineEditorResources m_EditorResourcesAsset;

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


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 shadowDistance = new GUIContent("Distance", "Max shadow rendering distance.");
public static GUIContent directionalShadowAtlasResolution = new GUIContent("Atlas Resolution",

public static GUIContent supportsLocalShadows = new GUIContent("Local Shadows", "If disabled all local lights won't cast shadows.");
public static GUIContent localShadowsAtlasResolution = new GUIContent("Atlas Resolution",
"All local lights are packed into a single atlas. This setting controls the atlas size.");
"All local lights are packed into a single atlas. This setting controls the atlas size.");
public static string[] shadowCascadeOptions = {"No Cascades", "Two Cascades", "Four Cascades"};
public static string[] opaqueDownsamplingOptions = {"None", "2x (Bilinear)", "4x (Box)", "4x (Bilinear)"};

private SerializedProperty m_ShadowCascade4SplitProp;
private SerializedProperty m_LocalShadowSupportedProp;
private SerializedProperty m_LocalShadowsAtlasResolutionProp;
void OnEnable()
{
m_RenderScale = serializedObject.FindProperty("m_RenderScale");

EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(m_DirectionalShadowAtlasResolutionProp, Styles.directionalShadowAtlasResolution);
m_ShadowDistanceProp.floatValue = Mathf.Max(0.0f,
EditorGUILayout.FloatField(Styles.shadowDistance, m_ShadowDistanceProp.floatValue));
EditorGUILayout.FloatField(Styles.shadowDistance, m_ShadowDistanceProp.floatValue));
ShadowCascades cascades = (ShadowCascades) m_ShadowCascadesProp.intValue;
ShadowCascades cascades = (ShadowCascades)m_ShadowCascadesProp.intValue;
if (cascades == ShadowCascades.FOUR_CASCADES)
CoreEditorUtils.DrawCascadeSplitGUI<Vector3>(ref m_ShadowCascade4SplitProp);
else if (cascades == ShadowCascades.TWO_CASCADES)

UpdateAnimationValues();
DrawRenderingSettings();
DrawShadowSettings();
serializedObject.ApplyModifiedProperties();
}
}

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


if (shader.name.Contains("LightweightPipeline"))
#endif
{
float percentageCurrent = (float) currVariantsCount / (float) prevVariantsCount * 100f;
float percentageTotal = (float) m_TotalVariantsOutputCount / (float) m_TotalVariantsInputCount * 100f;
float percentageCurrent = (float)currVariantsCount / (float)prevVariantsCount * 100f;
float percentageTotal = (float)m_TotalVariantsOutputCount / (float)m_TotalVariantsInputCount * 100f;
" Remaining shader variants = {3}/{4} = {5}% - Total = {6}/{7} = {8}%",
shader.name, snippetData.passName, snippetData.shaderType.ToString(), currVariantsCount,
prevVariantsCount, percentageCurrent, m_TotalVariantsOutputCount, m_TotalVariantsInputCount,
percentageTotal);
" Remaining shader variants = {3}/{4} = {5}% - Total = {6}/{7} = {8}%",
shader.name, snippetData.passName, snippetData.shaderType.ToString(), currVariantsCount,
prevVariantsCount, percentageCurrent, m_TotalVariantsOutputCount, m_TotalVariantsInputCount,
percentageTotal);
Debug.Log(result);
}
}

}
}
}

6
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs


{
var opaqueScaler = m_OpaqueScalerValues[(int)m_Asset.OpaqueDownsampling];
RenderTextureDescriptor opaqueDesc = CreateRTDesc(frameRenderingConfiguration, opaqueScaler);
switch(m_Asset.OpaqueDownsampling)
switch (m_Asset.OpaqueDownsampling)
{
case Downsampling.None:
cmd.Blit(m_CurrCameraColorRT, CameraRenderTargetID.opaque);

CoreUtils.SetKeyword(cmd, LightweightKeywords.DirectionalShadowsText, m_ShadowPass.DirectionalShadowsRendered);
CoreUtils.SetKeyword(cmd, LightweightKeywords.LocalShadowsText, m_ShadowPass.LocalShadowsRendered);
CoreUtils.SetKeyword(cmd, LightweightKeywords.SoftShadowsText, m_ShadowPass.IsSoftShadowsEnabled && anyShadowsEnabled);
// TODO: Remove this. legacy particles support will be removed from Unity in 2018.3. This should be a shader_feature instead with prop exposed in the Standard particles shader.
CoreUtils.SetKeyword(cmd, "SOFTPARTICLES_ON", m_RequireDepthTexture && m_Asset.RequireSoftParticles);
}

3
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipelineCore.cs


public static readonly string LocalShadowsText = "_LOCAL_SHADOWS_ENABLED";
public static readonly string SoftShadowsText = "_SHADOWS_SOFT";
public static readonly string CascadeShadowsText = "_SHADOWS_CASCADE";
public static readonly ShaderKeyword AdditionalLights = new ShaderKeyword(AdditionalLightsText);
public static readonly ShaderKeyword VertexLights = new ShaderKeyword(VertexLightsText);
public static readonly ShaderKeyword MixedLightingSubtractive = new ShaderKeyword(MixedLightingSubtractiveText);

}
}
}

1
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightShadowPass.cs


defaultShadowSettings.shadowmapTextureFormat = RenderTextureFormat.Shadowmap;
defaultShadowSettings.screenspaceShadowmapTextureFormat = RenderTextureFormat.R8;
defaultShadowSettings.supportsSoftShadows = false;
}
return defaultShadowSettings;
}

2
ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightStandardParticlesUnlit.shader


half3 diffuse = AlphaModulate(albedo.rgb, albedo.a);
half alpha = AlphaBlendAndTest(albedo.a, _Cutoff);
half3 emission = SampleEmission(IN, _EmissionColor.rgb, TEXTURE2D_PARAM(_EmissionMap, sampler_EmissionMap));
half3 result = diffuse + emission;
half fogFactor = IN.posWS.w;
ApplyFogColor(result, half3(0, 0, 0), fogFactor);

2
ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/Terrain/LightweightStandardTerrain.shader


#pragma multi_compile_fog
#pragma multi_compile __ _TERRAIN_NORMAL_MAP
#include "LWRP/ShaderLibrary/Terrain/InputSurfaceTerrain.hlsl"
#include "LWRP/ShaderLibrary/Terrain/LightweightPassLitTerrain.hlsl"

2
ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/Terrain/LightweightStandardTerrainAddPass.shader


#pragma multi_compile __ _TERRAIN_NORMAL_MAP
#define TERRAIN_SPLAT_ADDPASS 1
#include "LWRP/ShaderLibrary/Terrain/InputSurfaceTerrain.hlsl"
#include "LWRP/ShaderLibrary/Terrain/LightweightPassLitTerrain.hlsl"

4
ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/Terrain/LightweightWavingGrass.shader


// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
Shader "Hidden/TerrainEngine/Details/WavingDoublePass" // Has to override the internal shaders so named like this
{
Properties
Properties
{
_WavingTint ("Fade Color", Color) = (.7,.6,.5, 0)
_MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {}

SubShader
SubShader
{
Tags {"Queue" = "Geometry+200" "RenderType" = "Grass" "IgnoreProjectors" = "True" "RenderPipeline" = "LightweightPipeline" }//"DisableBatching"="True"
Cull Off

4
ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/Terrain/LightweightWavingGrassBillboard.shader


// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
Shader "Hidden/TerrainEngine/Details/BillboardWavingDoublePass" // Has to override the internal shaders so named like this
{
Properties
Properties
{
_WavingTint ("Fade Color", Color) = (.7,.6,.5, 0)
_MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {}

SubShader
SubShader
{
Tags {"Queue" = "Geometry+200" "RenderType" = "GrassBillBoard" "IgnoreProjectors" = "True" "RenderPipeline" = "LightweightPipeline" }//"DisableBatching"="True"
Cull Off

正在加载...
取消
保存