Merge viewer bear updates + merge fixes
commit
119ce81029
|
|
@ -72,7 +72,6 @@ const S32 LSL_PRIM_NAME = 27;
|
|||
const S32 LSL_PRIM_DESC = 28;
|
||||
const S32 LSL_PRIM_ROT_LOCAL = 29;
|
||||
const S32 LSL_PRIM_PHYSICS_SHAPE_TYPE = 30;
|
||||
const S32 LSL_PRIM_PHYSICS_MATERIAL = 31;
|
||||
const S32 LSL_PRIM_OMEGA = 32;
|
||||
const S32 LSL_PRIM_POS_LOCAL = 33;
|
||||
const S32 LSL_PRIM_LINK_TARGET = 34;
|
||||
|
|
|
|||
|
|
@ -4880,13 +4880,15 @@ void LLVolumeFace::optimize(F32 angle_cutoff)
|
|||
|
||||
if (angle_cutoff > 1.f && !mNormals)
|
||||
{
|
||||
ll_aligned_free_16(new_face.mNormals);
|
||||
// Now alloc'd with positions
|
||||
//ll_aligned_free_16(new_face.mNormals);
|
||||
new_face.mNormals = NULL;
|
||||
}
|
||||
|
||||
if (!mTexCoords)
|
||||
{
|
||||
ll_aligned_free_16(new_face.mTexCoords);
|
||||
// Now alloc'd with positions
|
||||
//ll_aligned_free_16(new_face.mTexCoords);
|
||||
new_face.mTexCoords = NULL;
|
||||
}
|
||||
|
||||
|
|
@ -6277,7 +6279,7 @@ void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& mat_in, LLMat
|
|||
|
||||
//transform appended face normal and store
|
||||
norm_mat.rotate(src_norm[i], dst_norm[i]);
|
||||
dst_norm[i].normalize3fast_checked();
|
||||
dst_norm[i].normalize3fast();
|
||||
|
||||
//copy appended face texture coordinate
|
||||
dst_tc[i] = src_tc[i];
|
||||
|
|
|
|||
|
|
@ -166,6 +166,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
|
|||
|
||||
if ( !get_dom_sources(inputs, pos_offset, tc_offset, norm_offset, idx_stride, pos_source, tc_source, norm_source) || !pos_source )
|
||||
{
|
||||
llwarns << "Could not find dom sources for basic geo data; invalid model." << llendl;
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
|
||||
|
|
@ -201,6 +202,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
|
|||
if (((i + pos_offset) > index_count)
|
||||
|| ((idx[i+pos_offset]*3+2) > vertex_count))
|
||||
{
|
||||
llwarns << "Out of range index data; invalid model." << llendl;
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
|
||||
|
|
@ -210,6 +212,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
|
|||
|
||||
if (!cv.getPosition().isFinite3())
|
||||
{
|
||||
llwarns << "Nan positional data, invalid model." << llendl;
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
}
|
||||
|
|
@ -222,6 +225,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
|
|||
if (((i + tc_offset) > index_count)
|
||||
|| ((idx[i+tc_offset]*2+1) > tc_count))
|
||||
{
|
||||
llwarns << "Out of range TC indices." << llendl;
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
|
||||
|
|
@ -242,6 +246,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
|
|||
if (((i + norm_offset) > index_count)
|
||||
|| ((idx[i+norm_offset]*3+2) > norm_count))
|
||||
{
|
||||
llwarns << "Found out of range norm indices, invalid model." << llendl;
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
|
||||
|
|
@ -380,6 +385,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac
|
|||
|
||||
if (!get_dom_sources(inputs, pos_offset, tc_offset, norm_offset, idx_stride, pos_source, tc_source, norm_source))
|
||||
{
|
||||
llwarns << "Could not get DOM sources for basic geo data, invalid model." << llendl;
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
|
||||
|
|
@ -430,9 +436,10 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac
|
|||
{
|
||||
// guard against model data specifiying out of range indices or verts
|
||||
//
|
||||
if (((i + pos_offset) > index_count)
|
||||
|| ((idx[i+pos_offset]*3+2) > vertex_count))
|
||||
if (((cur_idx + pos_offset) > index_count)
|
||||
|| ((idx[cur_idx+pos_offset]*3+2) > vertex_count))
|
||||
{
|
||||
llwarns << "Out of range position indices, invalid model." << llendl;
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
|
||||
|
|
@ -455,6 +462,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac
|
|||
if (((cur_idx + tc_offset) > index_count)
|
||||
|| ((idx[cur_idx+tc_offset]*2+1) > tc_count))
|
||||
{
|
||||
llwarns << "Out of range TC indices, invalid model." << llendl;
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
|
||||
|
|
@ -475,6 +483,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac
|
|||
if (((cur_idx + norm_offset) > index_count)
|
||||
|| ((idx[cur_idx+norm_offset]*3+2) > norm_count))
|
||||
{
|
||||
llwarns << "Out of range norm indices, invalid model." << llendl;
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
|
||||
|
|
@ -653,6 +662,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
|
|||
domVertices* vertices = (domVertices*) elem.cast();
|
||||
if (!vertices)
|
||||
{
|
||||
llwarns << "Could not find vertex source, invalid model." << llendl;
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
domInputLocal_Array& v_inp = vertices->getInput_array();
|
||||
|
|
@ -666,6 +676,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
|
|||
domSource* src = (domSource*) elem.cast();
|
||||
if (!src)
|
||||
{
|
||||
llwarns << "Could not find DOM source, invalid model." << llendl;
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
v = &(src->getFloat_array()->getValue());
|
||||
|
|
@ -681,6 +692,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
|
|||
domSource* src = (domSource*) elem.cast();
|
||||
if (!src)
|
||||
{
|
||||
llwarns << "Could not find DOM source, invalid model." << llendl;
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
n = &(src->getFloat_array()->getValue());
|
||||
|
|
@ -693,6 +705,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
|
|||
domSource* src = (domSource*) elem.cast();
|
||||
if (!src)
|
||||
{
|
||||
llwarns << "Could not find DOM source, invalid model." << llendl;
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
t = &(src->getFloat_array()->getValue());
|
||||
|
|
|
|||
|
|
@ -381,11 +381,6 @@ BOOL LLGLSLShader::createShader(std::vector<LLStaticHashedString> * attributes,
|
|||
|
||||
// Create program
|
||||
mProgramObject = glCreateProgramObjectARB();
|
||||
|
||||
#if LL_DARWIN
|
||||
// work-around missing mix(vec3,vec3,bvec3)
|
||||
mDefines["OLD_SELECT"] = "1";
|
||||
#endif
|
||||
|
||||
#if LL_DARWIN
|
||||
// work-around missing mix(vec3,vec3,bvec3)
|
||||
|
|
|
|||
|
|
@ -832,8 +832,8 @@ LLLightState::LLLightState(S32 index)
|
|||
: mIndex(index),
|
||||
mEnabled(false),
|
||||
mConstantAtten(1.f),
|
||||
mLinearAtten(1.f),
|
||||
mQuadraticAtten(1.f),
|
||||
mLinearAtten(0.f),
|
||||
mQuadraticAtten(0.f),
|
||||
mSpotExponent(0.f),
|
||||
mSpotCutoff(180.f)
|
||||
{
|
||||
|
|
@ -1150,7 +1150,7 @@ void LLRender::syncLightState()
|
|||
|
||||
position[i] = light->mPosition;
|
||||
direction[i] = light->mSpotDirection;
|
||||
attenuation[i].set(1.f/light->mLinearAtten, light->mQuadraticAtten, light->mSpecular.mV[3]);
|
||||
attenuation[i].set(light->mLinearAtten, light->mQuadraticAtten, light->mSpecular.mV[3]);
|
||||
diffuse[i].set(light->mDiffuse.mV);
|
||||
}
|
||||
|
||||
|
|
@ -1893,33 +1893,33 @@ void LLRender::flush()
|
|||
//store mCount in a local variable to avoid re-entrance (drawArrays may call flush)
|
||||
U32 count = mCount;
|
||||
|
||||
if (mMode == LLRender::QUADS && !sGLCoreProfile)
|
||||
{
|
||||
if (mCount%4 != 0)
|
||||
if (mMode == LLRender::QUADS && !sGLCoreProfile)
|
||||
{
|
||||
if (mCount%4 != 0)
|
||||
{
|
||||
count -= (mCount % 4);
|
||||
llwarns << "Incomplete quad requested." << llendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mMode == LLRender::TRIANGLES)
|
||||
{
|
||||
if (mCount%3 != 0)
|
||||
|
||||
if (mMode == LLRender::TRIANGLES)
|
||||
{
|
||||
if (mCount%3 != 0)
|
||||
{
|
||||
count -= (mCount % 3);
|
||||
llwarns << "Incomplete triangle requested." << llendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mMode == LLRender::LINES)
|
||||
{
|
||||
if (mCount%2 != 0)
|
||||
|
||||
if (mMode == LLRender::LINES)
|
||||
{
|
||||
if (mCount%2 != 0)
|
||||
{
|
||||
count -= (mCount % 2);
|
||||
llwarns << "Incomplete line requested." << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
mCount = 0;
|
||||
|
||||
if (mBuffer->useVBOs() && !mBuffer->isLocked())
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt)
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -364,56 +364,36 @@ void LLRenderTarget::release()
|
|||
|
||||
sBytesAllocated -= mResX*mResY*4;
|
||||
}
|
||||
else if (mFBO)
|
||||
{
|
||||
else if (mUseDepth && mFBO)
|
||||
{ //detach shared depth buffer
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, mFBO);
|
||||
|
||||
if (mUseDepth)
|
||||
{ //detach shared depth buffer
|
||||
if (mStencil)
|
||||
{ //attached as a renderbuffer
|
||||
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0);
|
||||
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, 0);
|
||||
mStencil = false;
|
||||
}
|
||||
else
|
||||
{ //attached as a texture
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, LLTexUnit::getInternalType(mUsage), 0, 0);
|
||||
}
|
||||
mUseDepth = false;
|
||||
if (mStencil)
|
||||
{ //attached as a renderbuffer
|
||||
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0);
|
||||
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, 0);
|
||||
mStencil = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Detach any extra color buffers (e.g. SRGB spec buffers)
|
||||
//
|
||||
if (mFBO && (mTex.size() > 1))
|
||||
{
|
||||
S32 z;
|
||||
for (z = mTex.size() - 1; z >= 1; z--)
|
||||
{
|
||||
sBytesAllocated -= mResX*mResY*4;
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0+z, LLTexUnit::getInternalType(mUsage), 0, 0);
|
||||
stop_glerror();
|
||||
LLImageGL::deleteTextures(mUsage, mInternalFormat[z], 0, 1, &mTex[z], true);
|
||||
else
|
||||
{ //attached as a texture
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, LLTexUnit::getInternalType(mUsage), 0, 0);
|
||||
}
|
||||
mUseDepth = false;
|
||||
}
|
||||
|
||||
if (mFBO)
|
||||
{
|
||||
glDeleteFramebuffers(1, (GLuint *) &mFBO);
|
||||
stop_glerror();
|
||||
mFBO = 0;
|
||||
}
|
||||
|
||||
if (mTex.size() > 0)
|
||||
{
|
||||
sBytesAllocated -= mResX*mResY*4;
|
||||
LLImageGL::deleteTextures(mUsage, mInternalFormat[0], 0, 1, &mTex[0], true);
|
||||
sBytesAllocated -= mResX*mResY*4*mTex.size();
|
||||
LLImageGL::deleteTextures(mUsage, mInternalFormat[0], 0, mTex.size(), &mTex[0], true);
|
||||
mTex.clear();
|
||||
mInternalFormat.clear();
|
||||
}
|
||||
|
||||
mTex.clear();
|
||||
mInternalFormat.clear();
|
||||
|
||||
|
||||
mResX = mResY = 0;
|
||||
|
||||
sBoundTarget = NULL;
|
||||
|
|
@ -603,10 +583,8 @@ void LLRenderTarget::copyContentsToFramebuffer(LLRenderTarget& source, S32 srcX0
|
|||
{
|
||||
if (!source.mFBO)
|
||||
{
|
||||
llwarns << "Cannot copy framebuffer contents for non FBO render targets." << llendl;
|
||||
return;
|
||||
llerrs << "Cannot copy framebuffer contents for non FBO render targets." << llendl;
|
||||
}
|
||||
|
||||
{
|
||||
GLboolean write_depth = mask & GL_DEPTH_BUFFER_BIT ? TRUE : FALSE;
|
||||
|
||||
|
|
|
|||
|
|
@ -1180,17 +1180,17 @@ void LLShaderMgr::initAttribsAndUniforms()
|
|||
mReservedUniforms.push_back("norm_mat");
|
||||
|
||||
mReservedUniforms.push_back("global_gamma");
|
||||
mReservedUniforms.push_back("texture_gamma");
|
||||
|
||||
mReservedUniforms.push_back("texture_gamma");
|
||||
|
||||
mReservedUniforms.push_back("specular_color");
|
||||
mReservedUniforms.push_back("env_intensity");
|
||||
|
||||
mReservedUniforms.push_back("matrixPalette");
|
||||
|
||||
// <FS:CR> Import Vignette from Exodus
|
||||
mReservedUniforms.push_back("exo_vignette");
|
||||
mReservedUniforms.push_back("exo_screen");
|
||||
// </FS:CR> Import Vignette from Exodus
|
||||
|
||||
mReservedUniforms.push_back("matrixPalette");
|
||||
|
||||
mReservedUniforms.push_back("screenTex");
|
||||
mReservedUniforms.push_back("screenDepth");
|
||||
|
|
|
|||
|
|
@ -170,18 +170,17 @@ public:
|
|||
DEFERRED_NORM_MATRIX,
|
||||
|
||||
GLOBAL_GAMMA,
|
||||
TEXTURE_GAMMA,
|
||||
|
||||
TEXTURE_GAMMA,
|
||||
|
||||
SPECULAR_COLOR,
|
||||
ENVIRONMENT_INTENSITY,
|
||||
AVATAR_MATRIX,
|
||||
|
||||
// <FS:CR> Import Vignette from Exodus
|
||||
EXO_RENDER_VIGNETTE,
|
||||
EXO_RENDER_SCREEN,
|
||||
// </FS:CR> Import Vignette from Exodus
|
||||
|
||||
AVATAR_MATRIX,
|
||||
|
||||
WATER_SCREENTEX,
|
||||
WATER_SCREENDEPTH,
|
||||
WATER_REFTEX,
|
||||
|
|
|
|||
|
|
@ -297,7 +297,9 @@ void LLVBOPool::release(U32 name, volatile U8* buffer, U32 size)
|
|||
llassert(vbo_block_size(size) == size);
|
||||
|
||||
deleteBuffer(name);
|
||||
ll_aligned_free((U8*) buffer);
|
||||
|
||||
if ( LLVertexBuffer::sDisableVBOMapping || mUsage != GL_DYNAMIC_DRAW_ARB)
|
||||
ll_aligned_free((U8*) buffer);
|
||||
|
||||
if (mType == GL_ARRAY_BUFFER_ARB)
|
||||
{
|
||||
|
|
@ -807,10 +809,10 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi
|
|||
U16* idx = ((U16*) getIndicesPointer())+indices_offset;
|
||||
|
||||
stop_glerror();
|
||||
LLGLSLShader::startProfile();
|
||||
glDrawRangeElements(sGLMode[mode], start, end, count, GL_UNSIGNED_SHORT,
|
||||
LLGLSLShader::startProfile();
|
||||
glDrawRangeElements(sGLMode[mode], start, end, count, GL_UNSIGNED_SHORT,
|
||||
idx);
|
||||
LLGLSLShader::stopProfile(count, mode);
|
||||
LLGLSLShader::stopProfile(count, mode);
|
||||
stop_glerror();
|
||||
|
||||
|
||||
|
|
@ -1946,7 +1948,7 @@ void LLVertexBuffer::unmapBuffer()
|
|||
{
|
||||
// <FS:ND/> Fast timers can have measurable impact in frequent places. A better all around solution would be to disable all fast timers until the fast timer view is open. But we're not there yet.
|
||||
// LLFastTimer t(FTM_VBO_UNMAP);
|
||||
bindGLBuffer();
|
||||
bindGLBuffer(true);
|
||||
updated_all = mIndexLocked; //both vertex and index buffers done updating
|
||||
|
||||
if(!mMappable)
|
||||
|
|
@ -2220,7 +2222,8 @@ bool LLVertexBuffer::bindGLArray()
|
|||
if (mGLArray && sGLRenderArray != mGLArray)
|
||||
{
|
||||
{
|
||||
LLFastTimer t(FTM_BIND_GL_ARRAY);
|
||||
// <FS:ND/> Fast timers can have measurable impact in frequent places. A better all around solution would be to disable all fast timers until the fast timer view is open. But we're not there yet.
|
||||
// LLFastTimer t(FTM_BIND_GL_ARRAY);
|
||||
#if GL_ARB_vertex_array_object
|
||||
glBindVertexArray(mGLArray);
|
||||
#endif
|
||||
|
|
@ -2333,7 +2336,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
|
|||
required_mask |= required;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((data_mask & required_mask) != required_mask)
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec
|
|||
da *= spot*spot; // GL_SPOT_EXPONENT=2
|
||||
|
||||
//angular attenuation
|
||||
da *= max(dot(n, lv), 0.0);
|
||||
da *= max(dot(n, lv), 0.0);
|
||||
|
||||
float lit = max(da * dist_atten,0.0);
|
||||
|
||||
|
|
@ -458,7 +458,7 @@ void main()
|
|||
|
||||
float shadow = 1.0;
|
||||
|
||||
#if HAS_SHADOW
|
||||
#if HAS_SHADOW
|
||||
vec4 spos = pos;
|
||||
|
||||
if (spos.z > -shadow_clip.w)
|
||||
|
|
@ -541,7 +541,7 @@ void main()
|
|||
#else
|
||||
float final_alpha = diff.a;
|
||||
#endif
|
||||
|
||||
|
||||
// Insure we don't pollute depth with invis pixels in impostor rendering
|
||||
//
|
||||
if (final_alpha < 0.01)
|
||||
|
|
@ -591,16 +591,16 @@ void main()
|
|||
color.rgb *= gamma_diff.rgb;
|
||||
|
||||
//color.rgb = mix(diff.rgb, color.rgb, final_alpha);
|
||||
|
||||
|
||||
color.rgb = atmosLighting(color.rgb);
|
||||
color.rgb = scaleSoftClip(color.rgb);
|
||||
|
||||
vec4 light = vec4(0,0,0,0);
|
||||
|
||||
color.rgb = srgb_to_linear(color.rgb);
|
||||
|
||||
|
||||
#define LIGHT_LOOP(i) light.rgb += calcPointLightOrSpotLight(light_diffuse[i].rgb, diff.rgb, pos.xyz, norm, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z);
|
||||
|
||||
|
||||
LIGHT_LOOP(1)
|
||||
LIGHT_LOOP(2)
|
||||
LIGHT_LOOP(3)
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ void main()
|
|||
#ifdef USE_VERTEX_COLOR
|
||||
vertex_color = diffuse_color;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_SKIN
|
||||
vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip);
|
||||
#else
|
||||
|
|
@ -137,3 +137,4 @@ void main()
|
|||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -670,7 +670,7 @@ void main()
|
|||
vec4 diffuse = final_color;
|
||||
float envIntensity = final_normal.z;
|
||||
|
||||
vec3 col = vec3(0.0f,0.0f,0.0f);
|
||||
vec3 col = vec3(0.0f,0.0f,0.0f);
|
||||
|
||||
float bloom = 0.0;
|
||||
calcAtmospherics(pos.xyz, 1.0);
|
||||
|
|
@ -698,7 +698,7 @@ void main()
|
|||
col.rgb = col.rgb + atmosAffectDirectionalLight(final_da);
|
||||
|
||||
col.rgb *= gamma_diff.rgb;
|
||||
|
||||
|
||||
|
||||
float glare = 0.0;
|
||||
|
||||
|
|
|
|||
|
|
@ -112,54 +112,53 @@ void main()
|
|||
dist /= light[i].w;
|
||||
if (dist <= 1.0)
|
||||
{
|
||||
float da = dot(norm, lv);
|
||||
float da = dot(norm, lv);
|
||||
if (da > 0.0)
|
||||
{
|
||||
lv = normalize(lv);
|
||||
da = dot(norm, lv);
|
||||
{
|
||||
lv = normalize(lv);
|
||||
da = dot(norm, lv);
|
||||
|
||||
float fa = light_col[i].a+1.0;
|
||||
float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0);
|
||||
dist_atten *= dist_atten;
|
||||
dist_atten *= 2.0;
|
||||
float fa = light_col[i].a+1.0;
|
||||
float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0);
|
||||
dist_atten *= dist_atten;
|
||||
dist_atten *= 2.0;
|
||||
|
||||
dist_atten *= noise;
|
||||
dist_atten *= noise;
|
||||
|
||||
float lit = da * dist_atten;
|
||||
float lit = da * dist_atten;
|
||||
|
||||
vec3 col = light_col[i].rgb*lit*diff;
|
||||
vec3 col = light_col[i].rgb*lit*diff;
|
||||
|
||||
//vec3 col = vec3(dist2, light_col[i].a, lit);
|
||||
//vec3 col = vec3(dist2, light_col[i].a, lit);
|
||||
|
||||
if (spec.a > 0.0)
|
||||
{
|
||||
lit = min(da*6.0, 1.0) * dist_atten;
|
||||
//vec3 ref = dot(pos+lv, norm);
|
||||
vec3 h = normalize(lv+npos);
|
||||
float nh = dot(norm, h);
|
||||
float nv = dot(norm, npos);
|
||||
float vh = dot(npos, h);
|
||||
float sa = nh;
|
||||
float fres = pow(1 - dot(h, npos), 5)*0.4+0.5;
|
||||
if (spec.a > 0.0)
|
||||
{
|
||||
lit = min(da*6.0, 1.0) * dist_atten;
|
||||
//vec3 ref = dot(pos+lv, norm);
|
||||
vec3 h = normalize(lv+npos);
|
||||
float nh = dot(norm, h);
|
||||
float nv = dot(norm, npos);
|
||||
float vh = dot(npos, h);
|
||||
float sa = nh;
|
||||
float fres = pow(1 - dot(h, npos), 5)*0.4+0.5;
|
||||
|
||||
float gtdenom = 2 * nh;
|
||||
float gt = max(0, min(gtdenom * nv / vh, gtdenom * da / vh));
|
||||
float gtdenom = 2 * nh;
|
||||
float gt = max(0, min(gtdenom * nv / vh, gtdenom * da / vh));
|
||||
|
||||
if (nh > 0.0)
|
||||
{
|
||||
float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da);
|
||||
col += lit*scol*light_col[i].rgb*spec.rgb;
|
||||
//col += spec.rgb;
|
||||
}
|
||||
if (nh > 0.0)
|
||||
{
|
||||
float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da);
|
||||
col += lit*scol*light_col[i].rgb*spec.rgb;
|
||||
//col += spec.rgb;
|
||||
}
|
||||
|
||||
out_col += col;
|
||||
}
|
||||
|
||||
out_col += col;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
frag_color.rgb = out_col;
|
||||
frag_color.a = 0.0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
#extension GL_ARB_shader_texture_lod : enable
|
||||
|
||||
|
|
|
|||
|
|
@ -187,9 +187,9 @@ void main()
|
|||
color.rgb = mix(fb.rgb, refcol.rgb, df1 * 0.99999);
|
||||
|
||||
vec4 pos = vary_position;
|
||||
|
||||
|
||||
color.rgb += spec * specular;
|
||||
|
||||
|
||||
color.rgb = atmosTransport(color.rgb);
|
||||
color.rgb = scaleSoftClip(color.rgb);
|
||||
color.a = spec * sunAngle2;
|
||||
|
|
|
|||
|
|
@ -468,7 +468,7 @@ void main()
|
|||
envIntensity);
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (norm.w < 0.5)
|
||||
{
|
||||
col = mix(atmosLighting(col), fullbrightAtmosTransport(col), diffuse.a);
|
||||
|
|
@ -486,7 +486,7 @@ void main()
|
|||
//col = vec3(1,0,1);
|
||||
//col.g = envIntensity;
|
||||
}
|
||||
|
||||
|
||||
frag_color.rgb = col;
|
||||
frag_color.a = bloom;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5050,7 +5050,7 @@ void LLAgent::sendAgentSetAppearance()
|
|||
((param->getID() < 1100) || (!send_v1_message)))
|
||||
{
|
||||
msg->nextBlockFast(_PREHASH_VisualParam );
|
||||
|
||||
|
||||
// We don't send the param ids. Instead, we assume that the receiver has the same params in the same sequence.
|
||||
const F32 param_value = param->getWeight();
|
||||
const U8 new_weight = F32_to_U8(param_value, param->getMinWeight(), param->getMaxWeight());
|
||||
|
|
|
|||
|
|
@ -383,10 +383,6 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)
|
|||
if (group->mSpatialPartition->mRenderByGroup &&
|
||||
!group->isDead())
|
||||
{
|
||||
bool draw_glow_for_this_partition = mVertexShaderLevel > 0 && // no shaders = no glow.
|
||||
// All particle systems seem to come off the wire with texture entries which claim that they glow. This is probably a bug in the data. Suppress.
|
||||
group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_PARTICLE &&
|
||||
group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD_PARTICLE;
|
||||
|
||||
// <FS:LO> Dont suspend partical processing while particles are hidden, just skip over drawing them
|
||||
if(!(gPipeline.sRenderParticles) && (
|
||||
|
|
@ -398,6 +394,10 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)
|
|||
// </FS:LO>
|
||||
|
||||
|
||||
bool draw_glow_for_this_partition = mVertexShaderLevel > 0 && // no shaders = no glow.
|
||||
// All particle systems seem to come off the wire with texture entries which claim that they glow. This is probably a bug in the data. Suppress.
|
||||
group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_PARTICLE &&
|
||||
group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD_PARTICLE;
|
||||
|
||||
LLSpatialGroup::drawmap_elem_t& draw_info = group->mDrawMap[LLRenderPass::PASS_ALPHA];
|
||||
|
||||
|
|
|
|||
|
|
@ -1560,63 +1560,63 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
|
|||
}
|
||||
|
||||
void LLDrawPoolAvatar::getRiggedGeometry(LLFace* face, LLPointer<LLVertexBuffer>& buffer, U32 data_mask, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face)
|
||||
{
|
||||
face->setGeomIndex(0);
|
||||
face->setIndicesIndex(0);
|
||||
|
||||
//rigged faces do not batch textures
|
||||
face->setTextureIndex(255);
|
||||
|
||||
if (buffer.isNull() || buffer->getTypeMask() != data_mask || !buffer->isWriteable())
|
||||
{ //make a new buffer
|
||||
if (sShaderLevel > 0)
|
||||
{
|
||||
buffer = new LLVertexBuffer(data_mask, GL_DYNAMIC_DRAW_ARB);
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer = new LLVertexBuffer(data_mask, GL_STREAM_DRAW_ARB);
|
||||
}
|
||||
buffer->allocateBuffer(vol_face.mNumVertices, vol_face.mNumIndices, true);
|
||||
}
|
||||
else
|
||||
{ //resize existing buffer
|
||||
buffer->resizeBuffer(vol_face.mNumVertices, vol_face.mNumIndices);
|
||||
}
|
||||
|
||||
face->setSize(vol_face.mNumVertices, vol_face.mNumIndices);
|
||||
face->setVertexBuffer(buffer);
|
||||
|
||||
U16 offset = 0;
|
||||
|
||||
LLMatrix4 mat_vert = skin->mBindShapeMatrix;
|
||||
glh::matrix4f m((F32*) mat_vert.mMatrix);
|
||||
m = m.inverse().transpose();
|
||||
|
||||
F32 mat3[] =
|
||||
{ m.m[0], m.m[1], m.m[2],
|
||||
m.m[4], m.m[5], m.m[6],
|
||||
m.m[8], m.m[9], m.m[10] };
|
||||
|
||||
LLMatrix3 mat_normal(mat3);
|
||||
|
||||
//let getGeometryVolume know if alpha should override shiny
|
||||
U32 type = gPipeline.getPoolTypeFromTE(face->getTextureEntry(), face->getTexture());
|
||||
|
||||
if (type == LLDrawPool::POOL_ALPHA)
|
||||
{
|
||||
face->setGeomIndex(0);
|
||||
face->setIndicesIndex(0);
|
||||
|
||||
//rigged faces do not batch textures
|
||||
face->setTextureIndex(255);
|
||||
|
||||
if (buffer.isNull() || buffer->getTypeMask() != data_mask || !buffer->isWriteable())
|
||||
{ //make a new buffer
|
||||
if (sShaderLevel > 0)
|
||||
{
|
||||
buffer = new LLVertexBuffer(data_mask, GL_DYNAMIC_DRAW_ARB);
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer = new LLVertexBuffer(data_mask, GL_STREAM_DRAW_ARB);
|
||||
}
|
||||
buffer->allocateBuffer(vol_face.mNumVertices, vol_face.mNumIndices, true);
|
||||
}
|
||||
else
|
||||
{ //resize existing buffer
|
||||
buffer->resizeBuffer(vol_face.mNumVertices, vol_face.mNumIndices);
|
||||
}
|
||||
|
||||
face->setSize(vol_face.mNumVertices, vol_face.mNumIndices);
|
||||
face->setVertexBuffer(buffer);
|
||||
|
||||
U16 offset = 0;
|
||||
|
||||
LLMatrix4 mat_vert = skin->mBindShapeMatrix;
|
||||
glh::matrix4f m((F32*) mat_vert.mMatrix);
|
||||
m = m.inverse().transpose();
|
||||
|
||||
F32 mat3[] =
|
||||
{ m.m[0], m.m[1], m.m[2],
|
||||
m.m[4], m.m[5], m.m[6],
|
||||
m.m[8], m.m[9], m.m[10] };
|
||||
|
||||
LLMatrix3 mat_normal(mat3);
|
||||
|
||||
//let getGeometryVolume know if alpha should override shiny
|
||||
U32 type = gPipeline.getPoolTypeFromTE(face->getTextureEntry(), face->getTexture());
|
||||
|
||||
if (type == LLDrawPool::POOL_ALPHA)
|
||||
{
|
||||
face->setPoolType(LLDrawPool::POOL_ALPHA);
|
||||
}
|
||||
else
|
||||
{
|
||||
face->setPoolType(LLDrawPool::POOL_AVATAR);
|
||||
}
|
||||
face->setPoolType(LLDrawPool::POOL_ALPHA);
|
||||
}
|
||||
else
|
||||
{
|
||||
face->setPoolType(LLDrawPool::POOL_AVATAR);
|
||||
}
|
||||
|
||||
//llinfos << "Rebuilt face " << face->getTEOffset() << " of " << face->getDrawable() << " at " << gFrameTimeSeconds << llendl;
|
||||
face->getGeometryVolume(*volume, face->getTEOffset(), mat_vert, mat_normal, offset, true);
|
||||
face->getGeometryVolume(*volume, face->getTEOffset(), mat_vert, mat_normal, offset, true);
|
||||
|
||||
buffer->flush();
|
||||
}
|
||||
buffer->flush();
|
||||
}
|
||||
|
||||
void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace* face, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -535,14 +535,14 @@ void LLDrawPoolWater::shade()
|
|||
|
||||
if (eyedepth < 0.f && LLPipeline::sWaterReflections)
|
||||
{
|
||||
if (deferred_render)
|
||||
{
|
||||
if (deferred_render)
|
||||
{
|
||||
shader = &gDeferredUnderWaterProgram;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
shader = &gUnderWaterProgram;
|
||||
}
|
||||
{
|
||||
shader = &gUnderWaterProgram;
|
||||
}
|
||||
}
|
||||
else if (deferred_render)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -839,21 +839,21 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f,
|
|||
{
|
||||
v[i].setSelectWithMask(mask[i], min, max);
|
||||
}
|
||||
|
||||
|
||||
LLVector4a tv[8];
|
||||
|
||||
|
||||
//transform bounding box into drawable space
|
||||
for (U32 i = 0; i < 8; ++i)
|
||||
{
|
||||
mat_vert.affineTransform(v[i], tv[i]);
|
||||
}
|
||||
|
||||
|
||||
//find bounding box
|
||||
LLVector4a& newMin = mExtents[0];
|
||||
LLVector4a& newMax = mExtents[1];
|
||||
|
||||
|
||||
newMin = newMax = tv[0];
|
||||
|
||||
|
||||
for (U32 i = 1; i < 8; ++i)
|
||||
{
|
||||
newMin.setMin(newMin, tv[i]);
|
||||
|
|
@ -869,11 +869,11 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f,
|
|||
}
|
||||
|
||||
LLVector4a t;
|
||||
t.setAdd(newMin, newMax);
|
||||
t.setAdd(newMin,newMax);
|
||||
t.mul(0.5f);
|
||||
|
||||
mCenterLocal.set(t.getF32ptr());
|
||||
|
||||
|
||||
t.setSub(newMax,newMin);
|
||||
mBoundingSphereRadius = t.getLength3().getF32()*0.5f;
|
||||
|
||||
|
|
|
|||
|
|
@ -606,7 +606,7 @@ bool LLFeatureManager::parseGPUTable(std::string filename)
|
|||
LL_WARNS("RenderInit") << "GPU '" << rawRenderer << "' not recognized" << LL_ENDL;
|
||||
}
|
||||
//FS:TM based on team vote, don't allow defaulting above High (level 4). Used this here to reduce merge issues with gpu_table.xml
|
||||
//#if LL_DARWIN // never go over "mid" settings by default on OS X (FS:TM was limited to GPU_CLASS_2 only for mac)
|
||||
//#if LL_DARWIN // never go over "Mid" settings by default on OS X (FS:TM was GPU_CLASS_2)
|
||||
mGPUClass = llmin(mGPUClass, GPU_CLASS_4);
|
||||
//#endif
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -52,9 +52,12 @@
|
|||
#define MATERIALS_CAP_MATERIAL_ID_FIELD "MaterialID"
|
||||
#define SIM_FEATURE_MAX_MATERIALS_PER_TRANSACTION "MaxMaterialsPerTransaction"
|
||||
|
||||
#define MATERIALS_GET_MAX_ENTRIES 50
|
||||
#define MATERIALS_GET_TIMEOUT (60.f * 20)
|
||||
#define MATERIALS_POST_MAX_ENTRIES 50
|
||||
#define MATERIALS_POST_TIMEOUT (60.f * 5)
|
||||
#define MATERIALS_PUT_THROTTLE_SECS 1.f
|
||||
#define MATERIALS_PUT_MAX_ENTRIES 50
|
||||
|
||||
/**
|
||||
* LLMaterialsResponder helper class
|
||||
|
|
@ -592,7 +595,7 @@ void LLMaterialMgr::processGetQueue()
|
|||
|
||||
material_queue_t& materials = itRegionQueue->second;
|
||||
U32 max_entries = regionp->getMaxMaterialsPerTransaction();
|
||||
material_queue_t::iterator loopMaterial = materials.begin();
|
||||
material_queue_t::iterator loopMaterial = materials.begin();
|
||||
while ( (materials.end() != loopMaterial) && (materialsData.size() < max_entries) )
|
||||
{
|
||||
material_queue_t::iterator itMaterial = loopMaterial++;
|
||||
|
|
@ -688,34 +691,34 @@ void LLMaterialMgr::processPutQueue()
|
|||
{
|
||||
LLViewerRegion* regionp = objectp->getRegion();
|
||||
if ( !regionp )
|
||||
{
|
||||
{
|
||||
LL_WARNS("Materials") << "Object region is NULL" << LL_ENDL;
|
||||
mPutQueue.erase(itQueue);
|
||||
}
|
||||
}
|
||||
else if ( regionp->capabilitiesReceived() && !regionp->materialsCapThrottled())
|
||||
{
|
||||
LLSD& facesData = requests[regionp];
|
||||
LLSD& facesData = requests[regionp];
|
||||
|
||||
facematerial_map_t& face_map = itQueue->second;
|
||||
facematerial_map_t& face_map = itQueue->second;
|
||||
U32 max_entries = regionp->getMaxMaterialsPerTransaction();
|
||||
facematerial_map_t::iterator itFace = face_map.begin();
|
||||
facematerial_map_t::iterator itFace = face_map.begin();
|
||||
while ( (face_map.end() != itFace) && (facesData.size() < max_entries) )
|
||||
{
|
||||
LLSD faceData = LLSD::emptyMap();
|
||||
faceData[MATERIALS_CAP_FACE_FIELD] = static_cast<LLSD::Integer>(itFace->first);
|
||||
faceData[MATERIALS_CAP_OBJECT_ID_FIELD] = static_cast<LLSD::Integer>(objectp->getLocalID());
|
||||
if (!itFace->second.isNull())
|
||||
{
|
||||
faceData[MATERIALS_CAP_MATERIAL_FIELD] = itFace->second.asLLSD();
|
||||
}
|
||||
facesData.append(faceData);
|
||||
face_map.erase(itFace++);
|
||||
}
|
||||
if (face_map.empty())
|
||||
{
|
||||
mPutQueue.erase(itQueue);
|
||||
}
|
||||
{
|
||||
LLSD faceData = LLSD::emptyMap();
|
||||
faceData[MATERIALS_CAP_FACE_FIELD] = static_cast<LLSD::Integer>(itFace->first);
|
||||
faceData[MATERIALS_CAP_OBJECT_ID_FIELD] = static_cast<LLSD::Integer>(objectp->getLocalID());
|
||||
if (!itFace->second.isNull())
|
||||
{
|
||||
faceData[MATERIALS_CAP_MATERIAL_FIELD] = itFace->second.asLLSD();
|
||||
}
|
||||
facesData.append(faceData);
|
||||
face_map.erase(itFace++);
|
||||
}
|
||||
if (face_map.empty())
|
||||
{
|
||||
mPutQueue.erase(itQueue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ private:
|
|||
// need to get per-face answer to this question for sane alpha mode retention on updates.
|
||||
//
|
||||
bool is_alpha_face = object->isImageAlphaBlended(face);
|
||||
|
||||
|
||||
// need to keep this original answer for valid comparisons in logic below
|
||||
//
|
||||
U8 original_default_alpha_mode = is_alpha_face ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ public:
|
|||
void updateFilterPermMask();
|
||||
void commitIfImmediateSet();
|
||||
void commitCancel();
|
||||
|
||||
|
||||
void onFilterEdit(const std::string& search_string );
|
||||
|
||||
void setCanApply(bool can_preview, bool can_apply);
|
||||
|
|
|
|||
|
|
@ -346,7 +346,7 @@ public:
|
|||
LLViewerTexture *getTENormalMap(const U8 te) const;
|
||||
LLViewerTexture *getTESpecularMap(const U8 te) const;
|
||||
|
||||
bool isImageAlphaBlended(const U8 te) const;
|
||||
bool isImageAlphaBlended(const U8 te) const;
|
||||
|
||||
void fitFaceTexture(const U8 face);
|
||||
void sendTEUpdate() const; // Sends packed representation of all texture entry information
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ public:
|
|||
void getNeighboringRegionsStatus( std::vector<S32>& regions );
|
||||
const LLViewerRegionImpl * getRegionImpl() const { return mImpl; }
|
||||
LLViewerRegionImpl * getRegionImplNC() { return mImpl; }
|
||||
|
||||
|
||||
// implements the materials capability throttle
|
||||
bool materialsCapThrottled() const { return !mMaterialsCapThrottleTimer.hasExpired(); }
|
||||
void resetMaterialsCapThrottle();
|
||||
|
|
|
|||
|
|
@ -313,7 +313,8 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
|
|||
mShaderList.push_back(&gDeferredMaterialWaterProgram[1+LLMaterial::SHADER_COUNT]);
|
||||
mShaderList.push_back(&gDeferredMaterialWaterProgram[5+LLMaterial::SHADER_COUNT]);
|
||||
mShaderList.push_back(&gDeferredMaterialWaterProgram[9+LLMaterial::SHADER_COUNT]);
|
||||
mShaderList.push_back(&gDeferredMaterialWaterProgram[13+LLMaterial::SHADER_COUNT]);
|
||||
mShaderList.push_back(&gDeferredMaterialWaterProgram[13+LLMaterial::SHADER_COUNT]);
|
||||
mShaderList.push_back(&gDeferredAlphaProgram);
|
||||
mShaderList.push_back(&gDeferredAlphaProgram);
|
||||
mShaderList.push_back(&gDeferredAlphaImpostorProgram);
|
||||
mShaderList.push_back(&gDeferredAlphaWaterProgram);
|
||||
|
|
@ -1170,7 +1171,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
|
||||
if (success)
|
||||
{
|
||||
gDeferredDiffuseProgram.mName = "Deferred Diffuse Shader";
|
||||
gDeferredDiffuseProgram.mName = "Deferred Diffuse Shader";
|
||||
gDeferredDiffuseProgram.mShaderFiles.clear();
|
||||
gDeferredDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER_ARB));
|
||||
gDeferredDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseIndexedF.glsl", GL_FRAGMENT_SHADER_ARB));
|
||||
|
|
@ -1412,8 +1413,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
|
||||
for (U32 i = 0; i < LL_DEFERRED_MULTI_LIGHT_COUNT; i++)
|
||||
{
|
||||
if (success)
|
||||
{
|
||||
if (success)
|
||||
{
|
||||
gDeferredMultiLightProgram[i].mName = llformat("Deferred MultiLight Shader %d", i);
|
||||
gDeferredMultiLightProgram[i].mShaderFiles.clear();
|
||||
gDeferredMultiLightProgram[i].mShaderFiles.push_back(make_pair("deferred/multiPointLightV.glsl", GL_VERTEX_SHADER_ARB));
|
||||
|
|
@ -1744,20 +1745,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
success = gDeferredUnderWaterProgram.createShader(NULL, NULL);
|
||||
}
|
||||
|
||||
if (success)
|
||||
{
|
||||
// load water shader
|
||||
gDeferredUnderWaterProgram.mName = "Deferred Under Water Shader";
|
||||
gDeferredUnderWaterProgram.mFeatures.calculatesAtmospherics = true;
|
||||
gDeferredUnderWaterProgram.mFeatures.hasGamma = true;
|
||||
gDeferredUnderWaterProgram.mFeatures.hasTransport = true;
|
||||
gDeferredUnderWaterProgram.mShaderFiles.clear();
|
||||
gDeferredUnderWaterProgram.mShaderFiles.push_back(make_pair("deferred/waterV.glsl", GL_VERTEX_SHADER_ARB));
|
||||
gDeferredUnderWaterProgram.mShaderFiles.push_back(make_pair("deferred/underWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
|
||||
gDeferredUnderWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
|
||||
success = gDeferredUnderWaterProgram.createShader(NULL, NULL);
|
||||
}
|
||||
|
||||
if (success)
|
||||
{
|
||||
// <FS:Ansariel> Tofu's SSR
|
||||
|
|
|
|||
|
|
@ -336,4 +336,3 @@ extern LLGLSLShader gVignettePost; // <FS:CR> Import Vignette from Exodu
|
|||
extern LLGLSLShader gDeferredMaterialProgram[LLMaterial::SHADER_COUNT*2];
|
||||
extern LLGLSLShader gDeferredMaterialWaterProgram[LLMaterial::SHADER_COUNT*2];
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -694,6 +694,7 @@ public:
|
|||
av_iter++;
|
||||
}
|
||||
}
|
||||
|
||||
//if (gSavedSettings.getBOOL("DebugShowRenderMatrices"))
|
||||
static LLCachedControl<bool> debugShowRenderMatrices(gSavedSettings, "DebugShowRenderMatrices");
|
||||
if (debugShowRenderMatrices)
|
||||
|
|
|
|||
|
|
@ -1171,7 +1171,7 @@ void LLVOVolume::sculpt()
|
|||
S32 max_discard = mSculptTexture->getMaxDiscardLevel();
|
||||
if (discard_level > max_discard)
|
||||
{
|
||||
discard_level = max_discard; // clamp to the best we can do
|
||||
discard_level = max_discard; // clamp to the best we can do
|
||||
}
|
||||
if(discard_level > MAX_DISCARD_LEVEL)
|
||||
{
|
||||
|
|
@ -1535,7 +1535,7 @@ BOOL LLVOVolume::genBBoxes(BOOL force_global)
|
|||
continue;
|
||||
}
|
||||
res &= face->genVolumeBBoxes(*volume, i,
|
||||
mRelativeXform, /*mRelativeXformInvTrans,*/
|
||||
mRelativeXform,
|
||||
(mVolumeImpl && mVolumeImpl->isVolumeGlobal()) || force_global);
|
||||
|
||||
if (rebuild)
|
||||
|
|
@ -5081,7 +5081,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
|
|||
{
|
||||
if (!drawablep->isState(LLDrawable::RIGGED))
|
||||
{
|
||||
drawablep->setState(LLDrawable::RIGGED);
|
||||
drawablep->setState(LLDrawable::RIGGED);
|
||||
|
||||
//first time this is drawable is being marked as rigged,
|
||||
// do another LoD update to use avatar bounding box
|
||||
|
|
|
|||
|
|
@ -128,6 +128,10 @@
|
|||
//#define DEBUG_INDICES
|
||||
#endif
|
||||
|
||||
// Expensive and currently broken
|
||||
//
|
||||
#define MATERIALS_IN_REFLECTIONS 0
|
||||
|
||||
bool gShiftFrame = false;
|
||||
|
||||
//cached settings
|
||||
|
|
@ -685,6 +689,7 @@ void LLPipeline::init()
|
|||
connectRefreshCachedSettingsSafe("CameraMaxCoF");
|
||||
connectRefreshCachedSettingsSafe("CameraDoFResScale");
|
||||
connectRefreshCachedSettingsSafe("RenderAutoHideSurfaceAreaLimit");
|
||||
gSavedSettings.getControl("RenderAutoHideSurfaceAreaLimit")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
|
||||
connectRefreshCachedSettingsSafe("FSRenderVignette"); // <FS:CR> Import Vignette from Exodus
|
||||
}
|
||||
|
||||
|
|
@ -826,7 +831,7 @@ void LLPipeline::resizeScreenTexture()
|
|||
if ((resX != mScreen.getWidth()) || (resY != mScreen.getHeight()))
|
||||
{
|
||||
releaseScreenBuffers();
|
||||
if (!allocateScreenBuffer(resX,resY))
|
||||
if (!allocateScreenBuffer(resX,resY))
|
||||
{
|
||||
#if PROBABLE_FALSE_DISABLES_OF_ALM_HERE
|
||||
//FAILSAFE: screen buffer allocation failed, disable deferred rendering if it's enabled
|
||||
|
|
@ -5493,7 +5498,7 @@ void LLPipeline::renderDebug()
|
|||
if (i > 3)
|
||||
{ //render shadow frusta as volumes
|
||||
if (mShadowFrustPoints[i-4].empty())
|
||||
{
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -8559,6 +8564,7 @@ void LLPipeline::renderDeferredLighting()
|
|||
}
|
||||
|
||||
gDeferredSunProgram.uniform3fv(sOffset, slice, offset);
|
||||
gDeferredSunProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, mDeferredLight.getWidth(), mDeferredLight.getHeight());
|
||||
|
||||
{
|
||||
LLGLDisable blend(GL_BLEND);
|
||||
|
|
|
|||
|
|
@ -299,7 +299,7 @@ public:
|
|||
void unbindDeferredShader(LLGLSLShader& shader);
|
||||
void renderDeferredLighting();
|
||||
void renderDeferredLightingToRT(LLRenderTarget* target);
|
||||
|
||||
|
||||
void generateWaterReflection(LLCamera& camera);
|
||||
void generateSunShadow(LLCamera& camera);
|
||||
void generateHighlight(LLCamera& camera);
|
||||
|
|
|
|||
Loading…
Reference in New Issue