// virtual
BOOL LLViewerTexLayerSetBuffer::needsRender()
{
	llassert(mTexLayerSet->getAvatarAppearance() == gAgentAvatarp);
	if (!isAgentAvatarValid()) return FALSE;

	const BOOL upload_now = mNeedsUpload && isReadyToUpload();
	const BOOL update_now = mNeedsUpdate && isReadyToUpdate();

	// Don't render if we don't want to (or aren't ready to) upload or update.
	if (!(update_now || upload_now))
	{
		return FALSE;
	}

	// Don't render if we're animating our appearance.
	if (gAgentAvatarp->getIsAppearanceAnimating())
	{
		return FALSE;
	}

	// Don't render if we are trying to create a shirt texture but aren't wearing a skirt.
	if (gAgentAvatarp->getBakedTE(getViewerTexLayerSet()) == LLAvatarAppearanceDefines::TEX_SKIRT_BAKED && 
		!gAgentAvatarp->isWearingWearableType(LLWearableType::WT_SKIRT))
	{
		cancelUpload();
		return FALSE;
	}

	// Render if we have at least minimal level of detail for each local texture.
	return getViewerTexLayerSet()->isLocalTextureDataAvailable();
}
示例#2
0
/**
 * If the shadow is ready to be updated, check if the shadow is both
 * visible and dirty, and re-populate the shadow mesh if needed.
 *
 * To keep the shadow lag count synchronized across all shadow-casting nodes,
 * the shadow lag count will be reset to the value of the shadow lag factor
 * if the shadow is ready to be updated, even if it is not actually updated
 * due to it being invisible, or not dirty.
 */
void CC3ShadowVolumeMeshNode::updateShadow()
{
	//LogTrace(@"Testing to update %@ with shadow lag count %i", self, _shadowLagCount);
	if (isReadyToUpdate())
	{
		if (isShadowVisible())
		{
			updateStencilAlgorithm();
			if (_isShadowDirty) 
			{
				//LogTrace(@"Updating %@", self);
				populateShadowMesh();
				_isShadowDirty = false;
			}
		}
		_shadowLagCount = _shadowLagFactor;
	}
}
// virtual
void LLViewerTexLayerSetBuffer::midRenderTexLayerSet(BOOL success)
{
	// do we need to upload, and do we have sufficient data to create an uploadable composite?
	// TODO: When do we upload the texture if gAgent.mNumPendingQueries is non-zero?
	const BOOL upload_now = mNeedsUpload && isReadyToUpload();
	const BOOL update_now = mNeedsUpdate && isReadyToUpdate();

	if(upload_now)
	{
		if (!success)
		{
			LL_INFOS() << "Failed attempt to bake " << mTexLayerSet->getBodyRegionName() << LL_ENDL;
			mUploadPending = FALSE;
		}
		else
		{
			LLViewerTexLayerSet* layer_set = getViewerTexLayerSet();
			if (layer_set->isVisible())
			{
				layer_set->getAvatar()->debugBakedTextureUpload(layer_set->getBakedTexIndex(), FALSE); // FALSE for start of upload, TRUE for finish.
				doUpload();
			}
			else
			{
				mUploadPending = FALSE;
				mNeedsUpload = FALSE;
				mNeedsUploadTimer.pause();
				layer_set->getAvatar()->setNewBakedTexture(layer_set->getBakedTexIndex(),IMG_INVISIBLE);
			}
		}
	}
	
	if (update_now)
	{
		doUpdate();
	}

	// *TODO: Old logic does not check success before setGLTextureCreated
	// we have valid texture data now
	mGLTexturep->setGLTextureCreated(true);
}