use of org.terasology.rendering.opengl.FBOConfig in project Terasology by MovingBlocks.
the class DisplayResolutionDependentFBOs method regenerateFbos.
private void regenerateFbos() {
propertyChangeSupport.firePropertyChange(PRE_FBO_REGENERATION, 0, 1);
for (SimpleUri urn : fboConfigs.keySet()) {
FBOConfig fboConfig = getFboConfig(urn);
fboConfig.setDimensions(fullScale.multiplyBy(fboConfig.getScale()));
FBO.recreate(get(urn), getFboConfig(urn));
}
propertyChangeSupport.firePropertyChange(POST_FBO_REGENERATION, 0, 1);
// Note that the "old" and "new" values (0 and 1) in the above calls aren't actually
// used: they are only necessary to ensure that the event is fired up correctly.
}
use of org.terasology.rendering.opengl.FBOConfig in project Terasology by MovingBlocks.
the class DisplayResolutionDependentFBOs method generateDefaultFBOs.
private void generateDefaultFBOs() {
FBO gBuffer1 = generateWithDimensions(new FBOConfig(new SimpleUri("engine:fbo.gBuffer1"), FULL_SCALE, FBO.Type.HDR).useDepthBuffer().useNormalBuffer().useLightBuffer().useStencilBuffer(), fullScale);
FBO gBuffer2 = generateWithDimensions(new FBOConfig(new SimpleUri("engine:fbo.gBuffer2"), FULL_SCALE, FBO.Type.HDR).useDepthBuffer().useNormalBuffer().useLightBuffer().useStencilBuffer(), fullScale);
generateWithDimensions(new FBOConfig(FINAL_BUFFER, FULL_SCALE, FBO.Type.DEFAULT), fullScale);
gBufferPair = new SwappableFBO(gBuffer1, gBuffer2);
}
use of org.terasology.rendering.opengl.FBOConfig in project Terasology by MovingBlocks.
the class WorldRendererImpl method addSkyNodes.
private void addSkyNodes(RenderGraph renderGraph) {
Node backdropNode = new BackdropNode(context);
renderGraph.addNode(backdropNode, "backdropNode");
FBOConfig intermediateHazeConfig = new FBOConfig(HazeNode.INTERMEDIATE_HAZE_FBO_URI, ONE_16TH_SCALE, FBO.Type.DEFAULT);
FBO intermediateHazeFbo = displayResolutionDependentFBOs.request(intermediateHazeConfig);
HazeNode intermediateHazeNode = new HazeNode(context, displayResolutionDependentFBOs.getGBufferPair().getLastUpdatedFbo(), intermediateHazeFbo);
renderGraph.addNode(intermediateHazeNode, "intermediateHazeNode");
FBOConfig finalHazeConfig = new FBOConfig(HazeNode.FINAL_HAZE_FBO_URI, ONE_32TH_SCALE, FBO.Type.DEFAULT);
FBO finalHazeFbo = displayResolutionDependentFBOs.request(finalHazeConfig);
HazeNode finalHazeNode = new HazeNode(context, intermediateHazeFbo, finalHazeFbo);
renderGraph.addNode(finalHazeNode, "finalHazeNode");
Node lastUpdatedGBufferClearingNode = renderGraph.findNode("engine:lastUpdatedGBufferClearingNode");
renderGraph.connect(lastUpdatedGBufferClearingNode, backdropNode, intermediateHazeNode, finalHazeNode);
}
use of org.terasology.rendering.opengl.FBOConfig in project Terasology by MovingBlocks.
the class WorldRendererImpl method addBloomNodes.
private void addBloomNodes(RenderGraph renderGraph) {
// Bloom Effect: one high-pass filter and three blur passes
Node highPassNode = new HighPassNode(context);
renderGraph.addNode(highPassNode, "highPassNode");
FBOConfig halfScaleBloomConfig = new FBOConfig(BloomBlurNode.HALF_SCALE_FBO_URI, HALF_SCALE, FBO.Type.DEFAULT);
FBO halfScaleBloomFbo = displayResolutionDependentFBOs.request(halfScaleBloomConfig);
BloomBlurNode halfScaleBlurredBloomNode = new BloomBlurNode(context, displayResolutionDependentFBOs.get(HighPassNode.HIGH_PASS_FBO_URI), halfScaleBloomFbo);
renderGraph.addNode(halfScaleBlurredBloomNode, "halfScaleBlurredBloomNode");
FBOConfig quarterScaleBloomConfig = new FBOConfig(BloomBlurNode.QUARTER_SCALE_FBO_URI, QUARTER_SCALE, FBO.Type.DEFAULT);
FBO quarterScaleBloomFbo = displayResolutionDependentFBOs.request(quarterScaleBloomConfig);
BloomBlurNode quarterScaleBlurredBloomNode = new BloomBlurNode(context, halfScaleBloomFbo, quarterScaleBloomFbo);
renderGraph.addNode(quarterScaleBlurredBloomNode, "quarterScaleBlurredBloomNode");
FBOConfig one8thScaleBloomConfig = new FBOConfig(BloomBlurNode.ONE_8TH_SCALE_FBO_URI, ONE_8TH_SCALE, FBO.Type.DEFAULT);
FBO one8thScaleBloomFbo = displayResolutionDependentFBOs.request(one8thScaleBloomConfig);
BloomBlurNode one8thScaleBlurredBloomNode = new BloomBlurNode(context, quarterScaleBloomFbo, one8thScaleBloomFbo);
renderGraph.addNode(one8thScaleBlurredBloomNode, "one8thScaleBlurredBloomNode");
Node simpleBlendMaterialsNode = renderGraph.findNode("engine:simpleBlendMaterialsNode");
renderGraph.connect(simpleBlendMaterialsNode, highPassNode, halfScaleBlurredBloomNode, quarterScaleBlurredBloomNode, one8thScaleBlurredBloomNode);
}
use of org.terasology.rendering.opengl.FBOConfig in project Terasology by MovingBlocks.
the class WorldRendererImpl method addLightingNodes.
private void addLightingNodes(RenderGraph renderGraph) {
Node opaqueObjectsNode = renderGraph.findNode("engine:opaqueObjectsNode");
Node opaqueBlocksNode = renderGraph.findNode("engine:opaqueBlocksNode");
Node alphaRejectBlocksNode = renderGraph.findNode("engine:alphaRejectBlocksNode");
Node lastUpdatedGBufferClearingNode = renderGraph.findNode("engine:lastUpdatedGBufferClearingNode");
Node staleGBufferClearingNode = renderGraph.findNode("engine:staleGBufferClearingNode");
FBOConfig shadowMapConfig = new FBOConfig(ShadowMapNode.SHADOW_MAP_FBO_URI, FBO.Type.NO_COLOR).useDepthBuffer();
BufferClearingNode shadowMapClearingNode = new BufferClearingNode(shadowMapConfig, shadowMapResolutionDependentFBOs, GL_DEPTH_BUFFER_BIT);
renderGraph.addNode(shadowMapClearingNode, "shadowMapClearingNode");
shadowMapNode = new ShadowMapNode(context);
renderGraph.addNode(shadowMapNode, "shadowMapNode");
renderGraph.connect(shadowMapClearingNode, shadowMapNode);
Node deferredPointLightsNode = new DeferredPointLightsNode(context);
renderGraph.addNode(deferredPointLightsNode, "deferredPointLightsNode");
renderGraph.connect(opaqueObjectsNode, deferredPointLightsNode);
renderGraph.connect(opaqueBlocksNode, deferredPointLightsNode);
renderGraph.connect(alphaRejectBlocksNode, deferredPointLightsNode);
Node deferredMainLightNode = new DeferredMainLightNode(context);
renderGraph.addNode(deferredMainLightNode, "deferredMainLightNode");
renderGraph.connect(shadowMapNode, deferredMainLightNode);
renderGraph.connect(opaqueObjectsNode, deferredMainLightNode);
renderGraph.connect(opaqueBlocksNode, deferredMainLightNode);
renderGraph.connect(alphaRejectBlocksNode, deferredMainLightNode);
renderGraph.connect(deferredPointLightsNode, deferredMainLightNode);
Node applyDeferredLightingNode = new ApplyDeferredLightingNode(context);
renderGraph.addNode(applyDeferredLightingNode, "applyDeferredLightingNode");
renderGraph.connect(deferredMainLightNode, applyDeferredLightingNode);
renderGraph.connect(deferredPointLightsNode, applyDeferredLightingNode);
renderGraph.connect(lastUpdatedGBufferClearingNode, applyDeferredLightingNode);
renderGraph.connect(staleGBufferClearingNode, applyDeferredLightingNode);
}
Aggregations