Scott Lawrence avatar Scott Lawrence committed 3a7b305 Merge

merge changes for sh-2963

Comments (0)

Files changed (3)

indra/newview/lldrawpool.h

 		PASS_ALPHA,
 		PASS_ALPHA_MASK,
 		PASS_FULLBRIGHT_ALPHA_MASK,
+		PASS_ALPHA_INVISIBLE,
 		NUM_RENDER_TYPES,
 	};
 

indra/newview/lldrawpoolalpha.cpp

 
 		pushBatches(LLRenderPass::PASS_ALPHA_MASK, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
 		pushBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
+		pushBatches(LLRenderPass::PASS_ALPHA_INVISIBLE, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE);
 
 		if(shaders) 
 		{

indra/newview/llvovolume.cpp

 					else
 					{
 						if (te->getColor().mV[3] > 0.f)
-						{
+						{ //only treat as alpha in the pipeline if < 100% transparent
 							drawablep->setState(LLDrawable::HAS_ALPHA);
-							alpha_faces.push_back(facep);
 						}
+						alpha_faces.push_back(facep);
 					}
 				}
 				else
 			if (is_alpha)
 			{
 				// can we safely treat this as an alpha mask?
-				if (facep->canRenderAsMask())
+				if (facep->getFaceColor().mV[3] <= 0.f)
+				{ //100% transparent, don't render unless we're highlighting transparent
+					registerFace(group, facep, LLRenderPass::PASS_ALPHA_INVISIBLE);
+				}
+				else if (facep->canRenderAsMask())
 				{
 					if (te->getFullbright() || LLPipeline::sNoAlpha)
 					{
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.