3 using System.Collections.Generic;
5 using System.Threading.Tasks;
7 using SiliconStudio.Assets.Compiler;
8 using SiliconStudio.BuildEngine;
9 using SiliconStudio.Core.IO;
10 using SiliconStudio.Core.Serialization.Assets;
11 using SiliconStudio.Paradox.Effects.Data;
12 using SiliconStudio.Paradox.Shaders.Compiler;
14 namespace SiliconStudio.
Paradox.Assets.Effect
16 internal class LightingAssetCompiler : AssetCompilerBase<LightingAsset>
20 result.ShouldWaitForPreviousBuilds =
false;
21 result.BuildSteps =
new ListBuildStep {
new LightingConfigurationCompileCommand(urlInStorage, asset, context) };
24 private class LightingConfigurationCompileCommand :
AssetCommand<LightingAsset>
28 private UFile assetUrl;
30 public LightingConfigurationCompileCommand(
string url, LightingAsset value,
AssetCompilerContext context)
33 this.context = context;
34 assetUrl =
new UFile(url);
39 var compiler =
new LightingCompileGenerator(asset, context);
40 var results = compiler.Execute();
42 if (results != null && results.Count != 0)
46 var configDict =
new Dictionary<LightingConfigurationData, CompilerParameters>();
47 foreach (var perm
in results)
51 var configList = configDict.Select(x => x.Key).ToList();
52 configList.Sort((x,
y) => x.TotalLightCount -
y.TotalLightCount);
54 LightingConfigurationData.CheckUnrolls(configList.ToArray());
57 configs.Configs = configList.ToArray();
60 assetManager.Save(assetUrl, configs);
62 return Task.FromResult(ResultStatus.Successful);
Result of a compilation of assets when using IAssetCompiler.Compile
Data type for SiliconStudio.Paradox.Effects.LightingConfiguration.
Data type for SiliconStudio.Paradox.Effects.LightingConfigurationsSet.
_In_ size_t _In_ DXGI_FORMAT _In_ size_t _In_ float size_t y
A command processing an Asset.
The context used when compiling an asset in a Package.
Defines a normalized file path. See UPath for details. This class cannot be inherited.