PDA

View Full Version : Incorrect rendering of stencil shadow under Vista



PJDIXIT
06-29-2009, 08:10 AM
Hi guys,

I have implemented Robust Stencil Shadow paper posted on NVIDIA's website.

http://developer.nvidia.com/object/robust_shadow_volumes.html

My code works perfectly fine when I run it on XP with Intel media accelerator card. However when I run the same program on Vista 64 bit with NVIDIA GeForce 9200GE/PCI/SSE2 card shadows are not cast. Has anyone else faced similar problem?


When I run the program it shows following info: OpenGL version 3.0.0 Vender NVIDIA corporation Renderer GeForce 9200 M GE.

But when I copy the opengl32.dll shipped with XP into my programs folder on machine with Vista, it shows that OpenGL version as 1.1 Vendor as Microsoft and Renderer as GDI generic.

It is driving me crazy. :eek: Why is it behaving like that? I am not able to figure out why shadows are not cast. Whether it is Vista or opengl32.dll shipped with Vista or 64 bit operation system.

Its definitely a question for Opengl pundits!! :confused:

Thanks.

-Prasad

Stephen A
06-29-2009, 08:41 AM
The version string shows that drivers are correctly installed on the Vista machine. Don't copy opengl32.dll from one system to another, this is just plain wrong! :)

Two possible causes of the problem: a driver bug (unlikely) or a bug in the program (more likely). What does glGetError() return? Try placing a few calls before, during and after the code in question.

_NK47
06-29-2009, 08:43 AM
some code (how you handling stencil shadows) would help.

PJDIXIT
07-01-2009, 07:11 AM
Finally, after a lot of frustration I figured it out!

I am using Qt to develop my UI. I have to explicitly turn on stencil buffer for my QGLWidget for code to run correctly on Vista. How it was running correctly on XP is still a mystery to me.

MainWindow::MainWindow()
{

QGLFormat fmt;
fmt.setStencil(true); //This was the culprit. It was set to false before.
fmt.setAlpha(true);
fmt.setDoubleBuffer(true);
fmt.setDepth(true);
fmt.setAccum(true);
fmt.setRgba(true);
QGLFormat::setDefaultFormat(fmt);

graphicsPanelPtr = new GraphicsPanel();



Anyways, I am happy that its working now. Thanks to gDEbugger too. :D

-Prasad

remdul
07-03-2009, 08:26 AM
Either way, don't put MS' OpenGL32.dll in your program directory. It will cause your app to ignore the installed graphics driver, because when the DLLs referenced by the software are loaded, it first looks in the executable directory, and then in the \system\ or \system32\ (or whatever it is these days) directory.

(At least that's how it is supposed to work, YMMV.)