Skip to content

Error spam in debug + no imgui window showed #34

@NguyenNghi2002

Description

@NguyenNghi2002
Image

You need to change texture2D( on this line to texture(:

Out_Color = Frag_Color * texture2D(Texture, Frag_UV.st);

Correct shader:

string vertex_shader_glsl_120 =
    """
    uniform mat4 ProjMtx;
    attribute vec2 Position;
    attribute vec2 UV;
    attribute vec4 Color;
    varying vec2 Frag_UV;
    varying vec4 Frag_Color;
    void main()
    {
        Frag_UV = UV;
        Frag_Color = Color;
        gl_Position = vec4(Position.xy,0,1) * ProjMtx;
    }
    """;

string vertex_shader_glsl_130 =
    """
    uniform mat4 ProjMtx;
    in vec2 Position;
    in vec2 UV;
    in vec4 Color;
    out vec2 Frag_UV;
    out vec4 Frag_Color;
    void main()
    {
        Frag_UV = UV;
        Frag_Color = Color;
        gl_Position = vec4(Position.xy,0,1) * ProjMtx;
    }
    """;

string vertex_shader_glsl_300_es =
    """
    precision highp float;
    layout(location = 0) in vec2 Position;
    layout(location = 1) in vec2 UV;
    layout(location = 2) in vec4 Color;
    uniform mat4 ProjMtx;
    out vec2 Frag_UV;
    out vec4 Frag_Color;
    void main()
    {
        Frag_UV = UV;
        Frag_Color = Color;
        gl_Position = vec4(Position.xy,0,1) * ProjMtx;
    }
    """;

string vertex_shader_glsl_410_core =
    """
    layout(location = 0) in vec2 Position;
    layout(location = 1) in vec2 UV;
    layout(location = 2) in vec4 Color;
    uniform mat4 ProjMtx;
    out vec2 Frag_UV;
    out vec4 Frag_Color;
    void main()
    {
        Frag_UV = UV;
        Frag_Color = Color;
        gl_Position = vec4(Position.xy,0,1) * ProjMtx;
    }
    """;

string fragment_shader_glsl_120 =
    """
    #ifdef GL_ES
        precision mediump float;
    #endif
    uniform sampler2D Texture;
    varying vec2 Frag_UV;
    varying vec4 Frag_Color;
    void main()
    {
        gl_FragColor = Frag_Color * texture(Texture, Frag_UV.st);
    }
    """;

string fragment_shader_glsl_130 =
    """
    uniform sampler2D Texture;
    in vec2 Frag_UV;
    in vec4 Frag_Color;
    out vec4 Out_Color;
    void main()
    {
        Out_Color = Frag_Color * texture(Texture, Frag_UV.st);
    }
    """;

string fragment_shader_glsl_300_es =
    """
    precision mediump float;
    uniform sampler2D Texture;
    in vec2 Frag_UV;
    in vec4 Frag_Color;
    layout(location = 0) out vec4 Out_Color;
    void main()
    {
        Out_Color = Frag_Color * texture(Texture, Frag_UV.st);
    }
    """;

string fragment_shader_glsl_410_core =
    """
    in vec2 Frag_UV;
    in vec4 Frag_Color;
    uniform sampler2D Texture;
    layout(location = 0) out vec4 Out_Color;
    void main()
    {
        Out_Color = Frag_Color * texture(Texture, Frag_UV.st);
    }
    """;

Fixed:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions