Search in sources :

Example 1 with FBOConfig

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.
}
Also used : FBOConfig(org.terasology.rendering.opengl.FBOConfig) SimpleUri(org.terasology.engine.SimpleUri)

Example 2 with FBOConfig

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);
}
Also used : FBOConfig(org.terasology.rendering.opengl.FBOConfig) SwappableFBO(org.terasology.rendering.opengl.SwappableFBO) FBO(org.terasology.rendering.opengl.FBO) SwappableFBO(org.terasology.rendering.opengl.SwappableFBO) SimpleUri(org.terasology.engine.SimpleUri)

Example 3 with FBOConfig

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);
}
Also used : FBOConfig(org.terasology.rendering.opengl.FBOConfig) BackdropNode(org.terasology.rendering.dag.nodes.BackdropNode) SwappableFBO(org.terasology.rendering.opengl.SwappableFBO) FBO(org.terasology.rendering.opengl.FBO) HazeNode(org.terasology.rendering.dag.nodes.HazeNode) DeferredMainLightNode(org.terasology.rendering.dag.nodes.DeferredMainLightNode) PrePostCompositeNode(org.terasology.rendering.dag.nodes.PrePostCompositeNode) ShadowMapNode(org.terasology.rendering.dag.nodes.ShadowMapNode) OutlineNode(org.terasology.rendering.dag.nodes.OutlineNode) InitialPostProcessingNode(org.terasology.rendering.dag.nodes.InitialPostProcessingNode) BlurredAmbientOcclusionNode(org.terasology.rendering.dag.nodes.BlurredAmbientOcclusionNode) OpaqueBlocksNode(org.terasology.rendering.dag.nodes.OpaqueBlocksNode) AmbientOcclusionNode(org.terasology.rendering.dag.nodes.AmbientOcclusionNode) FinalPostProcessingNode(org.terasology.rendering.dag.nodes.FinalPostProcessingNode) UpdateExposureNode(org.terasology.rendering.dag.nodes.UpdateExposureNode) LightShaftsNode(org.terasology.rendering.dag.nodes.LightShaftsNode) AlphaRejectBlocksNode(org.terasology.rendering.dag.nodes.AlphaRejectBlocksNode) Node(org.terasology.rendering.dag.Node) DeferredPointLightsNode(org.terasology.rendering.dag.nodes.DeferredPointLightsNode) WorldReflectionNode(org.terasology.rendering.dag.nodes.WorldReflectionNode) ToneMappingNode(org.terasology.rendering.dag.nodes.ToneMappingNode) BufferClearingNode(org.terasology.rendering.dag.nodes.BufferClearingNode) HighPassNode(org.terasology.rendering.dag.nodes.HighPassNode) BloomBlurNode(org.terasology.rendering.dag.nodes.BloomBlurNode) OpaqueObjectsNode(org.terasology.rendering.dag.nodes.OpaqueObjectsNode) OutputToHMDNode(org.terasology.rendering.dag.nodes.OutputToHMDNode) LateBlurNode(org.terasology.rendering.dag.nodes.LateBlurNode) ApplyDeferredLightingNode(org.terasology.rendering.dag.nodes.ApplyDeferredLightingNode) BackdropReflectionNode(org.terasology.rendering.dag.nodes.BackdropReflectionNode) DownSamplerForExposureNode(org.terasology.rendering.dag.nodes.DownSamplerForExposureNode) HazeNode(org.terasology.rendering.dag.nodes.HazeNode) RefractiveReflectiveBlocksNode(org.terasology.rendering.dag.nodes.RefractiveReflectiveBlocksNode) SimpleBlendMaterialsNode(org.terasology.rendering.dag.nodes.SimpleBlendMaterialsNode) OutputToScreenNode(org.terasology.rendering.dag.nodes.OutputToScreenNode) BackdropNode(org.terasology.rendering.dag.nodes.BackdropNode) OverlaysNode(org.terasology.rendering.dag.nodes.OverlaysNode)

