private YAMLNode ExportMaterialTemplate(IExportContainer container) { if (GetSerializedVersion(container.ExportVersion) < 5) { return(MaterialTemplate.ExportYAML(container)); } if (GetSerializedVersion(container.Version) >= 5) { return(MaterialTemplate.ExportYAML(container)); } MaterialType type = GetMaterialType(container.Version); if (type == MaterialType.BuiltInStandard) { EngineBuiltInAsset asset = EngineBuiltInAssets.GetMaterial(EngineBuiltInAssets.DefaultTerrainStandardName, container.ExportVersion); return(asset.ToExportPointer().ExportYAML(container)); } if (type == MaterialType.BuiltInLegacyDiffuse) { EngineBuiltInAsset asset = EngineBuiltInAssets.GetMaterial(EngineBuiltInAssets.DefaultTerrainDiffuseName, container.ExportVersion); return(asset.ToExportPointer().ExportYAML(container)); } if (type == MaterialType.BuiltInLegacySpecular) { EngineBuiltInAsset asset = EngineBuiltInAssets.GetMaterial(EngineBuiltInAssets.DefaultTerrainSpecularName, container.ExportVersion); return(asset.ToExportPointer().ExportYAML(container)); } return(MaterialTemplate.ExportYAML(container)); }
private void ExportShaderPointer(IExportContainer container, YAMLSequenceNode node, HashSet <string> shaderNames, string name) { if (!shaderNames.Contains(name)) { EngineBuiltInAsset buildInAsset = EngineBuiltInAssets.GetShader(name, container.ExportVersion); node.Add(buildInAsset.ToExportPointer().ExportYAML(container)); } }
public YAMLNode ExportYAML(IExportContainer container, string shaderName) { YAMLMappingNode node = new YAMLMappingNode(); node.Add(ModeName, (int)BuiltinShaderMode.Builtin); EngineBuiltInAsset buildInAsset = EngineBuiltInAssets.GetShader(shaderName, container.ExportVersion); node.Add(ShaderName, buildInAsset.ToExportPointer().ExportYAML(container)); return(node); }
private YAMLNode ExportDetailMeshGrassShader(IExportContainer container) { if (IsReadDetailBillboardShader(container.Version)) { return(DetailMeshGrassShader.ExportYAML(container)); } EngineBuiltInAsset buildInAsset = EngineBuiltInAssets.GetShader(EngineBuiltInAssets.TerrainWavingDoublePass, container.ExportVersion); return(buildInAsset.ToExportPointer().ExportYAML(container)); }