Add depth map export (closes #371)
This commit is contained in:
@@ -4,11 +4,14 @@ import com.replaymod.core.versions.MCVer;
|
||||
import com.replaymod.render.capturer.RenderInfo;
|
||||
import com.replaymod.render.capturer.WorldRenderer;
|
||||
import com.replaymod.render.frame.BitmapFrame;
|
||||
import com.replaymod.render.rendering.Channel;
|
||||
import com.replaymod.render.rendering.FrameCapturer;
|
||||
import com.replaymod.render.utils.ByteBufferPool;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
public class BlendFrameCapturer implements FrameCapturer<BitmapFrame> {
|
||||
protected final WorldRenderer worldRenderer;
|
||||
@@ -26,7 +29,7 @@ public class BlendFrameCapturer implements FrameCapturer<BitmapFrame> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BitmapFrame process() {
|
||||
public Map<Channel, BitmapFrame> process() {
|
||||
if (framesDone == 0) {
|
||||
BlendState.getState().setup();
|
||||
}
|
||||
@@ -37,7 +40,8 @@ public class BlendFrameCapturer implements FrameCapturer<BitmapFrame> {
|
||||
worldRenderer.renderWorld(MCVer.getRenderPartialTicks(), null);
|
||||
BlendState.getState().postFrame(framesDone);
|
||||
|
||||
return new BitmapFrame(framesDone++, new Dimension(0, 0), 0, ByteBufferPool.allocate(0));
|
||||
BitmapFrame frame = new BitmapFrame(framesDone++, new Dimension(0, 0), 0, ByteBufferPool.allocate(0));
|
||||
return Collections.singletonMap(Channel.BRGA, frame);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user