Hello! I am trying to work with a vertex shader, but I ran into this problem:
m.Vertex_Before_PositionUpdated (
gl_Position = gl_ModelViewMatrix * gl_ProjectionMatrix * gl_Vertex;
);
When executing this code (just pass through vertex position), I get these errors:
Error: VERTEX SHADER ERROR: 0: 201: ‘gl_ModelViewMatrix’: undeclared identifier
ERROR: 0: 201: ‘gl_ProjectionMatrix’: undeclared identifier
ERROR: 0: 201: ‘gl_Vertex’: undeclared identifier
What could be the problem? If I cannot access opengl, how should I pass these basic values? Thx!
Hello did you check this doc?
https://doc.babylonjs.com/how_to/shader_material
In a nutshell your matrices must be just one uniform named: worldViewProjection
2 Likes
Thank you! Sorry for the stupid question
No worries! We are here to help
1 Like