Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • 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

  1. Home
  2. Kotlin/Java
  3. Rendering world behaves weirdly

Rendering world behaves weirdly

Scheduled Pinned Locked Moved Kotlin/Java
2 Posts 1 Posters 578 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    ThrowAway39234
    wrote on last edited by
    #1

    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 */
    
    1 Reply Last reply
    0
    • T Offline
      T Offline
      ThrowAway39234
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      About
      • Terms of Service
      • Privacy Policy
      • Status
      • Contact Us
      Downloads
      • Releases
      • Source code
      • License
      Docs
      • Tutorials
      • CustomHUD
      • AutoSettings
      • ScriptAPI
      Community
      • Forum
      • Guilded
      • YouTube
      • Twitter
      • D.Tube
      • Login

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