commit
69aef3a806
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
uniform mat3 normal_matrix;
|
||||
uniform mat4 texture_matrix0;
|
||||
uniform mat4 texture_matrix1;
|
||||
uniform mat4 modelview_matrix;
|
||||
uniform mat4 modelview_projection_matrix;
|
||||
|
||||
|
|
@ -70,7 +71,7 @@ void main()
|
|||
#endif
|
||||
|
||||
vary_position = pos.xyz;
|
||||
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
|
||||
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
|
||||
|
||||
#ifndef HAS_REFLECTION_PROBES
|
||||
vec3 ref = reflect(pos.xyz, -norm);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ void fullbright_lighting()
|
|||
discard;
|
||||
}
|
||||
|
||||
color.rgb *= vertex_color.rgb;
|
||||
color *= vertex_color;
|
||||
|
||||
color.rgb = pow(color.rgb, vec3(texture_gamma));
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
uniform mat3 normal_matrix;
|
||||
uniform mat4 texture_matrix0;
|
||||
uniform mat4 texture_matrix1;
|
||||
uniform mat4 modelview_matrix;
|
||||
uniform mat4 modelview_projection_matrix;
|
||||
|
||||
|
|
@ -70,7 +71,7 @@ void main()
|
|||
vec3 ref = reflect(pos.xyz, -norm);
|
||||
|
||||
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
|
||||
vary_texcoord1 = transpose(normal_matrix) * ref;
|
||||
vary_texcoord1 = (texture_matrix1 * vec4(ref,1.0)).xyz;
|
||||
|
||||
calcAtmospherics(pos.xyz);
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
uniform mat3 normal_matrix;
|
||||
uniform mat4 texture_matrix0;
|
||||
uniform mat4 texture_matrix1;
|
||||
uniform mat4 modelview_matrix;
|
||||
uniform mat4 modelview_projection_matrix;
|
||||
|
||||
|
|
@ -69,7 +70,7 @@ void main()
|
|||
vec3 ref = reflect(pos.xyz, -norm);
|
||||
|
||||
vary_texcoord0 = (texture_matrix0*vec4(texcoord0,0,1)).xy;
|
||||
vary_texcoord1 = transpose(normal_matrix) * ref;
|
||||
vary_texcoord1 = (texture_matrix1 * vec4(ref,1.0)).xyz;
|
||||
|
||||
calcAtmospherics(pos.xyz);
|
||||
|
||||
|
|
|
|||
|
|
@ -311,6 +311,7 @@ void LLDrawPoolBump::bindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& di
|
|||
shader->uniform4fv(LLViewerShaderMgr::SHINY_ORIGIN, 1, vec4.mV);
|
||||
if (shader_level > 1)
|
||||
{
|
||||
cube_map->setMatrix(1);
|
||||
// Make sure that texture coord generation happens for tex unit 1, as that's the one we use for
|
||||
// the cube map in the one pass shiny shaders
|
||||
cube_channel = shader->enableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP);
|
||||
|
|
@ -319,6 +320,7 @@ void LLDrawPoolBump::bindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& di
|
|||
}
|
||||
else
|
||||
{
|
||||
cube_map->setMatrix(0);
|
||||
cube_channel = shader->enableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP);
|
||||
diffuse_channel = -1;
|
||||
cube_map->enable(cube_channel);
|
||||
|
|
@ -332,6 +334,7 @@ void LLDrawPoolBump::bindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& di
|
|||
diffuse_channel = -1;
|
||||
gGL.getTexUnit(0)->disable();
|
||||
cube_map->enable(0);
|
||||
cube_map->setMatrix(0);
|
||||
gGL.getTexUnit(0)->bind(cube_map);
|
||||
}
|
||||
}
|
||||
|
|
@ -390,6 +393,7 @@ void LLDrawPoolBump::unbindCubeMap(LLGLSLShader* shader, S32 shader_level, S32&
|
|||
// Moved below shader->disableTexture call to avoid false alarms from auto-re-enable of textures on stage 0
|
||||
// MAINT-755
|
||||
cube_map->disable();
|
||||
cube_map->restoreMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -460,6 +464,7 @@ void LLDrawPoolBump::beginFullbrightShiny()
|
|||
LLVector4 vec4(vec, gShinyOrigin.mV[3]);
|
||||
shader->uniform4fv(LLViewerShaderMgr::SHINY_ORIGIN, 1, vec4.mV);
|
||||
|
||||
cube_map->setMatrix(1);
|
||||
if (shader->mFeatures.hasReflectionProbes)
|
||||
{
|
||||
gPipeline.bindReflectionProbes(*shader);
|
||||
|
|
@ -525,6 +530,7 @@ void LLDrawPoolBump::endFullbrightShiny()
|
|||
if( cube_map )
|
||||
{
|
||||
cube_map->disable();
|
||||
cube_map->restoreMatrix();
|
||||
if (shader->mFeatures.hasReflectionProbes)
|
||||
{
|
||||
gPipeline.unbindReflectionProbes(*shader);
|
||||
|
|
|
|||
|
|
@ -256,6 +256,19 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
struct CompareRenderOrder
|
||||
{
|
||||
bool operator()(const LLSpatialGroup* const& lhs, const LLSpatialGroup* const& rhs)
|
||||
{
|
||||
if (lhs->mAvatarp != rhs->mAvatarp)
|
||||
{
|
||||
return lhs->mAvatarp < rhs->mAvatarp;
|
||||
}
|
||||
|
||||
return lhs->mRenderOrder > rhs->mRenderOrder;
|
||||
}
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GEOM_DIRTY = LLViewerOctreeGroup::INVALID_STATE,
|
||||
|
|
@ -354,6 +367,9 @@ public:
|
|||
F32 mPixelArea;
|
||||
F32 mRadius;
|
||||
|
||||
//used by LLVOAVatar to set render order in alpha draw pool to preserve legacy render order behavior
|
||||
LLVOAvatar* mAvatarp = nullptr;
|
||||
U32 mRenderOrder = 0;
|
||||
// Reflection Probe associated with this node (if any)
|
||||
LLPointer<LLReflectionMap> mReflectionProbe = nullptr;
|
||||
|
||||
|
|
|
|||
|
|
@ -2809,6 +2809,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
|
|||
// update attachments positions
|
||||
if (detailed_update)
|
||||
{
|
||||
U32 draw_order = 0;
|
||||
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
|
||||
iter != mAttachmentPoints.end();
|
||||
++iter)
|
||||
|
|
@ -2847,9 +2848,17 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
attached_object->mDrawable->makeActive();
|
||||
attached_object->mDrawable->updateXform(TRUE);
|
||||
// if selecting any attachments, update all of them as non-damped
|
||||
if (LLSelectMgr::getInstance()->getSelection()->getObjectCount() && LLSelectMgr::getInstance()->getSelection()->isAttachment())
|
||||
{
|
||||
gPipeline.updateMoveNormalAsync(attached_object->mDrawable);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Note: SL-17415; While most objects follow joints,
|
||||
// some objects get position updates from server
|
||||
gPipeline.updateMoveDampedAsync(attached_object->mDrawable);
|
||||
}
|
||||
|
||||
// override_bbox calls movePartition() and getSpatialPartition(),
|
||||
// so bridge might no longer be valid, get it again.
|
||||
|
|
@ -2867,6 +2876,13 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
|
|||
bridge->setState(LLDrawable::MOVE_UNDAMPED);
|
||||
bridge->updateMove();
|
||||
bridge->setState(LLDrawable::EARLY_MOVE);
|
||||
|
||||
LLSpatialGroup* group = attached_object->mDrawable->getSpatialGroup();
|
||||
if (group)
|
||||
{ //set draw order of group
|
||||
group->mAvatarp = this;
|
||||
group->mRenderOrder = draw_order++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3877,7 +3877,11 @@ void LLPipeline::postSort(LLCamera& camera)
|
|||
|
||||
if (!sShadowRender)
|
||||
{
|
||||
// order alpha groups by distance
|
||||
std::sort(sCull->beginAlphaGroups(), sCull->endAlphaGroups(), LLSpatialGroup::CompareDepthGreater());
|
||||
|
||||
// order rigged alpha groups by avatar attachment order
|
||||
std::sort(sCull->beginRiggedAlphaGroups(), sCull->endRiggedAlphaGroups(), LLSpatialGroup::CompareRenderOrder());
|
||||
}
|
||||
|
||||
LL_PUSH_CALLSTACKS();
|
||||
|
|
|
|||
Loading…
Reference in New Issue