Skip to content

Commit 221c58c

Browse files
committed
Name refactors and conversion from tabs to spaces.
1 parent 893c944 commit 221c58c

10 files changed

Lines changed: 258 additions & 271 deletions

Assets/LowEndMobilePipeline/Editor/LegacyMobileToLowendMobileUpgrader.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
public class LegacyMobileToLowendMobileUpgrader : MaterialUpgrader
66
{
7-
[MenuItem("LowEndMobilePipeline/Material Upgraders/Upgrade Legacy Mobile Materials to LowEndMobile")]
7+
[MenuItem("RenderPipeline/LowEndMobilePipeline/Material Upgraders/Upgrade Legacy Mobile Materials to LowEndMobile")]
88
public static void UpgradeMaterialsToLD()
99
{
1010
List<MaterialUpgrader> materialUpgraders = new List<MaterialUpgrader>();
11-
materialUpgraders.Add(new LegacyMobileToLowendMobileUpgrader("Mobile/Diffuse"));
12-
materialUpgraders.Add(new LegacyMobileToLowendMobileUpgrader("Mobile/Bumped Specular"));
13-
materialUpgraders.Add(new LegacyMobileToLowendMobileUpgrader("Mobile/Bumped Specular(1 Directional Light)"));
14-
materialUpgraders.Add(new LegacyMobileToLowendMobileUpgrader("Mobile/Bumped Diffuse"));
15-
materialUpgraders.Add(new LegacyMobileToLowendMobileUpgrader("Mobile/Unlit (Supports Lightmap)"));
11+
materialUpgraders.Add(new LegacyMobileToLowendMobileUpgrader("Mobile/Diffuse"));
12+
materialUpgraders.Add(new LegacyMobileToLowendMobileUpgrader("Mobile/Bumped Specular"));
13+
materialUpgraders.Add(new LegacyMobileToLowendMobileUpgrader("Mobile/Bumped Specular(1 Directional Light)"));
14+
materialUpgraders.Add(new LegacyMobileToLowendMobileUpgrader("Mobile/Bumped Diffuse"));
15+
materialUpgraders.Add(new LegacyMobileToLowendMobileUpgrader("Mobile/Unlit (Supports Lightmap)"));
1616
materialUpgraders.Add(new LegacyMobileToLowendMobileUpgrader("Mobile/VertexLit"));
1717

1818
MaterialUpgrader.UpgradeProjectFolder(materialUpgraders, "Upgrade to LD Materials");

Assets/LowEndMobilePipeline/Editor/LowendMobilePipelineMaterialEditor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ public enum SpecularSource
3232

3333
public enum GlossinessSource
3434
{
35-
AlphaFromBaseTextureAndColor,
36-
AlphaFromSpecularTextureAndColor
35+
BaseAlpha,
36+
SpecularAlpha
3737
}
3838

3939
private void Awake()
@@ -176,7 +176,7 @@ private void DoSpecular()
176176
{
177177
specularSource.floatValue = source;
178178
if (source == (int)SpecularSource.BaseTexture)
179-
glossinessSourceProp.floatValue = (float)GlossinessSource.AlphaFromBaseTextureAndColor;
179+
glossinessSourceProp.floatValue = (float)GlossinessSource.BaseAlpha;
180180
}
181181

182182
SpecularSource specSource = (SpecularSource)specularSource.floatValue;
@@ -273,7 +273,7 @@ private void UpdateMaterialSpecularSource(Material material)
273273
}
274274

275275
GlossinessSource glossSource = (GlossinessSource)glossinessSourceProp.floatValue;
276-
if (glossSource == GlossinessSource.AlphaFromBaseTextureAndColor)
276+
if (glossSource == GlossinessSource.BaseAlpha)
277277
SetKeyword(material, "_GLOSSINESS_FROM_BASE_ALPHA", true);
278278
else
279279
SetKeyword(material, "_GLOSSINESS_FROM_BASE_ALPHA", false);

Assets/LowEndMobilePipeline/Editor/StandardToLowEndMaterialUpgrader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
public class StandardToLowEndMaterialUpgrader : MaterialUpgrader
66
{
7-
[MenuItem("LowEndMobilePipeline/Material Upgraders/Upgrade Standard Materials to Low End Mobile")]
7+
[MenuItem("RenderPipeline/LowEndMobilePipeline/Material Upgraders/Upgrade Standard Materials to Low End Mobile")]
88
private static void UpgradeMaterialsToLD()
99
{
1010
List<MaterialUpgrader> upgraders = new List<MaterialUpgrader>();

Assets/LowEndMobilePipeline/LowEndMobilePipeline.cs

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ public override void Render(ScriptableRenderContext context, Camera[] cameras)
6565
// Setup light and shadow shader constants
6666
SetupLightShaderVariables(cull.visibleLights, context);
6767
if (shadowsRendered)
68-
SetupShadowShaderVariables(context, camera.nearClipPlane, cullingParameters.shadowDistance,
69-
m_ShadowSettings.directionalLightCascadeCount);
68+
SetupShadowShaderVariables(context, m_ShadowSettings.directionalLightCascadeCount);
7069

7170
// Render Opaques
7271
var settings = new DrawRendererSettings(cull, camera, m_ForwardBasePassName);
@@ -315,22 +314,10 @@ private int GetMaxTileResolutionInAtlas(int atlasWidth, int atlasHeight, int til
315314
return resolution;
316315
}
317316

318-
void SetupShadowShaderVariables(ScriptableRenderContext context, float shadowNear, float shadowFar,
319-
int cascadeCount)
317+
void SetupShadowShaderVariables(ScriptableRenderContext context, int cascadeCount)
320318
{
321319
float shadowResolution = m_ShadowSlices[0].shadowResolution;
322320

323-
// PSSM distance settings
324-
float shadowFrustumDepth = shadowFar - shadowNear;
325-
Vector3 shadowSplitRatio = m_ShadowSettings.directionalLightCascades;
326-
327-
// We set PSSMDistance to infinity for non active cascades so the comparison test always fails for unavailable cascades
328-
Vector4 PSSMDistances = new Vector4(
329-
shadowNear + shadowSplitRatio.x*shadowFrustumDepth,
330-
(shadowSplitRatio.y > 0.0f) ? shadowNear + shadowSplitRatio.y*shadowFrustumDepth : Mathf.Infinity,
331-
(shadowSplitRatio.z > 0.0f) ? shadowNear + shadowSplitRatio.z*shadowFrustumDepth : Mathf.Infinity,
332-
1.0f/shadowResolution);
333-
334321
const int maxShadowCascades = 4;
335322
Matrix4x4[] shadowMatrices = new Matrix4x4[maxShadowCascades];
336323
for (int i = 0; i < cascadeCount; ++i)
@@ -349,8 +336,7 @@ void SetupShadowShaderVariables(ScriptableRenderContext context, float shadowNea
349336
var setupShadow = new CommandBuffer() {name = "SetupShadowShaderConstants"};
350337
SetShadowKeywords(setupShadow);
351338
setupShadow.SetGlobalMatrixArray("_WorldToShadow", shadowMatrices);
352-
setupShadow.SetGlobalVector("_PSSMDistancesAndShadowResolution", PSSMDistances);
353-
setupShadow.SetGlobalVectorArray("g_vDirShadowSplitSpheres", m_DirectionalShadowSplitDistances);
339+
setupShadow.SetGlobalVectorArray("_DirShadowSplitSpheres", m_DirectionalShadowSplitDistances);
354340
setupShadow.SetGlobalFloatArray("_PCFKernel", pcfKernel);
355341
SetShadowKeywords(setupShadow);
356342
context.ExecuteCommandBuffer(setupShadow);

0 commit comments

Comments
 (0)