Search in sources :

Example 6 with Framebuffer

use of net.minecraft.client.shader.Framebuffer in project DynamicSurroundings by OreCruncher.

the class FrameBufferShader method render.

public void render() throws ShaderException {
    if (this.blit == null)
        throw new RuntimeException("Framebuffer not initialized");
    this.blit.framebufferClear();
    // Save the MC frame buffer
    final Framebuffer mcFrameBuffer = Minecraft.getMinecraft().getFramebuffer();
    this.blit.bindFramebuffer(true);
    final float renderHeight = this.blit.framebufferHeight;
    final float renderWidth = this.blit.framebufferWidth;
    // Backup attributes
    GL11.glPushAttrib(GL11.GL_MATRIX_MODE | GL11.GL_VIEWPORT_BIT | GL11.GL_TRANSFORM_BIT);
    final int prevShaderProgram = GL11.glGetInteger(GL20.GL_CURRENT_PROGRAM);
    GL11.glGetFloat(GL11.GL_COLOR_CLEAR_VALUE, CLEAR_COLOR_BUFFER);
    // Backup matrices
    GlStateManager.pushMatrix();
    GlStateManager.matrixMode(GL11.GL_PROJECTION);
    GlStateManager.pushMatrix();
    GlStateManager.matrixMode(GL11.GL_MODELVIEW);
    GlStateManager.pushMatrix();
    // Set up 2D matrices
    GlStateManager.matrixMode(GL11.GL_PROJECTION);
    GlStateManager.loadIdentity();
    GlStateManager.ortho(0.0D, renderWidth, renderHeight, 0.0D, 1000.0D, 3000.0D);
    GlStateManager.matrixMode(GL11.GL_MODELVIEW);
    GlStateManager.loadIdentity();
    GlStateManager.translate(0.0F, 0.0F, -2000.0F);
    // Render the effect using the shader
    this.shader.use(this.callback);
    GlStateManager.enableTexture2D();
    GlStateManager.glBegin(GL11.GL_TRIANGLES);
    GlStateManager.glTexCoord2f(0, 0);
    GlStateManager.glVertex3f(0, 0, 0);
    GlStateManager.glTexCoord2f(0, 1);
    GlStateManager.glVertex3f(0, renderHeight, 0);
    GlStateManager.glTexCoord2f(1, 1);
    GlStateManager.glVertex3f(renderWidth, renderHeight, 0);
    GlStateManager.glTexCoord2f(1, 1);
    GlStateManager.glVertex3f(renderWidth, renderHeight, 0);
    GlStateManager.glTexCoord2f(1, 0);
    GlStateManager.glVertex3f(renderWidth, 0, 0);
    GlStateManager.glTexCoord2f(0, 0);
    GlStateManager.glVertex3f(0, 0, 0);
    GlStateManager.glEnd();
    this.shader.unUse();
    // Bind previous shader
    OpenGlHelper.glUseProgram(prevShaderProgram);
    // Restore matrices
    GlStateManager.matrixMode(GL11.GL_MODELVIEW);
    GlStateManager.popMatrix();
    GlStateManager.matrixMode(GL11.GL_PROJECTION);
    GlStateManager.popMatrix();
    // Restore attributes
    GlStateManager.popAttrib();
    GlStateManager.clearColor(CLEAR_COLOR_BUFFER.get(0), CLEAR_COLOR_BUFFER.get(1), CLEAR_COLOR_BUFFER.get(2), CLEAR_COLOR_BUFFER.get(3));
    // Restore matrices
    GlStateManager.popMatrix();
    // Bind back the MC framebuffer
    mcFrameBuffer.bindFramebuffer(true);
}
Also used : Framebuffer(net.minecraft.client.shader.Framebuffer)

Example 7 with Framebuffer

use of net.minecraft.client.shader.Framebuffer in project DynamicSurroundings by OreCruncher.

