PDA

View Full Version : Fragment shader operation



pete876
02-12-2003, 10:38 AM
I posted a similar question in the beginners forum but...well here it goes.

The NVIDIA fragment program extension has an SEQ(Set on Equal) instruction that works like this:

tmp0 = VectorLoad(op0);
tmp1 = VectorLoad(op1);
result.x = (tmp0.x == tmp1.x) ? 1.0 : 0.0;
result.y = (tmp0.y == tmp1.y) ? 1.0 : 0.0;
result.z = (tmp0.z == tmp1.z) ? 1.0 : 0.0;
result.w = (tmp0.w == tmp1.w) ? 1.0 : 0.0;

My question is, does anyone know if I can get this kind of functionality on a card that does not support fragment programs(texture shader?). The results doesn't have to be in floating point, just 1 or 0.I've looked for extensions and in specs but cant seem to find anything. Maybe you guys can help.

old post http://www.opengl.org/discussion_boards/ubb/Forum2/HTML/011725.html

thanks in advance
/Pete



[This message has been edited by pete876 (edited 02-12-2003).]

Humus
02-12-2003, 11:52 AM
It can be done in GL_ATI_fragment_shader too.

jwatte
02-12-2003, 05:11 PM
GL_ARB_fragment_program, too :-)

The closest I can think of for non-shader-type hardware would be to do a dependent texture look-up that's offset based on what you're testing (such as the difference between two things). Dependent texture look-ups need some kind of shader capability, though.

NitroGL
02-13-2003, 07:52 AM
Couldn't ARB_shadow be somehow used to do that too?