|
@@ -19935,13 +19935,16 @@ function WebGLState( gl, extensions, utils ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- function setMaterial( material ) {
|
|
|
+ function setMaterial( material, frontFaceCW ) {
|
|
|
|
|
|
material.side === DoubleSide
|
|
|
? disable( gl.CULL_FACE )
|
|
|
: enable( gl.CULL_FACE );
|
|
|
|
|
|
- setFlipSided( material.side === BackSide );
|
|
|
+ var flipSided = ( material.side === BackSide );
|
|
|
+ if ( frontFaceCW ) flipSided = ! flipSided;
|
|
|
+
|
|
|
+ setFlipSided( flipSided );
|
|
|
|
|
|
material.transparent === true
|
|
|
? setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha, material.premultipliedAlpha )
|
|
@@ -21820,7 +21823,9 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
this.renderBufferDirect = function ( camera, fog, geometry, material, object, group ) {
|
|
|
|
|
|
- state.setMaterial( material );
|
|
|
+ var frontFaceCW = ( object.isMesh && object.matrixWorld.determinant() < 0 );
|
|
|
+
|
|
|
+ state.setMaterial( material, frontFaceCW );
|
|
|
|
|
|
var program = setProgram( camera, fog, material, object );
|
|
|
var geometryProgram = geometry.id + '_' + program.id + '_' + ( material.wireframe === true );
|
|
@@ -22569,7 +22574,9 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
if ( object.isImmediateRenderObject ) {
|
|
|
|
|
|
- state.setMaterial( material );
|
|
|
+ var frontFaceCW = ( object.isMesh && object.matrixWorld.determinant() < 0 );
|
|
|
+
|
|
|
+ state.setMaterial( material, frontFaceCW );
|
|
|
|
|
|
var program = setProgram( camera, scene.fog, material, object );
|
|
|
|