weird problems using stenciling

Started by
2 comments, last by willi7 22 years, 1 month ago
Hi! I''m currently coding a little demo using OpenGL. At the moment I''m displaying quite a number of polygons using lighting, depth-buffering and blending. I checked the speed of my demo and got round about 50 FPS. That''s okay for my needs. BUT then I started to add one mirror to my scene (referring to the very good tutorial #27). I used exactly the same source as quoted in the tutorial. But if I just call glEnable(GL_STENCIL_TEST) and nothing else my demo gets slow as hell (about 1 FPS) - AND I''ve the same speed problem when calling the compiled exe from tutorial #27. I think OpenGL is just falling back to software rendering. But why? I''m using a ELSA Erazor III LT (NVIDIA RIVA TNT2 M64 chipset) with the lastest drivers (I tried the ELSA drivers and currently I''m running the NVIDIA reference drivers). According to ELSA, to my graphics card documentation and to serveral internet sites, my graphics card has full 8-bit hardware stenciling support. I''m rather helpless. Is there any testing utility to check my drivers. Does anybody know a solution for my problem. Please help me!
Advertisement
do you set your screen to 32bit color-mode?
depthbuffer to 24bits? and then stencil to 8bits? then it should work, else you _can_ get software mode..
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

quote:Original post by davepermen
do you set your screen to 32bit color-mode?
depthbuffer to 24bits? and then stencil to 8bits? then it should work, else you _can_ get software mode..


Well I did it like you said and it works. Many thanx for this hint. But I you could just answer one more question...

Is there absolutely no way to use stenciling with any other color depth or depth buffer depth? Do I have to force the user in this mode? Is there any reliable way to check what modes (pixel formats) work with stenciling? Until now I ran through the available pixel formats, checked for hardware acceleration (absence of PFD_GENERIC_FORMAT PFD_GENERIC_ACCELERATED) and for at least 16BPP and minimum 8 bit depth buffer and minimum 8 bit stencil buffer. It seems my method isn''t reliable at all. But how to manage it? Especially is there the problem when running in windowed mode and the user running his desktop with 16BPP (like me)...
Sorry but you _need_ 32bppp with a RIVA TNT2.

If you want your effects to be accelerated, you should provide three options into some configuration file :
1- use stencil
2- simulate stencil
3- dismiss stencil

And the end-user will tweak this parameter to get the best one : try the 1st, if good then keep it, otherwise try 2nd, then if good keep it, otherwise try 3rd, and if ain''t better choose whatever

This topic is closed to new replies.

Advertisement