Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

LiquidBounce Forum

T

ThrowAway39234

@ThrowAway39234
About
Posts
4
Topics
1
Shares
0
Groups
0
Followers
1
Following
0

Posts

Recent Best Controversial

  • How to draw a gradient rect
    T ThrowAway39234

    A better way of not using reflection would be:

    /**
     * @param color1 color in hex.
     * @param color2 color in hex.
     */
     function drawSimpleVerticalGradientRect(x, y, x2, y2, color1, color2) {
        GL11.glBegin(GL11.GL_QUADS);
        glColor(color1);
        GL11.glVertex2d(x, y);
        GL11.glVertex2d(x, y2);
        glColor(color2);
        GL11.glVertex2d(x2, y2);
        GL11.glVertex2d(x2, y);
        GL11.glEnd();
    }
    
    /**
     * @param color A color in hex.
     */
    function glColor(color) {
        var a = (color >> 24) & 0xFF;
        var r = (color >> 16) & 0xFF;
        var g = (color >> 8) & 0xFF;
        var b = (color) & 0xFF;
        GL11.glColor4f(r / 255, g / 255, b / 255, a / 255);
    }
    

    I would like to explain this, but i don't know if i could do it well

    Example Usage:

    GlStateManager.disableTexture2D();
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    // Tells GL to transition between colors
    GlStateManager.shadeModel(GL11.GL_SMOOTH);
    drawSimpleVerticalGradientRect(10, 10, 390, 390, 0xffffffff, 0x00ffffff);
    // Tells GL to use the ONLY' last color
    GlStateManager.shadeModel(GL11.GL_FLAT);
    GlStateManager.disableBlend();
    
    ScriptAPI

  • Rendering world behaves weirdly
    T ThrowAway39234

    Found the fix myself, i created the framebuffer with

    new Framebuffer(width, height, false)
    

    instead of

    new Framebuffer(width, height, true)
    

    which enables the depth... i should've known better

    Kotlin/Java

  • How to render images on screen
    T ThrowAway39234

    @purpl3-yt You can use GL11.GL_QUADS to render an image, you just need to bind the image, in minecraft you bind the image like so mc.getTextureManager().bindTexture(new ResourceLocation("path to resource or image inside /assets/minecraft/"))

    and render the quads like so:

    GL11.glBegin(GL11.GL_QUADS);
    GL11.glTexCoord(0, 0);
    GL11.glVertex2d(x, y);
    GL11.glTexCoord(1, 0);
    GL11.glVertex2d(x2, y);
    GL11.glTexCoord(1, 1);
    GL11.glVertex2d(x2, y2);
    GL11.glTexCoord(0, 1);
    GL11.glVertex2d(x, y2);
    GL11.glEnd();
    
    ScriptAPI

  • Rendering world behaves weirdly
    T ThrowAway39234

    Hello, i need help with rendering the world on a framebuffer. The world rendered (with mc.entityRenderer.renderWorld()) renders weirdly, i already tried enabling and disabling depth and other couple of things, i am not sure if using a framebuffer messes with it, i'm in 1.8.9 Vanilla (No forge). (and yes, i'm trying to render the world twice, for having a different camera server side). I figured here is the only place i know that can support me, so sorry if this comes off as an useless post.
    23eecf7b-e234-4f22-bad7-d70fd1113064-image.png

    My code:

    GlStateManager.color(1, 1, 1, 1);
    GlStateManager.enableTexture2D();
    
    GL11.glPushMatrix();
    
    /* Bind custom framebuffer */
    GL11.glPushMatrix();
    
    float py = mc.getRenderViewEntity().rotationYaw;
    float pp = mc.getRenderViewEntity().rotationPitch;
    float ppy = mc.getRenderViewEntity().prevRotationYaw;
    float ppp = mc.getRenderViewEntity().prevRotationPitch;
    boolean c = mc.gameSettings.thirdPersonView;
    mc.gameSettings.thirdPersonView = false;
    mc.getRenderViewEntity().rotationYaw = mc.getRenderViewEntity().prevRotationYaw = ((Rotations) (LiquidBounce.getModuleManager().getModule("Rotations"))).yaw;
    mc.getRenderViewEntity().rotationPitch = mc.getRenderViewEntity().prevRotationPitch = ((Rotations) (LiquidBounce.getModuleManager().getModule("Rotations"))).pitch;
    
    Framebuffer fb = mc.getFramebuffer();
    mc.setFrameBuffer(framebuffer);
    
    GlStateManager.disableBlend();
    
    mc.entityRenderer.renderWorld(partialTicks, System.nanoTime());
    
    GlStateManager.enableBlend();
    
    mc.setFrameBuffer(fb);
    
    mc.getRenderViewEntity().rotationYaw = py;
    mc.getRenderViewEntity().rotationPitch = pp;
    mc.getRenderViewEntity().prevRotationYaw = ppy;
    mc.getRenderViewEntity().prevRotationPitch = ppp;
    mc.gameSettings.thirdPersonView = c;
    
    mc.entityRenderer.setupOverlayRendering();
    
    GL11.glPopMatrix();
    
    /* Unbind custom framebuffer */
    
    GlStateManager.popMatrix();
    /* Bind minecraft's default framebuffer */
    
    Kotlin/Java
  • Login

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups