/
StencilOperation.js
77 lines (68 loc) · 1.82 KB
/
StencilOperation.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*global define*/
define(function() {
"use strict";
/**
* Determines the action taken based on the result of the stencil test.
*
* @exports StencilOperation
*/
var StencilOperation = {
/**
* 0. Sets the stencil buffer value to zero.
*
* @type {Number}
* @constant
*/
ZERO : 0,
/**
* 0x1E00. Does not change the stencil buffer.
*
* @type {Number}
* @constant
*/
KEEP : 0x1E00,
/**
* 0x1E01. Replaces the stencil buffer value with the reference value.
*
* @type {Number}
* @constant
*/
REPLACE : 0x1E01,
/**
* 0x1E02. Increments the stencil buffer value, clamping to unsigned byte.
*
* @type {Number}
* @constant
*/
INCREMENT : 0x1E02, // WebGL: INCR
/**
* 0x1E03. Decrements the stencil buffer value, clamping to zero.
*
* @type {Number}
* @constant
*/
DECREMENT : 0x1E03, // WebGL: DECR
/**
* 0x150A. Bitwise inverts the existing stencil buffer value.
*
* @type {Number}
* @constant
*/
INVERT : 0x150A,
/**
* 0x8507. Increments the stencil buffer value, wrapping to zero when exceeding the unsigned byte range.
*
* @type {Number}
* @constant
*/
INCREMENT_WRAP : 0x8507, // WebGL: INCR_WRAP
/**
* 0x8508. Decrements the stencil buffer value, wrapping to the maximum unsigned byte instead of going below zero.
*
* @type {Number}
* @constant
*/
DECREMENT_WRAP : 0x8508 // WebGL: DECR_WRAP
};
return StencilOperation;
});