Search in sources :

Example 1 with PipelineDataProvider

use of com.gempukku.libgdx.graph.pipeline.producer.node.PipelineDataProvider in project gdx-graph by MarcinSc.

the class Episode3Scene method loadPipelineRenderer.

private PipelineRenderer loadPipelineRenderer() {
    PipelineRenderer pipelineRenderer = PipelineLoader.loadPipelineRenderer(Gdx.files.local("episodes/episode3.json"), timeKeeper);
    pipelineRenderer.getPluginData(UIPluginPublicData.class).setStage("", stage);
    pipelineRenderer.getPluginData(RenderCallbackPublicData.class).setRenderCallback("Callback", new RenderCallback() {

        @Override
        public void renderCallback(RenderPipeline renderPipeline, PipelineDataProvider pipelineDataProvider, PipelineRenderingContext pipelineRenderingContext, PipelineNode.PipelineRequirementsCallback pipelineRequirementsCallback) {
            RenderPipelineBuffer currentBuffer = renderPipeline.getDefaultBuffer();
            int width = currentBuffer.getWidth();
            int height = currentBuffer.getHeight();
            float viewportWidth = camera.viewportWidth;
            float viewportHeight = camera.viewportHeight;
            if (width != viewportWidth || height != viewportHeight) {
                camera.viewportWidth = width;
                camera.viewportHeight = height;
                camera.update();
            }
            currentBuffer.beginColor();
            modelBatch.begin(camera);
            modelBatch.render(renderableProviders, environment);
            modelBatch.end();
            currentBuffer.endColor();
        }
    });
    return pipelineRenderer;
}
Also used : UIPluginPublicData(com.gempukku.libgdx.graph.plugin.ui.UIPluginPublicData) PipelineDataProvider(com.gempukku.libgdx.graph.pipeline.producer.node.PipelineDataProvider) RenderCallbackPublicData(com.gempukku.libgdx.graph.plugin.callback.RenderCallbackPublicData) RenderCallback(com.gempukku.libgdx.graph.plugin.callback.RenderCallback) PipelineRenderingContext(com.gempukku.libgdx.graph.pipeline.producer.PipelineRenderingContext) PipelineNode(com.gempukku.libgdx.graph.pipeline.producer.node.PipelineNode)

Example 2 with PipelineDataProvider

use of com.gempukku.libgdx.graph.pipeline.producer.node.PipelineDataProvider in project gdx-graph by MarcinSc.

the class Episode2Scene method loadPipelineRenderer.

private PipelineRenderer loadPipelineRenderer() {
    PipelineRenderer pipelineRenderer = PipelineLoader.loadPipelineRenderer(Gdx.files.local("episodes/episode2.json"), timeKeeper);
    pipelineRenderer.getPluginData(UIPluginPublicData.class).setStage("", stage);
    pipelineRenderer.getPluginData(RenderCallbackPublicData.class).setRenderCallback("Callback", new RenderCallback() {

        @Override
        public void renderCallback(RenderPipeline renderPipeline, PipelineDataProvider pipelineDataProvider, PipelineRenderingContext pipelineRenderingContext, PipelineNode.PipelineRequirementsCallback pipelineRequirementsCallback) {
            RenderPipelineBuffer currentBuffer = renderPipeline.getDefaultBuffer();
            int width = currentBuffer.getWidth();
            int height = currentBuffer.getHeight();
            float viewportWidth = camera.viewportWidth;
            float viewportHeight = camera.viewportHeight;
            if (width != viewportWidth || height != viewportHeight) {
                camera.viewportWidth = width;
                camera.viewportHeight = height;
                camera.update();
            }
            currentBuffer.beginColor();
            modelBatch.begin(camera);
            modelBatch.render(renderableProviders, environment);
            modelBatch.end();
            currentBuffer.endColor();
        }
    });
    return pipelineRenderer;
}
Also used : UIPluginPublicData(com.gempukku.libgdx.graph.plugin.ui.UIPluginPublicData) PipelineDataProvider(com.gempukku.libgdx.graph.pipeline.producer.node.PipelineDataProvider) RenderCallbackPublicData(com.gempukku.libgdx.graph.plugin.callback.RenderCallbackPublicData) RenderCallback(com.gempukku.libgdx.graph.plugin.callback.RenderCallback) PipelineRenderingContext(com.gempukku.libgdx.graph.pipeline.producer.PipelineRenderingContext) PipelineNode(com.gempukku.libgdx.graph.pipeline.producer.node.PipelineNode)

Example 3 with PipelineDataProvider

use of com.gempukku.libgdx.graph.pipeline.producer.node.PipelineDataProvider in project gdx-graph by MarcinSc.

the class ShadowShaderTestScene method loadPipelineRenderer.

private PipelineRenderer loadPipelineRenderer() {
    PipelineRenderer pipelineRenderer = PipelineLoader.loadPipelineRenderer(Gdx.files.local("test/shadow-shader-test.json"), timeKeeper);
    pipelineRenderer.setPipelineProperty("Camera", camera);
    pipelineRenderer.getPluginData(RenderCallbackPublicData.class).setRenderCallback("Callback", new RenderCallback() {

        @Override
        public void renderCallback(RenderPipeline renderPipeline, PipelineDataProvider pipelineDataProvider, PipelineRenderingContext pipelineRenderingContext, PipelineNode.PipelineRequirementsCallback pipelineRequirementsCallback) {
            RenderPipelineBuffer currentBuffer = renderPipeline.getDefaultBuffer();
            Directional3DLight firstLight = environment.getDirectionalLights().get(0);
            RenderPipelineBuffer shadowFrameBuffer = firstLight.getShadowFrameBuffer();
            renderPipeline.drawTexture(shadowFrameBuffer, currentBuffer, pipelineRenderingContext, pipelineDataProvider.getFullScreenRender());
        }
    });
    return pipelineRenderer;
}
Also used : PipelineDataProvider(com.gempukku.libgdx.graph.pipeline.producer.node.PipelineDataProvider) Directional3DLight(com.gempukku.libgdx.graph.plugin.lighting3d.Directional3DLight) RenderCallbackPublicData(com.gempukku.libgdx.graph.plugin.callback.RenderCallbackPublicData) RenderCallback(com.gempukku.libgdx.graph.plugin.callback.RenderCallback) PipelineRenderingContext(com.gempukku.libgdx.graph.pipeline.producer.PipelineRenderingContext) PipelineNode(com.gempukku.libgdx.graph.pipeline.producer.node.PipelineNode)

Aggregations

PipelineRenderingContext (com.gempukku.libgdx.graph.pipeline.producer.PipelineRenderingContext)3 PipelineDataProvider (com.gempukku.libgdx.graph.pipeline.producer.node.PipelineDataProvider)3 PipelineNode (com.gempukku.libgdx.graph.pipeline.producer.node.PipelineNode)3 RenderCallback (com.gempukku.libgdx.graph.plugin.callback.RenderCallback)3 RenderCallbackPublicData (com.gempukku.libgdx.graph.plugin.callback.RenderCallbackPublicData)3 UIPluginPublicData (com.gempukku.libgdx.graph.plugin.ui.UIPluginPublicData)2 Directional3DLight (com.gempukku.libgdx.graph.plugin.lighting3d.Directional3DLight)1