Jump to content
  • Advertisement
Sign in to follow this  
Lipponen

GLSL - Fragment Shader [SOLVED]

This topic is 3927 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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!