Quote: Original post by KrohmQuote: Original post by cippyboy
Oh and is there a shader debugger ? :D I`d really wanna see what the variables contain at run-time and stuff(I guess I`m asking for too much huh ?)
I has been told there is one from NVidia available only to well-known companies, but I think this is just a rumor. The stream-MIMD processing model is not really well suited to debugging.
NVIDIA develops FX Composer which has an integrated shader debugger, but it is designed for Direct 3D only. NVIDIA stated explicitly that they did not plan to export such work for OpenGL in the near future. It is free software, by-the-way.
Quote: Original post by cippyboy
1)Ok some other thing I cam across while writing some testing fragment programs, can I find out the fragment`s 3D position ? the window position doesn`t help too much...
You can use texture generation with EYE_LINEAR mode if you're not using VP's, or you can simply compute such info in a texture coordinate directly from vertex position if you're using VP's.
Quote: Original post by cippyboy
2)How does the DST command work ? I`m sending 2 vectors and still seem not too get what I want... it should return the length on all 4 components right ?
The input vectors must have a very specific style. The first one should be [NA, d^2, d^2, NA] and the second one should be [NA, 1/d, NA, 1/d].
See Section 2.14.5.7 of the ARB_vp spec.
Quote: Original post by cippyboy
Oh and how about the Square Root ? RSQ is reciprocal(which I don`t know what it should mean) I just want to do a square root to a variable that`s all...
reciprocal(x)=1/x
The square root isn't encoded in the ARB_vp/fp instructions, simply because you mostly don't need it (you can almost always do without, be it for distance values into lighting computations etc).
However, if you really want a SQRT-like instruction, you can combine a RSQ followed by a RCP instruction. The former computes 1/sqrt(x) and the latter computes 1/x, so : RCP(RSQ(x)) = 1/(1/sqrt(x)) = sqrt(x)