Search in sources :

Example 1 with InternalTextureFormat

use of net.coderbot.iris.gl.texture.InternalTextureFormat in project Iris by IrisShaders.

the class IrisImages method addShadowColorImages.

public static void addShadowColorImages(ImageHolder images, ShadowRenderTargets shadowRenderTargets) {
    for (int i = 0; i < shadowRenderTargets.getNumColorTextures(); i++) {
        final int index = i;
        IntSupplier textureID = () -> shadowRenderTargets.getColorTextureId(index);
        InternalTextureFormat format = shadowRenderTargets.getColorTextureFormat(index);
        images.addTextureImage(textureID, format, "shadowcolorimg" + i);
    }
}
Also used : InternalTextureFormat(net.coderbot.iris.gl.texture.InternalTextureFormat) IntSupplier(java.util.function.IntSupplier)

Example 2 with InternalTextureFormat

use of net.coderbot.iris.gl.texture.InternalTextureFormat in project Iris by IrisShaders.

the class IrisImages method addRenderTargetImages.

public static void addRenderTargetImages(ImageHolder images, Supplier<ImmutableSet<Integer>> flipped, RenderTargets renderTargets) {
    for (int i = 0; i < renderTargets.getRenderTargetCount(); i++) {
        final int index = i;
        // Note: image bindings *are* impacted by buffer flips.
        IntSupplier textureID = () -> {
            ImmutableSet<Integer> flippedBuffers = flipped.get();
            RenderTarget target = renderTargets.get(index);
            if (flippedBuffers.contains(index)) {
                return target.getAltTexture();
            } else {
                return target.getMainTexture();
            }
        };
        final InternalTextureFormat internalFormat = renderTargets.get(i).getInternalFormat();
        final String name = "colorimg" + i;
        images.addTextureImage(textureID, internalFormat, name);
    }
}
Also used : InternalTextureFormat(net.coderbot.iris.gl.texture.InternalTextureFormat) ImmutableSet(com.google.common.collect.ImmutableSet) IntSupplier(java.util.function.IntSupplier) RenderTarget(net.coderbot.iris.rendertarget.RenderTarget)

Aggregations

IntSupplier (java.util.function.IntSupplier)2 InternalTextureFormat (net.coderbot.iris.gl.texture.InternalTextureFormat)2 ImmutableSet (com.google.common.collect.ImmutableSet)1 RenderTarget (net.coderbot.iris.rendertarget.RenderTarget)1