Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
Shaders and gl_Vertex

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

Hi,

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 = vTexCoord1.st; \
v_texCoord2 = vTexCoord2.st; \
}";

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


niko
Moderator
Quote
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)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






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