Hello there people,
I’m currently trying - accompanied by a LOT of frustration :mad: - to get a pixel shader (fragment program) and / or vertex shader (vertex program) to run with OpenGL. I have bought nVidia’s “The Cg Tutorial” book with all kinds of examples that should work, but not a single person seems interested in telling you how you can actually COMPILE such a program by means of a practical example; I have tried compiling a simple, example pixel shader from the book using nVidia’s CGC command line compiler (CGC FragmentProgram.Txt). Nothing. The thing doesn’t seem to have a command line help switch and / or documentation, so I’m stuck.
I have also tried nVidia’s development IDE (FX Composer or whatever it is called) but it is WAY to cluttered with options to get up and running as far as the compilation of a simple pixel shader is concerned. I simply want to COMPILE a SINGLE PIXEL SHADER (a plain text file, nothing more) into an arbfp1 profile (or higher) compatible pixel shader program and I want to load this shader from within my application, is this really too much to ask (loading a precompiled (example) shader and using it in my application is no problem) ? I’m not interested in complete CgFX-projects with a plethora of vertex / pixel shaders and all kinds of additional assets that nVidia’s development environment wants to put me through.
I have also downloaded ATI’s RenderMonkey IDE (I’m currently using a Radeon 9800) but the current version isn’t able to compile shaders to an OpenGL profile: only DirectX profiles are supported, OpenGL support is planned ("…Support for DX8, DX9 (today) and OpenGL shader models (future)…"; :mad: way to go, ATI).
After that, I tried some third party tools like ShaderWorks: cluttered IDE, complete projects, no simple, single pixel / vertex shader compilation possible ( WHY?).
I’m starting to think about giving up. As a Computer Science student majoring in computer graphics I have enjoyed programming in OpenGL for quite some years now, but annoying and frustrating things like this just take the fun out of graphics programming. If someone out there can tell me what I am supposed to do to get a simple pixel shader (programmed in Cg / HLSL / GLSL; I am told the languages are compatible (although it seems that Cg-types like “float4” are not recognized by (at least) HLSL)) like the one below compiled using the arbfp1 profile, please let me know. Any Help would be greatly appreciated. Thanks in advance.
The program:
struct C2E2f_Output {
float4 color : COLOR;
};
C2E2f_Output C2E2f_Passthrough(float4 color : COLOR)
{
C2E2f_Output OUT;
OUT.color = color;
return OUT;
}
GRTZ,
(Sn)Ik.
P.S.
Im currently trying - as a last desperate attempt - to get my Visual Studio .Net environment to source highlight Cg / HLSL / GLSL shaders and / or compile them to an OpenGL / DirectX profile…