Converting .fx to CgFX


FX Composer 2안에 이런 것이 있었다. 아주 운이 좋은 것 같다. ㅋㅋㅋㅋㅋ
HLSL로 작성된 .fx 파일을 cgfx로 변환시켜 주는 방법이다.

FX Composer 2 comes with a Perl script that automatically converts HLSL .fx files
to CgFX. It is called “convert_fx.pl” and you can find it in the Utilities sub-folder of
the FX Composer 2 installed location.
convert_fx.pl outputs a copy of the input effect with Microsoft FX/CgFX 1.2
specific state assignments converted to the new OpenGL specific state assignments
in CgFX 1.5.
Perl must be installed for the script to run. (You can download a free Perl
distribution from www.activeperl.com.) To run the script, execute the following
command:

perl convert_fx.pl input.fx output.cgfx

LimitationsMultiple state assignments on a single line are not supported. If the input file

contains any lines similar to the following:

SrcBlend = One; DestBlend = Zero;

you must move these state assignments to their own line before running this script,
as shown below:

SrcBlend = One;
DestBlend = Zero;

State that has no direct OpenGL equivalent will not be changed; instead, this script
will add a comment to the line indicating that the state will have to be manually
updated. Search for “FIXME” in the output file to locate these problem states.
See the declaration of the unsupportedState array below for a list of state that is not
supported.