opengl - How to utilize GL_ARB_stencil_texturing -


from i've read, sample stencil texture in shader need set gl_depth_stencil_texture_mode, did this:

gltexparameteri(gl_texture_2d, gl_depth_stencil_texture_mode, gl_stencil_components); 

but invalid enum... why be?

according man page, correct enum value call gl_stencil_component, not gl_stencil_components (note trailing s).

as turns out, man page wrong. unfortunately not unusual. if in spec (e.g. table 8.17 on page 225 in opengl 4.5 spec document), valid values depth_stencil_texture_mode gl_depth_component , gl_stencil_index.

based on this, call should be:

gltexparameteri(gl_texture_2d, gl_depth_stencil_texture_mode, gl_stencil_index); 

this feature requires opengl 4.3 or higher.

gl_stencil_components valid argument glgetinternvalformativ(), not gltexparameteri().


Comments