It only worked on one of the three pieces of hardware I have, and specifically not on the one I developed it on. I only added the gradient stuff specifically for the talk, so people could be looking forward to future hardware more explicitly. (I don't know what the 360 and PS3 support, in fact, which was presumably a large percentage of my audience.)
The GF 7300 supports GLSL, but not ddx()/ddy() and gradients. Those are all part of an extension. I do an appropriate #ifdef
in my GLSL code and use the gradients only if they're available.
Unfortunately, that extension adds a HUGE set of features to GLSL, so there's probably hardware that supports partials, but not the rest, so there's NO WAY to access those functions in GLSL on those cards!
For writing ARB_fragment_program, there's an NVIDIA extension that provides derivatives and a lot less other functionality. It might even be available on the 7300, I'm not sure, I didn't bother trying to use it. (It's basically shameful
that there is hardware out there using finite differencing for dependent texture partials, and they don't let you hand them explicit derivatives instead, or at least an exact mipmap level, only a bias. It's shameful
. That lack of orthogonality is just insane. If you could at least specify the mipmap level explicitly, there are other things you could do.GLSL extensionNvidia fragment shader extension
ATI doesn't seem to have any corresponding extension.