the class GeneratedTexture method updateTexture.

public void updateTexture() {
    // Save the MC frame buffer and bind ours
    final Framebuffer mcFrameBuffer = Minecraft.getMinecraft().getFramebuffer();
    final Framebuffer blit = new Framebuffer(this.width, this.height, useDepth());
    blit.framebufferClear();
    blit.bindFramebuffer(useDepth());
    final OpenGlState glState = OpenGlState.push();
    // Backup attributes
    GL11.glPushAttrib(GL11.GL_MATRIX_MODE | GL11.GL_VIEWPORT_BIT | GL11.GL_TRANSFORM_BIT);
    // Backup matrices
    GlStateManager.pushMatrix();
    GlStateManager.matrixMode(GL11.GL_PROJECTION);
    GlStateManager.pushMatrix();
    GlStateManager.matrixMode(GL11.GL_MODELVIEW);
    GlStateManager.pushMatrix();
    // Set up 2D matrices
    GlStateManager.matrixMode(GL11.GL_PROJECTION);
    GlStateManager.loadIdentity();
    GlStateManager.ortho(0.0D, getWidth(), getHeight(), 0.0D, 1000.0D, 3000.0D);
    GlStateManager.matrixMode(GL11.GL_MODELVIEW);
    GlStateManager.loadIdentity();
    GlStateManager.translate(0.0F, 0.0F, -2000.0F);
    GlStateManager.enableTexture2D();
    try {
        // Do the render supplied by a derived class
        render();
    } catch (final Exception ex) {
        ex.printStackTrace();
    }
    // Restore matrices
    GlStateManager.matrixMode(GL11.GL_MODELVIEW);
    GlStateManager.popMatrix();
    GlStateManager.matrixMode(GL11.GL_PROJECTION);
    GlStateManager.popMatrix();
    // Restore attributes
    GlStateManager.popAttrib();
    GlStateManager.popMatrix();
    OpenGlState.pop(glState);
    try {
        blit.bindFramebufferTexture();
        final IntBuffer pixelBuffer = BufferUtils.createIntBuffer(getSize());
        GlStateManager.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, pixelBuffer);
        pixelBuffer.get(this.texture.getTextureData(), 0, pixelBuffer.remaining());
        this.texture.updateDynamicTexture();
    } catch (final Exception ex) {
        ex.printStackTrace();
    } finally {
        // Restore our state
        blit.deleteFramebuffer();
        if (mcFrameBuffer != null)
            mcFrameBuffer.bindFramebuffer(true);
    }
}
Also used : Framebuffer(net.minecraft.client.shader.Framebuffer) IntBuffer(java.nio.IntBuffer)

Example 8 with Framebuffer

use of net.minecraft.client.shader.Framebuffer in project GregTech by GregTechCE.

the class IntCircuitCategory method slice.

private void slice(Minecraft minecraft, int xPosition, int yPosition, @Nullable ItemStack ingredient) {
    Framebuffer fb = minecraft.getFramebuffer();
    if (!fb.isStencilEnabled()) {
        fb.enableStencil();
    }
    final int mask = 0xFF;
    final int val = 1;
    GL11.glEnable(GL11.GL_STENCIL_TEST);
    GlStateManager.clear(GL11.GL_STENCIL_BUFFER_BIT);
    GL11.glStencilOp(GL11.GL_KEEP, GL11.GL_KEEP, GL11.GL_REPLACE);
    GL11.glStencilFunc(GL11.GL_ALWAYS, val, mask);
    GL11.glStencilMask(mask);
    GlStateManager.color(1, 1, 1, 1);
    GlStateManager.colorMask(false, false, false, false);
    GlStateManager.depthMask(false);
    GlStateManager.disableTexture2D();
    Tessellator tes = Tessellator.getInstance();
    BufferBuilder buf = tes.getBuffer();
    buf.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION);
    buf.pos(xPosition + ITEM_WIDTH, yPosition, 0).endVertex();
    buf.pos(xPosition, yPosition + ITEM_WIDTH, 0).endVertex();
    buf.pos(xPosition + ITEM_WIDTH, yPosition + ITEM_WIDTH, 0).endVertex();
    tes.draw();
    GlStateManager.enableTexture2D();
    GL11.glStencilOp(GL11.GL_KEEP, GL11.GL_KEEP, GL11.GL_KEEP);
    GlStateManager.colorMask(true, true, true, true);
    GlStateManager.depthMask(true);
    GL11.glStencilFunc(GL11.GL_EQUAL, val, mask);
}
Also used : Framebuffer(net.minecraft.client.shader.Framebuffer) Tessellator(net.minecraft.client.renderer.Tessellator) BufferBuilder(net.minecraft.client.renderer.BufferBuilder)

