dungeon_crawler
diff prototype/src/tile.cc @ 60:aa86119e3295
added multipass deferred
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 25 Sep 2012 06:19:37 +0300 |
parents | 1ea56011c1ff |
children | 7f52d6310317 |
line diff
1.1 --- a/prototype/src/tile.cc Fri Sep 21 05:28:45 2012 +0300 1.2 +++ b/prototype/src/tile.cc Tue Sep 25 06:19:37 2012 +0300 1.3 @@ -141,8 +141,11 @@ 1.4 1.5 void Tile::draw(unsigned int draw_mask) const 1.6 { 1.7 + int tang_loc = rend->get_tangent_location(); 1.8 + 1.9 for(size_t i=0; i<meshes.size(); i++) { 1.10 if(mesh_side[i] & draw_mask) { 1.11 + meshes[i]->set_attrib_location(MESH_ATTR_TANGENT, tang_loc); 1.12 meshes[i]->draw(); 1.13 } 1.14 } 1.15 @@ -152,6 +155,7 @@ 1.16 { 1.17 for(size_t i=0; i<lights.size(); i++) { 1.18 if(light_side[i] & draw_mask) { 1.19 + printf("rendering light ...\n"); 1.20 lights[i]->draw(); 1.21 } 1.22 } 1.23 @@ -205,11 +209,6 @@ 1.24 { 1.25 int count = 0; 1.26 1.27 - int attr_loc = rend->get_tangent_location(); 1.28 - if(attr_loc == -1) { 1.29 - fprintf(stderr, "warning: failed to retrieve tangent attribute location while loading tile\n"); 1.30 - } 1.31 - 1.32 for(int i=0; i<(int)scn->mNumMeshes; i++) { 1.33 // ignore any lines or other crap 1.34 if(scn->mMeshes[i]->mPrimitiveTypes != aiPrimitiveType_TRIANGLE) { 1.35 @@ -221,9 +220,6 @@ 1.36 delete mesh; 1.37 continue; 1.38 } 1.39 - if(attr_loc != -1) { 1.40 - mesh->set_attrib_location(MESH_ATTR_TANGENT, attr_loc); 1.41 - } 1.42 1.43 Material mat; 1.44 mat.load(scn->mMaterials[scn->mMeshes[i]->mMaterialIndex], tset->get_textures());