Huge renderer update (WIP). Still plenty to do, especially pertaining to UI.
-Nametag bubble visbility is oddly inconsistent. May vanish with future planned UI merges... -VBOs are PAINFULLY slow on ATI hardware. This repos self-compiled davep/shining-fixes branch, so I'll leave the ball in LL's court for now regarding that.
This commit is contained in:
@@ -1274,7 +1274,7 @@ void LLVOSky::updateDummyVertexBuffer()
|
||||
LLStrider<LLVector3> vertices ;
|
||||
mFace[FACE_DUMMY]->getVertexBuffer()->getVertexStrider(vertices, 0);
|
||||
*vertices = mCameraPosAgent ;
|
||||
mFace[FACE_DUMMY]->getVertexBuffer()->setBuffer(0) ;
|
||||
mFace[FACE_DUMMY]->getVertexBuffer()->flush();
|
||||
}
|
||||
//----------------------------------
|
||||
//end of fake vertex buffer updating
|
||||
@@ -1357,7 +1357,7 @@ BOOL LLVOSky::updateGeometry(LLDrawable *drawable)
|
||||
*indicesp++ = index_offset + 3;
|
||||
*indicesp++ = index_offset + 2;
|
||||
|
||||
buff->setBuffer(0);
|
||||
buff->flush();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1521,7 +1521,7 @@ BOOL LLVOSky::updateHeavenlyBodyGeometry(LLDrawable *drawable, const S32 f, cons
|
||||
*indicesp++ = index_offset + 2;
|
||||
*indicesp++ = index_offset + 3;
|
||||
|
||||
facep->getVertexBuffer()->setBuffer(0);
|
||||
facep->getVertexBuffer()->flush();
|
||||
|
||||
if (is_sun)
|
||||
{
|
||||
@@ -2035,7 +2035,7 @@ void LLVOSky::updateReflectionGeometry(LLDrawable *drawable, F32 H,
|
||||
}
|
||||
}
|
||||
|
||||
face->getVertexBuffer()->setBuffer(0);
|
||||
face->getVertexBuffer()->flush();
|
||||
}
|
||||
|
||||
|
||||
@@ -2045,9 +2045,12 @@ void LLVOSky::updateFog(const F32 distance)
|
||||
{
|
||||
if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FOG))
|
||||
{
|
||||
glFogf(GL_FOG_DENSITY, 0);
|
||||
glFogfv(GL_FOG_COLOR, (F32 *) &LLColor4::white.mV);
|
||||
glFogf(GL_FOG_END, 1000000.f);
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glFogf(GL_FOG_DENSITY, 0);
|
||||
glFogfv(GL_FOG_COLOR, (F32 *) &LLColor4::white.mV);
|
||||
glFogf(GL_FOG_END, 1000000.f);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2117,7 +2120,10 @@ void LLVOSky::updateFog(const F32 distance)
|
||||
if (camera_height > water_height)
|
||||
{
|
||||
LLColor4 fog(render_fog_color);
|
||||
glFogfv(GL_FOG_COLOR, fog.mV);
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glFogfv(GL_FOG_COLOR, fog.mV);
|
||||
}
|
||||
mGLFogCol = fog;
|
||||
|
||||
if (hide_clip_plane)
|
||||
@@ -2125,13 +2131,19 @@ void LLVOSky::updateFog(const F32 distance)
|
||||
// For now, set the density to extend to the cull distance.
|
||||
const F32 f_log = 2.14596602628934723963618357029f; // sqrt(fabs(log(0.01f)))
|
||||
fog_density = f_log/fog_distance;
|
||||
glFogi(GL_FOG_MODE, GL_EXP2);
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glFogi(GL_FOG_MODE, GL_EXP2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const F32 f_log = 4.6051701859880913680359829093687f; // fabs(log(0.01f))
|
||||
fog_density = (f_log)/fog_distance;
|
||||
glFogi(GL_FOG_MODE, GL_EXP);
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glFogi(GL_FOG_MODE, GL_EXP);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2151,23 +2163,29 @@ void LLVOSky::updateFog(const F32 distance)
|
||||
fogCol.setAlpha(1);
|
||||
|
||||
// set the gl fog color
|
||||
glFogfv(GL_FOG_COLOR, (F32 *) &fogCol.mV);
|
||||
mGLFogCol = fogCol;
|
||||
|
||||
// set the density based on what the shaders use
|
||||
fog_density = water_fog_density * gSavedSettings.getF32("WaterGLFogDensityScale");
|
||||
glFogi(GL_FOG_MODE, GL_EXP2);
|
||||
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
glFogfv(GL_FOG_COLOR, (F32 *) &fogCol.mV);
|
||||
glFogi(GL_FOG_MODE, GL_EXP2);
|
||||
}
|
||||
}
|
||||
|
||||
mFogColor = sky_fog_color;
|
||||
mFogColor.setAlpha(1);
|
||||
LLGLSFog gls_fog;
|
||||
LLDrawPoolWater::sWaterFogEnd = fog_distance*2.2f;
|
||||
|
||||
glFogf(GL_FOG_END, fog_distance*2.2f);
|
||||
|
||||
glFogf(GL_FOG_DENSITY, fog_density);
|
||||
|
||||
glHint(GL_FOG_HINT, GL_NICEST);
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
LLGLSFog gls_fog;
|
||||
glFogf(GL_FOG_END, fog_distance*2.2f);
|
||||
glFogf(GL_FOG_DENSITY, fog_density);
|
||||
glHint(GL_FOG_HINT, GL_NICEST);
|
||||
}
|
||||
stop_glerror();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user