whats this Cg error?

Started by
18 comments, last by SirKnight 18 years, 2 months ago
ouch. i'm screwed then.
Advertisement
does this mean i cant do vertex texture fetch either?
If you find somewhere any examples that uses MRT and OpenGL, you can test fp40 support.
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?

i have checked for NV_fragment_program2 and NV_vertex_program3. no problem there. could you try compiling something with FP40 for me and see if it works on your card?
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.
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.


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.
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!
It compiles fine for me. Here's cgc's output:

test.cg11 lines, 0 errors.!!ARBvp1.0OPTION 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 0PARAM 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

This topic is closed to new replies.

Advertisement