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;
}
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;
}
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;
}
Aggregations