Results 1 to 8 of 8

Thread: OpenGL vertex_program_arb usage?

  1. #1
    Join Date
    Apr 2008
    Posts
    101

    Default OpenGL vertex_program_arb usage?

    basically I am trying to write a OpenGL3 compatible renderer, but since the radeon driver just supports OpenGL1.5 I have to use vp/fp instead of GLSL.

    I already managed to write a simple shader and to load it. Now I want to push some external data into it like the Model-View-Matrix, which is the following in OpenGL3:

    int loc = glGetUniformLocation(programObject, "name");
    glUniformMatrix4fv(loc, 1, GL_FALSE, identity);

    I also would like to know whether there is a function closer to glVertexAttribPointer than glVertexPointer?

    Generally I am looking for a tutorial which explains a vp/fp based render and also has some documentation for the assembly language.

    Or if you have any other tips how to develop a OpenGL3 render with the OSS stack, they are welcome. Speed does not matter yet.

  2. #2
    Join Date
    Jul 2009
    Location
    São Paulo, Brazil
    Posts
    74

    Default

    hum... I hope you haven't asked that on this forum only.
    You know there are forums where you are more likely to get an answer other than this one don't you?

  3. #3
    Join Date
    Nov 2007
    Posts
    1,024

    Default

    Quote Originally Posted by jntesteves View Post
    hum... I hope you haven't asked that on this forum only.
    You know there are forums where you are more likely to get an answer other than this one don't you?
    e.g., the official OpenGL discussion boards.

  4. #4
    Join Date
    Aug 2008
    Posts
    77

    Default

    The ARB_vertex_program/ARB_fragment_program extensions don't have a concept of uniforms. You can access OpenGL state using state.whatever, or copy the matrices manually into the program.local or program.env state arrays.

  5. #5
    Join Date
    Apr 2008
    Posts
    101

    Default

    thanks for the hints.

    @nhaehnle
    sure, I could work me through the OpenGL extension registry to find a solution. But it is actually a specification and thus not well suited as a reference/ turorial.

    How long do you think, would it have taken me to come up with something like this using it?
    http://www.opengl.org/discussion_boa...861#Post264861

    As a sidenote: I noticed that there is a GLSL compiler in the MESA tree. Do you know something whether it is usable as an alternative to Cgc?

  6. #6
    Join Date
    Aug 2008
    Posts
    77

    Default

    Well, I guess I'm just a very spec-minded person, comes with the territory of driver writing. I can write ARB programs just fine, and I never read any tutorials on it.

    The GLSL compiler in Mesa and Cgc solve different problems. The GLSL compiler in Mesa is the piece of code that drivers can use to implement ARB_vertex_shader, ARB_fragment_shader and related extensions. In other words, it is exactly what the name implies: It compiles GLSL (to an intermediate format which is then translated into binary instructions by the hardware driver).

  7. #7
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    1,811

    Default

    Quote Originally Posted by nhaehnle View Post
    Well, I guess I'm just a very spec-minded person, comes with the territory of driver writing. I can write ARB programs just fine, and I never read any tutorials on it.
    I've been told that just tends to happen after you have read a sufficient amount of specs. You eventually become fluent in the "language".

  8. #8
    Join Date
    Apr 2008
    Posts
    101

    Default

    Quote Originally Posted by nhaehnle View Post
    The GLSL compiler in Mesa and Cgc solve different problems. The GLSL compiler in Mesa is the piece of code that drivers can use to implement ARB_vertex_shader, ARB_fragment_shader and related extensions. In other words, it is exactly what the name implies: It compiles GLSL (to an intermediate format which is then translated into binary instructions by the hardware driver).
    ah, now I remember - MESA uses a fp/vp like language as it intermediate representation. Thus I thought it would be just fp/vp at the first glance...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •