PDA

View Full Version : Cg glsl profile question.



christiancoder
09-30-2006, 01:27 PM
Is there anything special I have to do to get a shader (defined in a cgfx file) that works fine using arbvp1/arbfp1 to work with glslv/glslf. I am using Cg 1.5 (non beta).

christiancoder
09-30-2006, 01:29 PM
I haven't tried this on an nvidia card, I am currently working with ati, but my understanding of how the profiles work means that this shouldn't matter.

SirKnight
10-02-2006, 11:32 AM
Are you having a particular problem with the glsl profiles?

The only thing you should have to do is use glslv and glslf as the profiles after the compile part in the program state assignment.

A quick example:


void vert( inout float4 pos : POSITION )
{
pos = pos * 2.0;
}

void frag( out float4 col : COLOR )
{
col = float4( 1.0, 0.0, 0.0, 1.0 );
}

technique t0
{
pass p0
{
VertexProgram = compile glslv vert();
FragmentProgram = compile glslf frag();
}
}