Cool, that intext directive turns up some useful stuff, never knew about that
Well anyway, I converted all my shaders, took me two days but still it was easier than I imagined. Now I need to dig out my netbook to test...
arb assembly tutorials?
I'm interested to see how well it turned out.xDan wrote:Cool, that intext directive turns up some useful stuff, never knew about that
Well anyway, I converted all my shaders, took me two days but still it was easier than I imagined. Now I need to dig out my netbook to test...
I assumed that the hardware limitations where the main obstacle, eg pixel shader x.x supports feature y, and the compilation of glsl code was just a formality.
I put the code up here, probably not much use to anyone out of context of my game though:
http://xzist.org/temp/puzzlegame/shaders/
It was all fairly trivial, couple of slightly tricky parts:
- no "if" construct, so had to use SLT/SGE (set-less than, so if the condition is true a variable is set to 1.0, otherwise is set to 0.0, you can then use that as a multiplier)
- no normalise function, but that is easily achieved (and can be seen done in the Irrlicht example shaders)
- no mix function, but that's also easily achieved (just a linear interpolation)
- no looping, so I had to unfold my loops (only time I had a loop was in my post processing blur pass)
But the end result is visually identical to my GLSL, since I didn't use any advanced features (mainly as my card didn't support them).
Though having tested it on my netbook, it works, but it's too slow to be usable. But hopefully it will still improve compatibility for some older PCs or laptops even if netbooks are out of the question.
http://xzist.org/temp/puzzlegame/shaders/
It was all fairly trivial, couple of slightly tricky parts:
- no "if" construct, so had to use SLT/SGE (set-less than, so if the condition is true a variable is set to 1.0, otherwise is set to 0.0, you can then use that as a multiplier)
- no normalise function, but that is easily achieved (and can be seen done in the Irrlicht example shaders)
- no mix function, but that's also easily achieved (just a linear interpolation)
- no looping, so I had to unfold my loops (only time I had a loop was in my post processing blur pass)
But the end result is visually identical to my GLSL, since I didn't use any advanced features (mainly as my card didn't support them).
Though having tested it on my netbook, it works, but it's too slow to be usable. But hopefully it will still improve compatibility for some older PCs or laptops even if netbooks are out of the question.