]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
dpsoftrast: SHADERMODE_GENERIC SHADERPERMUTATION_ALPHAKILL too
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 10 Mar 2012 12:54:55 +0000 (12:54 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 10 Mar 2012 12:54:55 +0000 (12:54 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11753 d7cf8633-e32d-0410-b094-e92efae38249

dpsoftrast.c

index b57129c1c9d1fac110198bc5d5e48444e9baa475..4967ef0eb7214422093812fcc5714571fdf153af 100644 (file)
@@ -3263,6 +3263,12 @@ static void DPSOFTRAST_PixelShader_Generic(DPSOFTRAST_State_Thread *thread, cons
        }
        else
                DPSOFTRAST_Draw_Span_VaryingBGRA8(triangle, span, buffer_FragColorbgra8, 1, buffer_z);
+       if(thread->shader_permutation & SHADERPERMUTATION_ALPHAKILL)
+       {
+               int x;
+               for (x = span->startx;x < span->endx;x++)
+                       buffer_FragColorbgra8[x*4+3] = buffer_FragColorbgra8[x*4+3] * thread->uniform4f[DPSOFTRAST_UNIFORM_Alpha*4+0];
+       }
        DPSOFTRAST_Draw_Span_FinishBGRA8(thread, triangle, span, buffer_FragColorbgra8);
 }