ps14toATIfs is a little C/C++ library I've whipped up that parses DirectX 8.1 pixel shaders version 1.4, and translates them to OpenGL calls using the ATI_fragment_shader extension. I know ATI offers the ATI_text_fragment_shader extension, but it's syntax is proprietary and not compatible with DirectX 8.1. The largest benefit to using ATI_text_fragment_shader is, however, the fact that it uses the standard ARB interface to managing programs (like ARB_vertex_program and ARB_fragment_program) using the target GL_TEXT_FRAGMENT_SHADER_ATI. Using this library will allow you to directly use DirectX pixel shaders 1.4 in an OpenGL program, with a few exceptions that are noted below.
texld r0, t0_dz.xyw texcrd r0, t0_dw.xyz |
Using this library is a snap. Note: The library does not initialize the ATI_fragment_shader extension for you. You must do this on your own.
|
GLuint shader = glGenFragmentShadersATI(1); glBindFragmentShaderATI(shader); /* program = a character array containing the pixel shader text */ glBeginFragmentShaderATI(); int error = ps14toATIFragmentShader(program); /* return of non-zero == error */ glEndFragmentShaderATI(); /* check for errors */ if(error) { int errc = ps14toATIfs_GetErrorCount(); for(int i = 0; i < errc; i++) fprintf(stderr, "%s\n", ps14toATIfs_GetErrorString(i)); } |
That's all there is to it.
Latest version: 0.03
Changes since 0.02:
source (tar.gz)
You will need to have bison and
flex installed to
compile. For windows users, there are win32 ports of these programs
available here as are a few
other usefull GNU command line programs. I've only compiled this code with
gcc. It may or may not compile with MSVC. I don't know, I
don't own it. I'm not offering pre-compiled binaries. So don't ask.
You're on your own :)
If you would like to contact me for whatever reason (bug reports,
patches, etc...) send email to:
Be sure to put "ps14toATIfs" somewhere in the subject line. Do not abuse
my in-box. I don't want to hear about compiling issues or anything of
that sort. I don't care. :)