@omerrgocmen/crewctl 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +193 -193
- package/orchestrator/README.md +473 -473
- package/orchestrator/config.default.json +90 -79
- package/orchestrator/roles/executor.md +57 -57
- package/orchestrator/roles/operator.md +77 -77
- package/orchestrator/roles/planner.md +58 -58
- package/orchestrator/roles/reviewer.md +63 -63
- package/orchestrator/skills/acceptance-criteria.md +18 -18
- package/orchestrator/skills/accessibility-audit.md +16 -16
- package/orchestrator/skills/accessible-forms.md +16 -16
- package/orchestrator/skills/api-design.md +27 -27
- package/orchestrator/skills/api-documentation.md +16 -16
- package/orchestrator/skills/architecture-decision-record.md +18 -18
- package/orchestrator/skills/authentication-design.md +16 -16
- package/orchestrator/skills/authorization-review.md +16 -16
- package/orchestrator/skills/backward-compatibility.md +17 -17
- package/orchestrator/skills/changelog-writing.md +16 -16
- package/orchestrator/skills/ci-pipeline-design.md +16 -16
- package/orchestrator/skills/cli-design.md +16 -16
- package/orchestrator/skills/code-review.md +27 -27
- package/orchestrator/skills/configuration-management.md +16 -16
- package/orchestrator/skills/container-review.md +16 -16
- package/orchestrator/skills/contract-testing.md +16 -16
- package/orchestrator/skills/dashboard-design.md +16 -16
- package/orchestrator/skills/database-migration.md +16 -16
- package/orchestrator/skills/database-schema-design.md +16 -16
- package/orchestrator/skills/debugging.md +26 -26
- package/orchestrator/skills/dependency-review.md +16 -16
- package/orchestrator/skills/design-review.md +29 -29
- package/orchestrator/skills/design-system.md +16 -16
- package/orchestrator/skills/docs-api-reference.md +16 -16
- package/orchestrator/skills/docs-troubleshooting.md +16 -16
- package/orchestrator/skills/docs-tutorial.md +16 -16
- package/orchestrator/skills/docs-writing.md +25 -25
- package/orchestrator/skills/empty-error-loading-states.md +16 -16
- package/orchestrator/skills/end-to-end-testing.md +16 -16
- package/orchestrator/skills/error-handling.md +16 -16
- package/orchestrator/skills/frontend-design.md +28 -28
- package/orchestrator/skills/git-commit-writing.md +16 -16
- package/orchestrator/skills/graphql-design.md +16 -16
- package/orchestrator/skills/incident-runbook.md +18 -18
- package/orchestrator/skills/input-validation.md +16 -16
- package/orchestrator/skills/integration-testing.md +16 -16
- package/orchestrator/skills/interaction-design.md +16 -16
- package/orchestrator/skills/landing-page-design.md +16 -16
- package/orchestrator/skills/observability-design.md +16 -16
- package/orchestrator/skills/openapi-contract.md +16 -16
- package/orchestrator/skills/performance-profiling.md +16 -16
- package/orchestrator/skills/privacy-review.md +16 -16
- package/orchestrator/skills/property-based-testing.md +16 -16
- package/orchestrator/skills/pull-request-writing.md +16 -16
- package/orchestrator/skills/refactoring.md +16 -16
- package/orchestrator/skills/release-readiness.md +16 -16
- package/orchestrator/skills/responsive-design.md +16 -16
- package/orchestrator/skills/secrets-management.md +16 -16
- package/orchestrator/skills/secure-file-upload.md +16 -16
- package/orchestrator/skills/security-review.md +26 -26
- package/orchestrator/skills/semantic-versioning.md +17 -17
- package/orchestrator/skills/seo-on-page.md +16 -16
- package/orchestrator/skills/seo-structured-data.md +16 -16
- package/orchestrator/skills/seo-technical-audit.md +16 -16
- package/orchestrator/skills/sql-query-review.md +16 -16
- package/orchestrator/skills/supply-chain-security.md +16 -16
- package/orchestrator/skills/test-strategy.md +16 -16
- package/orchestrator/skills/threat-modeling.md +16 -16
- package/orchestrator/skills/unit-testing.md +16 -16
- package/orchestrator/skills/write-tests.md +28 -28
- package/orchestrator/src/checkpoints.js +0 -4
- package/orchestrator/src/cli-registry.js +848 -740
- package/orchestrator/src/cli.js +140 -140
- package/orchestrator/src/doctor.js +64 -64
- package/orchestrator/src/engine.js +1914 -1735
- package/orchestrator/src/schedule.js +124 -126
- package/orchestrator/src/server.js +817 -818
- package/orchestrator/src/skill-registry.js +272 -272
- package/orchestrator/src/store.js +478 -470
- package/orchestrator/web/OrbitControls.js +1417 -1417
- package/orchestrator/web/board.html +146 -146
- package/orchestrator/web/code.html +213 -213
- package/orchestrator/web/flow.html +741 -741
- package/orchestrator/web/index.html +622 -602
- package/orchestrator/web/jsm/postprocessing/EffectComposer.js +231 -231
- package/orchestrator/web/jsm/postprocessing/MaskPass.js +104 -104
- package/orchestrator/web/jsm/postprocessing/Pass.js +95 -95
- package/orchestrator/web/jsm/postprocessing/RenderPass.js +99 -99
- package/orchestrator/web/jsm/postprocessing/ShaderPass.js +77 -77
- package/orchestrator/web/jsm/postprocessing/UnrealBloomPass.js +415 -415
- package/orchestrator/web/jsm/shaders/CopyShader.js +45 -45
- package/orchestrator/web/jsm/shaders/LuminosityHighPassShader.js +66 -66
- package/orchestrator/web/site.webmanifest +12 -12
- package/orchestrator/web/three.module.min.js +6 -6
- package/package.json +51 -51
|
@@ -1,231 +1,231 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Clock,
|
|
3
|
-
HalfFloatType,
|
|
4
|
-
NoBlending,
|
|
5
|
-
Vector2,
|
|
6
|
-
WebGLRenderTarget
|
|
7
|
-
} from 'three';
|
|
8
|
-
import { CopyShader } from '../shaders/CopyShader.js';
|
|
9
|
-
import { ShaderPass } from './ShaderPass.js';
|
|
10
|
-
import { MaskPass } from './MaskPass.js';
|
|
11
|
-
import { ClearMaskPass } from './MaskPass.js';
|
|
12
|
-
|
|
13
|
-
class EffectComposer {
|
|
14
|
-
|
|
15
|
-
constructor( renderer, renderTarget ) {
|
|
16
|
-
|
|
17
|
-
this.renderer = renderer;
|
|
18
|
-
|
|
19
|
-
this._pixelRatio = renderer.getPixelRatio();
|
|
20
|
-
|
|
21
|
-
if ( renderTarget === undefined ) {
|
|
22
|
-
|
|
23
|
-
const size = renderer.getSize( new Vector2() );
|
|
24
|
-
this._width = size.width;
|
|
25
|
-
this._height = size.height;
|
|
26
|
-
|
|
27
|
-
renderTarget = new WebGLRenderTarget( this._width * this._pixelRatio, this._height * this._pixelRatio, { type: HalfFloatType } );
|
|
28
|
-
renderTarget.texture.name = 'EffectComposer.rt1';
|
|
29
|
-
|
|
30
|
-
} else {
|
|
31
|
-
|
|
32
|
-
this._width = renderTarget.width;
|
|
33
|
-
this._height = renderTarget.height;
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
this.renderTarget1 = renderTarget;
|
|
38
|
-
this.renderTarget2 = renderTarget.clone();
|
|
39
|
-
this.renderTarget2.texture.name = 'EffectComposer.rt2';
|
|
40
|
-
|
|
41
|
-
this.writeBuffer = this.renderTarget1;
|
|
42
|
-
this.readBuffer = this.renderTarget2;
|
|
43
|
-
|
|
44
|
-
this.renderToScreen = true;
|
|
45
|
-
|
|
46
|
-
this.passes = [];
|
|
47
|
-
|
|
48
|
-
this.copyPass = new ShaderPass( CopyShader );
|
|
49
|
-
this.copyPass.material.blending = NoBlending;
|
|
50
|
-
|
|
51
|
-
this.clock = new Clock();
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
swapBuffers() {
|
|
56
|
-
|
|
57
|
-
const tmp = this.readBuffer;
|
|
58
|
-
this.readBuffer = this.writeBuffer;
|
|
59
|
-
this.writeBuffer = tmp;
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
addPass( pass ) {
|
|
64
|
-
|
|
65
|
-
this.passes.push( pass );
|
|
66
|
-
pass.setSize( this._width * this._pixelRatio, this._height * this._pixelRatio );
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
insertPass( pass, index ) {
|
|
71
|
-
|
|
72
|
-
this.passes.splice( index, 0, pass );
|
|
73
|
-
pass.setSize( this._width * this._pixelRatio, this._height * this._pixelRatio );
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
removePass( pass ) {
|
|
78
|
-
|
|
79
|
-
const index = this.passes.indexOf( pass );
|
|
80
|
-
|
|
81
|
-
if ( index !== - 1 ) {
|
|
82
|
-
|
|
83
|
-
this.passes.splice( index, 1 );
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
isLastEnabledPass( passIndex ) {
|
|
90
|
-
|
|
91
|
-
for ( let i = passIndex + 1; i < this.passes.length; i ++ ) {
|
|
92
|
-
|
|
93
|
-
if ( this.passes[ i ].enabled ) {
|
|
94
|
-
|
|
95
|
-
return false;
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return true;
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
render( deltaTime ) {
|
|
106
|
-
|
|
107
|
-
// deltaTime value is in seconds
|
|
108
|
-
|
|
109
|
-
if ( deltaTime === undefined ) {
|
|
110
|
-
|
|
111
|
-
deltaTime = this.clock.getDelta();
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
const currentRenderTarget = this.renderer.getRenderTarget();
|
|
116
|
-
|
|
117
|
-
let maskActive = false;
|
|
118
|
-
|
|
119
|
-
for ( let i = 0, il = this.passes.length; i < il; i ++ ) {
|
|
120
|
-
|
|
121
|
-
const pass = this.passes[ i ];
|
|
122
|
-
|
|
123
|
-
if ( pass.enabled === false ) continue;
|
|
124
|
-
|
|
125
|
-
pass.renderToScreen = ( this.renderToScreen && this.isLastEnabledPass( i ) );
|
|
126
|
-
pass.render( this.renderer, this.writeBuffer, this.readBuffer, deltaTime, maskActive );
|
|
127
|
-
|
|
128
|
-
if ( pass.needsSwap ) {
|
|
129
|
-
|
|
130
|
-
if ( maskActive ) {
|
|
131
|
-
|
|
132
|
-
const context = this.renderer.getContext();
|
|
133
|
-
const stencil = this.renderer.state.buffers.stencil;
|
|
134
|
-
|
|
135
|
-
//context.stencilFunc( context.NOTEQUAL, 1, 0xffffffff );
|
|
136
|
-
stencil.setFunc( context.NOTEQUAL, 1, 0xffffffff );
|
|
137
|
-
|
|
138
|
-
this.copyPass.render( this.renderer, this.writeBuffer, this.readBuffer, deltaTime );
|
|
139
|
-
|
|
140
|
-
//context.stencilFunc( context.EQUAL, 1, 0xffffffff );
|
|
141
|
-
stencil.setFunc( context.EQUAL, 1, 0xffffffff );
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
this.swapBuffers();
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
if ( MaskPass !== undefined ) {
|
|
150
|
-
|
|
151
|
-
if ( pass instanceof MaskPass ) {
|
|
152
|
-
|
|
153
|
-
maskActive = true;
|
|
154
|
-
|
|
155
|
-
} else if ( pass instanceof ClearMaskPass ) {
|
|
156
|
-
|
|
157
|
-
maskActive = false;
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
this.renderer.setRenderTarget( currentRenderTarget );
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
reset( renderTarget ) {
|
|
170
|
-
|
|
171
|
-
if ( renderTarget === undefined ) {
|
|
172
|
-
|
|
173
|
-
const size = this.renderer.getSize( new Vector2() );
|
|
174
|
-
this._pixelRatio = this.renderer.getPixelRatio();
|
|
175
|
-
this._width = size.width;
|
|
176
|
-
this._height = size.height;
|
|
177
|
-
|
|
178
|
-
renderTarget = this.renderTarget1.clone();
|
|
179
|
-
renderTarget.setSize( this._width * this._pixelRatio, this._height * this._pixelRatio );
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
this.renderTarget1.dispose();
|
|
184
|
-
this.renderTarget2.dispose();
|
|
185
|
-
this.renderTarget1 = renderTarget;
|
|
186
|
-
this.renderTarget2 = renderTarget.clone();
|
|
187
|
-
|
|
188
|
-
this.writeBuffer = this.renderTarget1;
|
|
189
|
-
this.readBuffer = this.renderTarget2;
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
setSize( width, height ) {
|
|
194
|
-
|
|
195
|
-
this._width = width;
|
|
196
|
-
this._height = height;
|
|
197
|
-
|
|
198
|
-
const effectiveWidth = this._width * this._pixelRatio;
|
|
199
|
-
const effectiveHeight = this._height * this._pixelRatio;
|
|
200
|
-
|
|
201
|
-
this.renderTarget1.setSize( effectiveWidth, effectiveHeight );
|
|
202
|
-
this.renderTarget2.setSize( effectiveWidth, effectiveHeight );
|
|
203
|
-
|
|
204
|
-
for ( let i = 0; i < this.passes.length; i ++ ) {
|
|
205
|
-
|
|
206
|
-
this.passes[ i ].setSize( effectiveWidth, effectiveHeight );
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
setPixelRatio( pixelRatio ) {
|
|
213
|
-
|
|
214
|
-
this._pixelRatio = pixelRatio;
|
|
215
|
-
|
|
216
|
-
this.setSize( this._width, this._height );
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
dispose() {
|
|
221
|
-
|
|
222
|
-
this.renderTarget1.dispose();
|
|
223
|
-
this.renderTarget2.dispose();
|
|
224
|
-
|
|
225
|
-
this.copyPass.dispose();
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
export { EffectComposer };
|
|
1
|
+
import {
|
|
2
|
+
Clock,
|
|
3
|
+
HalfFloatType,
|
|
4
|
+
NoBlending,
|
|
5
|
+
Vector2,
|
|
6
|
+
WebGLRenderTarget
|
|
7
|
+
} from 'three';
|
|
8
|
+
import { CopyShader } from '../shaders/CopyShader.js';
|
|
9
|
+
import { ShaderPass } from './ShaderPass.js';
|
|
10
|
+
import { MaskPass } from './MaskPass.js';
|
|
11
|
+
import { ClearMaskPass } from './MaskPass.js';
|
|
12
|
+
|
|
13
|
+
class EffectComposer {
|
|
14
|
+
|
|
15
|
+
constructor( renderer, renderTarget ) {
|
|
16
|
+
|
|
17
|
+
this.renderer = renderer;
|
|
18
|
+
|
|
19
|
+
this._pixelRatio = renderer.getPixelRatio();
|
|
20
|
+
|
|
21
|
+
if ( renderTarget === undefined ) {
|
|
22
|
+
|
|
23
|
+
const size = renderer.getSize( new Vector2() );
|
|
24
|
+
this._width = size.width;
|
|
25
|
+
this._height = size.height;
|
|
26
|
+
|
|
27
|
+
renderTarget = new WebGLRenderTarget( this._width * this._pixelRatio, this._height * this._pixelRatio, { type: HalfFloatType } );
|
|
28
|
+
renderTarget.texture.name = 'EffectComposer.rt1';
|
|
29
|
+
|
|
30
|
+
} else {
|
|
31
|
+
|
|
32
|
+
this._width = renderTarget.width;
|
|
33
|
+
this._height = renderTarget.height;
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
this.renderTarget1 = renderTarget;
|
|
38
|
+
this.renderTarget2 = renderTarget.clone();
|
|
39
|
+
this.renderTarget2.texture.name = 'EffectComposer.rt2';
|
|
40
|
+
|
|
41
|
+
this.writeBuffer = this.renderTarget1;
|
|
42
|
+
this.readBuffer = this.renderTarget2;
|
|
43
|
+
|
|
44
|
+
this.renderToScreen = true;
|
|
45
|
+
|
|
46
|
+
this.passes = [];
|
|
47
|
+
|
|
48
|
+
this.copyPass = new ShaderPass( CopyShader );
|
|
49
|
+
this.copyPass.material.blending = NoBlending;
|
|
50
|
+
|
|
51
|
+
this.clock = new Clock();
|
|
52
|
+
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
swapBuffers() {
|
|
56
|
+
|
|
57
|
+
const tmp = this.readBuffer;
|
|
58
|
+
this.readBuffer = this.writeBuffer;
|
|
59
|
+
this.writeBuffer = tmp;
|
|
60
|
+
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
addPass( pass ) {
|
|
64
|
+
|
|
65
|
+
this.passes.push( pass );
|
|
66
|
+
pass.setSize( this._width * this._pixelRatio, this._height * this._pixelRatio );
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
insertPass( pass, index ) {
|
|
71
|
+
|
|
72
|
+
this.passes.splice( index, 0, pass );
|
|
73
|
+
pass.setSize( this._width * this._pixelRatio, this._height * this._pixelRatio );
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
removePass( pass ) {
|
|
78
|
+
|
|
79
|
+
const index = this.passes.indexOf( pass );
|
|
80
|
+
|
|
81
|
+
if ( index !== - 1 ) {
|
|
82
|
+
|
|
83
|
+
this.passes.splice( index, 1 );
|
|
84
|
+
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
isLastEnabledPass( passIndex ) {
|
|
90
|
+
|
|
91
|
+
for ( let i = passIndex + 1; i < this.passes.length; i ++ ) {
|
|
92
|
+
|
|
93
|
+
if ( this.passes[ i ].enabled ) {
|
|
94
|
+
|
|
95
|
+
return false;
|
|
96
|
+
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return true;
|
|
102
|
+
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
render( deltaTime ) {
|
|
106
|
+
|
|
107
|
+
// deltaTime value is in seconds
|
|
108
|
+
|
|
109
|
+
if ( deltaTime === undefined ) {
|
|
110
|
+
|
|
111
|
+
deltaTime = this.clock.getDelta();
|
|
112
|
+
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const currentRenderTarget = this.renderer.getRenderTarget();
|
|
116
|
+
|
|
117
|
+
let maskActive = false;
|
|
118
|
+
|
|
119
|
+
for ( let i = 0, il = this.passes.length; i < il; i ++ ) {
|
|
120
|
+
|
|
121
|
+
const pass = this.passes[ i ];
|
|
122
|
+
|
|
123
|
+
if ( pass.enabled === false ) continue;
|
|
124
|
+
|
|
125
|
+
pass.renderToScreen = ( this.renderToScreen && this.isLastEnabledPass( i ) );
|
|
126
|
+
pass.render( this.renderer, this.writeBuffer, this.readBuffer, deltaTime, maskActive );
|
|
127
|
+
|
|
128
|
+
if ( pass.needsSwap ) {
|
|
129
|
+
|
|
130
|
+
if ( maskActive ) {
|
|
131
|
+
|
|
132
|
+
const context = this.renderer.getContext();
|
|
133
|
+
const stencil = this.renderer.state.buffers.stencil;
|
|
134
|
+
|
|
135
|
+
//context.stencilFunc( context.NOTEQUAL, 1, 0xffffffff );
|
|
136
|
+
stencil.setFunc( context.NOTEQUAL, 1, 0xffffffff );
|
|
137
|
+
|
|
138
|
+
this.copyPass.render( this.renderer, this.writeBuffer, this.readBuffer, deltaTime );
|
|
139
|
+
|
|
140
|
+
//context.stencilFunc( context.EQUAL, 1, 0xffffffff );
|
|
141
|
+
stencil.setFunc( context.EQUAL, 1, 0xffffffff );
|
|
142
|
+
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
this.swapBuffers();
|
|
146
|
+
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if ( MaskPass !== undefined ) {
|
|
150
|
+
|
|
151
|
+
if ( pass instanceof MaskPass ) {
|
|
152
|
+
|
|
153
|
+
maskActive = true;
|
|
154
|
+
|
|
155
|
+
} else if ( pass instanceof ClearMaskPass ) {
|
|
156
|
+
|
|
157
|
+
maskActive = false;
|
|
158
|
+
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
this.renderer.setRenderTarget( currentRenderTarget );
|
|
166
|
+
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
reset( renderTarget ) {
|
|
170
|
+
|
|
171
|
+
if ( renderTarget === undefined ) {
|
|
172
|
+
|
|
173
|
+
const size = this.renderer.getSize( new Vector2() );
|
|
174
|
+
this._pixelRatio = this.renderer.getPixelRatio();
|
|
175
|
+
this._width = size.width;
|
|
176
|
+
this._height = size.height;
|
|
177
|
+
|
|
178
|
+
renderTarget = this.renderTarget1.clone();
|
|
179
|
+
renderTarget.setSize( this._width * this._pixelRatio, this._height * this._pixelRatio );
|
|
180
|
+
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
this.renderTarget1.dispose();
|
|
184
|
+
this.renderTarget2.dispose();
|
|
185
|
+
this.renderTarget1 = renderTarget;
|
|
186
|
+
this.renderTarget2 = renderTarget.clone();
|
|
187
|
+
|
|
188
|
+
this.writeBuffer = this.renderTarget1;
|
|
189
|
+
this.readBuffer = this.renderTarget2;
|
|
190
|
+
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
setSize( width, height ) {
|
|
194
|
+
|
|
195
|
+
this._width = width;
|
|
196
|
+
this._height = height;
|
|
197
|
+
|
|
198
|
+
const effectiveWidth = this._width * this._pixelRatio;
|
|
199
|
+
const effectiveHeight = this._height * this._pixelRatio;
|
|
200
|
+
|
|
201
|
+
this.renderTarget1.setSize( effectiveWidth, effectiveHeight );
|
|
202
|
+
this.renderTarget2.setSize( effectiveWidth, effectiveHeight );
|
|
203
|
+
|
|
204
|
+
for ( let i = 0; i < this.passes.length; i ++ ) {
|
|
205
|
+
|
|
206
|
+
this.passes[ i ].setSize( effectiveWidth, effectiveHeight );
|
|
207
|
+
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
setPixelRatio( pixelRatio ) {
|
|
213
|
+
|
|
214
|
+
this._pixelRatio = pixelRatio;
|
|
215
|
+
|
|
216
|
+
this.setSize( this._width, this._height );
|
|
217
|
+
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
dispose() {
|
|
221
|
+
|
|
222
|
+
this.renderTarget1.dispose();
|
|
223
|
+
this.renderTarget2.dispose();
|
|
224
|
+
|
|
225
|
+
this.copyPass.dispose();
|
|
226
|
+
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export { EffectComposer };
|
|
@@ -1,104 +1,104 @@
|
|
|
1
|
-
import { Pass } from './Pass.js';
|
|
2
|
-
|
|
3
|
-
class MaskPass extends Pass {
|
|
4
|
-
|
|
5
|
-
constructor( scene, camera ) {
|
|
6
|
-
|
|
7
|
-
super();
|
|
8
|
-
|
|
9
|
-
this.scene = scene;
|
|
10
|
-
this.camera = camera;
|
|
11
|
-
|
|
12
|
-
this.clear = true;
|
|
13
|
-
this.needsSwap = false;
|
|
14
|
-
|
|
15
|
-
this.inverse = false;
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
render( renderer, writeBuffer, readBuffer /*, deltaTime, maskActive */ ) {
|
|
20
|
-
|
|
21
|
-
const context = renderer.getContext();
|
|
22
|
-
const state = renderer.state;
|
|
23
|
-
|
|
24
|
-
// don't update color or depth
|
|
25
|
-
|
|
26
|
-
state.buffers.color.setMask( false );
|
|
27
|
-
state.buffers.depth.setMask( false );
|
|
28
|
-
|
|
29
|
-
// lock buffers
|
|
30
|
-
|
|
31
|
-
state.buffers.color.setLocked( true );
|
|
32
|
-
state.buffers.depth.setLocked( true );
|
|
33
|
-
|
|
34
|
-
// set up stencil
|
|
35
|
-
|
|
36
|
-
let writeValue, clearValue;
|
|
37
|
-
|
|
38
|
-
if ( this.inverse ) {
|
|
39
|
-
|
|
40
|
-
writeValue = 0;
|
|
41
|
-
clearValue = 1;
|
|
42
|
-
|
|
43
|
-
} else {
|
|
44
|
-
|
|
45
|
-
writeValue = 1;
|
|
46
|
-
clearValue = 0;
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
state.buffers.stencil.setTest( true );
|
|
51
|
-
state.buffers.stencil.setOp( context.REPLACE, context.REPLACE, context.REPLACE );
|
|
52
|
-
state.buffers.stencil.setFunc( context.ALWAYS, writeValue, 0xffffffff );
|
|
53
|
-
state.buffers.stencil.setClear( clearValue );
|
|
54
|
-
state.buffers.stencil.setLocked( true );
|
|
55
|
-
|
|
56
|
-
// draw into the stencil buffer
|
|
57
|
-
|
|
58
|
-
renderer.setRenderTarget( readBuffer );
|
|
59
|
-
if ( this.clear ) renderer.clear();
|
|
60
|
-
renderer.render( this.scene, this.camera );
|
|
61
|
-
|
|
62
|
-
renderer.setRenderTarget( writeBuffer );
|
|
63
|
-
if ( this.clear ) renderer.clear();
|
|
64
|
-
renderer.render( this.scene, this.camera );
|
|
65
|
-
|
|
66
|
-
// unlock color and depth buffer and make them writable for subsequent rendering/clearing
|
|
67
|
-
|
|
68
|
-
state.buffers.color.setLocked( false );
|
|
69
|
-
state.buffers.depth.setLocked( false );
|
|
70
|
-
|
|
71
|
-
state.buffers.color.setMask( true );
|
|
72
|
-
state.buffers.depth.setMask( true );
|
|
73
|
-
|
|
74
|
-
// only render where stencil is set to 1
|
|
75
|
-
|
|
76
|
-
state.buffers.stencil.setLocked( false );
|
|
77
|
-
state.buffers.stencil.setFunc( context.EQUAL, 1, 0xffffffff ); // draw if == 1
|
|
78
|
-
state.buffers.stencil.setOp( context.KEEP, context.KEEP, context.KEEP );
|
|
79
|
-
state.buffers.stencil.setLocked( true );
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
class ClearMaskPass extends Pass {
|
|
86
|
-
|
|
87
|
-
constructor() {
|
|
88
|
-
|
|
89
|
-
super();
|
|
90
|
-
|
|
91
|
-
this.needsSwap = false;
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
render( renderer /*, writeBuffer, readBuffer, deltaTime, maskActive */ ) {
|
|
96
|
-
|
|
97
|
-
renderer.state.buffers.stencil.setLocked( false );
|
|
98
|
-
renderer.state.buffers.stencil.setTest( false );
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export { MaskPass, ClearMaskPass };
|
|
1
|
+
import { Pass } from './Pass.js';
|
|
2
|
+
|
|
3
|
+
class MaskPass extends Pass {
|
|
4
|
+
|
|
5
|
+
constructor( scene, camera ) {
|
|
6
|
+
|
|
7
|
+
super();
|
|
8
|
+
|
|
9
|
+
this.scene = scene;
|
|
10
|
+
this.camera = camera;
|
|
11
|
+
|
|
12
|
+
this.clear = true;
|
|
13
|
+
this.needsSwap = false;
|
|
14
|
+
|
|
15
|
+
this.inverse = false;
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
render( renderer, writeBuffer, readBuffer /*, deltaTime, maskActive */ ) {
|
|
20
|
+
|
|
21
|
+
const context = renderer.getContext();
|
|
22
|
+
const state = renderer.state;
|
|
23
|
+
|
|
24
|
+
// don't update color or depth
|
|
25
|
+
|
|
26
|
+
state.buffers.color.setMask( false );
|
|
27
|
+
state.buffers.depth.setMask( false );
|
|
28
|
+
|
|
29
|
+
// lock buffers
|
|
30
|
+
|
|
31
|
+
state.buffers.color.setLocked( true );
|
|
32
|
+
state.buffers.depth.setLocked( true );
|
|
33
|
+
|
|
34
|
+
// set up stencil
|
|
35
|
+
|
|
36
|
+
let writeValue, clearValue;
|
|
37
|
+
|
|
38
|
+
if ( this.inverse ) {
|
|
39
|
+
|
|
40
|
+
writeValue = 0;
|
|
41
|
+
clearValue = 1;
|
|
42
|
+
|
|
43
|
+
} else {
|
|
44
|
+
|
|
45
|
+
writeValue = 1;
|
|
46
|
+
clearValue = 0;
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
state.buffers.stencil.setTest( true );
|
|
51
|
+
state.buffers.stencil.setOp( context.REPLACE, context.REPLACE, context.REPLACE );
|
|
52
|
+
state.buffers.stencil.setFunc( context.ALWAYS, writeValue, 0xffffffff );
|
|
53
|
+
state.buffers.stencil.setClear( clearValue );
|
|
54
|
+
state.buffers.stencil.setLocked( true );
|
|
55
|
+
|
|
56
|
+
// draw into the stencil buffer
|
|
57
|
+
|
|
58
|
+
renderer.setRenderTarget( readBuffer );
|
|
59
|
+
if ( this.clear ) renderer.clear();
|
|
60
|
+
renderer.render( this.scene, this.camera );
|
|
61
|
+
|
|
62
|
+
renderer.setRenderTarget( writeBuffer );
|
|
63
|
+
if ( this.clear ) renderer.clear();
|
|
64
|
+
renderer.render( this.scene, this.camera );
|
|
65
|
+
|
|
66
|
+
// unlock color and depth buffer and make them writable for subsequent rendering/clearing
|
|
67
|
+
|
|
68
|
+
state.buffers.color.setLocked( false );
|
|
69
|
+
state.buffers.depth.setLocked( false );
|
|
70
|
+
|
|
71
|
+
state.buffers.color.setMask( true );
|
|
72
|
+
state.buffers.depth.setMask( true );
|
|
73
|
+
|
|
74
|
+
// only render where stencil is set to 1
|
|
75
|
+
|
|
76
|
+
state.buffers.stencil.setLocked( false );
|
|
77
|
+
state.buffers.stencil.setFunc( context.EQUAL, 1, 0xffffffff ); // draw if == 1
|
|
78
|
+
state.buffers.stencil.setOp( context.KEEP, context.KEEP, context.KEEP );
|
|
79
|
+
state.buffers.stencil.setLocked( true );
|
|
80
|
+
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
class ClearMaskPass extends Pass {
|
|
86
|
+
|
|
87
|
+
constructor() {
|
|
88
|
+
|
|
89
|
+
super();
|
|
90
|
+
|
|
91
|
+
this.needsSwap = false;
|
|
92
|
+
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
render( renderer /*, writeBuffer, readBuffer, deltaTime, maskActive */ ) {
|
|
96
|
+
|
|
97
|
+
renderer.state.buffers.stencil.setLocked( false );
|
|
98
|
+
renderer.state.buffers.stencil.setTest( false );
|
|
99
|
+
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export { MaskPass, ClearMaskPass };
|