3 using System.Threading.Tasks;
5 using SiliconStudio.Paradox;
6 using SiliconStudio.Paradox.DataModel;
7 using SiliconStudio.Paradox.Effects;
8 using SiliconStudio.Paradox.Effects.Modules;
9 using SiliconStudio.Paradox.Games;
10 using SiliconStudio.Core.Extensions;
11 using SiliconStudio.Paradox.Games.Mathematics;
12 using SiliconStudio.Paradox.Games.MicroThreading;
20 public static async
Task Run(EngineContext engineContext)
24 if (engineContext.DataContext.RenderPassPlugins.TryGetValueCast(
"YebisPlugin", out yebisPlugin))
26 yebisPlugin.Glare.Enable =
false;
27 yebisPlugin.DepthOfField.Enable =
false;
28 yebisPlugin.ToneMap.AutoExposure.Enable =
false;
29 yebisPlugin.ToneMap.Exposure = 1.0f;
30 yebisPlugin.ToneMap.Gamma = 2.2f;
34 EffectOld effect = engineContext.RenderContext.Effects.First(x => x.Name ==
"Multicore");
54 var rand =
new Random();
55 var cubeMeshData = Enumerable.Range(0, 10).Select(x => MeshDataHelper.CreateBox(10, 10, 10,
new Color((
float)rand.NextDouble(), (float)rand.NextDouble(), (float)rand.NextDouble(), 1.0f))).ToArray();
57 var effectMeshGroup =
new RenderPassListEnumerator();
58 engineContext.RenderContext.RenderPassEnumerators.Add(effectMeshGroup);
60 int objectSqrtCount = 31;
61 int meshCount = objectSqrtCount * objectSqrtCount * objectSqrtCount;
63 for (
int j = 0; j < meshCount; ++j)
65 var effectMesh =
new EffectMesh(effect, cubeMeshData[(j / 25) % 10]);
66 effectMesh.KeepAliveBy(engineContext.SimpleComponentRegistry);
67 effectMeshGroup.AddMesh(effectMesh);
69 var w2 = Matrix.Scaling(1.0f)
70 * Matrix.Translation(
new Vector3(
71 (j % objectSqrtCount - objectSqrtCount / 2) * 30.0f - 30.0f,
72 (((j / objectSqrtCount) % objectSqrtCount) - objectSqrtCount / 2) * 30.0f - 30.0f,
73 (j / (objectSqrtCount * objectSqrtCount) - objectSqrtCount / 2) * 30.0f - 30.0f));
75 effectMesh.Parameters.Set(TransformationKeys.World, w2);
static async Task Run(EngineContext engineContext)
SiliconStudio.Core.Mathematics.Color Color
SiliconStudio.Core.Mathematics.Vector3 Vector3