Sign in to follow this  

whats this Cg error?

This topic is 4298 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i am trying to sort out using MRT. i dont understand what the following error is complaining about: CG ERROR : The compile returned an error.(17) : fatal error C9999: Invalid component for output connector my fragment shader code: void main ( float2 coords : TEXCOORD0, uniform samplerRECT posTex, uniform samplerRECT velTex, out float4 new_pos : COLOR0, out float4 test : COLOR1 ) { float4 pos = texRECT(posTex,coords); float4 vel = texRECT(velTex,coords); new_pos = pos + vel; test = vel; }

Share this post


Link to post
Share on other sites
righto, i've figured what the problem is (kind of). you need fp40 profile to use MRT. according to my card, it doesnt support fp40. i think it should do, since GeForce 6 series are supposed to fully support shader model 3 (which i think includes MRT). all the drivers are up to date. i'm a bit pissed at this, any ideas why it wont do fp40?

Share this post


Link to post
Share on other sites
i have just tried compiling using

fragmentProfile = CG_PROFILE_FP40;

and i get a profile not supported error.

also when i do cgGLGetLatestProfile(CG_GL_FRAGMENT) it says its FP30.

is there a setting i need to put or something to enable it? i tried updating the drivers but didnt change anything.

Share this post


Link to post
Share on other sites
i reinstalled the Cg compiler yesterday when i did the drivers, so everything should be up to date. its really doing my head in, i cant do my uni project which i specifically bought this card to do.

Share this post


Link to post
Share on other sites
I also have a Geforce 6600. I have not tried to compile a cg shader with fp40, but from browsing their website and the cg documention, it seems fp40 matches NV_fragment_program2.

This is in my extension string. Did you try to upgrade your driver and see if that helped?

Share this post


Link to post
Share on other sites
I tried your program and it compiles and binds properly under CG_PROFILE_FP40.

I haven't tried to use it though. I have never worked with MRT before and I don't really want to dwelve into it right now.

If you post your program somewhere. I will gladly try it though.

Share this post


Link to post
Share on other sites
Yeah a demo showing this would be nice.

If all else fails, you can always write the assembly yourself and feed it into Cg by using CG_OBJECT when doing cgCreateProgram.


Share this post


Link to post
Share on other sites
Quote:
Original post by mbruenjes
GeForce 6600 supports Shader Model 3.0 for DirectX 9. I´m not sure if it supports that for OpenGL. But it could be an answer, why fp40 isn´t supported.


No it's supported under OpenGL as well. NVIDIA makes sure all hardware features are exposed in both APIs.

Share this post


Link to post
Share on other sites
Quote:
Original post by SirKnight
Yeah a demo showing this would be nice.


yeah i can happily post the code up if anyone would be kind enough to see if they can get it working on their machines. can you upload it on here or do i need to put it up somewhere else people to download?

i've given up on MRT for now, its not the end of the world if i cant get that working. i do desperately need to get vertex texture fetch working though. at the moment i am getting a wierd error message -

error C1115 : unable to find compatible overloaded function "tex2D"

for the following vertex shader

void main ( float2 coords : POSITION,
float4 color : COLOR,
uniform sampler2D posTex,
uniform float4x4 modelViewProj,
out float4 outpos : POSITION,
out float4 outcol : COLOR)
{
float4 particle_pos = tex2D(posTex,coords);
outpos = mul(modelViewProj, particle_pos);
outcol = float4(1, 0, 0, 1);
}


i cant see what thats complaining about. i checked the documentation for the GL_NV_vertex_program3 extension and vertex textures are definately supported.

one thing i dont follow is in the documentation is says:

ARB programs wishing to use this added functionality need only add:
OPTION NV_vertex_program3;
to the beginning of their vertex programs.

what are they talking about there? its certainly not code that Cg will recognise.

your help is very much appreciated, as you can probably tell i pretty new to all this and way out of my depth!

Share this post


Link to post
Share on other sites
It compiles fine for me. Here's cgc's output:


test.cg
11 lines, 0 errors.
!!ARBvp1.0
OPTION NV_vertex_program3;
# cgc version 1.4.0000, build date Jun 9 2005 12:09:02
# command line args: -profile vp40
# source file: test.cg
#vendor NVIDIA Corporation
#version 1.0.02
#profile vp40
#program main
#semantic main.posTex
#semantic main.modelViewProj
#var float2 coords : $vin.POSITION : POSITION : 0 : 1
#var float4 color : $vin.COLOR : COLOR0 : 1 : 0
#var sampler2D posTex : : texunit 0 : 2 : 1
#var float4x4 modelViewProj : : c[0], 4 : 3 : 1
#var float4 outpos : $vout.POSITION : HPOS : 4 : 1
#var float4 outcol : $vout.COLOR : COL0 : 5 : 1
#const c[4] = 1 0
PARAM c[5] = { program.local[0..3],
{ 1, 0 } };
TEMP R0;
TEMP CC;
BB1:
TEX R0, vertex.position, texture[0], 2D;
DP4 result.position.w, R0, c[3];
DP4 result.position.z, R0, c[2];
DP4 result.position.y, R0, c[1];
DP4 result.position.x, R0, c[0];
MOV result.color, c[4].xyyx;
END
# 6 instructions, 1 R-regs




-SirKnight

Share this post


Link to post
Share on other sites

This topic is 4298 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this