Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 167 vs 168 for /trunk/assets/shaders/GLSL/vertexAtoms/lightingDefaults.vert

Diff revisions: vs.
  @@ -7,7 +7,7 @@
7 7 out vec3 _viewDirection;
8 8 out vec3 _lightDirection[MAX_LIGHT_COUNT]; //<Light direction
9 9 out vec4 _shadowCoord[MAX_SHADOW_CASTING_LIGHTS];
10 - out float _attenuation[MAX_LIGHT_COUNT];
10 + smooth out float _attenuation[MAX_LIGHT_COUNT];
11 11
12 12
13 13 uniform bool dvd_enableShadowMapping;
  @@ -17,7 +17,6 @@
17 17 const float pidiv180 = 0.0174532777777778; //3.14159 / 180.0; // 36 degrees
18 18
19 19 void computeLightVectors(){
20 - vec4 vertexM = dvd_ModelMatrix * dvd_Vertex;
21 20 _vertexMV = dvd_ModelViewMatrix * dvd_Vertex; //< ModelView Vertex
22 21 _normalMV = normalize(dvd_NormalMatrix * dvd_Normal); //<ModelView Normal
23 22
  @@ -48,7 +47,7 @@
48 47
49 48 lightPos = mat3(dvd_ViewMatrix) * gl_LightSource[i].position.xyz;
50 49 //lightPosMV.w will be 0 for Directional Lights and 1 for Spot or Omni, so this avoids an "if/else"
51 - lightDirection = mix(-lightPos, normalize(lightPos - vertexM.xyz), lightType);
50 + lightDirection = mix(-lightPos, normalize(lightPos - _vertexM.xyz), lightType);
52 51
53 52 distance = length(lightDirection);
54 53 //either _attenuation == 1 if light is directional or we compute the actual value for omni and spot
  @@ -81,7 +80,7 @@
81 80 // position multiplied by the inverse of the camera matrix
82 81 // position multiplied by the light matrix. The vertex's position from the light's perspective
83 82 for(int i = 0; i < MAX_SHADOW_CASTING_LIGHTS; i++){
84 - _shadowCoord[i] = dvd_lightProjectionMatrices[i] * vertexM;
83 + _shadowCoord[i] = dvd_lightProjectionMatrices[i] * _vertexM;
85 84 }
86 85 }
87 86 }