Sign in to follow this  

nVidia CG in Windows 8 Metro style.

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

Does anyone know of a way to use nVidia CG in Windows 8 Metro style? CG should run, but will it pass certification? Is there a CG compiler that could translate my cgfx files into DirectX fx file for Windows 8?

Share this post


Link to post
Share on other sites
I'm not an expert on Metro or Cg, but I'm 99% sure that you won't be able to use the Cg runtime library in a Metro environment. This would mean that CgFX is out the window, since it has a lot of runtime state management. If the Cg compiler can compile raw shaders to D3D11 shader bytecode, then you [i]would[/i] be able to pre-compile shaders in your development environment and then load those pre-compiled shaders on a Metro device at runtime. However you still wouldn't be able to use any of the other Cg runtime libraries for manipulating state, or reflecting the shader info. But again I'm not too familar with Cg on the PC, so I couldn't say for sure whether this is possible.

I'm not aware of any library for translating between Cg and HLSL. For DX9 the languages are almost totally identical, but for DX11 there are definitely some differences. However you could certainly make use of macros to author your shaders such that they compile as both DX11 HLSL as well as Cg. I used to do this to maintain compatibility with a certain platform that uses Cg shaders exclusively.

Share this post


Link to post
Share on other sites
I'm fairly certain you can tell the Cg compiler to emit D3D11 shader bytecode, actually. You'll need to do things like state management yourself, but your shaders themselves should still work.

Share this post


Link to post
Share on other sites

This topic is 2131 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.

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