Search in sources :

Example 6 with FBO

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

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

Example 8 with FBO

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

Example 9 with 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;
}
Also used : FBO(org.terasology.engine.rendering.opengl.FBO) SimpleUri(org.terasology.engine.core.SimpleUri)

Aggregations

FBO (org.terasology.engine.rendering.opengl.FBO)9 SimpleUri (org.terasology.engine.core.SimpleUri)7 FboConfig (org.terasology.engine.rendering.opengl.FboConfig)3 SwappableFBO (org.terasology.engine.rendering.opengl.SwappableFBO)2 Map (java.util.Map)1 RenderPipelineTask (org.terasology.engine.rendering.dag.RenderPipelineTask)1 BufferPair (org.terasology.engine.rendering.dag.dependencyConnections.BufferPair)1