Changeset 665
Legend:
 Unmodified
 Added
 Removed

trunk/src/scene.cpp
r664 r665 39 39 extern Shader *stdshader; 40 40 #endif 41 extern mat4 projection_matrix, view_matrix,model_matrix;41 extern mat4 model_matrix; 42 42 43 43 /* … … 211 211 212 212 #else 213 glEnable(GL_DEPTH_TEST); 214 glDepthFunc(GL_LEQUAL); 215 glEnable(GL_ALPHA_TEST); 216 glAlphaFunc(GL_GEQUAL, 0.01f); 217 glEnable(GL_BLEND); 218 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 219 213 220 glLoadIdentity(); 214 221 glMultMatrixf(&model_matrix[0][0]); 
trunk/src/video.cpp
r664 r665 32 32 Shader *stdshader; 33 33 #endif 34 mat4 proj ection_matrix, view_matrix, model_matrix;34 mat4 proj_matrix, view_matrix, model_matrix; 35 35 36 36 #if LOL_EXPERIMENTAL … … 42 42 "in vec2 in_TexCoord;\n" 43 43 "out vec3 pass_Color;\n" 44 "uniform mat4 proj ection_matrix;\n"44 "uniform mat4 proj_matrix;\n" 45 45 "uniform mat4 view_matrix;\n" 46 46 "uniform mat4 model_matrix;\n" … … 48 48 "void main()\n" 49 49 "{\n" 50 " gl_Position = proj ection_matrix * view_matrix *"51 " model_matrix* vec4(in_Position, 1.0f);\n"50 " gl_Position = proj_matrix * view_matrix * model_matrix" 51 " * vec4(in_Position, 1.0f);\n" 52 52 " gl_TexCoord[0] = vec4(in_TexCoord, 0.0, 0.0);\n" 53 53 " pass_Color = in_Color;\n" … … 104 104 { 105 105 /* The easy way: purely orthogonal projection. */ 106 proj = mat4::ortho(0, width, 0, height, near, far);106 proj_matrix = mat4::ortho(0, width, 0, height, near, far); 107 107 } 108 108 else … … 124 124 } 125 125 126 proj = mat4::frustum(near * t1, near * t1,127 near * t2, near * t2, near, far)128 * mat4::translate(0.5f * width, 0.5f * height, dist);126 proj_matrix = mat4::frustum(near * t1, near * t1, 127 near * t2, near * t2, near, far) 128 * mat4::translate(0.5f * width, 0.5f * height, dist); 129 129 } 130 130 131 #if LOL_EXPERIMENTAL132 projection_matrix = proj;133 131 view_matrix = mat4(1.0f); 134 #else 132 133 #if !LOL_EXPERIMENTAL 135 134 glMatrixMode(GL_PROJECTION); 136 135 glLoadIdentity(); 137 glMultMatrixf(&proj [0][0]);136 glMultMatrixf(&proj_matrix[0][0]); 138 137 139 138 /* Reset the model view matrix, just in case */ 140 139 glMatrixMode(GL_MODELVIEW); 141 140 glLoadIdentity(); 141 glMultMatrixf(&view_matrix[0][0]); 142 142 #endif 143 143 } … … 153 153 void Video::Clear() 154 154 { 155 #if LOL_EXPERIMENTAL156 155 glViewport(0, 0, GetWidth(), GetHeight()); 157 156 glClear(GL_COLOR_BUFFER_BIT  GL_DEPTH_BUFFER_BIT  GL_STENCIL_BUFFER_BIT); 158 157 158 #if LOL_EXPERIMENTAL 159 159 GLuint uni; 160 uni = stdshader>GetUniformLocation("proj ection_matrix");161 glUniformMatrix4fv(uni, 1, GL_FALSE, &proj ection_matrix[0][0]);160 uni = stdshader>GetUniformLocation("proj_matrix"); 161 glUniformMatrix4fv(uni, 1, GL_FALSE, &proj_matrix[0][0]); 162 162 uni = stdshader>GetUniformLocation("view_matrix"); 163 163 glUniformMatrix4fv(uni, 1, GL_FALSE, &view_matrix[0][0]); 164 #else165 glEnable(GL_DEPTH_TEST);166 glDepthFunc(GL_LEQUAL);167 glEnable(GL_ALPHA_TEST);168 glAlphaFunc(GL_GEQUAL, 0.01f);169 glEnable(GL_BLEND);170 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);171 172 glClear(GL_COLOR_BUFFER_BIT  GL_DEPTH_BUFFER_BIT);173 164 #endif 174 165
Note: See TracChangeset
for help on using the changeset viewer.