Jump to content
  • Advertisement
Sign in to follow this  
bluntman

Getting double precision out of CgFx.

This topic is 3654 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

I am trying to convert one of my shaders to use double precision. I am running on the gp4 profile so it should support doubles, but I can't get it to recognise a double4x4 type for my matrix (it returns CG_UNKNOWN_TYPE from cgGetParameterType). How do I get double precision matrices into CgFx?

Share this post


Link to post
Share on other sites
Advertisement
As far as I know double precision is only supported in a few workstation graphics cards (ie. the Tesla range). So unless CgFX 2.0 supports double precision in software I don't think any GeForce cards support it.

PS: How's CgFX treating you? I've been playing for a few months with FX Composer/COLLADA/CUDA which has all gone ok... but CgFX has me beat. If you feel like helping the needy here's my thread: Textures not working (CgFX + OpenGL): draws black silhoette (works ok in FXComposer).

Share this post


Link to post
Share on other sites
Yeah a couple of hours after posting this I finally realised that OpenGL's accepting of double precision paramters _doesn't_ mean the graphics card works in doubles, its just to make life a bit easier for the programmer. :/ Still I fixed my precision problems the proper way by setting my geometries local origin closer to the center of the geometry rather than the center of the planet I am rendering.
Yeah CgFx is a mixed bag, the idea is nice, and it can work fairly well but theres some bits which don't make sense, an API with loads of functions with overlapping functionality, depreciated functions etc, and pretty poor documentation. If I was to start my project again I would try something else, or make my own shader composing library!
I will take a look at your thread but no promises, most of the problems I have fixed in CgFx have ended up being either begging the nVidia Cg forum for help or just trying every combination until one works!

Share this post


Link to post
Share on other sites
The only Nvidia GPU's that support double precision are the brand-new GTX 260/280. I believe the ATI HD3000 and HD4000 series also support dp. AFAIK this isn't even exposed through CUDA yet, much less Cg/GL/D3D.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!