I am interested in CG, in particular vertex programs. for example:
struct appin
{
float3 position : POSITION;
float3 normal : NORMAL;
float2 texcoord0 : TEXCOORD0;
};
struct vertout
{
float4 position : POSITION;
float4 color0 : COLOR0;
float2 texcoord0 : TEXCOORD0;
};
//-----------------------------------------------------------------------------
// IN = Incoming per-vertex data to be processed
// modelViewProjection = Combined model-view-projection matrix
// currentAngle = A value that goes from 0 to 360 and repeats
//-----------------------------------------------------------------------------
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?