Jump to content
  • Advertisement
Sign in to follow this  
NumberXaero

GLSL setup weirdness

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

Anyone have any idea what might be going wrong here. Ive have taken a shader from a tutorial i found and used it for testing my shader support. When i compile the tutorial the shader came from, the quad appears and the image is gray scaled (function of the shader, to grayscale image) so i know the shader works. When i use the shader it seems to have no effect. Ive broken it down to immediate mode calls which simply draw a quad, i activate the shader exactly the same way the tutorial does. My calls to the shader extension functions are spread out in different functions but they are ordered as follows and I get no errors when linking, compiling, or locating variables, its one pixel shader being ran on a 9800pro, newest drivers. glCreateProgramObjectARB // no error, returns 2147483649, same num as tutorial glCreateShaderObjectARB // no error, returns 536870913, same as tutorial glShaderSourceARB // used null terminated string, and non-null with length glCompileShaderARB // glGetObjectParameterivARB // with GL_OBJECT_COMPILE_STATUS_ARB, returns 1 glAttachObjectARB // no GL_INVALID_OPERATION detected glLinkProgramARB glGetObjectParameterivARB // with GL_OBJECT_LINK_STATUS_ARB, returns 1 glGetUniformLocationARB // get sampler2d location, returns 1 not -1 glGetUniformLocationARB // get vec4 location, returns 0 not -1 glUseProgramObjectARB // no GL_INVALID_OPERATION detected glUniform1iARB // set sampler2d glUniform4fARB // set vec4 ... Draw quad glUseProgramObjectARB(0) this is the same process that i have in place so i figured it was the shader i wrote that wasnt working because i havent written any shaders that really do much. Ive validated my own with GLSL syntax validator from 3dlabs, but i figured the logic was wrong so they just werent doing anything. So I found the tutorial made sure it worked, and im watching it work in the debugger. Yet, doing the same thing in my own project, the quad just appears with colored texture? Is there something else thats might be killing the effect of shaders for me? Keep in mind everything is bascially off and its a simple build shader activate shader set variables draw quad with texture in immediate mode deactivate shader no effect...

Share this post


Link to post
Share on other sites
Advertisement
while its a nice description code is worth 1000 lines of text at times as there are subtle things you might have missed out in your description which could be key to the problem..

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!