Stencil buffer not working in 163

In 162, i render a mesh that writes 1 to the stencil buffer, and then a mesh that renders only if the value is 1. In 163, nothing seems to happen regarding the stencil buffer. I’m not sure if it’s not being written or being read. However, when inspecting with spector i do see that the stencil values are being set.

Write to stencil:

Read from stencil:

I just noticed the STENCIL_BITS is 0 and in 162 i get 8

Well, to answer my own question, passing stencil:true into the webgl renderer resolves this. I log 8 bits from STENCIL_BITS.


Yes, with r163 stencil is now false by default for performance reasons. Most applications don’t need a stencil attachment in the default framebuffer so this change saves some memory. It is also noted in the migration guide: Migration Guide · mrdoob/three.js Wiki · GitHub