0
var gl = canvas.getContext('webgl', { stencil: true });

According to WebGL Spec, this line of code will ask the drawing buffer to have a stencil buffer of at least 8 bits.

But will that add any performance cost? Is it suitable to always asking one in an rendering engine?

(Google-Chrome? / Firefox?)

shrekshao
  • 388
  • 4
  • 12

1 Answers1

0

Unlikely.

Take a look here. >99% of devices have 24 bit of depth and 8 bit of stencil. The stencil test should also be faster than the depth test. Correct usage of stencil testing can lead into performance gains.

WacławJasper
  • 3,284
  • 14
  • 19