Shader Assembly Compiler (SHARK)
Last year OpenGL pixel shading capabilities finally have been standardized by ARB (see ARB_fragment_program). Before that happened, vendors used to provide interface to their hardware through proprietary extensions (e.g. NV_register_combiners or ATI_fragment_shader). Such differences in API require developer to rewrite essentially the same shader several times for different extensions. This is where SHARK helps: from a single source file it can generate a C++/Pascal code to perform appropriate OpenGL setup via different extensions (listed here).
SHARK is a tool to perform automatic conversion from DirectX 9 pixel shader assembly language into a C++/Pascal code that performs corresponding OpenGL setup through IHV’s propietary- or ARB-extensions. Possible advantages of SHARK over Cg are:
SHARK offers Ps API to handle everything that is specific to underlying extensions (e.g. code for enabling pixel shaders or setting constants). Typically, using Ps API it is possible to make a single rendering path for all supported hardware.
End user package – Win32 binary, documentation, headers
Source code – Microsoft Visual C++ 7.0
Microsoft DirectX 9 SDK – documentation on pixel shader assembly language, assembler with a good semantic checking
NVIDIA NVParse – library that performs run-time setup of NV_texture_shader+NV_register_combiners2 according to the given ps.1.0 assembly source.
If you are unsure about the output of SHARK and suspect that there’s a bug in generated code, please email description of the problem to me. Make sure to attach shader in question.