Search in sources :

Example 1 with RefractiveReflectiveBlocksNode

use of org.terasology.rendering.dag.nodes.RefractiveReflectiveBlocksNode in project Terasology by MovingBlocks.

the class WorldRendererImpl method addReflectionAndRefractionNodes.

private void addReflectionAndRefractionNodes(RenderGraph renderGraph) {
    FBOConfig reflectedBufferConfig = new FBOConfig(BackdropReflectionNode.REFLECTED_FBO_URI, HALF_SCALE, FBO.Type.DEFAULT).useDepthBuffer();
    BufferClearingNode reflectedBufferClearingNode = new BufferClearingNode(reflectedBufferConfig, displayResolutionDependentFBOs, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    renderGraph.addNode(reflectedBufferClearingNode, "reflectedBufferClearingNode");
    Node reflectedBackdropNode = new BackdropReflectionNode(context);
    renderGraph.addNode(reflectedBackdropNode, "reflectedBackdropNode");
    Node worldReflectionNode = new WorldReflectionNode(context);
    renderGraph.addNode(worldReflectionNode, "worldReflectionNode");
    renderGraph.connect(reflectedBufferClearingNode, reflectedBackdropNode, worldReflectionNode);
    FBOConfig reflectedRefractedBufferConfig = new FBOConfig(RefractiveReflectiveBlocksNode.REFRACTIVE_REFLECTIVE_FBO_URI, FULL_SCALE, FBO.Type.HDR).useNormalBuffer();
    BufferClearingNode reflectedRefractedBufferClearingNode = new BufferClearingNode(reflectedRefractedBufferConfig, displayResolutionDependentFBOs, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    renderGraph.addNode(reflectedRefractedBufferClearingNode, "reflectedRefractedBufferClearingNode");
    Node chunksRefractiveReflectiveNode = new RefractiveReflectiveBlocksNode(context);
    renderGraph.addNode(chunksRefractiveReflectiveNode, "chunksRefractiveReflectiveNode");
    Node applyDeferredLightingNode = renderGraph.findNode("engine:applyDeferredLightingNode");
    renderGraph.connect(reflectedRefractedBufferClearingNode, chunksRefractiveReflectiveNode);
    renderGraph.connect(worldReflectionNode, chunksRefractiveReflectiveNode);
    // TODO: At this stage, it is unclear -why- this connection is required, we just know that it's required. Investigate.
    renderGraph.connect(applyDeferredLightingNode, chunksRefractiveReflectiveNode);
// TODO: consider having a non-rendering node for FBO.attachDepthBufferTo() methods
}
Also used : FBOConfig(org.terasology.rendering.opengl.FBOConfig) RefractiveReflectiveBlocksNode(org.terasology.rendering.dag.nodes.RefractiveReflectiveBlocksNode) 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) BackdropReflectionNode(org.terasology.rendering.dag.nodes.BackdropReflectionNode) WorldReflectionNode(org.terasology.rendering.dag.nodes.WorldReflectionNode)

Aggregations

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