Skip to content

Rendering artifacts on non-square elements #191

@doceazedo

Description

@doceazedo

Everything that is not a square, such as most of the stuff on the demo custom rendering window, roundings and tabs are rendering with very weird, distorted artifacts:

CleanShot 2023-09-06 at 12 57 02@2x

Some other artifacts are also appearing depending on the options:

CleanShot.2023-09-06.at.12.57.52-converted.mp4

I didn't do anything fancy for the setup (note this is a Minecraft mod running on a Apple M1 Max, macOS 13.0.1):

object ImGui {
    val instance = ImGui
    val implGl3: ImplGL3
    val implGlfw: ImplGlfw

    init {
        MINECRAFT_BEHAVIORS = true

        val glfwWindow = GlfwWindow(MinecraftClient.getInstance().window.handle)
        val window = GlWindow(glfwWindow, Caps.Profile.COMPATIBILITY, true)

        window.makeCurrent(true)
        Context().setCurrent()

        implGlfw = ImplGlfw(window, false, null)
        implGl3 = ImplGL3()
    }
}
@Environment(EnvType.CLIENT)
open class ImGuiScreen(title: Text) : Screen(title) {
    override fun render(context: DrawContext?, mouseX: Int, mouseY: Int, delta: Float) {
        ImGui.implGl3.newFrame()
        ImGui.implGlfw.newFrame()
        ImGui.instance.newFrame()
        
        ImGui.instance.showDemoWindow(booleanArrayOf(true))
        
        ImGui.instance.render()
        ImGui.implGl3.renderDrawData(
            Objects.requireNonNull<DrawData>(ImGui.instance.drawData)
        )
    }
}

Any hints on how I can solve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions