浏览代码

Upgrade mateiral upgrader to suit LDRenderLoop needs.

/vr_sandbox
Felipe Lira 8 年前
当前提交
33d7e522
共有 3 个文件被更改,包括 44 次插入87 次删除
  1. 3
      Assets/LowEndRenderLoop/Editor/StandardSpecularToLDMaterialUpgrader.cs
  2. 119
      Assets/LowEndRenderLoop/LowEndRenderLoopVikingVillage.unity
  3. 9
      Assets/ScriptableRenderPipeline/Editor/MaterialUpgrader.cs

3
Assets/LowEndRenderLoop/Editor/StandardSpecularToLDMaterialUpgrader.cs


StandardSpecularToLDMaterialUpgrader(string oldShaderName)
{
RenameShader(oldShaderName, "RenderLoop/LowEnd");
RemoveTexture("_OcclusionMap");
RemoveTexture("_DetailAlbedoMap");
RemoveTexture("_DetailNormalMap");
}
}

119
Assets/LowEndRenderLoop/LowEndRenderLoopVikingVillage.unity


m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 8900000, guid: 545abe2b789631d42ba478c66371d77c, type: 2}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.39918268, g: 0.35051182, b: 0.37674487, a: 1}
m_IndirectSpecularColor: {r: 0.13367549, g: 0.101356134, b: 0.11775853, a: 1}
--- !u!157 &4
LightmapSettings:
m_ObjectHideFlags: 0

m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 6
serializedVersion: 8
m_Resolution: 1
m_BakeResolution: 1
m_TextureWidth: 2048

m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 1024
m_ReflectionCompression: 2
m_StationaryBakeMode: 1
m_MixedBakeMode: 1
m_BakeBackend: 0
m_PVRSampling: 1
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFiltering: 0
m_PVRFilteringMode: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousColorSigma: 1
m_PVRFilteringAtrousNormalSigma: 1
m_PVRFilteringAtrousPositionSigma: 1
m_RuntimeCPUUsage: 100
m_ShadowMaskMode: 0
--- !u!196 &5
NavMeshSettings:

m_Lightmapping: 2
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_CCT: 6570
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &114781287

m_Name:
m_EditorClassIdentifier:
shadowResolution: 400
m_innerSpotPercent: 0
shadowDimmer: 1
affectDiffuse: 1
affectSpecular: 1

m_Lightmapping: 4
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_CCT: 6570
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &181841811

m_Name:
m_EditorClassIdentifier:
shadowResolution: 900
m_innerSpotPercent: 0
shadowDimmer: 1
affectDiffuse: 1
affectSpecular: 1

m_Lightmapping: 2
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_CCT: 6570
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &290532805

m_Name:
m_EditorClassIdentifier:
shadowResolution: 400
m_innerSpotPercent: 0
shadowDimmer: 1
affectDiffuse: 1
affectSpecular: 1

Transform:
m_PrefabParentObject: {fileID: 400000, guid: 3ba18024abdc5834ebb6ca252e273790, type: 2}
m_PrefabInternal: {fileID: 473360042}
--- !u!1 &483288874
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 483288876}
- component: {fileID: 483288875}
- component: {fileID: 483288877}
- component: {fileID: 483288878}
m_Layer: 0
m_Name: FPS
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!132 &483288875
GUIText:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 483288874}
m_Enabled: 0
serializedVersion: 3
m_Text: FPS
m_Anchor: 0
m_Alignment: 0
m_PixelOffset: {x: 5, y: -5}
m_LineSpacing: 1
m_TabSize: 4
m_Font: {fileID: 0}
m_Material: {fileID: 0}
m_FontSize: 0
m_FontStyle: 1
m_Color:
serializedVersion: 2
rgba: 4294967295
m_PixelCorrect: 1
m_RichText: 1
--- !u!4 &483288876
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 483288874}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &483288877
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 483288874}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a477b185611ad6a498bcf123e1e5660d, type: 3}
m_Name:
m_EditorClassIdentifier:
updateInterval: 1
--- !u!114 &483288878
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 483288874}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 48ee9e170f25b7f4bae71785e70cea6a, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &483984919
Prefab:
m_ObjectHideFlags: 0

m_Lightmapping: 2
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_CCT: 6570
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &824347041

m_Name:
m_EditorClassIdentifier:
shadowResolution: 400
m_innerSpotPercent: 0
shadowDimmer: 1
affectDiffuse: 1
affectSpecular: 1

m_Lightmapping: 2
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_CCT: 6570
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &991787238

m_Name:
m_EditorClassIdentifier:
shadowResolution: 800
m_innerSpotPercent: 0
shadowDimmer: 1
affectDiffuse: 1
affectSpecular: 1

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 13
m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1388105999
Prefab:

9
Assets/ScriptableRenderPipeline/Editor/MaterialUpgrader.cs


Dictionary<string, string> m_TextureRename = new Dictionary<string, string>();
Dictionary<string, string> m_FloatRename = new Dictionary<string, string>();
Dictionary<string, string> m_ColorRename = new Dictionary<string, string>();
List<string> m_TexturesToRemove = new List<string>();
[Flags]
public enum UpgradeFlags

foreach (var t in m_ColorRename)
dstMaterial.SetColor(t.Value, srcMaterial.GetColor(t.Key));
foreach (var prop in m_TexturesToRemove)
dstMaterial.SetTexture(prop, null);
}
public void RenameShader(string oldName, string newName)

public void RenameColor(string oldName, string newName)
{
m_ColorRename[oldName] = newName;
}
public void RemoveTexture(string name)
{
m_TexturesToRemove.Add(name);
}
static bool IsMaterialPath(string path)

正在加载...
取消
保存