Search Unity

GLSL shader: rename predefined vertex attribute variables

Discussion in 'Shaders' started by boris_playrix, Oct 12, 2017.

  1. boris_playrix

    boris_playrix

    Joined:
    Sep 29, 2017
    Posts:
    5
    Is it possible to change gl_Vertex to a_vertex for example? (native glsl shader)
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,348
    What do you mean by change? If you mean can you make it so you use a different variable name in your shader to access the contents of gl_Vertex, sure.

    #define a_vertex gl_Vertex

    If you mean can you remove the gl_Vertex variable and have that same data be set on a_vertex, then no. The gl_Vertex variable is part of OpenGL.