Stop assuming that our render pipeline will only process RGB frames

For one, we have already switched to RGBA some time ago, so the name was
technically incorrect already.
But the main reason is that we'll want to use them for depth maps as well (and
potentially maybe even for HDR images if that's possible with canvas?).
This commit is contained in:
Jonas Herzig
2020-10-03 14:41:08 +02:00
parent 4c4c052d8a
commit aee486c4f3
19 changed files with 165 additions and 136 deletions

View File

@@ -3,14 +3,14 @@ package com.replaymod.render.blend;
import com.replaymod.core.versions.MCVer;
import com.replaymod.render.capturer.RenderInfo;
import com.replaymod.render.capturer.WorldRenderer;
import com.replaymod.render.frame.RGBFrame;
import com.replaymod.render.frame.BitmapFrame;
import com.replaymod.render.rendering.FrameCapturer;
import com.replaymod.render.utils.ByteBufferPool;
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
import java.io.IOException;
public class BlendFrameCapturer implements FrameCapturer<RGBFrame> {
public class BlendFrameCapturer implements FrameCapturer<BitmapFrame> {
protected final WorldRenderer worldRenderer;
protected final RenderInfo renderInfo;
protected int framesDone;
@@ -26,7 +26,7 @@ public class BlendFrameCapturer implements FrameCapturer<RGBFrame> {
}
@Override
public RGBFrame process() {
public BitmapFrame process() {
if (framesDone == 0) {
BlendState.getState().setup();
}
@@ -37,7 +37,7 @@ public class BlendFrameCapturer implements FrameCapturer<RGBFrame> {
worldRenderer.renderWorld(MCVer.getRenderPartialTicks(), null);
BlendState.getState().postFrame(framesDone);
return new RGBFrame(framesDone++, new Dimension(0, 0), ByteBufferPool.allocate(0));
return new BitmapFrame(framesDone++, new Dimension(0, 0), 0, ByteBufferPool.allocate(0));
}
@Override