Results 1 to 5 of 5

Thread: FP related problem

  1. #1
    Senior Member Regular Contributor
    Join Date
    Apr 2009
    Posts
    171

    FP related problem

    i was try to begin with GL_FRAGMENT_PROGRAM_ARB but my code show black on screen but slow down the speed of processing
    here some part of code i made

    i declared a object which is
    (i insist myself here something wrong)
    Code :
    GLfloat TriVert[] = {
     
    0.0f,0.5f,0.0f,
    -0.5f,0.0f,0.0f,
    0.5f,0.0f,0.0f,
     
     
    1.0f,0.0f,0.0f,
    0.0f,1.0f,0.0f,
    0.0f,0.0f,1.0f
    },theta = 0.0f;
     
    const char *thatsit = "\
     !!ARBfp1.0\
    PARAMS vert = {0.0f,0.5f,0.0f,\
    -0.5f,0.0f,0.0f,\
    0.5f,0.0f,0.0f,\
    };\
    MUL vert, TriVert\
    END";
    and display function
    Code :
    glVertexPointer(3,GL_FLOAT,NULL,0);
    glColorPointer(3,GL_FLOAT,NULL,(int*)36);
    glBindBufferARB(GL_ARRAY_BUFFER_ARB,Vertex);
    /*NOTE program bind at rendring time*/
    glBindProgramARB (GL_FRAGMENT_PROGRAM_ARB, nitspro);
     
     
    glEnableClientState(GL_VERTEX_ARRAY);
    glEnableClientState(GL_COLOR_ARRAY);
     
    glDrawArrays(GL_TRIANGLES,0,3);
    glDisableClientState(GL_VERTEX_ARRAY);
    glDisableClientState(GL_COLOR_ARRAY);
    //Destroy it
     
    glPopMatrix();

    and when i know that i have extension
    Code :
    if(GLEW_ARB_fragment_program)
    {
    fprintf(stdout,"Lets do some Fragment program job\n");
      glEnable(GL_FRAGMENT_PROGRAM_ARB);
    glGenProgramsARB(2,&nitspro);
    glBindProgramARB (GL_FRAGMENT_PROGRAM_ARB, nitspro);
    glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(thatsit), 
                              thatsit); 
    }
    else fprintf(stdout,"Hardware not supporting the fragment program job so leave it ");

    please help me regarding this

    i read the specs of fragment_program.txt
    and these of dot product textures attribute
    please help me in these things
    any link lecture on these DP3,HDP..,etc
    (Here i want to say i am 17 years that mean i am really beginner to these type of programming(not C/C++)
    so please reply)

    thanks for just reading it and think on this Q
    thanks in advance
    haven't made a game [img]<<GRAEMLIN_URL>>/frown.gif[/img]

  2. #2
    Senior Member OpenGL Pro Ilian Dinev's Avatar
    Join Date
    Jan 2008
    Location
    Watford, UK
    Posts
    1,294

    Re: FP related problem

    Make cgc.exe generate ARB-asm code for you. The string in "thatsit" must not start with new-line. A shader program cannot access "TriVert". Multiplying 3x3 matrices cannot be done in one instruction. ARB-asm opcodes take at least 3 parameters: dest,src1,src2.
    Write in GLSL, compile to arb-asm, view the asm code and line-by-line study each expression used there by looking at the specs.

    glGenProgramsARB(2,&amp;nitspro); // change 2 to 1


    Quite an odd case, this kid.

  3. #3
    Senior Member Regular Contributor
    Join Date
    Apr 2009
    Posts
    171

    Re: FP related problem

    thank u very much for reply
    but i am using linux Distros (Suse 11)
    and i have i915 with Mesa 7.4.4
    so i cannot use GLSL(perhaps)
    and alos i had BindBuffer(VBO) with 1 so can give problem

    i had insalled Specs(fragment and vertex programs)
    and just started reading it
    haven't made a game [img]<<GRAEMLIN_URL>>/frown.gif[/img]

  4. #4
    Senior Member OpenGL Pro Ilian Dinev's Avatar
    Join Date
    Jan 2008
    Location
    Watford, UK
    Posts
    1,294

    Re: FP related problem

    No, download cgc.exe . That's in the nVidia Cg Toolkit. It's the only real compiler that produces ARB-asm.
    You won't be sending that GLSL code to the gpu, but to the compiler.

  5. #5
    Senior Member Regular Contributor
    Join Date
    Apr 2009
    Posts
    171

    Re: FP related problem

    Hey thanks and find that Cg toolkit also available for linux platform so i installed both Window and Linux toolkit and

    now
    as if i used toolkit to make GLSL ARB-asm opcodes so can i understand the meaning of these variable,parameters etc so that i can codes with my own hands also got in my mind that what results should come out from code
    or
    i not need to care the Cg do all for me
    haven't made a game [img]<<GRAEMLIN_URL>>/frown.gif[/img]

Similar Threads

  1. hardware problem related to OpenCL
    By lazyisme in forum OpenCL
    Replies: 4
    Last Post: 09-21-2013, 08:27 AM
  2. Problem with glDepthTest (possibly camera related)
    By roflc0pt3r in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-08-2005, 08:50 PM
  3. Not related with OGL
    By KurtCob in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 04-25-2001, 11:37 AM
  4. MFC problem (not really OpenGl related... please help)
    By clucches in forum OpenGL: Advanced Coding
    Replies: 16
    Last Post: 04-20-2001, 09:18 AM
  5. Damn Quake3 Demo problem (think OpenGl related)
    By in forum OpenGL: User Software
    Replies: 0
    Last Post: 09-27-2000, 04:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean