Jump to content
  • Advertisement
Sign in to follow this  
3DModelerMan

nVidia CG in Windows 8 Metro style.

This topic is 2285 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
Advertisement
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 would 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
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!