File tree Expand file tree Collapse file tree 8 files changed +19
-56
lines changed Expand file tree Collapse file tree 8 files changed +19
-56
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ function vtkOpenGLActor(publicAPI, model) {
132
132
133
133
publicAPI . opaquePass = ( prepass , renderPass ) => {
134
134
if ( prepass ) {
135
- model . openGLRenderWindow . enableDepthMask ( ) ;
135
+ model . context . depthMask ( true ) ;
136
136
publicAPI . activateTextures ( ) ;
137
137
} else if ( model . activeTextures ) {
138
138
for ( let index = 0 ; index < model . activeTextures . length ; index ++ ) {
@@ -144,7 +144,7 @@ function vtkOpenGLActor(publicAPI, model) {
144
144
// Renders myself
145
145
publicAPI . translucentPass = ( prepass , renderPass ) => {
146
146
if ( prepass ) {
147
- model . openGLRenderWindow . disableDepthMask ( ) ;
147
+ model . context . depthMask ( false ) ;
148
148
publicAPI . activateTextures ( ) ;
149
149
} else if ( model . activeTextures ) {
150
150
for ( let index = 0 ; index < model . activeTextures . length ; index ++ ) {
Original file line number Diff line number Diff line change @@ -17,8 +17,12 @@ function vtkOpenGLActor2D(publicAPI, model) {
17
17
if ( ! model . renderable ) {
18
18
return ;
19
19
}
20
+ model . openGLRenderWindow = publicAPI . getFirstAncestorOfType (
21
+ 'vtkOpenGLRenderWindow'
22
+ ) ;
20
23
model . openGLRenderer =
21
24
publicAPI . getFirstAncestorOfType ( 'vtkOpenGLRenderer' ) ;
25
+ model . context = model . openGLRenderWindow . getContext ( ) ;
22
26
publicAPI . prepareNodes ( ) ;
23
27
publicAPI . addMissingNodes ( model . renderable . getTextures ( ) ) ;
24
28
publicAPI . addMissingNode ( model . renderable . getMapper ( ) ) ;
@@ -84,9 +88,6 @@ function vtkOpenGLActor2D(publicAPI, model) {
84
88
// Renders myself
85
89
publicAPI . opaquePass = ( prepass , renderPass ) => {
86
90
if ( prepass ) {
87
- model . context = publicAPI
88
- . getFirstAncestorOfType ( 'vtkOpenGLRenderWindow' )
89
- . getContext ( ) ;
90
91
model . context . depthMask ( true ) ;
91
92
publicAPI . activateTextures ( ) ;
92
93
} else {
@@ -100,9 +101,6 @@ function vtkOpenGLActor2D(publicAPI, model) {
100
101
// Renders myself
101
102
publicAPI . translucentPass = ( prepass , renderPass ) => {
102
103
if ( prepass ) {
103
- model . context = publicAPI
104
- . getFirstAncestorOfType ( 'vtkOpenGLRenderWindow' )
105
- . getContext ( ) ;
106
104
model . context . depthMask ( false ) ;
107
105
publicAPI . activateTextures ( ) ;
108
106
} else {
Original file line number Diff line number Diff line change @@ -22,9 +22,12 @@ function vtkOpenGLImageSlice(publicAPI, model) {
22
22
if ( ! model . renderable ) {
23
23
return ;
24
24
}
25
-
25
+ model . openGLRenderWindow = publicAPI . getFirstAncestorOfType (
26
+ 'vtkOpenGLRenderWindow'
27
+ ) ;
26
28
model . openGLRenderer =
27
29
publicAPI . getFirstAncestorOfType ( 'vtkOpenGLRenderer' ) ;
30
+ model . context = model . openGLRenderWindow . getContext ( ) ;
28
31
publicAPI . prepareNodes ( ) ;
29
32
publicAPI . addMissingNode ( model . renderable . getMapper ( ) ) ;
30
33
publicAPI . removeUnusedNodes ( ) ;
@@ -92,23 +95,13 @@ function vtkOpenGLImageSlice(publicAPI, model) {
92
95
// Renders myself
93
96
publicAPI . opaquePass = ( prepass , renderPass ) => {
94
97
if ( prepass ) {
95
- model . context = publicAPI
96
- . getFirstAncestorOfType ( 'vtkOpenGLRenderWindow' )
97
- . getContext ( ) ;
98
98
model . context . depthMask ( true ) ;
99
99
}
100
100
} ;
101
101
102
102
// Renders myself
103
103
publicAPI . translucentPass = ( prepass , renderPass ) => {
104
- if ( prepass ) {
105
- model . context = publicAPI
106
- . getFirstAncestorOfType ( 'vtkOpenGLRenderWindow' )
107
- . getContext ( ) ;
108
- model . context . depthMask ( false ) ;
109
- } else {
110
- model . context . depthMask ( true ) ;
111
- }
104
+ model . context . depthMask ( ! prepass ) ;
112
105
} ;
113
106
114
107
publicAPI . getKeyMatrices = ( ) => {
Original file line number Diff line number Diff line change @@ -273,16 +273,6 @@ export interface vtkOpenGLRenderWindow extends vtkOpenGLRenderWindowBase {
273
273
*/
274
274
traverseAllPasses ( ) : void ;
275
275
276
- /**
277
- *
278
- */
279
- disableDepthMask ( ) : void ;
280
-
281
- /**
282
- *
283
- */
284
- enableDepthMask ( ) : void ;
285
-
286
276
/**
287
277
*
288
278
*/
Original file line number Diff line number Diff line change @@ -1045,20 +1045,6 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
1045
1045
}
1046
1046
} ;
1047
1047
1048
- publicAPI . disableDepthMask = ( ) => {
1049
- if ( model . depthMaskEnabled ) {
1050
- model . context . depthMask ( false ) ;
1051
- model . depthMaskEnabled = false ;
1052
- }
1053
- } ;
1054
-
1055
- publicAPI . enableDepthMask = ( ) => {
1056
- if ( ! model . depthMaskEnabled ) {
1057
- model . context . depthMask ( true ) ;
1058
- model . depthMaskEnabled = true ;
1059
- }
1060
- } ;
1061
-
1062
1048
publicAPI . disableCullFace = ( ) => {
1063
1049
if ( model . cullFaceEnabled ) {
1064
1050
model . context . disable ( model . context . CULL_FACE ) ;
@@ -1116,7 +1102,6 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
1116
1102
1117
1103
const DEFAULT_VALUES = {
1118
1104
cullFaceEnabled : false ,
1119
- depthMaskEnabled : true ,
1120
1105
shaderCache : null ,
1121
1106
initialized : false ,
1122
1107
context : null ,
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ function vtkOpenGLRenderer(publicAPI, model) {
59
59
if ( ! model . renderable . getPreserveDepthBuffer ( ) ) {
60
60
gl . clearDepth ( 1.0 ) ;
61
61
clearMask |= gl . DEPTH_BUFFER_BIT ;
62
- gl . depthMask ( true ) ;
62
+ model . context . depthMask ( true ) ;
63
63
}
64
64
65
65
const ts = publicAPI . getTiledSizeAndOrigin ( ) ;
@@ -146,7 +146,7 @@ function vtkOpenGLRenderer(publicAPI, model) {
146
146
if ( ! model . renderable . getPreserveDepthBuffer ( ) ) {
147
147
gl . clearDepth ( 1.0 ) ;
148
148
clearMask |= gl . DEPTH_BUFFER_BIT ;
149
- gl . depthMask ( true ) ;
149
+ model . context . depthMask ( true ) ;
150
150
}
151
151
152
152
gl . colorMask ( true , true , true , true ) ;
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ function vtkOpenGLSkybox(publicAPI, model) {
49
49
if ( prepass && ! model . openGLRenderer . getSelector ( ) ) {
50
50
publicAPI . updateBufferObjects ( ) ;
51
51
52
- model . openGLRenderWindow . enableDepthMask ( ) ;
52
+ model . context . depthMask ( true ) ;
53
53
54
54
model . openGLRenderWindow
55
55
. getShaderCache ( )
Original file line number Diff line number Diff line change @@ -19,8 +19,12 @@ function vtkOpenGLVolume(publicAPI, model) {
19
19
return ;
20
20
}
21
21
if ( prepass ) {
22
+ model . openGLRenderWindow = publicAPI . getFirstAncestorOfType (
23
+ 'vtkOpenGLRenderWindow'
24
+ ) ;
22
25
model . openGLRenderer =
23
26
publicAPI . getFirstAncestorOfType ( 'vtkOpenGLRenderer' ) ;
27
+ model . context = model . openGLRenderWindow . getContext ( ) ;
24
28
publicAPI . prepareNodes ( ) ;
25
29
publicAPI . addMissingNode ( model . renderable . getMapper ( ) ) ;
26
30
publicAPI . removeUnusedNodes ( ) ;
@@ -58,14 +62,7 @@ function vtkOpenGLVolume(publicAPI, model) {
58
62
if ( ! model . renderable || ! model . renderable . getVisibility ( ) ) {
59
63
return ;
60
64
}
61
- if ( prepass ) {
62
- model . context = publicAPI
63
- . getFirstAncestorOfType ( 'vtkOpenGLRenderWindow' )
64
- . getContext ( ) ;
65
- model . context . depthMask ( false ) ;
66
- } else {
67
- model . context . depthMask ( true ) ;
68
- }
65
+ model . context . depthMask ( ! prepass ) ;
69
66
} ;
70
67
71
68
publicAPI . getKeyMatrices = ( ) => {
You can’t perform that action at this time.
0 commit comments