ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperLicht
forum topic indicator Shaders and gl_Vertex
person icon
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.

person icon
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:










 

  

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


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






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