Big OpenGL performance drop when porting from fixed-function to shaders
I have some fixed-function OpenGL code that I'm upgrading to use shaders. I've done the code work, but am seeing a huge performance drop. The frame rate in a typical scene has halved. There are still some parts of the scene using the fixed-function pipeline though. Are there any obvious gotchas that could account for this?
Off the top of my head, the code looks comparable. I've replaced the fixed-function code which used one directional light, ambient and diffuse only, for a simple vertex shader with per-vertex directional ambient/diffuse lighting, and a trivial pixel shader with one texture lookup modulated withthe interpolated colour. Previously the code called glInterleavedArrays; now I have three calls to glVertexAttribPointer instead (not using vertex array objects.) The vertex & index data are stored in buffer objects. The rendering looks identical.
The test machine is an Intel Clarkdale Core i5-660 running Windows 7 Ultimate x64 SP1, using the Clarkdale GPU. Driver version is 188.8.131.529. I don't see the same issue on another GeForce test machine, so I think it's something to do with Intel's GPU or drivers.
Hi Andrew, Would you have the test application to share with us to replicate the issue and test out? Have you tried some of the other applications with shaders to see if you are getting the same issue? Thanks -deepak
I'd like to add that I have similar results on Dell Inspiron with Intel G41 Express Chipset with the latest drivers 8.15.10.
I've tested a basic shader using OpenGL's GLSL and the vertex shader performance is slow. It seems as if the shader is being processed on the CPU. I've compared the exact shader on Google Chome's WebGL and saw high frame rates, similar to fixed-function pipeline rates.
I'm dealing with about 70,000 vertexes, which is no problem in the fixed-function pipeline, but performance is degraded on GLSL (from 150fps to 22fps).
I've tried changing the 3D settings in the display control panel, but there is no noticeable effect.
the only immediate solution I can think of is to use the Angle openGL replacement library, which converts opengl commands to directx, or to use a non-Intel video card.