29 #include "../idlib/precompiled.h"
117 #define DERIVE_UNSMOOTHED_BITANGENT
122 static int numSilEdges;
125 static int numPlanes;
129 #ifdef USE_TRI_DATA_ALLOCATOR
161 triVertexAllocator.
Init();
162 triIndexAllocator.
Init();
163 triShadowVertexAllocator.
Init();
164 triPlaneAllocator.
Init();
165 triSilIndexAllocator.
Init();
166 triSilEdgeAllocator.
Init();
167 triDominantTrisAllocator.
Init();
168 triMirroredVertAllocator.
Init();
169 triDupVertAllocator.
Init();
194 triShadowVertexAllocator.
Shutdown();
198 triDominantTrisAllocator.
Shutdown();
199 triMirroredVertAllocator.
Shutdown();
234 common->
Printf(
"%6d kB vertex memory (%d kB free in %d blocks, %d empty base blocks)\n",
238 common->
Printf(
"%6d kB index memory (%d kB free in %d blocks, %d empty base blocks)\n",
242 common->
Printf(
"%6d kB shadow vert memory (%d kB free in %d blocks, %d empty base blocks)\n",
246 common->
Printf(
"%6d kB tri plane memory (%d kB free in %d blocks, %d empty base blocks)\n",
250 common->
Printf(
"%6d kB sil index memory (%d kB free in %d blocks, %d empty base blocks)\n",
254 common->
Printf(
"%6d kB sil edge memory (%d kB free in %d blocks, %d empty base blocks)\n",
258 common->
Printf(
"%6d kB dominant tri memory (%d kB free in %d blocks, %d empty base blocks)\n",
262 common->
Printf(
"%6d kB mirror vert memory (%d kB free in %d blocks, %d empty base blocks)\n",
266 common->
Printf(
"%6d kB dup vert memory (%d kB free in %d blocks, %d empty base blocks)\n",
333 total +=
sizeof( *tri );
424 srfTrianglesAllocator.
Free( tri );
497 common->
Error(
"R_FreeStaticTriSurf: freed a freed triangle" );
505 #ifdef ID_DEBUG_MEMORY
557 tri->
verts = triVertexAllocator.
Alloc( numVerts );
598 #ifdef USE_TRI_DATA_ALLOCATOR
611 #ifdef USE_TRI_DATA_ALLOCATOR
624 #ifdef USE_TRI_DATA_ALLOCATOR
675 common->
Error(
"R_RangeCheckIndexes: numIndexes < 0" );
678 common->
Error(
"R_RangeCheckIndexes: numVerts < 0" );
683 common->
Error(
"R_RangeCheckIndexes: numIndexes %% 3" );
688 common->
Error(
"R_RangeCheckIndexes: index out of range" );
714 int c_removed, c_unique;
722 for ( i = 0 ; i < tri->
numVerts ; i++ ) {
732 for ( i = 0 ; i < tri->
numVerts ; i++ ) {
736 hashKey = hash.GenerateKey( v1->
xyz );
737 for ( j = hash.First( hashKey ); j >= 0; j = hash.Next( j ) ) {
739 if ( v2->
xyz[0] == v1->
xyz[0]
740 && v2->
xyz[1] == v1->
xyz[1]
741 && v2->
xyz[2] == v1->
xyz[2] ) {
750 hash.Add( hashKey, i );
774 remap = R_CreateSilRemap( tri );
793 int *remap = (
int *) _alloca16( tri->
numVerts *
sizeof( remap[0] ) );
796 for ( i = 0; i < tri->
numVerts; i++ ) {
806 int * tempDupVerts = (
int *) _alloca16( tri->
numVerts * 2 *
sizeof( tempDupVerts[0] ) );
808 for ( i = 0; i < tri->
numVerts; i++ ) {
809 if ( remap[i] != i ) {
841 for (
int i = 0; i < tri->
numIndexes; i+= 3, planes++ ) {
854 d1[0] = v2->
x - v1->
x;
855 d1[1] = v2->
y - v1->
y;
856 d1[2] = v2->
z - v1->
z;
858 d2[0] = v3->
x - v1->
x;
859 d2[1] = v3->
y - v1->
y;
860 d2[2] = v3->
z - v1->
z;
862 normal[0] = d2.
y * d1.
z - d2.
z * d1.
y;
863 normal[1] = d2.
z * d1.
x - d2.
x * d1.
z;
864 normal[2] = d2.
x * d1.
y - d2.
y * d1.
x;
866 float sqrLength, invLength;
868 sqrLength = normal.
x * normal.
x + normal.
y * normal.
y + normal.
z * normal.
z;
871 (*planes)[0] = normal[0] * invLength;
872 (*planes)[1] = normal[1] * invLength;
873 (*planes)[2] = normal[2] * invLength;
895 for ( i = 0 ; i < tri->
numVerts ; i++ ) {
906 for ( i = 0 ; i < tri->
numIndexes ; i += 3, planes++ ) {
907 for ( j = 0 ; j < 3 ; j++ ) {
925 static int c_duplicatedEdges, c_tripledEdges;
927 static void R_DefineEdge(
int v1,
int v2,
int planeNum ) {
937 if ( silEdges[i].v1 == v1 && silEdges[i].v2 == v2 ) {
942 if ( silEdges[i].v2 == v1 && silEdges[i].v1 == v2 ) {
943 if ( silEdges[i].p2 != numPlanes ) {
949 silEdges[
i].
p2 = planeNum;
956 if ( numSilEdges == MAX_SIL_EDGES ) {
961 silEdgeHash.
Add( hashKey, numSilEdges );
963 silEdges[numSilEdges].
p1 = planeNum;
964 silEdges[numSilEdges].
p2 = numPlanes;
965 silEdges[numSilEdges].
v1 =
v1;
966 silEdges[numSilEdges].
v2 =
v2;
976 static int SilEdgeSort(
const void *
a,
const void *
b ) {
1008 omitCoplanarEdges =
false;
1013 silEdgeHash.
Clear();
1014 numPlanes = numTris;
1016 c_duplicatedEdges = 0;
1019 for ( i = 0 ; i < numTris ; i++ ) {
1027 R_DefineEdge( i1, i2, i );
1028 R_DefineEdge( i2, i3, i );
1029 R_DefineEdge( i3, i1, i );
1032 if ( c_duplicatedEdges || c_tripledEdges ) {
1033 common->
DWarning(
"%i duplicated edge directions, %i tripled edges", c_duplicatedEdges, c_tripledEdges );
1043 int c_coplanarCulled;
1045 c_coplanarCulled = 0;
1046 if ( omitCoplanarEdges ) {
1047 for ( i = 0 ; i < numSilEdges ; i++ ) {
1054 if ( silEdges[i].p2 == numPlanes ) {
1058 base = silEdges[
i].
p1 * 3;
1066 base = silEdges[
i].
p2 * 3;
1067 for ( j = 0 ; j < 3 ; j++ ) {
1077 memmove( &silEdges[i], &silEdges[i+1], (numSilEdges-i-1) *
sizeof( silEdges[i] ) );
1083 if ( c_coplanarCulled ) {
1084 c_coplanarSilEdges += c_coplanarCulled;
1089 c_totalSilEdges += numSilEdges;
1092 qsort( silEdges, numSilEdges,
sizeof( silEdges[0] ), SilEdgeSort );
1100 for ( i = 0 ; i < numSilEdges ; i++ ) {
1101 if ( silEdges[i].p2 == numPlanes ) {
1116 memcpy( tri->
silEdges, silEdges, numSilEdges *
sizeof( tri->
silEdges[0] ) );
1126 static bool R_FaceNegativePolarity(
const srfTriangles_t *tri,
int firstIndex ) {
1135 d0[3] = b->
st[0] - a->
st[0];
1136 d0[4] = b->
st[1] - a->
st[1];
1138 d1[3] = c->
st[0] - a->
st[0];
1139 d1[4] = c->
st[1] - a->
st[1];
1141 area = d0[3] * d1[4] - d0[4] * d1[3];
1161 int c_textureDegenerateFaces;
1162 int c_positive, c_negative;
1171 c_textureDegenerateFaces = 0;
1177 ft = &faceTangents[i/3];
1183 d0[0] = b->
xyz[0] - a->
xyz[0];
1184 d0[1] = b->
xyz[1] - a->
xyz[1];
1185 d0[2] = b->
xyz[2] - a->
xyz[2];
1186 d0[3] = b->
st[0] - a->
st[0];
1187 d0[4] = b->
st[1] - a->
st[1];
1189 d1[0] = c->
xyz[0] - a->
xyz[0];
1190 d1[1] = c->
xyz[1] - a->
xyz[1];
1191 d1[2] = c->
xyz[2] - a->
xyz[2];
1192 d1[3] = c->
st[0] - a->
st[0];
1193 d1[4] = c->
st[1] - a->
st[1];
1195 area = d0[3] * d1[4] - d0[4] * d1[3];
1196 if ( fabs( area ) < 1e-20
f ) {
1201 c_textureDegenerateFaces++;
1204 if ( area > 0.0
f ) {
1214 float inva = area < 0.0f ? -1 : 1;
1216 temp[0] = (d0[0] * d1[4] - d0[4] * d1[0]) * inva;
1217 temp[1] = (d0[1] * d1[4] - d0[4] * d1[1]) * inva;
1218 temp[2] = (d0[2] * d1[4] - d0[4] * d1[2]) * inva;
1222 temp[0] = (d0[3] * d1[0] - d0[0] * d1[3]) * inva;
1223 temp[1] = (d0[3] * d1[1] - d0[1] * d1[3]) * inva;
1224 temp[2] = (d0[3] * d1[2] - d0[2] * d1[3]) * inva;
1228 temp[0] = (d0[0] * d1[4] - d0[4] * d1[0]);
1229 temp[1] = (d0[1] * d1[4] - d0[4] * d1[1]);
1230 temp[2] = (d0[2] * d1[4] - d0[4] * d1[2]);
1234 temp[0] = (d0[3] * d1[0] - d0[0] * d1[3]);
1235 temp[1] = (d0[3] * d1[1] - d0[1] * d1[3]);
1236 temp[2] = (d0[3] * d1[2] - d0[2] * d1[3]);
1264 bool polarityUsed[2];
1275 memset( tverts, 0, tri->
numVerts *
sizeof( *tverts ) );
1283 polarity = R_FaceNegativePolarity( tri, i );
1284 for ( j = 0 ; j < 3 ; j++ ) {
1291 for ( i = 0 ; i < tri->
numVerts ; i++ ) {
1302 if ( totalVerts == tri->
numVerts ) {
1309 #ifdef USE_TRI_DATA_ALLOCATOR
1315 triVertexAllocator.
Free( oldVerts );
1320 for ( i = 0 ; i < tri->
numVerts ; i++ ) {
1333 R_FaceNegativePolarity( tri, 3*(i/3) ) ) {
1382 R_DeriveFaceTangents( tri, faceTangents );
1385 for ( i = 0 ; i < tri->
numVerts ; i++ ) {
1392 ft = &faceTangents[i/3];
1395 for ( j = 0 ; j < 3 ; j++ ) {
1425 for ( i = 0 ; i < tri->
numVerts ; i++ ) {
1427 for ( j = 0 ; j < 2 ; j++ ) {
1439 static ID_INLINE
void VectorNormalizeFast2(
const idVec3 &
v,
idVec3 &out) {
1442 ilength =
idMath::RSqrt( v[0]*v[0] + v[1]*v[1] + v[2]*v[2] );
1443 out[0] = v[0] * ilength;
1444 out[1] = v[1] * ilength;
1445 out[2] = v[2] * ilength;
1460 static int IndexSort(
const void *a,
const void *b ) {
1479 qsort( ind, tri->
numIndexes,
sizeof( *ind ), IndexSort );
1482 memset( dt, 0, tri->
numVerts *
sizeof( dt[0] ) );
1490 idVec3 normal, tangent, bitangent;
1498 c = tri->
verts + i3;
1500 d0[0] = b->
xyz[0] - a->
xyz[0];
1501 d0[1] = b->
xyz[1] - a->
xyz[1];
1502 d0[2] = b->
xyz[2] - a->
xyz[2];
1503 d0[3] = b->
st[0] - a->
st[0];
1504 d0[4] = b->
st[1] - a->
st[1];
1506 d1[0] = c->
xyz[0] - a->
xyz[0];
1507 d1[1] = c->
xyz[1] - a->
xyz[1];
1508 d1[2] = c->
xyz[2] - a->
xyz[2];
1509 d1[3] = c->
st[0] - a->
st[0];
1510 d1[4] = c->
st[1] - a->
st[1];
1512 normal[0] = ( d1[1] * d0[2] - d1[2] * d0[1] );
1513 normal[1] = ( d1[2] * d0[0] - d1[0] * d0[2] );
1514 normal[2] = ( d1[0] * d0[1] - d1[1] * d0[0] );
1516 float area = normal.
Length();
1519 if ( area < maxArea ) {
1524 if ( i1 == vertNum ) {
1525 dt[vertNum].
v2 =
i2;
1526 dt[vertNum].
v3 = i3;
1527 }
else if ( i2 == vertNum ) {
1528 dt[vertNum].
v2 = i3;
1529 dt[vertNum].
v3 =
i1;
1531 dt[vertNum].
v2 =
i1;
1532 dt[vertNum].
v3 =
i2;
1536 if ( len < 0.001
f ) {
1542 area = d0[3] * d1[4] - d0[4] * d1[3];
1544 tangent[0] = ( d0[0] * d1[4] - d0[4] * d1[0] );
1545 tangent[1] = ( d0[1] * d1[4] - d0[4] * d1[1] );
1546 tangent[2] = ( d0[2] * d1[4] - d0[4] * d1[2] );
1548 if ( len < 0.001
f ) {
1553 bitangent[0] = ( d0[3] * d1[0] - d0[0] * d1[3] );
1554 bitangent[1] = ( d0[3] * d1[1] - d0[1] * d1[3] );
1555 bitangent[2] = ( d0[3] * d1[2] - d0[2] * d1[3] );
1556 len = bitangent.
Length();
1557 if ( len < 0.001
f ) {
1560 #ifdef DERIVE_UNSMOOTHED_BITANGENT
1589 for (
int i = 0 ; i < tri->
numVerts ; i++ ) {
1599 d0[0] = b->
xyz[0] - a->
xyz[0];
1600 d0[1] = b->
xyz[1] - a->
xyz[1];
1601 d0[2] = b->
xyz[2] - a->
xyz[2];
1602 d0[3] = b->
st[0] - a->
st[0];
1603 d0[4] = b->
st[1] - a->
st[1];
1605 d1[0] = c->
xyz[0] - a->
xyz[0];
1606 d1[1] = c->
xyz[1] - a->
xyz[1];
1607 d1[2] = c->
xyz[2] - a->
xyz[2];
1608 d1[3] = c->
st[0] - a->
st[0];
1609 d1[4] = c->
st[1] - a->
st[1];
1619 #ifdef DERIVE_UNSMOOTHED_BITANGENT
1677 for ( i = 0; i < tri->
numVerts; i++ ) {
1687 idVec3 temp, normal, tangents[2];
1693 d0[0] = b->
xyz[0] - a->
xyz[0];
1694 d0[1] = b->
xyz[1] - a->
xyz[1];
1695 d0[2] = b->
xyz[2] - a->
xyz[2];
1696 d0[3] = b->
st[0] - a->
st[0];
1697 d0[4] = b->
st[1] - a->
st[1];
1699 d1[0] = c->
xyz[0] - a->
xyz[0];
1700 d1[1] = c->
xyz[1] - a->
xyz[1];
1701 d1[2] = c->
xyz[2] - a->
xyz[2];
1702 d1[3] = c->
st[0] - a->
st[0];
1703 d1[4] = c->
st[1] - a->
st[1];
1706 temp[0] = d1[1] * d0[2] - d1[2] * d0[1];
1707 temp[1] = d1[2] * d0[0] - d1[0] * d0[2];
1708 temp[2] = d1[0] * d0[1] - d1[1] * d0[0];
1709 VectorNormalizeFast2( temp, normal );
1712 float area = d0[3] * d1[4] - d0[4] * d1[3];
1713 float inva = area < 0.0f ? -1 : 1;
1715 temp[0] = (d0[0] * d1[4] - d0[4] * d1[0]) * inva;
1716 temp[1] = (d0[1] * d1[4] - d0[4] * d1[1]) * inva;
1717 temp[2] = (d0[2] * d1[4] - d0[4] * d1[2]) * inva;
1718 VectorNormalizeFast2( temp, tangents[0] );
1720 temp[0] = (d0[3] * d1[0] - d0[0] * d1[3]) * inva;
1721 temp[1] = (d0[3] * d1[1] - d0[1] * d1[3]) * inva;
1722 temp[2] = (d0[3] * d1[2] - d0[2] * d1[3]) * inva;
1723 VectorNormalizeFast2( temp, tangents[1] );
1725 temp[0] = (d0[0] * d1[4] - d0[4] * d1[0]);
1726 temp[1] = (d0[1] * d1[4] - d0[4] * d1[1]);
1727 temp[2] = (d0[2] * d1[4] - d0[4] * d1[2]);
1728 VectorNormalizeFast2( temp, tangents[0] );
1730 temp[0] = (d0[3] * d1[0] - d0[0] * d1[3]);
1731 temp[1] = (d0[3] * d1[1] - d0[1] * d1[3]);
1732 temp[2] = (d0[3] * d1[2] - d0[2] * d1[3]);
1733 VectorNormalizeFast2( temp, tangents[1] );
1737 for (
int j = 0 ; j < 3 ; j++ ) {
1739 vert->normal += normal;
1740 vert->tangents[0] += tangents[0];
1741 vert->tangents[1] += tangents[1];
1745 planes->
Normal() = normal;
1756 for ( i = 0; i < tri->
numVerts; i++ ) {
1774 verts[dupVerts[i*2+0]].
normal += verts[dupVerts[i*2+1]].
normal;
1779 verts[dupVerts[i*2+1]].
normal = verts[dupVerts[i*2+0]].
normal;
1811 for ( i = 0 ; i < tri->
numVerts ; i++ ) {
1817 for (
int j = 0 ; j < 2 ; j++ ) {
1853 for ( r = 0 ; r < 3 ; r++ ) {
1857 for ( j = i + 3 ; j < tri->
numIndexes ; j+=3 ) {
1870 common->
Printf(
"removed %i duplicated triangles\n", c_removed );
1893 if ( a == b || a == c || b == c ) {
1907 common->
Printf(
"removed %i degenerate triangles\n", c_removed );
1932 if ( c_degenerate ) {
1953 common->
Error(
"R_RemoveUnusedVerts: bad index" );
1960 common->
Error(
"R_RemoveUnusedVerts: bad index" );
1967 for ( i = 0 ; i < tri->
numVerts ; i++ ) {
1984 for ( i = 0 ; i < tri->
numVerts ; i++ ) {
2015 for ( i = 0 ; i < numSurfaces ; i++ ) {
2028 for ( i = 0 ; i < numSurfaces ; i++ ) {
2075 for ( i = 0 ; i < tri->
numVerts ; i++ ) {
2080 for ( i = 0 ; i < tri->
numIndexes ; i+= 3 ) {
2109 if ( identifySilEdges ) {
2114 R_DuplicateMirroredVertexes( tri );
2123 if ( useUnsmoothedTangents ) {
2126 }
else if ( !createNormals ) {
2152 memset( &tri, 0,
sizeof( tri ) );
2177 R_DuplicateMirroredVertexes( &tri );
2181 if ( useUnsmoothedTangents ) {
2271 total +=
sizeof( *deformInfo );
int R_TriSurfMemory(const srfTriangles_t *tri)
int GetNumFreeBlocks(void) const
void R_FreeDeferredTriSurfs(frameData_t *frame)
assert(prefInfo.fullscreenBtn)
void R_FreeStaticTriSurf(srfTriangles_t *tri)
bool FromPoints(const idVec3 &p1, const idVec3 &p2, const idVec3 &p3, bool fixDegenerate=true)
const idVec3 & Normal(void) const
int Next(const int index) const
void R_PurgeTriSurfData(frameData_t *frame)
void R_ReallyFreeStaticTriSurf(srfTriangles_t *tri)
void R_ResizeStaticTriSurfShadowVerts(srfTriangles_t *tri, int numVerts)
void R_CreateVertexNormals(srfTriangles_t *tri)
void R_ReferenceStaticTriSurfVerts(srfTriangles_t *tri, const srfTriangles_t *reference)
virtual void VPCALL DeriveTangents(idPlane *planes, idDrawVert *verts, const int numVerts, const int *indexes, const int numIndexes)=0
srfTriangles_t * R_CopyStaticTriSurf(const srfTriangles_t *tri)
type * Alloc(const int num)
void R_ReferenceStaticTriSurfIndexes(srfTriangles_t *tri, const srfTriangles_t *reference)
void R_RangeCheckIndexes(const srfTriangles_t *tri)
float Distance(const idVec3 &v) const
void R_CleanupTriangles(srfTriangles_t *tri, bool createNormals, bool identifySilEdges, bool useUnsmoothedTangents)
void R_CheckStaticTriSurfMemory(const srfTriangles_t *tri)
int GetBaseBlockMemory(void) const
void R_BuildDominantTris(srfTriangles_t *tri)
bool facePlanesCalculated
type * Resize(type *ptr, const int num)
void R_ResizeStaticTriSurfVerts(srfTriangles_t *tri, int numVerts)
srfTriangles_t * R_MergeTriangles(const srfTriangles_t *tri1, const srfTriangles_t *tri2)
struct vertCache_s * ambientCache
void R_FreeStaticTriSurfSilIndexes(srfTriangles_t *tri)
void R_DeriveTangents(srfTriangles_t *tri, bool allocFacePlanes)
void SetLockMemory(bool lock)
int GetNumEmptyBaseBlocks(void) const
srfTriangles_t * R_AllocStaticTriSurf(void)
int First(const int key) const
struct srfTriangles_s * ambientSurface
void R_IdentifySilEdges(srfTriangles_t *tri, bool omitCoplanarEdges)
GLfloat GLfloat GLfloat v2
void R_ReverseTriangles(srfTriangles_t *tri)
float normalizationScale[3]
virtual void VPCALL MinMax(float &min, float &max, const float *src, const int count)=0
idCVar r_useSilRemap("r_useSilRemap","1", CVAR_RENDERER|CVAR_BOOL,"consider verts with the same XYZ, but different ST the same for shadows")
srfTriangles_t * firstDeferredFreeTriSurf
void R_AllocStaticTriSurfShadowVerts(srfTriangles_t *tri, int numVerts)
const int SILEDGE_HASH_SIZE
idVec3 vec3_origin(0.0f, 0.0f, 0.0f)
virtual void VPCALL DeriveTriPlanes(idPlane *planes, const idDrawVert *verts, const int numVerts, const int *indexes, const int numIndexes)=0
virtual void virtual void virtual void DWarning(const char *fmt,...) id_attribute((format(printf
void R_AllocStaticTriSurfPlanes(srfTriangles_t *tri, int numIndexes)
const char * CheckMemory(const type *ptr) const
void R_RemoveDuplicatedTriangles(srfTriangles_t *tri)
#define LIGHT_TRIS_DEFERRED
struct vertCache_s * lightingCache
int GetAllocCount(void) const
srfTriangles_t * R_MergeSurfaceList(const srfTriangles_t **surfaces, int numSurfaces)
shadowCache_t * shadowVertexes
struct vertCache_s * shadowCache
GLubyte GLubyte GLubyte a
void R_AllocStaticTriSurfIndexes(srfTriangles_t *tri, int numIndexes)
virtual void Printf(const char *fmt,...) id_attribute((format(printf
virtual void VPCALL DeriveUnsmoothedTangents(idDrawVert *verts, const dominantTri_s *dominantTris, const int numVerts)=0
virtual void VPCALL Memcpy(void *dst, const void *src, const int count)=0
void R_ShowTriSurfMemory_f(const idCmdArgs &args)
int GenerateKey(const char *string, bool caseSensitive=true) const
void R_FreeStaticTriSurfVertexCaches(srfTriangles_t *tri)
void FreeEmptyBaseBlocks(void)
GLfloat GLfloat GLfloat GLfloat v3
GLdouble GLdouble GLdouble r
void R_DeriveTangentsWithoutNormals(srfTriangles_t *tri)
int R_DeformInfoMemoryUsed(deformInfo_t *deformInfo)
void R_TestDegenerateTextureSpace(srfTriangles_t *tri)
void R_RemoveDegenerateTriangles(srfTriangles_t *tri)
void R_ShutdownTriSurfData(void)
void * R_ClearedStaticAlloc(int bytes)
void * R_StaticAlloc(int bytes)
virtual void VPCALL NormalizeTangents(idDrawVert *verts, const int numVerts)=0
void R_FreeDeformInfo(deformInfo_t *deformInfo)
void R_CreateDupVerts(srfTriangles_t *tri)
void R_ResizeStaticTriSurfIndexes(srfTriangles_t *tri, int numIndexes)
void R_InitTriSurfData(void)
idVertexCache vertexCache
void R_DeriveFacePlanes(srfTriangles_t *tri)
struct srfTriangles_s * nextDeferredFree
deformInfo_t * R_BuildDeformInfo(int numVerts, const idDrawVert *verts, int numIndexes, const int *indexes, bool useUnsmoothedTangents)
void R_CreateSilIndexes(srfTriangles_t *tri)
void Add(const int key, const int index)
int GetFreeBlockMemory(void) const
void R_AllocStaticTriSurfVerts(srfTriangles_t *tri, int numVerts)
void R_DeriveUnsmoothedTangents(srfTriangles_t *tri)
void Free(vertCache_t *buffer)
srfTriangles_t * lastDeferredFreeTriSurf
struct vertCache_s * indexCache
struct srfTriangles_s srfTriangles_t
void R_StaticFree(void *data)
virtual void Error(const char *fmt,...) id_attribute((format(printf
static float RSqrt(float x)
void R_RemoveUnusedVerts(srfTriangles_t *tri)
void FitThroughPoint(const idVec3 &p)
idSIMDProcessor * SIMDProcessor
void R_BoundTriSurf(srfTriangles_t *tri)
dominantTri_t * dominantTris