summaryrefslogtreecommitdiff
path: root/src/renderergl2/tr_bsp.c
diff options
context:
space:
mode:
authorSmileTheory <SmileTheory@gmail.com>2013-11-12 19:21:51 -0800
committerTim Angus <tim@ngus.net>2014-06-17 17:43:36 +0100
commit38af27b32b1302fd5ddd83d992fc8ec73209b3ad (patch)
tree0af9a9e571ffd1120d4603bd8d09f092875786e3 /src/renderergl2/tr_bsp.c
parent1efea34f7dc0afa21c1ddaa62705c8f4e6b76d9e (diff)
OpenGL2: Calculate bitangent in shader, and store normal/tangent as normalized byte arrays.
Diffstat (limited to 'src/renderergl2/tr_bsp.c')
-rw-r--r--src/renderergl2/tr_bsp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/renderergl2/tr_bsp.c b/src/renderergl2/tr_bsp.c
index 26d7fa50..082a0b9b 100644
--- a/src/renderergl2/tr_bsp.c
+++ b/src/renderergl2/tr_bsp.c
@@ -1811,12 +1811,14 @@ static void CopyVert(const srfVert_t * in, srfVert_t * out)
out->xyz[j] = in->xyz[j];
#ifdef USE_VERT_TANGENT_SPACE
out->tangent[j] = in->tangent[j];
- out->bitangent[j] = in->bitangent[j];
+ //out->bitangent[j] = in->bitangent[j];
#endif
out->normal[j] = in->normal[j];
out->lightdir[j] = in->lightdir[j];
}
+ out->tangent[3] = in->tangent[3];
+
for(j = 0; j < 2; j++)
{
out->st[j] = in->st[j];
@@ -2001,7 +2003,7 @@ static void R_CreateWorldVBOs(void)
#ifdef USE_VERT_TANGENT_SPACE
vbo = R_CreateVBO2(va("staticBspModel0_VBO %i", k), numVerts, verts,
- ATTR_POSITION | ATTR_TEXCOORD | ATTR_LIGHTCOORD | ATTR_TANGENT | ATTR_BITANGENT |
+ ATTR_POSITION | ATTR_TEXCOORD | ATTR_LIGHTCOORD | ATTR_TANGENT |
ATTR_NORMAL | ATTR_COLOR | ATTR_LIGHTDIRECTION, VBO_USAGE_STATIC);
#else
vbo = R_CreateVBO2(va("staticBspModel0_VBO %i", k), numVerts, verts,