dungeon_crawler
diff prototype/src/material.cc @ 35:d0e93b4d9ec9
normal mapping
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 28 Aug 2012 06:28:22 +0300 |
parents | ddb68dc4ba07 |
children | acfe0c0110fc |
line diff
1.1 --- a/prototype/src/material.cc Tue Aug 28 03:34:56 2012 +0300 1.2 +++ b/prototype/src/material.cc Tue Aug 28 06:28:22 2012 +0300 1.3 @@ -70,7 +70,18 @@ 1.4 glBindTexture(GL_TEXTURE_2D, tex[TEXTYPE_DIFFUSE]); 1.5 glEnable(GL_TEXTURE_2D); 1.6 } else { 1.7 + glActiveTextureARB(GL_TEXTURE0); 1.8 glDisable(GL_TEXTURE_2D); 1.9 } 1.10 + 1.11 + if(tex[TEXTYPE_NORMAL]) { 1.12 + glActiveTextureARB(GL_TEXTURE1); 1.13 + glBindTexture(GL_TEXTURE_2D, tex[TEXTYPE_NORMAL]); 1.14 + glEnable(GL_TEXTURE_2D); 1.15 + } else { 1.16 + glActiveTextureARB(GL_TEXTURE1); 1.17 + glDisable(GL_TEXTURE_2D); 1.18 + } 1.19 + 1.20 glActiveTextureARB(GL_TEXTURE0); 1.21 }