@@ -53,6 +53,12 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent
5353 }
5454
5555 var alpha = container . _alpha ;
56+
57+ var alphaTopRight = container . alphaTopRight ;
58+ var alphaBottomLeft = container . alphaBottomLeft ;
59+ var alphaBottomRight = container . alphaBottomRight ;
60+ var usingQuadAlpha = ( alphaBottomLeft !== alpha || alphaBottomRight !== alpha || alphaTopRight !== alpha ) ;
61+
5662 var scrollFactorX = container . scrollFactorX ;
5763 var scrollFactorY = container . scrollFactorY ;
5864
@@ -70,6 +76,11 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent
7076 }
7177
7278 var childAlpha = child . alpha ;
79+ var childAlphaTopRight = child . alphaTopRight ;
80+ var childAlphaBottomLeft = child . alphaBottomLeft ;
81+ var childAlphaBottomRight = child . alphaBottomRight ;
82+ var usingChildQuadAlpha = ( childAlphaBottomLeft !== childAlpha || childAlphaBottomRight !== childAlpha || childAlphaTopRight !== childAlpha ) ;
83+
7384 var childScrollFactorX = child . scrollFactorX ;
7485 var childScrollFactorY = child . scrollFactorY ;
7586
@@ -106,13 +117,39 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent
106117
107118 // Set parent values
108119 child . setScrollFactor ( childScrollFactorX * scrollFactorX , childScrollFactorY * scrollFactorY ) ;
109- child . setAlpha ( childAlpha * alpha ) ;
120+
121+ if ( usingQuadAlpha )
122+ {
123+ if ( usingChildQuadAlpha )
124+ {
125+ child . setAlpha ( childAlpha * alpha , childAlphaTopRight * alphaTopRight , childAlphaBottomLeft * alphaBottomLeft , childAlphaBottomRight * alphaBottomRight ) ;
126+ }
127+ else
128+ {
129+ child . setAlpha ( childAlpha * alpha , childAlpha * alphaTopRight , childAlpha * alphaBottomLeft , childAlpha * alphaBottomRight ) ;
130+ }
131+ }
132+ else if ( usingChildQuadAlpha )
133+ {
134+ child . setAlpha ( childAlpha * alpha , childAlphaTopRight * alpha , childAlphaBottomLeft * alpha , childAlphaBottomRight * alpha ) ;
135+ }
136+ else
137+ {
138+ child . setAlpha ( childAlpha * alpha ) ;
139+ }
110140
111141 // Render
112142 child . renderWebGL ( renderer , child , interpolationPercentage , camera , transformMatrix ) ;
113143
114144 // Restore original values
115- child . setAlpha ( childAlpha ) ;
145+ if ( usingChildQuadAlpha )
146+ {
147+ child . setAlpha ( childAlpha , childAlphaTopRight , childAlphaBottomLeft , childAlphaBottomRight ) ;
148+ }
149+ else
150+ {
151+ child . setAlpha ( childAlpha ) ;
152+ }
116153 child . setScrollFactor ( childScrollFactorX , childScrollFactorY ) ;
117154
118155 renderer . newType = false ;
0 commit comments