arb vertex program question

my question follows:
is it possible to differentiate between vertices belonging to the same mesh in arb programs?
i mean, i would like to do different ops on different areas of my mesh
i’ve been looking for some CMP function in arb progs to identify vertices by their position but found nothing
shall i create 2 or more different meshes?
thanks for your time

[This message has been edited by tellaman (edited 01-13-2003).]

OpenGL has no concept of a “mesh”; how would it know if two vertices belong to the same one?

Sounds like you want to draw each part of your mesh separately and with a different vertex program.

ya i’d better call it display list
is it possible anyway?

The standard way in ARB_vertex_program to execute a command like the following from ARB_fragment_program:

CMP dst, src0, src1, src2

is a sequence like the following:

SGE tmp, src0, 0; # tmp = 1 if src0>=0, 0 otherwise
SUB tmp2, src2, src1; # tmp2 = src2-src1
MAD dst, tmp, tmp2, src2;

This should yield either src1 or src2 as appropriate.

It’s probably worth adding this as an example in the spec, since it’s fairly commonly used.

I could be wrong, but I think you mean:

SGE tmp, src0, 0; # tmp = 1 if src0>=0, 0 otherwise
SUB tmp2, src2, src1; # tmp2 = src2-src1
MAD dst, tmp, tmp2, src1;

Paul

[This message has been edited by bakery2k (edited 01-13-2003).]

thanks a lot that’s exactly what i was looking for

Originally posted by bakery2k:
[b]I could be wrong, but I think you mean:

SGE tmp, src0, 0; # tmp = 1 if src0>=0, 0 otherwise
SUB tmp2, src2, src1; # tmp2 = src2-src1
MAD dst, tmp, tmp2, src1;

Paul

[This message has been edited by bakery2k (edited 01-13-2003).][/b]

Yes, you are correct. I wrote it one way, then reversed the order in mid-stream since it seemed more intutive. Didn’t fix it all, though.