Example 4 with FBOConfig

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);
}
Also used : FBOConfig(org.terasology.rendering.opengl.FBOConfig) SwappableFBO(org.terasology.rendering.opengl.SwappableFBO) FBO(org.terasology.rendering.opengl.FBO) BloomBlurNode(org.terasology.rendering.dag.nodes.BloomBlurNode) DeferredMainLightNode(org.terasology.rendering.dag.nodes.DeferredMainLightNode) PrePostCompositeNode(org.terasology.rendering.dag.nodes.PrePostCompositeNode) ShadowMapNode(org.terasology.rendering.dag.nodes.ShadowMapNode) OutlineNode(org.terasology.rendering.dag.nodes.OutlineNode) InitialPostProcessingNode(org.terasology.rendering.dag.nodes.InitialPostProcessingNode) BlurredAmbientOcclusionNode(org.terasology.rendering.dag.nodes.BlurredAmbientOcclusionNode) OpaqueBlocksNode(org.terasology.rendering.dag.nodes.OpaqueBlocksNode) AmbientOcclusionNode(org.terasology.rendering.dag.nodes.AmbientOcclusionNode) FinalPostProcessingNode(org.terasology.rendering.dag.nodes.FinalPostProcessingNode) UpdateExposureNode(org.terasology.rendering.dag.nodes.UpdateExposureNode) LightShaftsNode(org.terasology.rendering.dag.nodes.LightShaftsNode) AlphaRejectBlocksNode(org.terasology.rendering.dag.nodes.AlphaRejectBlocksNode) Node(org.terasology.rendering.dag.Node) DeferredPointLightsNode(org.terasology.rendering.dag.nodes.DeferredPointLightsNode) WorldReflectionNode(org.terasology.rendering.dag.nodes.WorldReflectionNode) ToneMappingNode(org.terasology.rendering.dag.nodes.ToneMappingNode) BufferClearingNode(org.terasology.rendering.dag.nodes.BufferClearingNode) HighPassNode(org.terasology.rendering.dag.nodes.HighPassNode) BloomBlurNode(org.terasology.rendering.dag.nodes.BloomBlurNode) OpaqueObjectsNode(org.terasology.rendering.dag.nodes.OpaqueObjectsNode) OutputToHMDNode(org.terasology.rendering.dag.nodes.OutputToHMDNode) LateBlurNode(org.terasology.rendering.dag.nodes.LateBlurNode) ApplyDeferredLightingNode(org.terasology.rendering.dag.nodes.ApplyDeferredLightingNode) BackdropReflectionNode(org.terasology.rendering.dag.nodes.BackdropReflectionNode) DownSamplerForExposureNode(org.terasology.rendering.dag.nodes.DownSamplerForExposureNode) HazeNode(org.terasology.rendering.dag.nodes.HazeNode) RefractiveReflectiveBlocksNode(org.terasology.rendering.dag.nodes.RefractiveReflectiveBlocksNode) SimpleBlendMaterialsNode(org.terasology.rendering.dag.nodes.SimpleBlendMaterialsNode) OutputToScreenNode(org.terasology.rendering.dag.nodes.OutputToScreenNode) BackdropNode(org.terasology.rendering.dag.nodes.BackdropNode) OverlaysNode(org.terasology.rendering.dag.nodes.OverlaysNode) HighPassNode(org.terasology.rendering.dag.nodes.HighPassNode)

