PDA

View Full Version : silly ARB parameter passing question



vmh5
01-28-2004, 10:39 AM
I started out learning Cg but need to support Mac OS-X as well as windows. Since I've given up on NVidia's promises I'm now the process of converting everything to ARB.

The real hassle here is the parameter passing. My question is this: can I pass a single float to a fragment program? It seems the glProgramLocalParameter API expects vectors only.

BTW if you can point to some good documentation & examples for using the glxxARB vertex and fragment runtime code I'd be most happy!

vmh5
01-28-2004, 11:39 AM
So it's beginning to dawn on me that there is no such thing as single floats. That Cg code compiled as profile arbvp1 allows you to pass single parameter floats but it's actually wasting using a 4 float vector for each one?

I.e. I'd better pack my single parameters into vectors?

Is this assumption correct?

V-man
01-28-2004, 06:21 PM
Yes, each parameter is 4 components.

Cg offers a conveniance. The ARB wants to keep the # of entry points to a minimum.