Example 9 with Framebuffer

use of net.minecraft.client.shader.Framebuffer in project Hyperium by HyperiumClient.

the class SplashProgress method drawSplash.

/**
 * Render the splash screen background
 *
 * @param tm {@link TextureManager}
 */
public static void drawSplash(TextureManager tm) {
    // Initialize the texture manager if null
    if (ctm == null)
        ctm = tm;
    // Get the users screen width and height to apply
    ScaledResolution scaledresolution = new ScaledResolution(Minecraft.getMinecraft());
    // Create the scale factor
    int scaleFactor = scaledresolution.getScaleFactor();
    // Bind the width and height to the framebuffer
    Framebuffer framebuffer = new Framebuffer(scaledresolution.getScaledWidth() * scaleFactor, scaledresolution.getScaledHeight() * scaleFactor, true);
    framebuffer.bindFramebuffer(false);
    // Create the projected image to be rendered
    GlStateManager.matrixMode(GL11.GL_PROJECTION);
    GlStateManager.loadIdentity();
    GlStateManager.ortho(0.0D, scaledresolution.getScaledWidth(), scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
    GlStateManager.matrixMode(GL11.GL_MODELVIEW);
    GlStateManager.loadIdentity();
    GlStateManager.translate(0.0F, 0.0F, -2000.0F);
    GlStateManager.disableLighting();
    GlStateManager.disableFog();
    GlStateManager.disableDepth();
    GlStateManager.enableTexture2D();
    // Initialize the splash texture
    if (splash == null)
        splash = new ResourceLocation("textures/hyperium-splash.png");
    // Bind the texture
    tm.bindTexture(splash);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    // Draw the image
    Gui.drawScaledCustomSizeModalRect(0, 0, 0, 0, 1920, 1080, scaledresolution.getScaledWidth(), scaledresolution.getScaledHeight(), 1920, 1080);
    // Draw the progress bar
    drawProgress();
    // Unbind the width and height as it's no longer needed
    framebuffer.unbindFramebuffer();
    // Render the previously used frame buffer
    framebuffer.framebufferRender(scaledresolution.getScaledWidth() * scaleFactor, scaledresolution.getScaledHeight() * scaleFactor);
    // Update the texture to enable alpha drawing
    GlStateManager.enableAlpha();
    GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F);
    // Update the users screen
    Minecraft.getMinecraft().updateDisplay();
}
Also used : Framebuffer(net.minecraft.client.shader.Framebuffer) ScaledResolution(net.minecraft.client.gui.ScaledResolution) ResourceLocation(net.minecraft.util.ResourceLocation)

Example 10 with Framebuffer

use of net.minecraft.client.shader.Framebuffer in project ImmersiveEngineering by BluSunrize.

the class ClientProxy method preInit.

