Update
Another days wo
rk, and I now have this. It does not look like that much have changed since yesterday, but it has! I can now handle an arbitrary amount of triangles and I have clean separation between the various stages of the pipeline. I was able to remove alot of redundant textures and Cg programs so the above screenshot, although more advanced under the hood, actually takes the same amount of videram as the previous one, and this one even has four times the triangle count.My major headache is the Cg compiler (1.3 beta 2) which has a comparable amount of bugs to your avarage country sized rain forest. Nested conditionals are apparently very hard to compile into fp30 code, and the arbfp1 code is simply incorrect. I sometimes has to add code updating some component of a vector just before a conditional which updates that same vector anyways (or kills the fragment) – so the first update is utter useless, but apparently required to make it compile right. Go figure. I would just like to add that I normally consider compiler/API complains as a sign of someone not understanding the tool they use. In this case though, I am the one complaining, and I am fairly sure that my complaints are justified. If you, however, know why my cgc is behaving this weird I would really like to hear from you.
Oh, and the above cube is of course exported from 3D Studio MAX using my own exporter, loaded from disk using my own engine, and then restructered and fed to the GPU :).