Jump to content
  • Advertisement
Sign in to follow this  
Enerjak

OpenGL weird shader error at run time.

This topic is 2020 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

Ok, for some reason I can't seem to compile my shader for openGL due to this:

 

 

http://puu.sh/303nE.jpg

 

now here is my vert / frag shader.

 

shader.vert

#version 150 core  
in vec3 in_Position;
  
in vec3 in_Color;  
out vec3 pass_Color;  
void main(void)
  
{
       
gl_Position = vec4(in_Position, 1.0);
       
pass_Color = in_Color;
  
}  

 

shader.frag

 

#version 150 core

in vec3 pass_Color;

out vec4 out_Color;

void main(void)
{
      out_Color = vec4(pass_Color, 1.0);
}

 

so, i don't know why this is not compiling good. Also, my GTX 450 NVIDIA card doesn't seem to support wglewCreateContext which is weird, is there anyway to be sure it doesn't support it? (I would think it would be common among cards of this day to support this:

 

if(wglewIsSupported("WGL_ARB_Create_Context") == 1)
		{
			this->m_GLRC = ::wglCreateContextAttribsARB(this->m_deviceContext, NULL, attributes);
			wglMakeCurrent(NULL,NULL);
			wglDeleteContext(m_GLRC);
			wglMakeCurrent(m_deviceContext, m_GLRC);
			MessageBoxA(NULL,"context created",NULL,MB_OK);
		}
	

 

 

Share this post


Link to post
Share on other sites
Advertisement

try changing the "WGL_ARB_Create_Context" to "WGL_ARB_create_context".

 

I'm not sure why the shader isn't compiling. All I can think is that you're not transforming the vec3 against the projection/modelview matrices, or any matrices for that matter, but I wouldn't know if doing anything otherwise would be invalid - such as casting to a vec4.

Share this post


Link to post
Share on other sites

try changing the "WGL_ARB_Create_Context" to "WGL_ARB_create_context".

 

I'm not sure why the shader isn't compiling. All I can think is that you're not transforming the vec3 against the projection/modelview matrices, or any matrices for that matter, but I wouldn't know if doing anything otherwise would be invalid - such as casting to a vec4.

thanks, that worked, but created openGL version 1-1 for some reason? weird............

Share this post


Link to post
Share on other sites

I ran your shaders through AMD's GPU ShaderAnalyzer and it verifies that your code is correct.  I may get mobbed for saying this, but even though the Khronos group recommends that you should always add #version to the shader program, I've noticed from testing everything I write on multiple GPU brands that sometimes the shader will fail even when the code is valid.  It seems that some drivers will reject the shader because it doesn't like the version number.  Try commenting it out and see what happens.

Share this post


Link to post
Share on other sites
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!