Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
Shaders and gl_Vertex

Registered User
2011-07-15 12:45:36


I tried using gl_Vertex in the vertex shader, but it doesn't seem to work in Copperlicht. When using it in the tutorial 5 it gives this error message:

Error loading vertex shader: ERROR: 0:4: 'gl_Vertex' : undeclared identifier
Could not create shader program

Got any ideas what I'm doing wrong? Here's the shader:

var vertex_shader_source = "\
ifdef GL_ES \n\
precision highp float; \n\
endif \n\
uniform mat4 worldviewproj; \
attribute vec4 vPosition; \
attribute vec4 vNormal; \
attribute vec2 vTexCoord1; \
attribute vec2 vTexCoord2; \
varying vec2 v_texCoord1; \
varying vec2 v_texCoord2; \
void main() \
{ \
vec4 v = vec4(gl_Vertex); \
gl_Position = worldviewproj * vPosition;\
v_texCoord1 =; \
v_texCoord2 =; \

If I change the gl_Vertex to gl_Position, it compiles just fine.

2011-07-15 13:28:10

Hm, gl_Vertex doesn't work, no.Not sure why it should, though? Just use gl_Position.

Create reply:

Posted by: (you are not logged in)

Enter the missing letter in: "Internat?onal" (you are not logged in)




Possible Codes

Feature Code
Link [url] [/url]
Bold [b]bold text[/b]
Image [img][/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]



Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact