|
@@ -103,59 +103,51 @@ function WebGLState( gl, extensions, capabilities ) {
|
|
|
|
|
|
if ( currentDepthFunc !== depthFunc ) {
|
|
|
|
|
|
- if ( depthFunc ) {
|
|
|
+ switch ( depthFunc ) {
|
|
|
|
|
|
- switch ( depthFunc ) {
|
|
|
+ case NeverDepth:
|
|
|
|
|
|
- case NeverDepth:
|
|
|
-
|
|
|
- gl.depthFunc( gl.NEVER );
|
|
|
- break;
|
|
|
-
|
|
|
- case AlwaysDepth:
|
|
|
-
|
|
|
- gl.depthFunc( gl.ALWAYS );
|
|
|
- break;
|
|
|
-
|
|
|
- case LessDepth:
|
|
|
+ gl.depthFunc( gl.NEVER );
|
|
|
+ break;
|
|
|
|
|
|
- gl.depthFunc( gl.LESS );
|
|
|
- break;
|
|
|
+ case AlwaysDepth:
|
|
|
|
|
|
- case LessEqualDepth:
|
|
|
+ gl.depthFunc( gl.ALWAYS );
|
|
|
+ break;
|
|
|
|
|
|
- gl.depthFunc( gl.LEQUAL );
|
|
|
- break;
|
|
|
+ case LessDepth:
|
|
|
|
|
|
- case EqualDepth:
|
|
|
+ gl.depthFunc( gl.LESS );
|
|
|
+ break;
|
|
|
|
|
|
- gl.depthFunc( gl.EQUAL );
|
|
|
- break;
|
|
|
+ case LessEqualDepth:
|
|
|
|
|
|
- case GreaterEqualDepth:
|
|
|
+ gl.depthFunc( gl.LEQUAL );
|
|
|
+ break;
|
|
|
|
|
|
- gl.depthFunc( gl.GEQUAL );
|
|
|
- break;
|
|
|
+ case EqualDepth:
|
|
|
|
|
|
- case GreaterDepth:
|
|
|
+ gl.depthFunc( gl.EQUAL );
|
|
|
+ break;
|
|
|
|
|
|
- gl.depthFunc( gl.GREATER );
|
|
|
- break;
|
|
|
+ case GreaterEqualDepth:
|
|
|
|
|
|
- case NotEqualDepth:
|
|
|
+ gl.depthFunc( gl.GEQUAL );
|
|
|
+ break;
|
|
|
|
|
|
- gl.depthFunc( gl.NOTEQUAL );
|
|
|
- break;
|
|
|
+ case GreaterDepth:
|
|
|
|
|
|
- default:
|
|
|
+ gl.depthFunc( gl.GREATER );
|
|
|
+ break;
|
|
|
|
|
|
- gl.depthFunc( gl.LEQUAL );
|
|
|
+ case NotEqualDepth:
|
|
|
|
|
|
- }
|
|
|
+ gl.depthFunc( gl.NOTEQUAL );
|
|
|
+ break;
|
|
|
|
|
|
- } else {
|
|
|
+ default:
|
|
|
|
|
|
- gl.depthFunc( gl.LEQUAL );
|
|
|
+ gl.depthFunc( gl.LEQUAL );
|
|
|
|
|
|
}
|
|
|
|