From 38af27b32b1302fd5ddd83d992fc8ec73209b3ad Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Tue, 12 Nov 2013 19:21:51 -0800 Subject: OpenGL2: Calculate bitangent in shader, and store normal/tangent as normalized byte arrays. --- src/renderergl2/tr_bsp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/renderergl2/tr_bsp.c') 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, -- cgit