View Full Version : glScale3f but on a GLSL vertex shader?

03-18-2012, 01:24 PM
Hello I've finally figured out how to use vertex arrays inside Opengl 3.3x but having issues with my shaders now

I was wondering how to change the size of a quad using a shader this is my current vertex array

static const GLfloat g_vertex_buffer_data[] = {
//X Y Z
-1.0f,-1.0f, 0.0f,
1.0f,-1.0f, 0.0f,
1.0f, 1.0f, 0.0f,
-1.0f, 1.0f, 0.0f,


and here is my current fragment shader and vertex shader code


#version 330 core

layout(location = 0) in vec3 Position;

void main()
gl_Position.xyz = Position;



out vec3 color;

void main(){
color = vec3(1,1,0);

Thanks in Advance

03-18-2012, 01:43 PM
Your vertex shader is missing 'standard' features such as multiply in position by a model matrix and then a camera matrix.
gl_Position = cameramatrix * modelmatrix * Position;

In your case the uniform modelmatrix would be an identity matrix which has then been scaled. The. Camera matrix would be just identity.