Hi, I am trying lesson 47 and I have done everything I think but i get this error.
Here is the applicable code:
// Load And Compile The Vertex Shader From File
cgWaterSurface = cgCreateProgramFromFile(cgContext, CG_SOURCE,"Wave.Cg", cgVertexProfile, "main", 0);
// Validate Success
if (cgWaterSurface == NULL)
{
// We Need To Determine What Went Wrong
CGerror Error = cgGetError();
// Show A Message Box Explaining What Went Wrong
MessageBox(NULL, cgGetErrorString(Error), "Error", MB_OK);
....
...
..
I get the MessageBox that pops up and it says "CG ERROR: The compile returned an error"
Here is my Cg Script
// Water Wave Cg Program
// Input structure
struct appdata
{
float4 position : POSITION; // Position is always required
float4 color: COLOR0;
float3 wave: COLOR1;
};
// Output structure
struct vfconn
{
float4 HPos: POSITION;
float4 Col0: COLOR0;
};
// Our actual CG script
vfconn main(appdata IN,uniform float4x4 ModelViewProj)
{
vfconn OUT; // Variable To Handle Our Output From The Vertex
// Shader (Goes To A Fragment Shader If Available)
// Change The Y Position Of The Vertex Based On Sine Waves
IN.position.y = ( sin(IN.wave.x + (IN.position.z / 4.0) ) + sin(IN.wave.x + (IN.position.x / 5.0) ) ) * 2.5f;
// Transform The Vertex Position Into Homogenous Clip-Space (Required)
OUT.HPos = mul(ModelViewProj, IN.position);
// Set The Color To The Value Specified In IN.color
OUT.Col0.xyz = IN.color.xyz;
return OUT;
};
Now How can i test my cg scripts for syntaxing and all of that?