Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: 'gl_Position' : undeclared identifier

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2018
    Posts
    5

    'gl_Position' : undeclared identifier

    I have a Problem with the vertex shader : the compile infoLog is ''
    Code :
    ERROR: 0:6: 'gl_Position' : undeclared identifier
    ERROR: 0:6: 'assign' :  cannot convert from '4-component vector of highp float' to 'highp float' "
    the shader Code:
    Code glsl:
    #version 330 core
    layout (location = 0) in vec3 aPos;
     
    void main()
    {
        gl_Position = vec4(aPos, 1.0f);
    }

    Whats the mistake ?
    Last edited by Dark Photon; 12-24-2018 at 11:30 AM.

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,596
    Compiles fine here as a vertex shader. Shader Playground suggests that it's valid as well.

    Make sure you're compiling this as a vertex shader, not as a shader for some other shader stage.
    Last edited by Dark Photon; 12-24-2018 at 12:09 PM.

  3. #3
    Junior Member Newbie
    Join Date
    Dec 2018
    Posts
    5
    Thanks. The Problem was that I compiled the vertex shader as Fragment shader and the Fragment shader as vertex shader.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •