Hi everyone,
I have some legacy code which I am converting/porting to a new framework using Trolltech’s Qt framework. The version from 4.7 also has support for GLSL shaders. I have some shader code in my legacy application which is as follows. It is a fragment shader and not too complex (I think!)
char* szShader = new char[1024];
strcpy(szShader, "!!ARBfp1.0
");
strcat(szShader, "PARAM c[1] = { { 65535, 0.00390625, 256, 0.0039215689 } };
");
strcat(szShader, "TEMP R0;
");
strcat(szShader, "TEX R0.x, fragment.texcoord[0], texture[0], 2D;
");
strcat(szShader, "MUL R0.x, R0, c[0];
");
strcat(szShader, "MUL R0.y, R0.x, c[0];
");
strcat(szShader, "ABS R0.z, R0.y;
");
strcat(szShader, "FRC R0.z, R0;
");
strcat(szShader, "MUL R0.z, R0, c[0];
");
strcat(szShader, "FLR R0.y, R0;
");
strcat(szShader, "CMP R0.x, R0, -R0.z, R0.z;
");
strcat(szShader, "MUL_SAT R0.xy, R0, c[0].w;
");
strcat(szShader, "TEX result.color, R0, texture[1], 2D;
");
strcat(szShader, "END
\0");
I have actually never done any graphic programming and am quite stumped as to how I can convert this to higher level GLSL shader. Unfortunately, Qt does not support ASM shaders and I have been strugglng with this for the past few days.
I would be really grateful if someone can give me some pointers or can help me translate this to GLSL. Is there any free tools that might be available that go from ASM to the shader language of choice? I could not find one on the net.
Many thanks. I appreciate any help you can give me.
Cheers,
Anja