Sign in to follow this  
owl

glEnable(GL_STENCIL_TEST) crashing with VBOs?

Recommended Posts

Hello,

On a GForce mx440, windows xp, mingw

I'm trying to implement shadow volumes. To start with something I downloaded lesson 27 from nehe and it compiled and ran just fine.

My code is using VBO's and by only adding a call to glEnable(GL_STENCIL_TEST) I get a segfault in ?? () (C:\WINDOWS\system32\nvoglnt.dll) with no further description.

A first hand differences I can tell from my code and nehes is that nehe's is using immediate mode and mine uses VBO's initialized through GLEW. I'm also rendering a lot more vertices.

I've debuged the code and the segfault doesn't occurs when calling glEnable(GL_STENCIL_TEST) but when calling [b]glDrawElements[/b] right after.


Does this information bring up some ideas you could share? Thanks in advance?

Share this post


Link to post
Share on other sites
I don't know. Is it possible that you are corrupting some memory on the graphics card? Perhaps you are overstepping the boundary of a VBO. Try making your VBOs bigger by double and see if it magically solves the problem.

Share this post


Link to post
Share on other sites
[quote name='V-man' timestamp='1307798648' post='4822069']
Try making your VBOs bigger by double and see if it magically solves the problem.
[/quote]

LMAO!

Share this post


Link to post
Share on other sites
[quote name='owl' timestamp='1307801519' post='4822081']
[quote name='V-man' timestamp='1307798648' post='4822069']
Try making your VBOs bigger by double and see if it magically solves the problem.
[/quote]

LMAO!
[/quote]

It's a valid answer.

I don't think it's intended as a "this is the corrrect way to solve your problem" answer, more of a "try this and it will confirm if that's the cause of your problem" answer. If it does confirm it, then you'll need to go back over your code, find out where you're overflowing, and fix it properly. But it's valid as a quick and dirty way of checking this as a possible cause without investing too much effort into code restructuring.

Another possible cause is that you've got a vertex pointer/array enabled with NULL data. Also check that your indices param to glDrawElements is good and that you haven't enabled GL_INDEX_ARRAY (which doesn't do what you might think it does).

Third possible reason is that the GeForce 4 MX series was a really bad PoS hardware, even in it's time, and you're overdue an upgrade.

Share this post


Link to post
Share on other sites
[quote]Third possible reason is that the GeForce 4 MX series was a really bad PoS hardware, even in it's time, and you're overdue an upgrade.[/quote]

Absolutely, I remember developers hated the Geforce 4 MX in it's time. It was a low-budget card with no real shader support, unlike the Ti series that were "the real deal".
People have had it for years in their systems and I still hate it when some of my demos won't run on a someone's computer because of this bloody fixed-functionality card.

However, I do remember using VBO's in combination with stencil shadows without problems on this card. So it must be another issue.

Share this post


Link to post
Share on other sites
[quote name='mhagain' timestamp='1307827521' post='4822175']
and that you haven't enabled GL_INDEX_ARRAY (which doesn't do what you might think it does).
[/quote]

Yes man. That was it. Thank you a LOT of LOTS! :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this