Original Post
I made a recent post about deferred shading with Cg... well... here is my Fragment Program and i am getting compiler errors that dont make sense.(at least to me and i am fairly new at writing Cg Shaders) Deferred_Shading: creating fragment program from file: CG ERROR : The compile re turned an error. ..\Shaders\GbufferF.cg(26) : error C0000: syntax error, unexpected ',', expectin g '(' at token "," ..\Shaders\GbufferF.cg(26) : error C0501: type name expected at token "," ..\Shaders\GbufferF.cg(27) : error C1068: too much data in type constructor ..\Shaders\GbufferF.cg(27) : error C0000: syntax error, unexpected ';', expectin g ')' at token ";" ..\Shaders\GbufferF.cg(27) : error C0501: type name expected at token ";" [Edited by - AverageJoeSSU on January 13, 2008 7:35:15 PM]
struct fs_mrt
{
float4 color0 : COLOR0;
float4 color1 : COLOR1;
float4 color2 : COLOR2;
};
void GbufferF( float4 oPosition : POSITION,
float2 oTexCoord : TEXCOORD0,
float3 oNormal : TEXCOORD1,
float3 Sem : TEXCOORD3,
uniform sampler2D Texture,
uniform sampler2D NormalMap,
uniform float4x4 ModelViewProj
)
{
fs_mrt OUT;
OUT.color0 = float4( (oPosition).xyz, Sem.x );
float4 normal = tex2D(NormalMap, oTexCoord);
OUT.color1 = float4( (normal).xyz , Sem.y);
float4 diffuse = tex2D( Texture , oTexCoord); //line 26
OUT.color2 = float4( (diffuse).xyz , Sem.z); //line 27
return OUT
}