Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualHodgman

Posted 09 September 2012 - 09:51 AM

In assembly language the variables setting is actually through setting different registers, On contrast in HLSL for example it is through pair of interfaces like GetParameterByName and SetMatrix.

Those 2 functions aren't related to HLSL, they're part of the "Effect framework" (.fx file format), which is a wrapper around HLSL. The Cg equivalent is CgFX.
If you don't use the "Effect framework", then all of your HLSL variables still correspond to specific registers, the same as you're used to with your assembly shaders.

It seems CG is the best choice among all due to its high portability and easily to be transfered into HLSL or GLSL

HLSL and Cg are almost exactly the same, so much so that I write my shaders once, and I compile them as HLSL for D3D and compile the same file as Cg for OpenGL Posted Image

A robust structure of renderer that could compile shaders in both assembly language and high level language

Is this required? Assembly shaders have been phased out in D3D (from DX10 onwards, you have to use HLSL). Anyway, as above in D3D, compiled HLSL shaders act the same as asm shaders.

#1Hodgman

Posted 09 September 2012 - 09:50 AM

In assembly language the variables setting is actually through setting different registers, On contrast in HLSL for example it is through pair of interfaces like GetParameterByName and SetMatrix.

Those 2 functions aren't related to HLSL, they're part of the "Effect framework" (.fx file format), which is a wrapper around HLSL. The Cg equivalent is CgFX.

It seems CG is the best choice among all due to its high portability and easily to be transfered into HLSL or GLSL

HLSL and Cg are almost exactly the same, so much so that I write my shaders once, and I compile them as HLSL for D3D and compile the same file as Cg for OpenGL Posted Image
If you don't use the Effect framework, then all of your HLSL variables still correspond to specific registers, the same as you're used to with your assembly shaders.

A robust structure of renderer that could compile shaders in both assembly language and high level language

Is this required? Assembly shaders have been phased out in D3D (from DX10 onwards, you have to use HLSL). Anyway, as above in D3D, compiled HLSL shaders act the same as asm shaders.

PARTNERS