Example 5 with FBOConfig

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);
}
Also used : FBOConfig(org.terasology.rendering.opengl.FBOConfig) ApplyDeferredLightingNode(org.terasology.rendering.dag.nodes.ApplyDeferredLightingNode) ShadowMapNode(org.terasology.rendering.dag.nodes.ShadowMapNode) DeferredMainLightNode(org.terasology.rendering.dag.nodes.DeferredMainLightNode) PrePostCompositeNode(org.terasology.rendering.dag.nodes.PrePostCompositeNode) ShadowMapNode(org.terasology.rendering.dag.nodes.ShadowMapNode) OutlineNode(org.terasology.rendering.dag.nodes.OutlineNode) InitialPostProcessingNode(org.terasology.rendering.dag.nodes.InitialPostProcessingNode) BlurredAmbientOcclusionNode(org.terasology.rendering.dag.nodes.BlurredAmbientOcclusionNode) OpaqueBlocksNode(org.terasology.rendering.dag.nodes.OpaqueBlocksNode) AmbientOcclusionNode(org.terasology.rendering.dag.nodes.AmbientOcclusionNode) FinalPostProcessingNode(org.terasology.rendering.dag.nodes.FinalPostProcessingNode) UpdateExposureNode(org.terasology.rendering.dag.nodes.UpdateExposureNode) LightShaftsNode(org.terasology.rendering.dag.nodes.LightShaftsNode) AlphaRejectBlocksNode(org.terasology.rendering.dag.nodes.AlphaRejectBlocksNode) Node(org.terasology.rendering.dag.Node) DeferredPointLightsNode(org.terasology.rendering.dag.nodes.DeferredPointLightsNode) WorldReflectionNode(org.terasology.rendering.dag.nodes.WorldReflectionNode) ToneMappingNode(org.terasology.rendering.dag.nodes.ToneMappingNode) BufferClearingNode(org.terasology.rendering.dag.nodes.BufferClearingNode) HighPassNode(org.terasology.rendering.dag.nodes.HighPassNode) BloomBlurNode(org.terasology.rendering.dag.nodes.BloomBlurNode) OpaqueObjectsNode(org.terasology.rendering.dag.nodes.OpaqueObjectsNode) OutputToHMDNode(org.terasology.rendering.dag.nodes.OutputToHMDNode) LateBlurNode(org.terasology.rendering.dag.nodes.LateBlurNode) ApplyDeferredLightingNode(org.terasology.rendering.dag.nodes.ApplyDeferredLightingNode) BackdropReflectionNode(org.terasology.rendering.dag.nodes.BackdropReflectionNode) DownSamplerForExposureNode(org.terasology.rendering.dag.nodes.DownSamplerForExposureNode) HazeNode(org.terasology.rendering.dag.nodes.HazeNode) RefractiveReflectiveBlocksNode(org.terasology.rendering.dag.nodes.RefractiveReflectiveBlocksNode) SimpleBlendMaterialsNode(org.terasology.rendering.dag.nodes.SimpleBlendMaterialsNode) OutputToScreenNode(org.terasology.rendering.dag.nodes.OutputToScreenNode) BackdropNode(org.terasology.rendering.dag.nodes.BackdropNode) OverlaysNode(org.terasology.rendering.dag.nodes.OverlaysNode) BufferClearingNode(org.terasology.rendering.dag.nodes.BufferClearingNode) DeferredPointLightsNode(org.terasology.rendering.dag.nodes.DeferredPointLightsNode) DeferredMainLightNode(org.terasology.rendering.dag.nodes.DeferredMainLightNode)

Aggregations

FBOConfig (org.terasology.rendering.opengl.FBOConfig)9 Node (org.terasology.rendering.dag.Node)6 AlphaRejectBlocksNode (org.terasology.rendering.dag.nodes.AlphaRejectBlocksNode)6 AmbientOcclusionNode (org.terasology.rendering.dag.nodes.AmbientOcclusionNode)6 ApplyDeferredLightingNode (org.terasology.rendering.dag.nodes.ApplyDeferredLightingNode)6 BackdropNode (org.terasology.rendering.dag.nodes.BackdropNode)6 BackdropReflectionNode (org.terasology.rendering.dag.nodes.BackdropReflectionNode)6 BloomBlurNode (org.terasology.rendering.dag.nodes.BloomBlurNode)6 BlurredAmbientOcclusionNode (org.terasology.rendering.dag.nodes.BlurredAmbientOcclusionNode)6 BufferClearingNode (org.terasology.rendering.dag.nodes.BufferClearingNode)6 DeferredMainLightNode (org.terasology.rendering.dag.nodes.DeferredMainLightNode)6 DeferredPointLightsNode (org.terasology.rendering.dag.nodes.DeferredPointLightsNode)6 DownSamplerForExposureNode (org.terasology.rendering.dag.nodes.DownSamplerForExposureNode)6 FinalPostProcessingNode (org.terasology.rendering.dag.nodes.FinalPostProcessingNode)6 HazeNode (org.terasology.rendering.dag.nodes.HazeNode)6 HighPassNode (org.terasology.rendering.dag.nodes.HighPassNode)6 InitialPostProcessingNode (org.terasology.rendering.dag.nodes.InitialPostProcessingNode)6 LateBlurNode (org.terasology.rendering.dag.nodes.LateBlurNode)6 LightShaftsNode (org.terasology.rendering.dag.nodes.LightShaftsNode)6 OpaqueBlocksNode (org.terasology.rendering.dag.nodes.OpaqueBlocksNode)6