I am interested in CG, in particular vertex programs. for example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| struct appin { float3 position : POSITION; float3 normal : NORMAL; float2 texcoord0 : TEXCOORD0; };
struct vertout { float4 position : POSITION; float4 color0 : COLOR0; float2 texcoord0 : TEXCOORD0; };
vertout main( appin IN, uniform float4x4 modelViewProjection, uniform float4 currentAngle ) { vertout OUT;
float4 v = float4( IN.position.x, IN.position.y, IN.position.z, 1.0f ); v.y = sin( IN.position.x + currentAngle.x ); v.y += sin( IN.position.z + currentAngle.x ); v.y *= IN.position.x * 0.08f;
OUT.position = mul( modelViewProjection, v );
OUT.color0 = float4( 1.0f, 1.0f, 1.0f, 1.0f ); OUT.texcoord0 = IN.texcoord0;
return OUT; } |
So question.. what platforms are CG supported? What versions of opengl is it supported?
Is this something I can hope to use on win, linux and max across a variety of cards which are Geforce II and equivelent ATI?
Anyone have any experience using CG?