MCPcopy Create free account
hub / github.com/pmndrs/postprocessing / toggleRenderMode

Method toggleRenderMode

demo/src/demos/SSAODemo.js:274–298  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

272 };
273
274 function toggleRenderMode() {
275
276 const mode = Number(params["render mode"]);
277
278 if(mode === RenderMode.DEPTH) {
279
280 textureEffect.setTextureSwizzleRGBA(ColorChannel.ALPHA);
281
282 } else if(mode === RenderMode.NORMALS) {
283
284 textureEffect.setTextureSwizzleRGBA(
285 ColorChannel.RED,
286 ColorChannel.GREEN,
287 ColorChannel.BLUE,
288 ColorChannel.ALPHA
289 );
290
291 }
292
293 textureEffect.blendMode.setBlendFunction((mode !== RenderMode.DEFAULT) ?
294 BlendFunction.NORMAL : BlendFunction.SKIP);
295
296 effectPass.encodeOutput = (mode === RenderMode.DEFAULT);
297
298 }
299
300 if(capabilities.isWebGL2) {
301

Callers

nothing calls this directly

Calls 2

setTextureSwizzleRGBAMethod · 0.80
setBlendFunctionMethod · 0.80

Tested by

no test coverage detected