use of org.terasology.engine.rendering.opengl.FBO in project Terasology by MovingBlocks.
the class ImmutableFbo 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.engine.rendering.opengl.FBO in project Terasology by MovingBlocks.
the class DisplayResolutionDependentFbo 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.engine.rendering.opengl.FBO in project Terasology by MovingBlocks.
the class DisplayResolutionDependentFbo 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, fullScale.multiplyBy(fboConfig.getScale()));
}
retain(fboName);
return fbo;
}
use of org.terasology.engine.rendering.opengl.FBO in project Terasology by MovingBlocks.
the class ShadowMapResolutionDependentFbo 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;
}
Aggregations