Anyhow, don't thank me, thank Kloot. I'm just fixing minor crap, is all. He was the one who implemented TBN matrixes in the engine, etc., which made all of this possible, and wrote (and rewrote, and rewrote) the code. I did a few things here and there, but that's just bug-fixes really.
I think this code's about as good as it's going to get. I've tested with cloak, capture, etc., and it all seems to be working.
The CPU costs are not entirely trivial, but cannot really be avoided, and I don't see any good places to optimize. I see maybe 10FPS dropped because of CPU load when I am on a World Builder map. That's ouch-inducing, but not too terrifying.
What will be a little more painful is the last step- getting an alpha-transparency version working that uses full depth sorting, and hopefully a Fresnel shader. In theory, the GLSL side of that is pretty easy- just steal a little bit of jK's code from his airjet shader, call it a day. But I think that that's the final goal here- it would put Spring's unit rendering on-par with the latest game engines.
Map rendering still needs to reach that state as well, but we have most of the code for that, and "merely" need a SMF clone that includes a second texture per tile that is a DDS DXT5, for storing normalmap / heightmaps with, and we can be there in a week or so of messing about. Then maps would finally look as good as anything in a "professional" engine.
And of course this shader can be tweaked for various effects, that I probably don't have time to explore ATM. For example, that extraColor.b channel is still available for tweaking anything that people might want, from specularity to color-shifts based on the normal vectors, for "opalescent" effects, exotic metallic shaders, etc.
But I won't have time to get to that stuff, at least not any time soon- it isn't necessary for P.U.R.E. atm, and I have a lot of content to finish before the next version of P.U.R.E. is done. Heck, I have a lot of content to complete before I can even release screenshots of this new technology outside this place, frankly. I have maybe half of the World Builder stuff done, but that's because so many things share maps.
But most of my units have "normalmaps" that I built using CrazyBump's demo, and they're utter crap- I'll have to hand-paint them instead. Lots of fun, considering that I didn't keep the layers for the "armor plates" intact

Anyhow... progress is progress, I suppose. Several down, a million to go. The really sad part is that is the third time I've had to make a normalmap for the Engineering Team, one of the hardest models in P.U.R.E. because it's a jigsaw of odd shapes... but I threw out the older versions, and had to remake it again. This time I archived the PSD, lol.

