about summary refs log tree commit diff stats
path: root/.gitignore
Commit message (Collapse)AuthorAgeFilesLines
* Changes to get it to compile on WindowsStar Rauchenberger2023-05-031-0/+1
|
* Does this workStar Rauchenberger2023-05-021-0/+1
|
* Map + popups reflect checked locationsStar Rauchenberger2023-05-021-0/+1
|
* Started reading in game data yamlStar Rauchenberger2023-05-021-0/+1
|
* Initial commitStar Rauchenberger2023-05-011-0/+1
bia@gmail.com> 2015-02-15 15:23:19 -0500 committer Kelly Rauchenberger <fefferburbia@gmail.com> 2015-02-15 15:23:19 -0500 Added bloom!' href='/therapy/commit/shaders/final.vertex?id=783b308990e7c4ef0837a102a138778f73e4d2b7'>783b308 ^
cd48894 ^
783b308 ^


783b308 ^
5986041 ^
cd48894 ^
783b308 ^
de5a458
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28



                                                       
                                      

            


                    



                      
                                            


           
                                                        
                


                                                                                        
                                                                     
  
                                                    
                                                          
 
#version 330 core

layout(location = 0) in vec3 vertexPosition_modelspace;
layout(location = 1) in vec3 vertexNormal;
layout(location = 2) in vec2 vertexUV;

out vec2 UV;
out vec3 normIn;
out vec3 camDirIn;
out vec3 lightDirIn;

uniform mat4 MVP;
uniform mat4 worldMat;

const vec3 Tuning_LightPos = vec3(2, 1, -1);

void main()
{
  gl_Position = MVP * vec4(vertexPosition_modelspace,1);
  UV = vertexUV;
  normIn = vertexNormal;
  
  mat3 invWorldRot = transpose(mat3(worldMat[0].xyz, worldMat[1].xyz, worldMat[2].xyz));
  vec3 worldPos = (worldMat * vec4(vertexPosition_modelspace,1)).xyz;
  
  camDirIn = invWorldRot * (vec3(2,0,0) - worldPos);
  lightDirIn = invWorldRot * (Tuning_LightPos - worldPos);
}