@Override
public void preInit() {
    Framebuffer fb = ClientUtils.mc().getFramebuffer();
    if (OpenGlHelper.framebufferSupported && IEConfig.stencilBufferEnabled && !fb.isStencilEnabled()) {
        // Enabling FBO stencils
        stencilBufferEnabled = fb.enableStencil();
    }
    ModelLoaderRegistry.registerLoader(IEOBJLoader.instance);
    OBJLoader.INSTANCE.addDomain("immersiveengineering");
    IEOBJLoader.instance.addDomain("immersiveengineering");
    MinecraftForge.EVENT_BUS.register(this);
    MinecraftForge.EVENT_BUS.register(ImmersiveModelRegistry.instance);
    ImmersiveModelRegistry.instance.registerCustomItemModel(new ItemStack(IEContent.itemBullet, 1, 2), new ImmersiveModelRegistry.ItemModelReplacement() {

        @Override
        public IBakedModel createBakedModel(IBakedModel existingModel) {
            return new ModelItemDynamicOverride(existingModel, null);
        }
    });
    ImmersiveModelRegistry.instance.registerCustomItemModel(new ItemStack(IEContent.itemShader), new ImmersiveModelRegistry.ItemModelReplacement() {

        @Override
        public IBakedModel createBakedModel(IBakedModel existingModel) {
            return new ModelItemDynamicOverride(existingModel, null);
        }
    });
    ImmersiveModelRegistry.instance.registerCustomItemModel(new ItemStack(IEContent.itemTool, 1, 2), new ImmersiveModelRegistry.ItemModelReplacement_OBJ("immersiveengineering:models/item/tool/voltmeter.obj", false).setTransformations(TransformType.FIRST_PERSON_RIGHT_HAND, new Matrix4().translate(-.25, .375, .3125).rotate(-Math.PI * .5, 0, 1, 0)).setTransformations(TransformType.FIRST_PERSON_LEFT_HAND, new Matrix4().translate(-.25, .375, -.625).rotate(-Math.PI * .5, 0, 1, 0)).setTransformations(TransformType.THIRD_PERSON_RIGHT_HAND, new Matrix4().translate(-0.25, .125, .25).scale(.625f, .625f, .625f).rotate(-Math.PI * .375, 0, 1, 0)).setTransformations(TransformType.THIRD_PERSON_LEFT_HAND, new Matrix4().translate(-0.5, .125, -.3125).scale(.625f, .625f, .625f).rotate(-Math.PI * .375, 0, 1, 0)).setTransformations(TransformType.FIXED, new Matrix4().translate(-.5, .5, -.5).scale(1, 1, 1).rotate(Math.PI, 0, 1, 0)).setTransformations(TransformType.GUI, new Matrix4().translate(0, .5, 0).scale(1.125, 1.125, 1.125).rotate(-Math.PI * .25, 0, 1, 0)).setTransformations(TransformType.GROUND, new Matrix4().translate(.25, .25, .25).scale(.5, .5, .5)));
    ImmersiveModelRegistry.instance.registerCustomItemModel(new ItemStack(IEContent.itemToolbox), new ImmersiveModelRegistry.ItemModelReplacement_OBJ("immersiveengineering:models/item/toolbox.obj", false).setTransformations(TransformType.FIRST_PERSON_RIGHT_HAND, new Matrix4().scale(.375, .375, .375).translate(-.75, 1.25, .3125).rotate(-Math.PI * .75, 0, 1, 0)).setTransformations(TransformType.FIRST_PERSON_LEFT_HAND, new Matrix4().scale(.375, .375, .375).translate(-.125, 1.25, .9375).rotate(Math.PI * .25, 0, 1, 0)).setTransformations(TransformType.THIRD_PERSON_RIGHT_HAND, new Matrix4().translate(-.25, .1875, .3125).scale(.625, .625, .625).rotate(Math.PI, 0, 1, 0).rotate(-Math.PI * .5, 1, 0, 0)).setTransformations(TransformType.THIRD_PERSON_LEFT_HAND, new Matrix4().translate(-.25, -.4375, .3125).scale(.625, .625, .625).rotate(Math.PI * .5, 1, 0, 0)).setTransformations(TransformType.FIXED, new Matrix4().translate(.5, .875, -.5).scale(1, 1, 1).rotate(Math.PI * .5, 0, 1, 0)).setTransformations(TransformType.GUI, new Matrix4().translate(-.625, .75, 0).scale(.875, .875, .875).rotate(-Math.PI * .6875, 0, 1, 0)).setTransformations(TransformType.GROUND, new Matrix4().translate(.25, .5, .25).scale(.5, .5, .5)));
    ImmersiveModelRegistry.instance.registerCustomItemModel(new ItemStack(IEContent.itemRevolver, 1, 0), new ImmersiveModelRegistry.ItemModelReplacement_OBJ("immersiveengineering:models/item/revolver.obj", true).setTransformations(TransformType.FIRST_PERSON_RIGHT_HAND, new Matrix4().rotate(Math.toRadians(-90), 0, 1, 0).scale(.1875, .25, .25).translate(.25, .25, .5)).setTransformations(TransformType.FIRST_PERSON_LEFT_HAND, new Matrix4().rotate(Math.toRadians(90), 0, 1, 0).scale(.1875, .25, .25).translate(-.3, .25, .5)).setTransformations(TransformType.THIRD_PERSON_RIGHT_HAND, new Matrix4().translate(-.125, .0625, -.03125).scale(.125, .125, .125).rotate(Math.toRadians(-90), 0, 1, 0).rotate(Math.toRadians(-10), 0, 0, 1)).setTransformations(TransformType.THIRD_PERSON_LEFT_HAND, new Matrix4().translate(.0, .0625, -.03125).scale(.125, .125, .125).rotate(Math.toRadians(90), 0, 1, 0).rotate(Math.toRadians(10), 0, 0, 1)).setTransformations(TransformType.GUI, new Matrix4().translate(.1875, -.0781225, -.15625).scale(.2, .2, .2).rotate(Math.toRadians(-40), 0, 1, 0).rotate(Math.toRadians(-35), 0, 0, 1)).setTransformations(TransformType.FIXED, new Matrix4().translate(-.375, -.25, -.0625).scale(.1875, .1875, .1875).rotate(Math.PI, 0, 1, 0).rotate(Math.toRadians(-40), 0, 0, 1)).setTransformations(TransformType.GROUND, new Matrix4().translate(.125, 0, .0625).scale(.125, .125, .125)));
    IEContent.itemRevolver.setTileEntityItemStackRenderer(ItemRendererIEOBJ.INSTANCE);
    ImmersiveModelRegistry.instance.registerCustomItemModel(new ItemStack(IEContent.itemDrill, 1, 0), new ImmersiveModelRegistry.ItemModelReplacement_OBJ("immersiveengineering:models/item/drill/drill_diesel.obj", true).setTransformations(TransformType.FIRST_PERSON_RIGHT_HAND, new Matrix4().scale(.375, .4375, .375).translate(-.25, 1, .5).rotate(Math.PI * .5, 0, 1, 0)).setTransformations(TransformType.FIRST_PERSON_LEFT_HAND, new Matrix4().scale(-.375, .4375, .375).translate(.25, 1, .5).rotate(-Math.PI * .5, 0, 1, 0)).setTransformations(TransformType.THIRD_PERSON_RIGHT_HAND, new Matrix4().translate(.0625, .9375, .25).scale(.75, .75, .75).rotate(Math.PI * .75, 0, 1, 0).rotate(Math.PI * .375, 0, 0, 1).rotate(-Math.PI * .25, 1, 0, 0)).setTransformations(TransformType.THIRD_PERSON_LEFT_HAND, new Matrix4().translate(.0625, .9375, .25).scale(-.75, .75, .75).rotate(-Math.PI * .75, 0, 1, 0).rotate(-Math.PI * .375, 0, 0, 1).rotate(-Math.PI * .25, 1, 0, 0)).setTransformations(TransformType.FIXED, new Matrix4().translate(.1875, .0625, .15625).scale(.4375, .4375, .4375).rotate(-Math.PI * .25, 0, 0, 1)).setTransformations(TransformType.GUI, new Matrix4().translate(-.5, .25, 0).scale(.75, .75, .75).rotate(-Math.PI * .6875, 0, 1, 0).rotate(-Math.PI * .125, 0, 0, 1)).setTransformations(TransformType.GROUND, new Matrix4().translate(.125, .25, .25).scale(.5, .5, .5)));
    IEContent.itemDrill.setTileEntityItemStackRenderer(ItemRendererIEOBJ.INSTANCE);
    ImmersiveModelRegistry.instance.registerCustomItemModel(new ItemStack(IEContent.itemFluorescentTube, 1, 0), new ImmersiveModelRegistry.ItemModelReplacement_OBJ("immersiveengineering:models/item/fluorescent_tube.obj", true).setTransformations(TransformType.FIRST_PERSON_RIGHT_HAND, new Matrix4().translate(.2, .1, 0).rotate(-Math.PI / 3, 1, 0, 0)).setTransformations(TransformType.FIRST_PERSON_LEFT_HAND, new Matrix4().translate(.2, .1, 0).rotate(-Math.PI / 3, 1, 0, 0)).setTransformations(TransformType.THIRD_PERSON_RIGHT_HAND, new Matrix4().translate(0, .5, .1)).setTransformations(TransformType.THIRD_PERSON_LEFT_HAND, new Matrix4().translate(0, .5, .1)).setTransformations(TransformType.FIXED, new Matrix4()).setTransformations(TransformType.GUI, new Matrix4().rotate(-Math.PI / 4, 0, 0, 1).rotate(Math.PI / 8, 0, 1, 0)).setTransformations(TransformType.GROUND, new Matrix4().scale(.5, .5, .5).translate(0, .5, 0)));
    IEContent.itemFluorescentTube.setTileEntityItemStackRenderer(ItemRendererIEOBJ.INSTANCE);
    ImmersiveModelRegistry.instance.registerCustomItemModel(new ItemStack(IEContent.itemChemthrower, 1, 0), new ImmersiveModelRegistry.ItemModelReplacement_OBJ("immersiveengineering:models/item/chemthrower.obj", true).setTransformations(TransformType.FIRST_PERSON_RIGHT_HAND, new Matrix4().scale(.375, .375, .375).translate(-.25, 1, .5).rotate(Math.PI * .5, 0, 1, 0)).setTransformations(TransformType.FIRST_PERSON_LEFT_HAND, new Matrix4().scale(-.375, .375, .375).translate(-.25, 1, .5).rotate(-Math.PI * .5, 0, 1, 0)).setTransformations(TransformType.THIRD_PERSON_RIGHT_HAND, new Matrix4().translate(0, .75, .1875).scale(.5, .5, .5).rotate(Math.PI * .75, 0, 1, 0).rotate(Math.PI * .375, 0, 0, 1).rotate(-Math.PI * .25, 1, 0, 0)).setTransformations(TransformType.THIRD_PERSON_LEFT_HAND, new Matrix4().translate(0, .75, .1875).scale(.5, -.5, .5).rotate(Math.PI * .75, 0, 1, 0).rotate(Math.PI * .625, 0, 0, 1).rotate(-Math.PI * .25, 1, 0, 0)).setTransformations(TransformType.FIXED, new Matrix4().translate(.125, .125, -.25).scale(.3125, .3125, .3125).rotate(Math.PI, 0, 1, 0).rotate(Math.PI * .25, 0, 0, 1)).setTransformations(TransformType.GUI, new Matrix4().translate(-.1875, .3125, 0).scale(.4375, .4375, .4375).rotate(-Math.PI * .6875, 0, 1, 0).rotate(-Math.PI * .125, 0, 0, 1)).setTransformations(TransformType.GROUND, new Matrix4().translate(0, .25, .125).scale(.25, .25, .25)));
    IEContent.itemChemthrower.setTileEntityItemStackRenderer(ItemRendererIEOBJ.INSTANCE);
    ImmersiveModelRegistry.instance.registerCustomItemModel(new ItemStack(IEContent.itemRailgun, 1, 0), // TODO add the fancy render back?
    new ImmersiveModelRegistry.ItemModelReplacement_OBJ("immersiveengineering:models/item/railgun.obj", true).setTransformations(TransformType.FIRST_PERSON_RIGHT_HAND, new Matrix4().scale(.125, .125, .125).translate(-.5, 1.5, .5).rotate(Math.PI * .46875, 0, 1, 0)).setTransformations(TransformType.FIRST_PERSON_LEFT_HAND, new Matrix4().scale(.125, .125, .125).translate(-1.75, 1.625, .875).rotate(-Math.PI * .46875, 0, 1, 0)).setTransformations(TransformType.THIRD_PERSON_RIGHT_HAND, new Matrix4().translate(.0625, .5, -.3125).scale(.1875, .1875, .1875).rotate(Math.PI * .53125, 0, 1, 0).rotate(Math.PI * .25, 0, 0, 1)).setTransformations(TransformType.THIRD_PERSON_LEFT_HAND, new Matrix4().translate(-.1875, .5, -.3125).scale(.1875, .1875, .1875).rotate(-Math.PI * .46875, 0, 1, 0).rotate(-Math.PI * .25, 0, 0, 1)).setTransformations(TransformType.FIXED, new Matrix4().translate(.1875, .0625, .0625).scale(.125, .125, .125).rotate(-Math.PI * .25, 0, 0, 1)).setTransformations(TransformType.GUI, new Matrix4().translate(-.1875, 0, 0).scale(.1875, .1875, .1875).rotate(-Math.PI * .6875, 0, 1, 0).rotate(-Math.PI * .1875, 0, 0, 1)).setTransformations(TransformType.GROUND, new Matrix4().translate(.125, .125, .0625).scale(.125, .125, .125)));
    IEContent.itemRailgun.setTileEntityItemStackRenderer(ItemRendererIEOBJ.INSTANCE);
    ImmersiveModelRegistry.instance.registerCustomItemModel(new ItemStack(IEContent.itemShield), new ImmersiveModelRegistry.ItemModelReplacement_OBJ("immersiveengineering:models/item/shield.obj", true).setTransformations(TransformType.FIRST_PERSON_RIGHT_HAND, new Matrix4().rotate(Math.toRadians(90), 0, 1, 0).rotate(.1, 1, 0, 0).translate(.5, .125, .5)).setTransformations(TransformType.FIRST_PERSON_LEFT_HAND, new Matrix4().rotate(Math.toRadians(-90), 0, 1, 0).rotate(-.1, 1, 0, 0).translate(-.5, .125, .5)).setTransformations(TransformType.THIRD_PERSON_RIGHT_HAND, new Matrix4().translate(.59375, .375, .75)).setTransformations(TransformType.THIRD_PERSON_LEFT_HAND, new Matrix4().rotate(3.14159, 0, 1, 0).translate(-.59375, .375, .25)).setTransformations(TransformType.FIXED, new Matrix4().rotate(1.57079, 0, 1, 0).scale(.75f, .75f, .75f).translate(.375, .5, .5)).setTransformations(TransformType.GUI, new Matrix4().translate(-.375, .375, 0).scale(.75, .625, .75).rotate(-2.35619, 0, 1, 0).rotate(0.13089, 0, 0, 1)).setTransformations(TransformType.GROUND, new Matrix4().translate(.125, .125, .125).scale(.25, .25, .25)));
    IEContent.itemShield.setTileEntityItemStackRenderer(ItemRendererIEOBJ.INSTANCE);
    RenderingRegistry.registerEntityRenderingHandler(EntityRevolvershot.class, new IRenderFactory<EntityRevolvershot>() {

        @Override
        public Render createRenderFor(RenderManager manager) {
            return new EntityRenderRevolvershot(manager);
        }
    });
    RenderingRegistry.registerEntityRenderingHandler(EntitySkylineHook.class, new IRenderFactory<EntitySkylineHook>() {

        @Override
        public Render createRenderFor(RenderManager manager) {
            return new EntityRenderNone(manager);
        }
    });
    RenderingRegistry.registerEntityRenderingHandler(EntityChemthrowerShot.class, new IRenderFactory<EntityChemthrowerShot>() {

        @Override
        public Render createRenderFor(RenderManager manager) {
            return new EntityRenderChemthrowerShot(manager);
        }
    });
    RenderingRegistry.registerEntityRenderingHandler(EntityRailgunShot.class, new IRenderFactory<EntityRailgunShot>() {

        @Override
        public Render createRenderFor(RenderManager manager) {
            return new EntityRenderRailgunShot(manager);
        }
    });
    RenderingRegistry.registerEntityRenderingHandler(EntityIEExplosive.class, new IRenderFactory<EntityIEExplosive>() {

        @Override
        public Render createRenderFor(RenderManager manager) {
            return new EntityRenderIEExplosive(manager);
        }
    });
    RenderingRegistry.registerEntityRenderingHandler(EntityFluorescentTube.class, new IRenderFactory<EntityFluorescentTube>() {

        @Override
        public Render createRenderFor(RenderManager manager) {
            return new EntityRenderFluorescentTube(manager);
        }
    });
    ModelLoaderRegistry.registerLoader(new ConnLoader());
    ModelLoaderRegistry.registerLoader(new FeedthroughLoader());
    ModelLoaderRegistry.registerLoader(new ModelConfigurableSides.Loader());
    ModelLoaderRegistry.registerLoader(new MultiLayerLoader());
    ConveyorChute.clientInit();
}
Also used : Matrix4(blusunrize.immersiveengineering.common.util.chickenbones.Matrix4) Framebuffer(net.minecraft.client.shader.Framebuffer) ConnLoader(blusunrize.immersiveengineering.client.models.smart.ConnLoader) FeedthroughLoader(blusunrize.immersiveengineering.client.models.smart.FeedthroughLoader) MultiLayerLoader(blusunrize.immersiveengineering.client.models.multilayer.MultiLayerLoader) IBakedModel(net.minecraft.client.renderer.block.model.IBakedModel) PositionedItemStack(blusunrize.lib.manual.ManualPages.PositionedItemStack)

Aggregations

Framebuffer (net.minecraft.client.shader.Framebuffer)10 ScaledResolution (net.minecraft.client.gui.ScaledResolution)2 MultiLayerLoader (blusunrize.immersiveengineering.client.models.multilayer.MultiLayerLoader)1 ConnLoader (blusunrize.immersiveengineering.client.models.smart.ConnLoader)1 FeedthroughLoader (blusunrize.immersiveengineering.client.models.smart.FeedthroughLoader)1 Matrix4 (blusunrize.immersiveengineering.common.util.chickenbones.Matrix4)1 PositionedItemStack (blusunrize.lib.manual.ManualPages.PositionedItemStack)1 TextureHelper (com.microsoft.Malmo.Utils.TextureHelper)1 BufferedImage (java.awt.image.BufferedImage)1 IntBuffer (java.nio.IntBuffer)1 BufferBuilder (net.minecraft.client.renderer.BufferBuilder)1 Tessellator (net.minecraft.client.renderer.Tessellator)1 IBakedModel (net.minecraft.client.renderer.block.model.IBakedModel)1 ResourceLocation (net.minecraft.util.ResourceLocation)1