Search in sources :

Example 1 with FBO

use of org.terasology.rendering.opengl.FBO 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 2 with FBO

use of org.terasology.rendering.opengl.FBO in project Terasology by MovingBlocks.

the class ImmutableFBOs method request.

@Override
public FBO request(FBOConfig fboConfig) {
    FBO fbo;
    SimpleUri fboName = fboConfig.getName();
    if (fboConfigs.containsKey(fboName)) {
        if (!fboConfig.equals(fboConfigs.get(fboName))) {
            throw new IllegalArgumentException("Requested FBO is already available with different configuration");
        }
        fbo = fboLookup.get(fboConfig.getName());
    } else {
        fbo = generateWithDimensions(fboConfig, fboConfig.getDimensions());
    }
    retain(fboName);
    return fbo;
}
Also used : FBO(org.terasology.rendering.opengl.FBO) SimpleUri(org.terasology.engine.SimpleUri)

Example 3 with FBO

use of org.terasology.rendering.opengl.FBO in project Terasology by MovingBlocks.

the class ShadowMapResolutionDependentFBOs method request.

@Override
public FBO request(FBOConfig fboConfig) {
    FBO fbo;
    SimpleUri fboName = fboConfig.getName();
    if (fboConfigs.containsKey(fboName)) {
        if (!fboConfig.equals(fboConfigs.get(fboName))) {
            throw new IllegalArgumentException("Requested FBO is already available with different configuration");
        }
        fbo = fboLookup.get(fboConfig.getName());
    } else {
        fbo = generateWithDimensions(fboConfig, shadowMapResolution);
    }
    retain(fboName);
    return fbo;
}
Also used : FBO(org.terasology.rendering.opengl.FBO) SimpleUri(org.terasology.engine.SimpleUri)

Example 4 with FBO

use of org.terasology.rendering.opengl.FBO 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 5 with FBO

use of org.terasology.rendering.opengl.FBO 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)

Aggregations

FBO (org.terasology.rendering.opengl.FBO)10 SwappableFBO (org.terasology.rendering.opengl.SwappableFBO)7 SimpleUri (org.terasology.engine.SimpleUri)6 FBOConfig (org.terasology.rendering.opengl.FBOConfig)5 Node (org.terasology.rendering.dag.Node)3 AlphaRejectBlocksNode (org.terasology.rendering.dag.nodes.AlphaRejectBlocksNode)3 AmbientOcclusionNode (org.terasology.rendering.dag.nodes.AmbientOcclusionNode)3 ApplyDeferredLightingNode (org.terasology.rendering.dag.nodes.ApplyDeferredLightingNode)3 BackdropNode (org.terasology.rendering.dag.nodes.BackdropNode)3 BackdropReflectionNode (org.terasology.rendering.dag.nodes.BackdropReflectionNode)3 BloomBlurNode (org.terasology.rendering.dag.nodes.BloomBlurNode)3 BlurredAmbientOcclusionNode (org.terasology.rendering.dag.nodes.BlurredAmbientOcclusionNode)3 BufferClearingNode (org.terasology.rendering.dag.nodes.BufferClearingNode)3 DeferredMainLightNode (org.terasology.rendering.dag.nodes.DeferredMainLightNode)3 DeferredPointLightsNode (org.terasology.rendering.dag.nodes.DeferredPointLightsNode)3 DownSamplerForExposureNode (org.terasology.rendering.dag.nodes.DownSamplerForExposureNode)3 FinalPostProcessingNode (org.terasology.rendering.dag.nodes.FinalPostProcessingNode)3 HazeNode (org.terasology.rendering.dag.nodes.HazeNode)3 HighPassNode (org.terasology.rendering.dag.nodes.HighPassNode)3 InitialPostProcessingNode (org.terasology.rendering.dag.nodes.InitialPostProcessingNode)3