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