• Advertisement
Sign in to follow this  

GLSL - Fragment Shader [SOLVED]

This topic is 3628 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

My Fragment shader doesnt seem to compile at all, I have tested it in rendermonkey and it gives the thumbs up. I load the vertex shader the same way as the fragment shader, with the "same" code and the vertex shader is loaded correctly. This is how I load the Fragment shader:
if(LoadSource(stream, sizePx, px)) {
	pxSrc = px;
	
	m_PxsId = glCreateShader(GL_FRAGMENT_SHADER);
	glShaderSource(m_PxsId, 1, &pxSrc, NULL);
	glCompileShader(m_PxsId);
	delete [] px;

	glGetShaderiv(m_PxsId, GL_COMPILE_STATUS, &ok);

	if(ok == GL_FALSE) {
		m_PxsId = 0;
	}
}


LoadSource() loads the shader into a char *. The fragment shader looks like this:
void main()
{	
	gl_FragColor = vec4(0.4,0.4,0.8,1.0);
}


[Edited by - Lipponen on March 19, 2008 10:44:22 AM]

Share this post


Link to post
Share on other sites
Advertisement
Pre-mature end of file.

But i solved it, it seemed that I gave it too little room in the array :-)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement