Java 类net.minecraft.client.shader.Framebuffer 实例源码

项目:renderTo    文件:FrameBufferUtils.java   
public int saveFrameBufferToFile(Framebuffer buffer, File f, int width, int height, boolean cut) {
    try {
        BufferedImage bufferedimage = getImageFromFrameBuffer(buffer, width, height);
        if(cut) {
            Rectangle bound = getImageBound(bufferedimage);
            int compareResult = compareImage(bufferedimage, bound);
            if(compareResult == 0) {
                bufferedimage = cutPicture(bufferedimage, bound);
            } else {
                return compareResult;
            }
        }
        ImageIO.write(bufferedimage, "png", f);
    } catch(Exception e) {
        RenderToMod.logger.error("Cannot save framebuffer to file " + f);
        RenderToMod.logger.error(e + ": " + e.getMessage());
        RenderToMod.logger.error(Arrays.toString(e.getStackTrace()));
    }
    return 0;
}
项目:renderTo    文件:FrameBufferUtils.java   
public BufferedImage getImageFromFrameBuffer(Framebuffer buffer, int width, int height) {
    int k = buffer.framebufferTextureWidth * buffer.framebufferTextureHeight;
    if (pixelBuffer == null || pixelBuffer.capacity() < k) {
        pixelBuffer = BufferUtils.createIntBuffer(k);
        pixelValues = new int[k];
    }
    GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1);
    GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
    pixelBuffer.clear();
    GlStateManager.bindTexture(buffer.framebufferTexture);
    GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, pixelBuffer);
    pixelBuffer.get(pixelValues);
    TextureUtil.processPixelValues(pixelValues, buffer.framebufferTextureWidth, buffer.framebufferTextureHeight);
    BufferedImage bufferedimage = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);
    int l = buffer.framebufferTextureHeight - buffer.framebufferHeight;
    bufferedimage.setRGB(0, 0, width, height, pixelValues, l*buffer.framebufferTextureWidth, buffer.framebufferTextureWidth);
    return bufferedimage;
}
项目:renderTo    文件:RenderToGuiScreen.java   
private void saveBlockPic(String domain, String selected, int outputSize) {
    File f = new File(saveDir, domain + "/block/" + outputSize + "x/" + selected.replaceAll("[^0-9a-zA-Z]{1}", "_") + ".png");
    f.getParentFile().mkdirs();

    Framebuffer mb = mc.getFramebuffer();
    int radius = Math.min(mb.framebufferWidth, mb.framebufferHeight);
    Framebuffer fb = new Framebuffer(mb.framebufferWidth * outputSize / radius, mb.framebufferHeight * outputSize / radius, true);
    fb.framebufferClear();
    fb.bindFramebuffer(false);

    int r = radius * this.width / mb.framebufferWidth;

    setupRenderItemGlState(r, 0, 0);
    drawBlockCore(selected);
    releaseRenderItemGlState();

    FrameBufferUtils.instance.saveFrameBufferToFile(fb, f, outputSize, outputSize, false);

    mb.bindFramebuffer(true);
    fb.deleteFramebuffer();
}
项目:renderTo    文件:RenderToGuiScreen.java   
private void saveItemPic(String domain, String selected, int outputSize) {
    File f = new File(saveDir, domain + "/item/" + outputSize + "x/" + selected.replaceAll("[^0-9a-zA-Z]{1}", "_") + ".png");
    f.getParentFile().mkdirs();

    Framebuffer mb = mc.getFramebuffer();
    int radius = Math.min(mb.framebufferWidth, mb.framebufferHeight);
    Framebuffer fb = new Framebuffer(mb.framebufferWidth * outputSize / radius, mb.framebufferHeight * outputSize / radius, true);
    fb.framebufferClear();
    fb.bindFramebuffer(false);

    int r = radius * this.width / mb.framebufferWidth;

    setupRenderItemGlState(r, 0, 0);
    drawItemCore(selected);
    releaseRenderItemGlState();

    FrameBufferUtils.instance.saveFrameBufferToFile(fb, f, outputSize, outputSize, false);

    mb.bindFramebuffer(true);
    fb.deleteFramebuffer();
}
项目:minema    文件:CaptureFrame.java   
public void readPixels(boolean fbo, boolean pbo) {
    buffer.rewind();

    // set alignment flags
    glPixelStorei(GL_PACK_ALIGNMENT, 1);
    glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

    // read texture from framebuffer if enabled, otherwise use slower
    // glReadPixels
    if (fbo) {
        Framebuffer fb = MC.getFramebuffer();
        fb.bindFramebufferTexture();
        if (pbo) {
            glGetTexImage(GL_TEXTURE_2D, 0, FORMAT, TYPE, 0);
        } else {
            glGetTexImage(GL_TEXTURE_2D, 0, FORMAT, TYPE, buffer);
        }
        fb.unbindFramebufferTexture();
    } else {
        if (pbo) {
            glReadPixels(0, 0, width, height, FORMAT, TYPE, 0);
        } else {
            glReadPixels(0, 0, width, height, FORMAT, TYPE, buffer);
        }
    }
}
项目:minecraft-vr-base    文件:FrameBufferShim.java   
public FrameBufferShim(Framebuffer buf ) {
    super(32,32,false); //just dummy values. We'll delete it anyway
    deleteFramebuffer();
    framebufferTextureWidth = buf.framebufferTextureWidth;
    framebufferTextureHeight = buf.framebufferTextureHeight;

    framebufferWidth = buf.framebufferWidth;
    framebufferHeight = buf.framebufferHeight;

    framebufferObject = buf.framebufferObject;
    framebufferTexture = buf.framebufferTexture;

    useDepth = buf.useDepth;
    depthBuffer = buf.depthBuffer;

    framebufferColor = buf.framebufferColor;
    framebufferFilter = buf.framebufferFilter;
}
项目:ClientAPI    文件:Camera.java   
public Camera(CameraHandle handle) {
    this.handle = handle;
    this.reflected = handle.reflected();
    this.framebuffer = new Framebuffer(handle.width(), handle.height(), true);

    CameraManager.getInstance().register(this);
}
项目:DecompiledMinecraft    文件:LoadingScreenRenderer.java   
public LoadingScreenRenderer(Minecraft mcIn)
{
    this.mc = mcIn;
    this.scaledResolution = new ScaledResolution(mcIn);
    this.framebuffer = new Framebuffer(mcIn.displayWidth, mcIn.displayHeight, false);
    this.framebuffer.setFramebufferFilter(9728);
}
项目:BaseClient    文件:LoadingScreenRenderer.java   
public LoadingScreenRenderer(Minecraft mcIn)
{
    this.mc = mcIn;
    this.scaledResolution = new ScaledResolution(mcIn);
    this.framebuffer = new Framebuffer(mcIn.displayWidth, mcIn.displayHeight, false);
    this.framebuffer.setFramebufferFilter(9728);
}
项目:BaseClient    文件:LoadingScreenRenderer.java   
public LoadingScreenRenderer(Minecraft mcIn)
{
    this.mc = mcIn;
    this.scaledResolution = new ScaledResolution(mcIn);
    this.framebuffer = new Framebuffer(mcIn.displayWidth, mcIn.displayHeight, false);
    this.framebuffer.setFramebufferFilter(9728);
}
项目:Proyecto-DASI    文件:VideoProducerImplementation.java   
@Override
public void prepare(MissionInit missionInit)
{
       this.fbo = new Framebuffer(this.videoParams.getWidth(), this.videoParams.getHeight(), true);
       // Create a buffer for retrieving the depth map, if requested:
       if (this.videoParams.isWantDepth())
        this.depthBuffer = BufferUtils.createFloatBuffer(this.videoParams.getWidth() * this.videoParams.getHeight());
       // Set the requested camera position
       Minecraft.getMinecraft().gameSettings.thirdPersonView = this.videoParams.getViewpoint();
}
项目:Proyecto-DASI    文件:VideoProducerImplementation.java   
@Override
public void prepare(MissionInit missionInit)
{
       this.fbo = new Framebuffer(this.videoParams.getWidth(), this.videoParams.getHeight(), true);
       // Create a buffer for retrieving the depth map, if requested:
       if (this.videoParams.isWantDepth())
        this.depthBuffer = BufferUtils.createFloatBuffer(this.videoParams.getWidth() * this.videoParams.getHeight());
       // Set the requested camera position
       Minecraft.getMinecraft().gameSettings.thirdPersonView = this.videoParams.getViewpoint();
}
项目:flex-fov    文件:Standard.java   
@Override
public void renderWorld(EntityRenderer er, Minecraft mc, Framebuffer framebuffer, Shader shader,
        int[] framebufferTextures, float partialTicks, long finishTimeNano, int width, int height, float sizeIncrease) {
    RenderUtil.render360 = false;
    RenderUtil.partialWidth = mc.displayWidth;
    RenderUtil.partialHeight = mc.displayHeight;
    er.renderWorldPass(2, partialTicks, finishTimeNano);
}
项目:Backmemed    文件:LoadingScreenRenderer.java   
public LoadingScreenRenderer(Minecraft mcIn)
{
    this.mc = mcIn;
    this.scaledResolution = new ScaledResolution(mcIn);
    this.framebuffer = new Framebuffer(mcIn.displayWidth, mcIn.displayHeight, false);
    this.framebuffer.setFramebufferFilter(9728);
}
项目:Backmemed    文件:ScreenShotHelper.java   
public static BufferedImage createScreenshot(int width, int height, Framebuffer framebufferIn)
{
    if (OpenGlHelper.isFramebufferEnabled())
    {
        width = framebufferIn.framebufferTextureWidth;
        height = framebufferIn.framebufferTextureHeight;
    }

    int i = width * height;

    if (pixelBuffer == null || pixelBuffer.capacity() < i)
    {
        pixelBuffer = BufferUtils.createIntBuffer(i);
        pixelValues = new int[i];
    }

    GlStateManager.glPixelStorei(3333, 1);
    GlStateManager.glPixelStorei(3317, 1);
    pixelBuffer.clear();

    if (OpenGlHelper.isFramebufferEnabled())
    {
        GlStateManager.bindTexture(framebufferIn.framebufferTexture);
        GlStateManager.glGetTexImage(3553, 0, 32993, 33639, pixelBuffer);
    }
    else
    {
        GlStateManager.glReadPixels(0, 0, width, height, 32993, 33639, pixelBuffer);
    }

    pixelBuffer.get(pixelValues);
    TextureUtil.processPixelValues(pixelValues, width, height);
    BufferedImage bufferedimage = new BufferedImage(width, height, 1);
    bufferedimage.setRGB(0, 0, width, height, pixelValues, 0, width);
    return bufferedimage;
}
项目:CustomWorldGen    文件:LoadingScreenRenderer.java   
public LoadingScreenRenderer(Minecraft mcIn)
{
    this.mc = mcIn;
    this.scaledResolution = new ScaledResolution(mcIn);
    this.framebuffer = new Framebuffer(mcIn.displayWidth, mcIn.displayHeight, false);
    this.framebuffer.setFramebufferFilter(9728);
}
项目:CustomWorldGen    文件:ScreenShotHelper.java   
/**
 * Saves a screenshot in the game directory with a time-stamped filename.
 * Returns an ITextComponent indicating the success/failure of the saving.
 */
public static ITextComponent saveScreenshot(File gameDirectory, int width, int height, Framebuffer buffer)
{
    /**
     * Saves a screenshot in the game directory with the given file name (or null to generate a time-stamped name).
     * Returns an ITextComponent indicating the success/failure of the saving.
     */
    return saveScreenshot(gameDirectory, (String)null, width, height, buffer);
}
项目:Aether-Legacy    文件:AetherLoadingScreen.java   
public AetherLoadingScreen(Minecraft mcIn)
   {
    super(mcIn);

       this.mc = mcIn;

       this.framebuffer = new Framebuffer(mcIn.displayWidth, mcIn.displayHeight, false);
       this.framebuffer.setFramebufferFilter(9728);
}
项目:DynamicSurroundings    文件:FrameBufferShader.java   
public void setSize(final int width, final int height) {
    if (this.blit != null && (this.blit.framebufferWidth != width || this.blit.framebufferHeight != height)) {
        this.release();
    }

    if (this.blit == null) {
        this.blit = new Framebuffer(width, height, false);
        this.blit.setFramebufferColor(0F, 0F, 0F, 0F);
    }
}
项目:BIGB    文件:GuiItemIconDumper.java   
private BufferedImage screenshot() {
    Framebuffer fb = Minecraft.getMinecraft().getFramebuffer();
    Dimension mcSize = GuiDraw.displayRes();
    Dimension texSize = mcSize;

    if (OpenGlHelper.isFramebufferEnabled())
        texSize = new Dimension(fb.framebufferTextureWidth, fb.framebufferTextureHeight);

    int k = texSize.width * texSize.height;
    if (pixelBuffer == null || pixelBuffer.capacity() < k) {
        pixelBuffer = BufferUtils.createIntBuffer(k);
        pixelValues = new int[k];
    }

    GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1);
    GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
    pixelBuffer.clear();

    if (OpenGlHelper.isFramebufferEnabled()) {
        GlStateManager.bindTexture(fb.framebufferTexture);
        GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, pixelBuffer);
    } else {
        GL11.glReadPixels(0, 0, texSize.width, texSize.height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, pixelBuffer);
    }

    pixelBuffer.get(pixelValues);
    TextureUtil.processPixelValues(pixelValues, texSize.width, texSize.height);

    BufferedImage img = new BufferedImage(mcSize.width, mcSize.height, BufferedImage.TYPE_INT_ARGB);
    if (OpenGlHelper.isFramebufferEnabled()) {
        int yOff = texSize.height - mcSize.height;
        for (int y = 0; y < mcSize.height; ++y)
            for (int x = 0; x < mcSize.width; ++x)
                img.setRGB(x, y, pixelValues[(y + yOff) * texSize.width + x]);
    } else {
        img.setRGB(0, 0, texSize.width, height, pixelValues, 0, texSize.width);
    }

    return img;
}
项目:malmo    文件:DepthProducerImplementation.java   
@Override
public void prepare(MissionInit missionInit)
{
    this.fbo = new Framebuffer(this.videoParams.getWidth(), this.videoParams.getHeight(), true);
    // Set the requested camera position
    // Minecraft.getMinecraft().gameSettings.thirdPersonView = this.videoParams.getViewpoint();
}
项目:malmo    文件:ColourMapProducerImplementation.java   
@Override
public void prepare(MissionInit missionInit)
{
    this.fbo = new Framebuffer(this.getWidth(), this.getHeight(), true);
    TextureHelper.setIsProducingColourMap(true);
    TextureHelper.setMobColours(this.mobColours);
    TextureHelper.setMiscTextureColours(this.miscColours);
    TextureHelper.setSkyRenderer(new TextureHelper.BlankSkyRenderer(this.cmParams.getSkyColour()));
}
项目:malmo    文件:VideoProducerImplementation.java   
@Override
public void prepare(MissionInit missionInit)
{
    this.fbo = new Framebuffer(this.videoParams.getWidth(), this.videoParams.getHeight(), true);
    // Create a buffer for retrieving the depth map, if requested:
    if (this.videoParams.isWantDepth())
        this.depthBuffer = BufferUtils.createFloatBuffer(this.videoParams.getWidth() * this.videoParams.getHeight());
    // Set the requested camera position
    Minecraft.getMinecraft().gameSettings.thirdPersonView = this.videoParams.getViewpoint();
}
项目:renderTo    文件:RenderToGuiScreen.java   
private void saveEntityPic(String domain, String selected, double size) {
    String fileSuffix = globalSetting.saveGif ? ".gif" : ".png";
    File f = new File(saveDir, domain + "/entity/" + size + "x/" + selected.replaceAll("[\\\\\\/\\?\\:\\>\\<\\|\\*\\\"]{1}", "_") + fileSuffix);
    f.getParentFile().mkdirs();

    Entity entity = cachedEntities.get(domain.equals("minecraft") ? selected : (domain + "." + selected));
    if(entity == null) {
        return;
    }
    double sizex = 0.5 * size * entity.width * 1.414;
    double sizey = 0.5 * size * (entity.height * 0.866 + entity.width * 0.707);
    int outx = (int)(64 * sizex + 0.5);
    int outy = (int)(64 * sizey + 0.5);
    int result;
    do {
        Framebuffer mb = mc.getFramebuffer();
        if(globalSetting.saveGif) {
            result = saveEntityGif(size, f, entity, outx, outy, mb);
        } else {
            Framebuffer fb = createAndRenderEntityToFrameBuffer(size, entity, outx, outy, mb);
            result = FrameBufferUtils.instance.saveFrameBufferToFile(fb, f, outx, outy, true);
            fb.deleteFramebuffer();
        }

        if ((result & 1) != 0) {
            outx *= 2;
        }
        if ((result & 2) != 0) {
            outy *= 2;
        }
        mb.bindFramebuffer(true);
    } while(result != 0);
}
项目:renderTo    文件:RenderToGuiScreen.java   
private Framebuffer createAndRenderEntityToFrameBuffer(double size, Entity entity, int outx, int outy, Framebuffer mb) {
    int radius = Math.min(mb.framebufferWidth * outy, mb.framebufferHeight * outx);
    Framebuffer fb = new Framebuffer(mb.framebufferWidth * outx * outy / radius, mb.framebufferHeight * outx * outy / radius, true);
    fb.framebufferClear();
    fb.bindFramebuffer(false);

    int r = radius * this.width / mb.framebufferWidth;
    float scale = (float)(size * 64) * r / outx / outy;
    AxisAlignedBB bb = entity.getEntityBoundingBox();

    setupRenderEntityGlState(r / outy, r / outx, entity, scale);
    drawEntityCore(entity, bb);
    releaseRenderEntityGlState();
    return fb;
}
项目:Resilience-Client-Source    文件:LoadingScreenRenderer.java   
public LoadingScreenRenderer(Minecraft par1Minecraft)
{
    this.mc = par1Minecraft;
    this.field_146587_f = new ScaledResolution(par1Minecraft.gameSettings, par1Minecraft.displayWidth, par1Minecraft.displayHeight);
    this.field_146588_g = new Framebuffer(this.field_146587_f.getScaledWidth(), this.field_146587_f.getScaledHeight(), false);
    this.field_146588_g.setFramebufferFilter(9728);
}
项目:Real-Life-Mod-1.8    文件:FrameBuffer.java   
/**
 * stitch the given framebuffer into the texture sheet at the appropriate location.
 * converts the framebuffer from colour to greyscale
 * @param frameBuffer
 * @param textureIndex
 * @param whichFace
 */
private void stitchGreyFrameBufferIntoTextureSheet(Framebuffer frameBuffer, int textureIndex, EnumFacing whichFace)
{
  frameBuffer.bindFramebufferTexture();
  IntBuffer pixelBuffer = BufferUtils.createIntBuffer(U_TEXELS_PER_FACE * V_TEXELS_PER_FACE);
  GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, pixelBuffer);

  int[] frameData = new int[pixelBuffer.remaining()];
  pixelBuffer.get(frameData);

  int[] textureSheet = blockTextures.getTextureData();
  int textureWidthTexels = NUMBER_OF_FACES_PER_BLOCK * U_TEXELS_PER_FACE;
  int textureSheetBase = textureIndex * V_TEXELS_PER_FACE * textureWidthTexels
                        + whichFace.getIndex() * U_TEXELS_PER_FACE;

  for (int v = 0; v < V_TEXELS_PER_FACE; ++v) {
    for (int u = 0; u < U_TEXELS_PER_FACE; ++u) {
      int sourceColour = frameData[u + v * U_TEXELS_PER_FACE];
      int red = sourceColour & 0xff;
      int green = (sourceColour & 0xff00) >> 8;
      int blue = (sourceColour & 0xff0000) >> 16;
      int average = (red + blue + green) / 3;
      int grey = average | (average << 8) | (average << 16) | 0xff000000;
      textureSheet[textureSheetBase + u + v * textureWidthTexels] = grey;
    }
  }
}
项目:multishot    文件:ScreenshotSaver.java   
public ScreenshotSaver(String basePath, int interval, int imgfmt, int width, int height, boolean useFreeCamera)
{
    this.mc = Minecraft.getMinecraft();
    this.width = width;
    this.height = height;
    this.shotInterval = interval;
    this.imgFormat = imgfmt;
    this.useFreeCamera = useFreeCamera;
    this.dateString = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss").format(new Date(System.currentTimeMillis()));

    if (useFreeCamera)
    {
        this.frameBuffer = new Framebuffer(width, height, true);
        this.frameBuffer.setFramebufferColor(0.0F, 0.0F, 0.0F, 0.0F);
    }
    else
    {
        this.frameBuffer = this.mc.getFramebuffer();
    }

    if (this.imgFormat == 0)
    {
        this.filenameExtension = "png";
    }
    else
    {
        this.filenameExtension = "jpg";
    }

    // We save the screenshots in a separate sub directory each time, named after the start timestamp
    this.savePath = new File(basePath, this.dateString);

    if (this.savePath.isDirectory() == false)
    {
        if (this.savePath.mkdirs() == false)
        {
            Multishot.logger.warn("Error: Could not create directory '{}'", this.savePath.getPath());
        }
    }
}
项目:multishot    文件:ScreenshotSaver.java   
private void captureFrame(int width, int height, Framebuffer framebufferIn)
{
    if (OpenGlHelper.isFramebufferEnabled())
    {
        width = framebufferIn.framebufferTextureWidth;
        height = framebufferIn.framebufferTextureHeight;
    }

    int i = width * height;

    if (pixelBuffer == null || pixelBuffer.capacity() < i)
    {
        pixelBuffer = BufferUtils.createIntBuffer(i);
        pixelValues = new int[i];
    }

    GlStateManager.glPixelStorei(3333, 1);
    GlStateManager.glPixelStorei(3317, 1);
    pixelBuffer.clear();

    if (OpenGlHelper.isFramebufferEnabled())
    {
        GlStateManager.bindTexture(framebufferIn.framebufferTexture);
        GlStateManager.glGetTexImage(3553, 0, 32993, 33639, pixelBuffer);
    }
    else
    {
        GlStateManager.glReadPixels(0, 0, width, height, 32993, 33639, pixelBuffer);
    }

    this.hasData = true;
    this.notify();
}
项目:multishot    文件:ScreenshotSaver.java   
private BufferedImage createScreenshot(int width, int height, Framebuffer frameBuffer)
{
    this.hasData = false;

    pixelBuffer.get(pixelValues);
    TextureUtil.processPixelValues(pixelValues, width, height);
    BufferedImage bufferedImage;

    if (OpenGlHelper.isFramebufferEnabled())
    {
        bufferedImage = new BufferedImage(frameBuffer.framebufferWidth, frameBuffer.framebufferHeight, 1);
        int j = frameBuffer.framebufferTextureHeight - frameBuffer.framebufferHeight;

        for (int k = j; k < frameBuffer.framebufferTextureHeight; ++k)
        {
            for (int l = 0; l < frameBuffer.framebufferWidth; ++l)
            {
                bufferedImage.setRGB(l, k - j, pixelValues[k * frameBuffer.framebufferTextureWidth + l]);
            }
        }
    }
    else
    {
        bufferedImage = new BufferedImage(width, height, 1);
        bufferedImage.setRGB(0, 0, width, height, pixelValues, 0, width);
    }

    return bufferedImage;
}
项目:Kitchen-Sink    文件:Rendering.java   
public static void drawFullScreenLogo(final ResourceLocation logo, final int bg) {
    Minecraft mc = Minecraft.getMinecraft();
    ScaledResolution scaledresolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
       int i = scaledresolution.getScaleFactor();
       Framebuffer framebuffer = new Framebuffer(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i, true);
       framebuffer.bindFramebuffer(false);
       GlStateManager.matrixMode(5889);
       GlStateManager.loadIdentity();
       GlStateManager.ortho(0.0D, (double)scaledresolution.getScaledWidth(), (double)scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
       GlStateManager.matrixMode(5888);
       GlStateManager.loadIdentity();
       GlStateManager.translate(0.0F, 0.0F, -2000.0F);
       GlStateManager.disableLighting();
       GlStateManager.disableFog();
       GlStateManager.disableDepth();
       GlStateManager.enableTexture2D();
       mc.getTextureManager().bindTexture(logo);
       Tessellator tessellator = Tessellator.getInstance();
       WorldRenderer worldrenderer = tessellator.getWorldRenderer();
       worldrenderer.startDrawingQuads();
       worldrenderer.setColorOpaque_I(16777215);
       worldrenderer.addVertexWithUV(0.0D, (double)mc.displayHeight, 0.0D, 0.0D, 0.0D);
       worldrenderer.addVertexWithUV((double)mc.displayWidth, (double)mc.displayHeight, 0.0D, 0.0D, 0.0D);
       worldrenderer.addVertexWithUV((double)mc.displayWidth, 0.0D, 0.0D, 0.0D, 0.0D);
       worldrenderer.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
       tessellator.draw();
       GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
       worldrenderer.setColorOpaque_I(bg);
       short short1 = 256;
       short short2 = 256;
       mc.scaledTessellator((scaledresolution.getScaledWidth() - short1) / 2, (scaledresolution.getScaledHeight() - short2) / 2, 0, 0, short1, short2);
       GlStateManager.disableLighting();
       GlStateManager.disableFog();
       framebuffer.unbindFramebuffer();
       framebuffer.framebufferRender(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i);
       GlStateManager.enableAlpha();
       GlStateManager.alphaFunc(516, 0.1F);
       mc.updateDisplay();
}
项目:ExpandedRailsMod    文件:LoadingScreenRenderer.java   
public LoadingScreenRenderer(Minecraft mcIn)
{
    this.mc = mcIn;
    this.scaledResolution = new ScaledResolution(mcIn);
    this.framebuffer = new Framebuffer(mcIn.displayWidth, mcIn.displayHeight, false);
    this.framebuffer.setFramebufferFilter(9728);
}
项目:Cauldron    文件:LoadingScreenRenderer.java   
public LoadingScreenRenderer(Minecraft p_i1017_1_)
{
    this.mc = p_i1017_1_;
    this.field_146587_f = new ScaledResolution(p_i1017_1_, p_i1017_1_.displayWidth, p_i1017_1_.displayHeight);
    this.field_146588_g = new Framebuffer(p_i1017_1_.displayWidth, p_i1017_1_.displayHeight, false);
    this.field_146588_g.setFramebufferFilter(9728);
}
项目:Cauldron    文件:LoadingScreenRenderer.java   
public LoadingScreenRenderer(Minecraft p_i1017_1_)
{
    this.mc = p_i1017_1_;
    this.field_146587_f = new ScaledResolution(p_i1017_1_, p_i1017_1_.displayWidth, p_i1017_1_.displayHeight);
    this.field_146588_g = new Framebuffer(p_i1017_1_.displayWidth, p_i1017_1_.displayHeight, false);
    this.field_146588_g.setFramebufferFilter(9728);
}
项目:minecraft-vr-base    文件:VRRenderer.java   
public void vrGUIRender( )
{
    this.mc.mcProfiler.startSection("vr-gui-render");
    Framebuffer fbGUI = this.mc.getFramebuffer();

    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glLoadIdentity();
    GL11.glTranslatef(0.0F, 0.0F, -10.0F);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA );
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glEnable(GL11.GL_COLOR_MATERIAL);
    fbGUI.bindFramebufferTexture();
    double scale = 3;
    double aspectRatio = 2*this.mc.displayWidth/(double)this.mc.displayHeight;
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    tessellator.setColorOpaque_I(-1);
    tessellator.addVertexWithUV( scale*aspectRatio,  scale, 0.0D, 1.0D, 1.0D);
    tessellator.addVertexWithUV(-scale*aspectRatio,  scale, 0.0D, 0.0D, 1.0D);
    tessellator.addVertexWithUV(-scale*aspectRatio, -scale, 0.0D, 0.0D, 0.0D);
    tessellator.addVertexWithUV( scale*aspectRatio, -scale, 0.0D, 1.0D, 0.0D);
    tessellator.draw();
    fbGUI.unbindFramebufferTexture();
    GL11.glDepthMask(true);
    this.mc.mcProfiler.endSection();
}
项目:OpenBlocks    文件:SkyBlockRenderer.java   
public void renderSkyTexture() {
    if (!isActive) return;

    final Minecraft mc = Minecraft.getMinecraft();
    final Framebuffer mcFb = mc.getFramebuffer();

    GlStateManager.disableFog();
    RenderUtils.disableLightmap();

    GlStateManager.matrixMode(GL11.GL_PROJECTION);
    GlStateManager.pushMatrix();
    GlStateManager.matrixMode(GL11.GL_MODELVIEW);
    GlStateManager.pushMatrix();

    GlStateManager.depthMask(false);
    skyFb.framebufferRender(mc.displayWidth, mc.displayHeight);
    GlStateManager.enableDepth();
    GlStateManager.viewport(0, 0, mcFb.framebufferWidth, mcFb.framebufferHeight);

    GlStateManager.popMatrix();
    GlStateManager.matrixMode(GL11.GL_PROJECTION);
    GlStateManager.popMatrix();
    GlStateManager.matrixMode(GL11.GL_MODELVIEW);

    RenderUtils.enableLightmap();
    GlStateManager.enableFog();
}
项目:OpenModsLib    文件:FramebufferBlitter.java   
@Override
public void blitFramebufferOp(Framebuffer in, Framebuffer out) {
    GL30.glBlitFramebuffer(
            0, 0, in.framebufferWidth, in.framebufferHeight,
            0, 0, out.framebufferWidth, out.framebufferHeight,
            GL11.GL_COLOR_BUFFER_BIT,
            GL11.GL_NEAREST);

}
项目:OpenModsLib    文件:FramebufferBlitter.java   
@Override
public void blitFramebufferOp(Framebuffer in, Framebuffer out) {
    EXTFramebufferBlit.glBlitFramebufferEXT(
            0, 0, in.framebufferWidth, in.framebufferHeight,
            0, 0, out.framebufferWidth, out.framebufferHeight,
            GL11.GL_COLOR_BUFFER_BIT,
            GL11.GL_NEAREST);
}
项目:OpenModsLib    文件:FramebufferBlitter.java   
public void blitFramebuffer(Framebuffer in, Framebuffer out) {
    OpenGlHelper.glBindFramebuffer(getReadConst(), in.framebufferObject);
    OpenGlHelper.glBindFramebuffer(getDrawConst(), out.framebufferObject);

    blitFramebufferOp(in, out);

    OpenGlHelper.glBindFramebuffer(getReadConst(), 0);
    OpenGlHelper.glBindFramebuffer(getDrawConst(), 0);
}
项目:iChunUtil    文件:RendererHelper.java   
public static Framebuffer createFrameBuffer(boolean useDepth, boolean useStencil)
{
    Framebuffer render = new Framebuffer(Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight, useDepth);
    if(useStencil && canUseStencils())
    {
        render.enableStencil();
    }
    frameBuffers.add(render);
    return render;
}