WorldRendererImpl.java - add rendering modules' initialization in order
import org.terasology.config.Config;
import org.terasology.config.RenderingConfig;
import org.terasology.context.Context;
+import org.terasology.engine.module.RenderingModuleManager;
import org.terasology.engine.subsystem.DisplayDevice;
import org.terasology.engine.subsystem.lwjgl.GLBufferPool;
import org.terasology.engine.subsystem.lwjgl.LwjglGraphics;
+import org.terasology.engine.subsystem.rendering.ModuleRenderingSubsystem;
import org.terasology.logic.console.Console;
import org.terasology.logic.console.commandSystem.MethodCommand;
import org.terasology.logic.console.commandSystem.annotations.Command;
import org.terasology.math.TeraMath;
import org.terasology.math.geom.Vector3f;
import org.terasology.math.geom.Vector3i;
+import org.terasology.module.ModuleEnvironment;
import org.terasology.rendering.ShaderManager;
import org.terasology.rendering.assets.material.Material;
import org.terasology.rendering.backdrop.BackdropProvider;
import org.terasology.rendering.cameras.OpenVRStereoCamera;
import org.terasology.rendering.cameras.PerspectiveCamera;
import org.terasology.rendering.cameras.SubmersibleCamera;
+import org.terasology.rendering.dag.RenderingModuleRegistry;
import org.terasology.rendering.dag.gsoc.DummyNode;
+import org.terasology.rendering.dag.gsoc.ModuleRendering;
import org.terasology.rendering.dag.gsoc.NewNode;
import org.terasology.rendering.dag.RenderGraph;
import org.terasology.rendering.dag.RenderPipelineTask;
@@ -168,6 +173,10 @@ public WorldRendererImpl(Context context, GLBufferPool bufferPool) {
initRenderingSupport();
+ initRenderGraph();
+
+ initRenderingModules();
+
console = context.get(Console.class);
MethodCommand.registerAvailable(this, console, context);
}
@@ -184,7 +193,6 @@ private void initRenderingSupport() {
context.put(WorldRenderer.class, this);
context.put(RenderQueuesHelper.class, renderQueues);
context.put(RenderableWorld.class, renderableWorld);
- initRenderGraph();
}
private void initRenderGraph() {
@@ -198,6 +206,13 @@ private void initRenderGraph() {
requestTaskListRefresh();
}
+ private void initRenderingModules() {
+ RenderingModuleRegistry renderingModuleRegistry = context.get(RenderingModuleManager.class).getRegistry();
+ for (ModuleRendering moduleRenderingInstance : renderingModuleRegistry.getOrderedRenderingModules()) {
+ moduleRenderingInstance.initialise();
+ }
+ }
+
public void addDummyNodes() {
/*
NewNode blurredAmbientOcclusionNode = new DummyNode ("blurredAmbientOcclusionNode", context);
