V2 spatial partition, and all the pipeline changes that go with it.

Note: Deferred mode is not finished, and thus broken. Don't use!
This commit is contained in:
Shyotl
2011-03-06 05:47:26 -06:00
parent 9f434ab384
commit 996aaf6345
57 changed files with 1987 additions and 660 deletions

View File

@@ -60,6 +60,7 @@ LLSurfacePatch::LLSurfacePatch() :
mHeightsGenerated(FALSE),
mDataOffset(0),
mDataZ(NULL),
mDataNorm(NULL),
mVObjp(NULL),
mOriginRegion(0.f, 0.f, 0.f),
mCenterRegion(0.f, 0.f, 0.f),
@@ -712,17 +713,7 @@ BOOL LLSurfacePatch::updateTexture()
if (mVObjp)
{
mVObjp->dirtyGeom();
}
updateCompositionStats();
F32 tex_patch_size = meters_per_grid*grids_per_patch_edge;
if (comp->generateTexture((F32)origin_region[VX], (F32)origin_region[VY],
tex_patch_size, tex_patch_size))
{
mSTexUpdate = FALSE;
// Also generate the water texture
mSurfacep->generateWaterTexture((F32)origin_region.mdV[VX], (F32)origin_region.mdV[VY],
tex_patch_size, tex_patch_size);
gPipeline.markGLRebuild(mVObjp);
return TRUE;
}
}
@@ -735,6 +726,28 @@ BOOL LLSurfacePatch::updateTexture()
}
}
void LLSurfacePatch::updateGL()
{
F32 meters_per_grid = getSurface()->getMetersPerGrid();
F32 grids_per_patch_edge = (F32)getSurface()->getGridsPerPatchEdge();
LLViewerRegion *regionp = getSurface()->getRegion();
LLVector3d origin_region = getOriginGlobal() - getSurface()->getOriginGlobal();
LLVLComposition* comp = regionp->getComposition();
updateCompositionStats();
F32 tex_patch_size = meters_per_grid*grids_per_patch_edge;
if (comp->generateTexture((F32)origin_region[VX], (F32)origin_region[VY],
tex_patch_size, tex_patch_size))
{
mSTexUpdate = FALSE;
// Also generate the water texture
mSurfacep->generateWaterTexture((F32)origin_region.mdV[VX], (F32)origin_region.mdV[VY],
tex_patch_size, tex_patch_size);
}
}
void LLSurfacePatch::dirtyZ()
{