Jump to content
  • Advertisement
Sign in to follow this  
spek

OpenGL Upgrade to Cg 2.0 problem & Texture 2D array

This topic is 3065 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Recently I needed a 2d Array texture, but found out that Cg1.5 didn't support them yet. So, I downloaded Cg 2.0 and simply replaced the DLL's. The shader works now, but the framerate suddenly dropped from 33 to 23 FPS, that's about 33%! I didn't change anything else in the code, neither the (Delphi) file that links up with all the DLL functions. Unfortunately, I can't find updated Delphi headers for Cg 2.0. I could update them myself, but hey, I'm lazy, those units are pretty big! And maybe the problem is elsewhere. Does someone have any idea what it could be? Certain function calls, wrong setup, passing parameters... I'm using Delphi 7, OpenGL 1.x, Cg 2.0. He, ancient tools :) Laptop has a GeForce 9800M GTS. Using Shader model 3.0 in the Cg setup. -edit: same performance drop when using the newest Cg 2.2 release. For now I could use 3D textures instead of 2D texture array's. I need them or Cascaded Shadow Maps. Would there be any reason to use array's over 3D textures, or vice versa? Regards [Edited by - spek on February 22, 2010 3:39:19 PM]

Share this post


Link to post
Share on other sites
Advertisement
Have you tried using cgGLSetDebugMode(CG_FALSE)? This will avoid the numerous glGetError calls the runtime makes internally.

Remember there's also a Cg forum at NVIDIA's developer site where many NVIDIA engineers roam, several from the Cg teams. http://developer.nvidia.com/forums/index.php?showforum=14

Share this post


Link to post
Share on other sites
That function wasn't even defined in my old header. Tried it, but no significant difference (neither with the old DLL's by the way). Guess something else is causing problems. I can't remember doing anything really special in the shaders. Maybe one thing, since I while I'm using the glState. For example:

uniform float4x4 mvp
...
out.pos = mul( mvp, in.pos );

REPLACED BY
out.pot = mul( glstate.matrix.mvp, in.pos );

That didn't change the speed, although compiling time suddenly became a lot longer (I have more than hundred shaders).


Thanks for pointing to that forum, although I always start with gamedev since I get the best help here ussually ;)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!