I finally read all about shaders and incorporated them into my engine! :)
I wrote a very small shader that make a very noticeable effect to test to see if it's working and I see no difference...
Here's my shader and fragment code
vs.txt
void main()
{
gl_TexCoord[0] = gl_TexCoord;
gl_Position = ftransform();
}
fs.txt
void main()
{
vec4 texcolor = texture2D(0, gl_TexCoord[0].st);
gl_FragColor = texcolor;
gl_FragColor.a = 0.3;
}
here's code in the engine to set it up.
WShader::cWVertexShader * pVS = WShader::cWVertexShader::Add("vs");
pVS->LoadFromFile("Assets/Shaders/vs.txt",true);
WShader::cWFragmentShader * pFS = WShader::cWFragmentShader::Add("fs");
pFS->LoadFromFile("Assets/Shaders/fs.txt",true);
WShader::cWShaderProgram *pProg = WShader::cWShaderProgram::Add("TestProg");
pProg->AttachShader(pVS); ////glAttachShader(m_ProgramID, shader->m_ShaderID);
pProg->AttachShader(pFS); //glAttachShader(m_ProgramID, shader->m_ShaderID);
pProg->Link(); //glLinkProgram(m_ProgramID);
pProg->Use(); //glUseProgram(m_ProgramID);
Each function does whats it expected, no errors, from what I can see (inside the functions i put what it really does in the comment next to it). Is there maybe some basic thing I'm missing?
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML