Stencil Buffer

when i use the stencil buffer in 16bit depth, i have 9 fps but i am only drawing 500 polygons Why?

Many cards only support stencil together with 24-bit depth, they pacj together 8 bits of stencil and 24-bits of depth into a nice round 32 bits (good for memory alignment). You particular card (an older GeForce perhaps?) probably doesn’t support 24 bits of depth together with 16-bits of colour and therefore falls back to software. That’s my guess anyway.

Because you might have used a hardware which doesn’t support stencil together with 16 bit depth and fell back to a software rendering algorithm in the driver.
Don’t use 16 bit depth then. Check if you can get 24 bit depth and 8 bit stencil in HighColor.
If not, use true color.

I have used the same code with a GeForce4Mx 128Mb and with a Voodoo3 and i got the same results 9 fps, Could it be possible?

Yes, if both chips can’t do it the limiting factor is how fast your CPU can render the image into the frame buffer.
Try the GeForce with true color and the 24 bit depth and 8 bit stencil pixelformat.
If that’s still 9 fps, maybe your 500 polygons are that big, that you are fillrate limited.
To verify try if a smaller window size increases the performance.

Thanks Relix, In True Color it runs at 70 fps with VR :cool:

Fine, 70 Hz sounds like monitor refresh rate.
If you want to try without, go to the display control panel, find the “wait for vertical retrace” or “vsync” switch in the GeForce tab and set it to off.