Jump to content
  • Advertisement
Sign in to follow this  
joanusdmentia

Using vertex programs.....

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

I've been trying to get this working all day to no avail. Needless to say I'm getting *very* irrate.... anyway, should the following setup a vertex shader correctly? As far as I can tell I'm taking EXACTLY the same steps as the samples in the NVIDIA samples but all I get is an empty screen. If I don't call glUseProgramObjectARB() everything works as it should so the problem has to be with the shader setup or the program itself.
    const char* vertexShaderCode = 
        "void main()\n"
        "{\n"
        "    gl_Position = ftransform();\n"
        "}"
        ;

    vertexProgram = glCreateProgramObjectARB();
    uint vertexShader = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
    int len = strlen(vertexShaderCode);
    glShaderSourceARB(vertexShader,1,&vertexShaderCode,&len);
    glCompileShaderARB(vertexShader);

    GLuint shaderStatus;
    glGetObjectParameterivARB(vertexShader,GL_OBJECT_COMPILE_STATUS_ARB,(GLint*)&shaderStatus);
    char shaderLog[10000];
    glGetInfoLogARB(vertexShader,10000,0,shaderLog);

    glAttachObjectARB(vertexProgram,vertexShader);
    glDeleteObjectARB(vertexShader);
    glLinkProgramARB(vertexProgram);

    GLuint programStatus;
    glGetObjectParameterivARB(vertexProgram,GL_OBJECT_LINK_STATUS_ARB,(GLint*)&programStatus);
    char programLog[10000];
    glGetInfoLogARB(vertexProgram,10000,0,programLog);

Share this post


Link to post
Share on other sites
Advertisement
this psd has about the simplest example of setting up a shader

http://www.ati.com/developer/gdc/OpenGLShadingLanguage.pdf

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!