Jump to content


How similar are CGFX and D3DX FX?


2 replies to this topic

#1 Goz

    Senior Member

  • Members
  • PipPipPipPip
  • 575 posts

Posted 08 September 2008 - 09:38 PM

I've been looking into Cg recently due to D3D10 "issues" with the D3D FX format (You can no longer state track fx files). It seems that CGFX is far more like D3DX9 FX, than i ever imagined. In fact, the more i look into the format the more it looks like its completely compatible with D3DX. Is this true does anyone know?

Going to try and code up a CGFX implementation of my engine's effect code. Would be great to know how much time i'm gonna waste though ;) Compatibility between the 2, though, would be great as it would mean i could re-use my oversized library of fx files without having to laboriously make small modifications.

#2 starstutter

    Senior Member

  • Members
  • PipPipPipPip
  • 1039 posts

Posted 08 September 2008 - 10:19 PM

I think CG is almost identical to HLSL. I've been using hlsl for about a year now, and most of my sample code comes from n-vidia (all written in cg) and I have yet to see a single difference.
(\__/)
(='.'=)
This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!

#3 Kenneth Gorking

    Senior Member

  • Members
  • PipPipPipPip
  • 939 posts

Posted 09 September 2008 - 03:21 PM

CgFX was originally based directly off of HLSL, so back in the day you could compile them unmodified in CgFX. It has changed a bit since then, towards a more OpenGL-like state syntax, and other stuff like that.

There is however profiles in newer Cg that allows you to compile source code from both HLSL and GLSL, and the 2.1 beta, that was released in august, also lets you use D3D10 profiles.
"Stupid bug! You go squish now!!" - Homer Simpson





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users