Skip to content

Wrong UVs for Quad. #10321

Description

@RoastedKaju

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

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