Cool spark/particle effect demo

Did you click on the plate with the logo?
The arc is supposed to follow your mouse on the plate.

Okay, after trying the homogenous texture coordinates, it looks the same as the messed up one on the other cards. To see the desired output and the output of the homogenous texture coordinates/Voodoo3/TNT2 output, go here: http://www.aboveandbeyondsoft.com/samples.html
Also notice how the incorrect output not only is skewed, but it is also less bright.

As for triangle strips, I couldn’t get it to work correctly. Is there some trick to it? I don’t have much experience with triangle strips but can’t I just take the code above and change “GL_QUADS” to “GL_TRIABLE_STRIP”? When I do, it looks like little triangles instead of sparks. bsically, the whole “tail” end of the “quad” no longer shows up at all. I would also like to note that the nVidia demo apparently used quads. Any ideas?

Look here to see the order the vertices must be passed for your spark when using a triangle strip: http://personal.lig.bellsouth.net/~dfrey/spark.gif

Note: You may have to reverse the front face definition or reverse the strip parity to D-A-C-B

[This message has been edited by DFrey (edited 02-16-2001).]

About the NVIDIA demo using quads for the sparks, you are right, they did use quads. But they already knew the order to pass the quad vertices to obtain the tesselation they desired. Their needs were constrained in developing the program just for the GeForce cards alone. But you can not exploit that same constraint if you want to run on other video cards. So you must explicitly state what the tesselation should be to get it to work right on all cards.

[This message has been edited by DFrey (edited 02-16-2001).]

Wow! Did you make this graphic just for me? Thanks, DFrey! You’re the man! BTW, do you have any idea of how to get rid of the sqrt() and still accomplish the same thing?

To get rid of sqrt, you can use a lookup table. That is faster, or I think they also have an approximation in 3dnow or whatever Intel calls their SSE stuff.

Do you think the accuracy of something like, say, nVidia’s faster sqrt() function would be sufficient?

It should be quite fine. However, 3DNow! or SSE can normalize a vector faster. I previously posted a 3DNow! enhanced vector normalization routine on the board a few days ago when someone was asking about fast normalization. I do not currently know the equivalent SSE enhanced routine, though I suspect it is similiar.

Right, I’ve never done any CPU specific optimizations before so how do I perform the proper check to see if the instruction is supported?

This is what I use:

MOV Support3DNow, 0
MOV EAX, 80000000h
CPUID
CMP EAX, 80000000h
JBE NoExtendedFunction

MOV EAX, 80000001h
CPUID
TEST EDX, 80000000h
SETNZ AL
MOV Support3DNow, AL

TEST EDX, 40000000h
SETNZ AL
MOV Support3DNowExt, AL

TEST EDX, 0x00400000
SETNZ AL
MOV SupportExtendedMMX, AL

NoExtendedFunction: