Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer
This commit is contained in:
@@ -77,9 +77,11 @@ LLPolyMorphData::LLPolyMorphData(const LLPolyMorphData &rhs) :
|
|||||||
{
|
{
|
||||||
const S32 numVertices = mNumIndices;
|
const S32 numVertices = mNumIndices;
|
||||||
|
|
||||||
mCoords = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a)));
|
U32 size = sizeof(LLVector4a)*numVertices;
|
||||||
mNormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a)));
|
|
||||||
mBinormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a)));
|
mCoords = static_cast<LLVector4a*>( ll_aligned_malloc_16(size) );
|
||||||
|
mNormals = static_cast<LLVector4a*>( ll_aligned_malloc_16(size) );
|
||||||
|
mBinormals = static_cast<LLVector4a*>( ll_aligned_malloc_16(size) );
|
||||||
mTexCoords = new LLVector2[numVertices];
|
mTexCoords = new LLVector2[numVertices];
|
||||||
mVertexIndices = new U32[numVertices];
|
mVertexIndices = new U32[numVertices];
|
||||||
|
|
||||||
@@ -125,9 +127,13 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
|||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// allocate vertices
|
// allocate vertices
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
mCoords = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a)));
|
|
||||||
mNormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a)));
|
U32 size = sizeof(LLVector4a)*numVertices;
|
||||||
mBinormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(numVertices * sizeof(LLVector4a)));
|
|
||||||
|
mCoords = static_cast<LLVector4a*>(ll_aligned_malloc_16(size));
|
||||||
|
mNormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(size));
|
||||||
|
mBinormals = static_cast<LLVector4a*>(ll_aligned_malloc_16(size));
|
||||||
|
|
||||||
mTexCoords = new LLVector2[numVertices];
|
mTexCoords = new LLVector2[numVertices];
|
||||||
// Actually, we are allocating more space than we need for the skiplist
|
// Actually, we are allocating more space than we need for the skiplist
|
||||||
mVertexIndices = new U32[numVertices];
|
mVertexIndices = new U32[numVertices];
|
||||||
@@ -889,17 +895,29 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
|
|||||||
norm.mul(delta_weight*maskWeight*NORMAL_SOFTEN_FACTOR);
|
norm.mul(delta_weight*maskWeight*NORMAL_SOFTEN_FACTOR);
|
||||||
scaled_normals[vert_index_mesh].add(norm);
|
scaled_normals[vert_index_mesh].add(norm);
|
||||||
norm = scaled_normals[vert_index_mesh];
|
norm = scaled_normals[vert_index_mesh];
|
||||||
|
|
||||||
|
// guard against degenerate input data before we create NaNs below!
|
||||||
|
//
|
||||||
norm.normalize3fast();
|
norm.normalize3fast();
|
||||||
normals[vert_index_mesh] = norm;
|
normals[vert_index_mesh] = norm;
|
||||||
|
|
||||||
// calculate new binormals
|
// calculate new binormals
|
||||||
LLVector4a binorm = mMorphData->mBinormals[vert_index_morph];
|
LLVector4a binorm = mMorphData->mBinormals[vert_index_morph];
|
||||||
|
|
||||||
|
// guard against degenerate input data before we create NaNs below!
|
||||||
|
//
|
||||||
|
if (!binorm.isFinite3() || (binorm.dot3(binorm).getF32() <= F_APPROXIMATELY_ZERO))
|
||||||
|
{
|
||||||
|
binorm.set(1,0,0,1);
|
||||||
|
}
|
||||||
|
|
||||||
binorm.mul(delta_weight*maskWeight*NORMAL_SOFTEN_FACTOR);
|
binorm.mul(delta_weight*maskWeight*NORMAL_SOFTEN_FACTOR);
|
||||||
scaled_binormals[vert_index_mesh].add(binorm);
|
scaled_binormals[vert_index_mesh].add(binorm);
|
||||||
LLVector4a tangent;
|
LLVector4a tangent;
|
||||||
tangent.setCross3(scaled_binormals[vert_index_mesh], norm);
|
tangent.setCross3(scaled_binormals[vert_index_mesh], norm);
|
||||||
LLVector4a& normalized_binormal = binormals[vert_index_mesh];
|
LLVector4a& normalized_binormal = binormals[vert_index_mesh];
|
||||||
normalized_binormal.setCross3(norm, tangent);
|
|
||||||
|
normalized_binormal.setCross3(norm, tangent);
|
||||||
normalized_binormal.normalize3fast();
|
normalized_binormal.normalize3fast();
|
||||||
|
|
||||||
tex_coords[vert_index_mesh] += mMorphData->mTexCoords[vert_index_morph] * delta_weight * maskWeight;
|
tex_coords[vert_index_mesh] += mMorphData->mTexCoords[vert_index_morph] * delta_weight * maskWeight;
|
||||||
|
|||||||
@@ -636,7 +636,10 @@ public:
|
|||||||
parent = node->getOctParent();
|
parent = node->getOctParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
node->insert(data);
|
if(node != this)
|
||||||
|
{
|
||||||
|
node->insert(data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -858,14 +858,25 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
|
|||||||
{ //dump every 128 lines
|
{ //dump every 128 lines
|
||||||
|
|
||||||
LL_WARNS("ShaderLoading") << "\n" << ostr.str() << llendl;
|
LL_WARNS("ShaderLoading") << "\n" << ostr.str() << llendl;
|
||||||
ostr.str("");
|
ostr = std::stringstream();
|
||||||
ostr.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LL_WARNS("ShaderLoading") << "\n" << ostr.str() << llendl;
|
LL_WARNS("ShaderLoading") << "\n" << ostr.str() << llendl;
|
||||||
#endif // LL_WINDOWS
|
#else
|
||||||
|
std::string str;
|
||||||
|
|
||||||
|
for (GLuint i = 0; i < count; i++) {
|
||||||
|
str.append(text[i]);
|
||||||
|
|
||||||
|
if (i % 128 == 0)
|
||||||
|
{
|
||||||
|
LL_WARNS("ShaderLoading") << str << llendl;
|
||||||
|
str = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
glDeleteObjectARB(ret); //no longer need handle
|
glDeleteObjectARB(ret); //no longer need handle
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,11 @@ void LFSimFeatureHandler::setSupportedFeatures()
|
|||||||
region->getSimulatorFeatures(info);
|
region->getSimulatorFeatures(info);
|
||||||
//if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) // Non-SL specific sim features
|
//if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) // Non-SL specific sim features
|
||||||
{
|
{
|
||||||
mSupportsExport = info.has("ExportSupported");
|
// For definition of OpenSimExtras please see
|
||||||
|
// http://opensimulator.org/wiki/SimulatorFeatures_Extras
|
||||||
|
mSupportsExport = info["OpenSimExtras"]["ExportSupported"].asBoolean();
|
||||||
|
mMapServerURL = info["OpenSimExtras"]["map-server-url"].asString();
|
||||||
|
mSearchURL = info["OpenSimExtras"]["search-server-url"].asString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,10 +60,14 @@ public:
|
|||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
bool simSupportsExport() const { return mSupportsExport; }
|
bool simSupportsExport() const { return mSupportsExport; }
|
||||||
|
std::string mapServerURL() const { return mMapServerURL; }
|
||||||
|
std::string searchURL() const { return mSearchURL; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// SignaledTypes
|
// SignaledTypes
|
||||||
SignaledType<bool> mSupportsExport;
|
SignaledType<bool> mSupportsExport;
|
||||||
|
std::string mMapServerURL;
|
||||||
|
std::string mSearchURL;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //LFSIMFEATUREHANDLER_H
|
#endif //LFSIMFEATUREHANDLER_H
|
||||||
|
|||||||
@@ -290,7 +290,6 @@ public:
|
|||||||
NEARBY_LIGHT = 0x00200000, // In gPipeline.mNearbyLightSet
|
NEARBY_LIGHT = 0x00200000, // In gPipeline.mNearbyLightSet
|
||||||
BUILT = 0x00400000,
|
BUILT = 0x00400000,
|
||||||
FORCE_INVISIBLE = 0x00800000, // stay invis until CLEAR_INVISIBLE is set (set of orphaned)
|
FORCE_INVISIBLE = 0x00800000, // stay invis until CLEAR_INVISIBLE is set (set of orphaned)
|
||||||
CLEAR_INVISIBLE = 0x01000000, // clear FORCE_INVISIBLE next draw frame
|
|
||||||
REBUILD_SHADOW = 0x02000000,
|
REBUILD_SHADOW = 0x02000000,
|
||||||
HAS_ALPHA = 0x04000000,
|
HAS_ALPHA = 0x04000000,
|
||||||
RIGGED = 0x08000000,
|
RIGGED = 0x08000000,
|
||||||
|
|||||||
@@ -112,41 +112,6 @@ void planarProjection(LLVector2 &tc, const LLVector4a& normal,
|
|||||||
tc.mV[0] = 1.0f+((binormal.dot3(vec).getF32())*2 - 0.5f);
|
tc.mV[0] = 1.0f+((binormal.dot3(vec).getF32())*2 - 0.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sphericalProjection(LLVector2 &tc, const LLVector4a& normal,
|
|
||||||
const LLVector4a &mCenter, const LLVector4a& vec)
|
|
||||||
{ //BROKEN
|
|
||||||
/*tc.mV[0] = acosf(vd.mNormal * LLVector3(1,0,0))/3.14159f;
|
|
||||||
|
|
||||||
tc.mV[1] = acosf(vd.mNormal * LLVector3(0,0,1))/6.284f;
|
|
||||||
if (vd.mNormal.mV[1] > 0)
|
|
||||||
{
|
|
||||||
tc.mV[1] = 1.0f-tc.mV[1];
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
void cylindricalProjection(LLVector2 &tc, const LLVector4a& normal, const LLVector4a &mCenter, const LLVector4a& vec)
|
|
||||||
{ //BROKEN
|
|
||||||
/*LLVector3 binormal;
|
|
||||||
float d = vd.mNormal * LLVector3(1,0,0);
|
|
||||||
if (d >= 0.5f || d <= -0.5f)
|
|
||||||
{
|
|
||||||
binormal = LLVector3(0,1,0);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
binormal = LLVector3(1,0,0);
|
|
||||||
}
|
|
||||||
LLVector3 tangent = binormal % vd.mNormal;
|
|
||||||
|
|
||||||
tc.mV[1] = -((tangent*vec)*2 - 0.5f);
|
|
||||||
|
|
||||||
tc.mV[0] = acosf(vd.mNormal * LLVector3(1,0,0))/6.284f;
|
|
||||||
|
|
||||||
if (vd.mNormal.mV[1] < 0)
|
|
||||||
{
|
|
||||||
tc.mV[0] = 1.0f-tc.mV[0];
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////
|
////////////////////
|
||||||
//
|
//
|
||||||
// LLFace implementation
|
// LLFace implementation
|
||||||
@@ -942,20 +907,10 @@ LLVector2 LLFace::surfaceToTexture(LLVector2 surface_coord, LLVector3 position,
|
|||||||
volume_normal.load3(mDrawablep->getVOVolume()->agentDirectionToVolume(normal).mV);
|
volume_normal.load3(mDrawablep->getVOVolume()->agentDirectionToVolume(normal).mV);
|
||||||
volume_normal.normalize3fast();
|
volume_normal.normalize3fast();
|
||||||
|
|
||||||
switch (texgen)
|
if (texgen == LLTextureEntry::TEX_GEN_PLANAR)
|
||||||
{
|
{
|
||||||
case LLTextureEntry::TEX_GEN_PLANAR:
|
|
||||||
planarProjection(tc, volume_normal, center, volume_position);
|
planarProjection(tc, volume_normal, center, volume_position);
|
||||||
break;
|
}
|
||||||
case LLTextureEntry::TEX_GEN_SPHERICAL:
|
|
||||||
sphericalProjection(tc, volume_normal, center, volume_position);
|
|
||||||
break;
|
|
||||||
case LLTextureEntry::TEX_GEN_CYLINDRICAL:
|
|
||||||
cylindricalProjection(tc, volume_normal, center, volume_position);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mTextureMatrix) // if we have a texture matrix, use it
|
if (mTextureMatrix) // if we have a texture matrix, use it
|
||||||
@@ -1248,8 +1203,8 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
|||||||
}
|
}
|
||||||
|
|
||||||
LLStrider<LLVector3> vert;
|
LLStrider<LLVector3> vert;
|
||||||
LLStrider<LLVector2> tex_coords;
|
LLStrider<LLVector2> tex_coords0;
|
||||||
LLStrider<LLVector2> tex_coords2;
|
LLStrider<LLVector2> tex_coords1;
|
||||||
LLStrider<LLVector3> norm;
|
LLStrider<LLVector3> norm;
|
||||||
LLStrider<LLColor4U> colors;
|
LLStrider<LLColor4U> colors;
|
||||||
LLStrider<LLVector3> binorm;
|
LLStrider<LLVector3> binorm;
|
||||||
@@ -1297,19 +1252,37 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
|||||||
LLColor4U color = (tep ? LLColor4U(tep->getColor()) : LLColor4U::white);
|
LLColor4U color = (tep ? LLColor4U(tep->getColor()) : LLColor4U::white);
|
||||||
|
|
||||||
if (rebuild_color) // FALSE if tep == NULL
|
if (rebuild_color) // FALSE if tep == NULL
|
||||||
{
|
{ //decide if shiny goes in alpha channel of color
|
||||||
if (tep)
|
if (tep &&
|
||||||
|
getPoolType() != LLDrawPool::POOL_ALPHA) // <--- alpha channel MUST contain transparency, not shiny
|
||||||
{
|
{
|
||||||
GLfloat alpha[4] =
|
bool shiny_in_alpha = false;
|
||||||
|
|
||||||
|
if (LLPipeline::sRenderDeferred)
|
||||||
|
{ //store shiny in alpha if we don't have a specular map
|
||||||
|
//if (!mat || mat->getSpecularID().isNull())
|
||||||
|
{
|
||||||
|
shiny_in_alpha = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
|
if(LLPipeline::sRenderBump && tep->getShiny())
|
||||||
|
{
|
||||||
|
shiny_in_alpha = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(shiny_in_alpha)
|
||||||
|
{
|
||||||
|
GLfloat alpha[4] =
|
||||||
|
{
|
||||||
0.00f,
|
0.00f,
|
||||||
0.25f,
|
0.25f,
|
||||||
0.5f,
|
0.5f,
|
||||||
0.75f
|
0.75f
|
||||||
};
|
};
|
||||||
|
|
||||||
if (getPoolType() != LLDrawPool::POOL_ALPHA && (LLPipeline::sRenderDeferred || (LLPipeline::sRenderBump && tep->getShiny())))
|
llassert(tep->getShiny() <= 3);
|
||||||
{
|
|
||||||
color.mV[3] = U8 (alpha[tep->getShiny()] * 255);
|
color.mV[3] = U8 (alpha[tep->getShiny()] * 255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1644,7 +1617,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
|||||||
|
|
||||||
if (!do_bump)
|
if (!do_bump)
|
||||||
{ //not in atlas or not bump mapped, might be able to do a cheap update
|
{ //not in atlas or not bump mapped, might be able to do a cheap update
|
||||||
mVertexBuffer->getTexCoord0Strider(tex_coords, mGeomIndex, mGeomCount);
|
mVertexBuffer->getTexCoord0Strider(tex_coords0, mGeomIndex, mGeomCount);
|
||||||
|
|
||||||
if (texgen != LLTextureEntry::TEX_GEN_PLANAR)
|
if (texgen != LLTextureEntry::TEX_GEN_PLANAR)
|
||||||
{
|
{
|
||||||
@@ -1655,12 +1628,12 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
|||||||
{
|
{
|
||||||
LLFastTimer t(FTM_FACE_TEX_QUICK_NO_XFORM);
|
LLFastTimer t(FTM_FACE_TEX_QUICK_NO_XFORM);
|
||||||
S32 tc_size = (num_vertices*2*sizeof(F32)+0xF) & ~0xF;
|
S32 tc_size = (num_vertices*2*sizeof(F32)+0xF) & ~0xF;
|
||||||
LLVector4a::memcpyNonAliased16((F32*) tex_coords.get(), (F32*) vf.mTexCoords, tc_size);
|
LLVector4a::memcpyNonAliased16((F32*) tex_coords0.get(), (F32*) vf.mTexCoords, tc_size);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LLFastTimer t(FTM_FACE_TEX_QUICK_XFORM);
|
LLFastTimer t(FTM_FACE_TEX_QUICK_XFORM);
|
||||||
F32* dst = (F32*) tex_coords.get();
|
F32* dst = (F32*) tex_coords0.get();
|
||||||
LLVector4a* src = (LLVector4a*) vf.mTexCoords;
|
LLVector4a* src = (LLVector4a*) vf.mTexCoords;
|
||||||
|
|
||||||
LLVector4a trans;
|
LLVector4a trans;
|
||||||
@@ -1706,7 +1679,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
|||||||
tmp = tmp * *mTextureMatrix;
|
tmp = tmp * *mTextureMatrix;
|
||||||
tc.mV[0] = tmp.mV[0];
|
tc.mV[0] = tmp.mV[0];
|
||||||
tc.mV[1] = tmp.mV[1];
|
tc.mV[1] = tmp.mV[1];
|
||||||
*tex_coords++ = tc;
|
*tex_coords0++ = tc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1729,7 +1702,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
|||||||
tc.mV[0] = tmp.mV[0];
|
tc.mV[0] = tmp.mV[0];
|
||||||
tc.mV[1] = tmp.mV[1];
|
tc.mV[1] = tmp.mV[1];
|
||||||
|
|
||||||
*tex_coords++ = tc;
|
*tex_coords0++ = tc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1745,7 +1718,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
|||||||
|
|
||||||
xform(tc, cos_ang, sin_ang, os, ot, ms, mt);
|
xform(tc, cos_ang, sin_ang, os, ot, ms, mt);
|
||||||
|
|
||||||
*tex_coords++ = tc;
|
*tex_coords0++ = tc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1758,9 +1731,13 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
|||||||
else
|
else
|
||||||
{ //either bump mapped or in atlas, just do the whole expensive loop
|
{ //either bump mapped or in atlas, just do the whole expensive loop
|
||||||
LLFastTimer t(FTM_FACE_TEX_DEFAULT);
|
LLFastTimer t(FTM_FACE_TEX_DEFAULT);
|
||||||
mVertexBuffer->getTexCoord0Strider(tex_coords, mGeomIndex, mGeomCount, map_range);
|
|
||||||
|
|
||||||
std::vector<LLVector2> bump_tc;
|
std::vector<LLVector2> bump_tc;
|
||||||
|
|
||||||
|
LLStrider<LLVector2> dst;
|
||||||
|
|
||||||
|
mVertexBuffer->getTexCoord0Strider(dst, mGeomIndex, mGeomCount, map_range);
|
||||||
|
|
||||||
|
|
||||||
for (S32 i = 0; i < num_vertices; i++)
|
for (S32 i = 0; i < num_vertices; i++)
|
||||||
{
|
{
|
||||||
@@ -1776,20 +1753,10 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
|||||||
|
|
||||||
vec.mul(scalea);
|
vec.mul(scalea);
|
||||||
|
|
||||||
switch (texgen)
|
if (texgen == LLTextureEntry::TEX_GEN_PLANAR)
|
||||||
{
|
{
|
||||||
case LLTextureEntry::TEX_GEN_PLANAR:
|
planarProjection(tc, norm, center, vec);
|
||||||
planarProjection(tc, norm, center, vec);
|
}
|
||||||
break;
|
|
||||||
case LLTextureEntry::TEX_GEN_SPHERICAL:
|
|
||||||
sphericalProjection(tc, norm, center, vec);
|
|
||||||
break;
|
|
||||||
case LLTextureEntry::TEX_GEN_CYLINDRICAL:
|
|
||||||
cylindricalProjection(tc, norm, center, vec);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tex_mode && mTextureMatrix)
|
if (tex_mode && mTextureMatrix)
|
||||||
@@ -1804,8 +1771,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
|||||||
xform(tc, cos_ang, sin_ang, os, ot, ms, mt);
|
xform(tc, cos_ang, sin_ang, os, ot, ms, mt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*dst++ = tc;
|
||||||
*tex_coords++ = tc;
|
|
||||||
if (do_bump)
|
if (do_bump)
|
||||||
{
|
{
|
||||||
bump_tc.push_back(tc);
|
bump_tc.push_back(tc);
|
||||||
@@ -1819,7 +1785,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
|||||||
|
|
||||||
if (do_bump)
|
if (do_bump)
|
||||||
{
|
{
|
||||||
mVertexBuffer->getTexCoord1Strider(tex_coords2, mGeomIndex, mGeomCount, map_range);
|
mVertexBuffer->getTexCoord1Strider(tex_coords1, mGeomIndex, mGeomCount, map_range);
|
||||||
|
|
||||||
for (S32 i = 0; i < num_vertices; i++)
|
for (S32 i = 0; i < num_vertices; i++)
|
||||||
{
|
{
|
||||||
@@ -1843,10 +1809,11 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
|||||||
}
|
}
|
||||||
|
|
||||||
binormal.normalize3fast();
|
binormal.normalize3fast();
|
||||||
|
|
||||||
LLVector2 tc = bump_tc[i];
|
LLVector2 tc = bump_tc[i];
|
||||||
tc += LLVector2( bump_s_primary_light_ray.dot3(tangent).getF32(), bump_t_primary_light_ray.dot3(binormal).getF32() );
|
tc += LLVector2( bump_s_primary_light_ray.dot3(tangent).getF32(), bump_t_primary_light_ray.dot3(binormal).getF32() );
|
||||||
|
|
||||||
*tex_coords2++ = tc;
|
*tex_coords1++ = tc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (map_range)
|
if (map_range)
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ public:
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
LL_ALIGN_PREFIX(16)
|
LL_ALIGN_PREFIX(64)
|
||||||
class LLSpatialGroup : public LLOctreeListener<LLDrawable>
|
class LLSpatialGroup : public LLOctreeListener<LLDrawable>
|
||||||
{
|
{
|
||||||
friend class LLSpatialPartition;
|
friend class LLSpatialPartition;
|
||||||
|
|||||||
@@ -2249,7 +2249,8 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
|||||||
if (mDrawable->isState(LLDrawable::FORCE_INVISIBLE) && !mOrphaned)
|
if (mDrawable->isState(LLDrawable::FORCE_INVISIBLE) && !mOrphaned)
|
||||||
{
|
{
|
||||||
// lldebugs << "Clearing force invisible: " << mID << ":" << getPCodeString() << ":" << getPositionAgent() << llendl;
|
// lldebugs << "Clearing force invisible: " << mID << ":" << getPCodeString() << ":" << getPositionAgent() << llendl;
|
||||||
mDrawable->setState(LLDrawable::CLEAR_INVISIBLE);
|
mDrawable->clearState(LLDrawable::FORCE_INVISIBLE);
|
||||||
|
gPipeline.markRebuild( mDrawable, LLDrawable::REBUILD_ALL, TRUE );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2164,8 +2164,9 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port)
|
|||||||
if (childp->mDrawable.notNull())
|
if (childp->mDrawable.notNull())
|
||||||
{
|
{
|
||||||
// Make the drawable visible again and set the drawable parent
|
// Make the drawable visible again and set the drawable parent
|
||||||
childp->mDrawable->setState(LLDrawable::CLEAR_INVISIBLE);
|
childp->mDrawable->clearState(LLDrawable::FORCE_INVISIBLE);
|
||||||
childp->setDrawableParent(objectp->mDrawable); // LLViewerObjectList::findOrphans()
|
childp->setDrawableParent(objectp->mDrawable); // LLViewerObjectList::findOrphans()
|
||||||
|
gPipeline.markRebuild( childp->mDrawable, LLDrawable::REBUILD_ALL, TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make certain particles, icon and HUD aren't hidden
|
// Make certain particles, icon and HUD aren't hidden
|
||||||
|
|||||||
@@ -1043,6 +1043,7 @@ void LLVOSurfacePatch::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newM
|
|||||||
{
|
{
|
||||||
LLVector3 posAgent = getPositionAgent();
|
LLVector3 posAgent = getPositionAgent();
|
||||||
LLVector3 scale = getScale();
|
LLVector3 scale = getScale();
|
||||||
|
//make z-axis scale at least 1 to avoid shadow artifacts on totally flat land
|
||||||
scale.mV[VZ] = llmax(scale.mV[VZ], 1.f);
|
scale.mV[VZ] = llmax(scale.mV[VZ], 1.f);
|
||||||
newMin.load3( (posAgent-scale*0.5f).mV); // Changing to 2.f makes the culling a -little- better, but still wrong
|
newMin.load3( (posAgent-scale*0.5f).mV); // Changing to 2.f makes the culling a -little- better, but still wrong
|
||||||
newMax.load3( (posAgent+scale*0.5f).mV);
|
newMax.load3( (posAgent+scale*0.5f).mV);
|
||||||
|
|||||||
@@ -4128,7 +4128,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
|
|||||||
draw_vec[idx]->mEnd += facep->getGeomCount();
|
draw_vec[idx]->mEnd += facep->getGeomCount();
|
||||||
draw_vec[idx]->mVSize = llmax(draw_vec[idx]->mVSize, facep->getVirtualSize());
|
draw_vec[idx]->mVSize = llmax(draw_vec[idx]->mVSize, facep->getVirtualSize());
|
||||||
|
|
||||||
if (index >= draw_vec[idx]->mTextureList.size())
|
if (index < 255 && index >= draw_vec[idx]->mTextureList.size())
|
||||||
{
|
{
|
||||||
draw_vec[idx]->mTextureList.resize(index+1);
|
draw_vec[idx]->mTextureList.resize(index+1);
|
||||||
draw_vec[idx]->mTextureList[index] = tex;
|
draw_vec[idx]->mTextureList[index] = tex;
|
||||||
@@ -4449,6 +4449,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
|
|||||||
bool can_be_shiny = mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE ||
|
bool can_be_shiny = mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE ||
|
||||||
mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE;
|
mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE;
|
||||||
|
|
||||||
|
bool is_deferred_simple = LLPipeline::sRenderDeferred && !fullbright;
|
||||||
if (mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK && te->getColor().mV[3] >= 0.999f)
|
if (mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK && te->getColor().mV[3] >= 0.999f)
|
||||||
{
|
{
|
||||||
pool->addRiggedFace(facep, fullbright ? LLDrawPoolAvatar::RIGGED_FULLBRIGHT : LLDrawPoolAvatar::RIGGED_SIMPLE);
|
pool->addRiggedFace(facep, fullbright ? LLDrawPoolAvatar::RIGGED_FULLBRIGHT : LLDrawPoolAvatar::RIGGED_SIMPLE);
|
||||||
@@ -4459,18 +4460,21 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
|
|||||||
{
|
{
|
||||||
pool->addRiggedFace(facep, fullbright ? LLDrawPoolAvatar::RIGGED_FULLBRIGHT_ALPHA : LLDrawPoolAvatar::RIGGED_ALPHA);
|
pool->addRiggedFace(facep, fullbright ? LLDrawPoolAvatar::RIGGED_FULLBRIGHT_ALPHA : LLDrawPoolAvatar::RIGGED_ALPHA);
|
||||||
}
|
}
|
||||||
|
is_deferred_simple = false;
|
||||||
}
|
}
|
||||||
else if (gPipeline.canUseVertexShaders()
|
else if (gPipeline.canUseVertexShaders()
|
||||||
&& LLPipeline::sRenderBump
|
&& LLPipeline::sRenderBump
|
||||||
&& te->getShiny()
|
&& te->getShiny()
|
||||||
&& can_be_shiny)
|
&& can_be_shiny)
|
||||||
{
|
{
|
||||||
pool->addRiggedFace(facep, fullbright ? LLDrawPoolAvatar::RIGGED_FULLBRIGHT_SHINY : LLDrawPoolAvatar::RIGGED_SHINY);
|
pool->addRiggedFace(facep, fullbright ? LLDrawPoolAvatar::RIGGED_FULLBRIGHT_SHINY : !LLPipeline::sRenderDeferred ? LLDrawPoolAvatar::RIGGED_SHINY : LLDrawPoolAvatar::RIGGED_SIMPLE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pool->addRiggedFace(facep, fullbright ? LLDrawPoolAvatar::RIGGED_FULLBRIGHT : LLDrawPoolAvatar::RIGGED_SIMPLE);
|
pool->addRiggedFace(facep, fullbright ? LLDrawPoolAvatar::RIGGED_FULLBRIGHT : LLDrawPoolAvatar::RIGGED_SIMPLE);
|
||||||
}
|
}
|
||||||
|
if(is_deferred_simple)
|
||||||
|
pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_DEFERRED_SIMPLE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -5209,7 +5213,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
|
|||||||
&& te->getShiny()
|
&& te->getShiny()
|
||||||
&& can_be_shiny)
|
&& can_be_shiny)
|
||||||
{
|
{
|
||||||
registerFace(group, facep, fullbright ? LLRenderPass::PASS_FULLBRIGHT_SHINY : LLRenderPass::PASS_SHINY);
|
registerFace(group, facep, fullbright ? LLRenderPass::PASS_FULLBRIGHT_SHINY : (!LLPipeline::sRenderDeferred || hud_group) ? LLRenderPass::PASS_SHINY : LLRenderPass::PASS_SIMPLE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -49,6 +49,7 @@
|
|||||||
#include "llregionflags.h"
|
#include "llregionflags.h"
|
||||||
#include "llworldmapmessage.h"
|
#include "llworldmapmessage.h"
|
||||||
#include "hippogridmanager.h"
|
#include "hippogridmanager.h"
|
||||||
|
#include "lfsimfeaturehandler.h"
|
||||||
|
|
||||||
bool LLWorldMap::sGotMapURL = false;
|
bool LLWorldMap::sGotMapURL = false;
|
||||||
// Timers to temporise database requests
|
// Timers to temporise database requests
|
||||||
@@ -512,7 +513,7 @@ bool LLWorldMap::useWebMapTiles()
|
|||||||
{
|
{
|
||||||
static const LLCachedControl<bool> use_web_map_tiles("UseWebMapTiles",false);
|
static const LLCachedControl<bool> use_web_map_tiles("UseWebMapTiles",false);
|
||||||
return use_web_map_tiles &&
|
return use_web_map_tiles &&
|
||||||
(( gHippoGridManager->getConnectedGrid()->isSecondLife() || sGotMapURL));
|
(( gHippoGridManager->getConnectedGrid()->isSecondLife() || sGotMapURL || !LFSimFeatureHandler::instance().mapServerURL().empty()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLWorldMap::reloadItems(bool force)
|
void LLWorldMap::reloadItems(bool force)
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
#include "llviewercontrol.h"
|
#include "llviewercontrol.h"
|
||||||
#include "llviewertexturelist.h"
|
#include "llviewertexturelist.h"
|
||||||
#include "math.h" // log()
|
#include "math.h" // log()
|
||||||
|
#include "lfsimfeaturehandler.h"
|
||||||
|
|
||||||
// Turn this on to output tile stats in the standard output
|
// Turn this on to output tile stats in the standard output
|
||||||
#define DEBUG_TILES_STAT 0
|
#define DEBUG_TILES_STAT 0
|
||||||
@@ -187,7 +188,9 @@ LLPointer<LLViewerFetchedTexture> LLWorldMipmap::getObjectsTile(U32 grid_x, U32
|
|||||||
LLPointer<LLViewerFetchedTexture> LLWorldMipmap::loadObjectsTile(U32 grid_x, U32 grid_y, S32 level)
|
LLPointer<LLViewerFetchedTexture> LLWorldMipmap::loadObjectsTile(U32 grid_x, U32 grid_y, S32 level)
|
||||||
{
|
{
|
||||||
// Get the grid coordinates
|
// Get the grid coordinates
|
||||||
std::string imageurl = gSavedSettings.getString("MapServerURL") + llformat("map-%d-%d-%d-objects.jpg", level, grid_x, grid_y);
|
std::string simOverrideMap = LFSimFeatureHandler::instance().mapServerURL();
|
||||||
|
std::string imageurl = (simOverrideMap.empty() ? gSavedSettings.getString("MapServerURL") : simOverrideMap)
|
||||||
|
+ llformat("map-%d-%d-%d-objects.jpg", level, grid_x, grid_y);
|
||||||
|
|
||||||
// DO NOT COMMIT!! DEBUG ONLY!!!
|
// DO NOT COMMIT!! DEBUG ONLY!!!
|
||||||
// Use a local jpeg for every tile to test map speed without S3 access
|
// Use a local jpeg for every tile to test map speed without S3 access
|
||||||
|
|||||||
@@ -1415,12 +1415,32 @@ U32 LLPipeline::getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* ima
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool alpha = te->getColor().mV[3] < 0.999f;
|
LLMaterial* mat = te->getMaterialParams().get();
|
||||||
|
|
||||||
|
bool color_alpha = te->getColor().mV[3] < 0.999f;
|
||||||
|
bool alpha = color_alpha;
|
||||||
if (imagep)
|
if (imagep)
|
||||||
{
|
{
|
||||||
alpha = alpha || (imagep->getComponents() == 4 && imagep->getType() != LLViewerTexture::MEDIA_TEXTURE) || (imagep->getComponents() == 2);
|
alpha = alpha || (imagep->getComponents() == 4 && imagep->getType() != LLViewerTexture::MEDIA_TEXTURE) || (imagep->getComponents() == 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (alpha && mat)
|
||||||
|
{
|
||||||
|
switch (mat->getDiffuseAlphaMode())
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
alpha = true; // Material's alpha mode is set to blend. Toss it into the alpha draw pool.
|
||||||
|
break;
|
||||||
|
case 0: //alpha mode set to none, never go to alpha pool
|
||||||
|
case 3: //alpha mode set to emissive, never go to alpha pool
|
||||||
|
alpha = color_alpha;
|
||||||
|
break;
|
||||||
|
default: //alpha mode set to "mask", go to alpha pool if fullbright
|
||||||
|
alpha = color_alpha; // Material's alpha mode is set to none, mask, or emissive. Toss it into the opaque material draw pool.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (alpha)
|
if (alpha)
|
||||||
{
|
{
|
||||||
return LLDrawPool::POOL_ALPHA;
|
return LLDrawPool::POOL_ALPHA;
|
||||||
@@ -2405,17 +2425,6 @@ BOOL LLPipeline::updateDrawableGeom(LLDrawable* drawablep, BOOL priority)
|
|||||||
BOOL update_complete = drawablep->updateGeometry(priority);
|
BOOL update_complete = drawablep->updateGeometry(priority);
|
||||||
if (update_complete && assertInitialized())
|
if (update_complete && assertInitialized())
|
||||||
{
|
{
|
||||||
//Workaround for 'missing prims' until it's fixed upstream by LL.
|
|
||||||
//Sometimes clearing CLEAR_INVISIBLE and FORCE_INVISIBLE in LLPipeline::stateSort was too late. Do it here instead, before
|
|
||||||
//the rebuild state is picked up on and LLVolumeGeometryManager::rebuildGeom is called.
|
|
||||||
//If the FORCE_INVISIBLE isn't cleared before the rebuildGeom call, the geometry will NOT BE REBUILT!
|
|
||||||
if(drawablep->isState(LLDrawable::CLEAR_INVISIBLE))
|
|
||||||
{
|
|
||||||
// clear invisible flag here to avoid single frame glitch
|
|
||||||
drawablep->clearState(LLDrawable::FORCE_INVISIBLE|LLDrawable::CLEAR_INVISIBLE);
|
|
||||||
return false; //Defer to next mBuildQ1 iteration
|
|
||||||
}
|
|
||||||
|
|
||||||
drawablep->setState(LLDrawable::BUILT);
|
drawablep->setState(LLDrawable::BUILT);
|
||||||
mGeometryChanges++;
|
mGeometryChanges++;
|
||||||
}
|
}
|
||||||
@@ -3162,11 +3171,6 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera)
|
|||||||
{
|
{
|
||||||
drawablep->setVisible(camera, NULL, FALSE);
|
drawablep->setVisible(camera, NULL, FALSE);
|
||||||
}
|
}
|
||||||
else if (drawablep->isState(LLDrawable::CLEAR_INVISIBLE))
|
|
||||||
{
|
|
||||||
// clear invisible flag here to avoid single frame glitch
|
|
||||||
drawablep->clearState(LLDrawable::FORCE_INVISIBLE|LLDrawable::CLEAR_INVISIBLE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LLViewerCamera::sCurCameraID == LLViewerCamera::CAMERA_WORLD)
|
if (LLViewerCamera::sCurCameraID == LLViewerCamera::CAMERA_WORLD)
|
||||||
@@ -9739,11 +9743,13 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
|
|||||||
LLVector4a left;
|
LLVector4a left;
|
||||||
left.load3(camera.getLeftAxis().mV);
|
left.load3(camera.getLeftAxis().mV);
|
||||||
left.mul(left);
|
left.mul(left);
|
||||||
|
llassert(left.dot3(left).getF32() > F_APPROXIMATELY_ZERO);
|
||||||
left.normalize3fast();
|
left.normalize3fast();
|
||||||
|
|
||||||
LLVector4a up;
|
LLVector4a up;
|
||||||
up.load3(camera.getUpAxis().mV);
|
up.load3(camera.getUpAxis().mV);
|
||||||
up.mul(up);
|
up.mul(up);
|
||||||
|
llassert(up.dot3(up).getF32() > F_APPROXIMATELY_ZERO);
|
||||||
up.normalize3fast();
|
up.normalize3fast();
|
||||||
|
|
||||||
tdim.mV[0] = fabsf(half_height.dot3(left).getF32());
|
tdim.mV[0] = fabsf(half_height.dot3(left).getF32());
|
||||||
|
|||||||
Reference in New Issue
Block a user