#10321·filament

Wrong UVs for Quad.

Author: RoastedKajuCreated Aug 17, 2026Updated Aug 18, 2026

For some reason, I cannot get a simple texture onto a Quad, I even tried asking LLMs and they keep going in circle on issues like mipmaps and other stuff which probably isn't causing this.

A normal Quad in graphics is made up of 2 triangles and the UV should give us a smooth gradient from left to right, however in my case it is giving me a diagonal line where the triangles meet.

Image

Just the UVs, this is wrong it shouldn't be like this: Image

My material is quite simple:

material {
    name : "TexturedColorMaterial",
    shadingModel : unlit,
    flipUV : false,
    parameters : [
        {
            type : sampler2d,
            name : albedoMap
        }
    ],
    requires : [
        uv0
    ]
}

fragment {
    void material(inout MaterialInputs material) {
        prepareMaterial(material);
        material.baseColor = texture(materialParams_albedoMap, getUV0());
    }
}

The full code is here, the only thing different is i am using GLFW for my example https://gist.github.com/RoastedKaju/c94a8600aef8053ecdc717f1fc6649ee