converting to arb


i am after a way to convert my glsl code to ARB in a fashion that allows me to keep my framework as-is. i.e preserves uniform names, meaning I can just read in the ARB code and compile, link etc but still use getuniformlocation etc to alter runtime variables.

cgc will produce a nice compiled arb code with some fairly cryptic header information (won’t load as glsl though), and the only other option I’ve seen is ashli which produces slightly less polished arb and is also unloadable via the standard interface.
Basically I want to add a level of obfuscation to customers with a minimal amount of effort on my part :slight_smile:

I understand that I should be able to load ARB code in the same manner that i do glsl, but please correct me if I am wrong.

your suggestions most welcome!

The cgc output is far from cryptic. Just make a few test-shaders and monitor the asm.
arb asm is not loaded and manipulated the same way as GLSL.
The API are
glProgramLocalParameters4fvEXT // optional, very new

the question was whether there was a way to generate an arb shader that I could load pretty much directly.
I gather you’re telling me that i would still need to remap from my readable variable names to those given in the cgc created header output?

No, I’m saying that with cgc, you compile your GLSL shader, get a nicely formatted ARBasm code with commented lines that list all your uniforms, varyings, args nicely and whether the given symbols are used, and which hardware-resource they use. And the names of symbols are exactly as they were in your GLSL code.
You parse those comments, and thus make a custom glGetUniformLocation, glGetAttribLocation, glUniform

ARB asm is the most direct approach, GLSL is not.
There’s no way to use the GLSL API to load/control an arb-asm shader.

ok thanks very much for that