any clue about StencilAttrib?

it looks like it is impossible but simple operation i need with the StencilAttrib.

i need it to change all values from say N to all values of M as it draws. Looks like this is impossible b/c there is only one “reference” number and two read and write masks. But maybe i am missing some trick where i could encode M and N in the StencilAttrib using the masks. It would be easy if i could make M and N consecutive and use increment … but that is not the case.

thanks for help!