diff options
author | knolax <1339802534.kk@gmail.com> | 2017-02-22 20:43:47 -0500 |
---|---|---|
committer | knolax <1339802534.kk@gmail.com> | 2017-02-22 20:43:47 -0500 |
commit | c7bdd6fcae58e09597071405c1449df64e084c51 (patch) | |
tree | c9ca26278a7a86725aa2e5af7e1a330c89265137 /example/vertexshader.glsl | |
parent | d137bf2485050b54bb0ac65ef543ba24f18fabbe (diff) |
implemented phoung shading and surrounding infrastructure, gen.cpp compiles a simple program that creates raw vertex data from vertexes in a way that surppassess the limitations of opengl's native elements[] protocol. next step is to allow for z distance based override and multi draw;
Diffstat (limited to 'example/vertexshader.glsl')
-rw-r--r-- | example/vertexshader.glsl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/example/vertexshader.glsl b/example/vertexshader.glsl index 4187969..f60ec9f 100644 --- a/example/vertexshader.glsl +++ b/example/vertexshader.glsl @@ -2,9 +2,15 @@ uniform mat4 proj; uniform mat4 tran; uniform mat4 cam; +uniform mat4 rot; in vec3 position; - +in vec3 vnormal; +varying vec4 fragpos; +varying vec4 fragnormal; // if this needs to not be blended jsut have all vertexes in a poly be the same void main() { - gl_Position = proj * cam * tran * vec4(position, 1.0f); + //this is the actual position + gl_Position = proj * cam * tran * vec4(position, 1.0f);// - vec4(gl_Normal, 1.0f); + fragpos = tran * vec4(position, 1.0f); + fragnormal = (tran * vec4(vnormal, 1.0f)) - (tran * vec4(0.0, 0.0, 0.0, 1.0)); } |