Questions about OpenGL (after RTFM) - Java-Games

This is a discussion on Questions about OpenGL (after RTFM) - Java-Games ; Hi all, after having read "Beginning OpenGL Game Programming" by Dave Astle and Kevin Hawkins, and "The Official Guide to Learning OpenGL" I still have doubts about some subjects I'm gonna list, hoping some nice soul here illuminates me. Vertex ...

+ Reply to Thread
Results 1 to 3 of 3

Questions about OpenGL (after RTFM)

  1. Default Questions about OpenGL (after RTFM)


    Hi all,
    after having read "Beginning OpenGL Game Programming" by
    Dave Astle and Kevin Hawkins, and "The Official Guide to
    Learning OpenGL" I still have doubts about some subjects
    I'm gonna list, hoping some nice soul here illuminates me.

    Vertex Transformations:
    How do I disable all Vertex Transformations? I want to
    use my own geometry engine (which is already written and
    which has some features I really like), and thus I would
    like to avoid OpenGL making multiplications all around
    with the identity matrix, which would slow down things
    (wether computed by the CPU or by the GPU) to perform
    nothing useful anyway.
    Basically I *only* need to draw texture mapped triangles
    in 3 dimensions. I don't mind using "w" instead of "z",
    if that is more natural, given the low-level I aim to.

    Lighting:
    How does OpenGL implement, in the "back end", lighting?
    After having done all its calculations, does it simply set
    a R,G,B,(A?) value for each vertex (i.e. Gouraud Shading)
    for both the primary and secondary colors, or is it more
    than that? Does it use some hidden feature?

    Secondary Colors:
    Although the capability is listed (GL_EXT_secondary_color)
    when I check the supported extensions via glGetString(),
    I can't find glSecondaryColor3f (nor the other functions
    which begin with glSecondaryColor*) exported neither in
    the OpenGL32.DLL nor in the glu32.DLL. Where are them?

    Max Texture Size:
    I know that it has to be queried, and that the maximum
    guaranteed is only 64x64. However, does anybody know if
    there's a "de-facto" guaranteed minimum in Win32 OGLs?
    And, if not, the best approach would be to load several
    64x64 textures (with borders?) and tesselate everything?
    Ain't that annoying? I would much prefer if OpenGL did
    it (or I would rather get all the fun and program the
    hardware directly). Actually, the only significative
    usefulness I see for something that forces itself
    between you and the silicon is easing tasks like that.

    Last but not least:
    Has anybody written a database listing all the common
    PC video cards' supported features / which extensions
    are standard, etc..? If so, can you point me to an URL
    please?
    Also, can you point me to the best utility to report
    all the capabilities of the installed driver?

    Greets & many Thanks,
    Mike


  2. Default Re: Questions about OpenGL (after RTFM)

    nospam wrote:

    > after having read "Beginning OpenGL Game Programming" by
    > Dave Astle and Kevin Hawkins, and "The Official Guide to
    > Learning OpenGL" I still have doubts about some subjects
    > I'm gonna list, hoping some nice soul here illuminates me.


    You could also try news:comp.graphics.api.opengl (and Google).

    Always post technical questinos to the narrowest newsgroup possible.

    --
    Phlip
    http://www.c2.com/cgi/wiki?ZeekLand



  3. Default Re: Questions about OpenGL (after RTFM)

    nospam@nospam.com wrote:
    > Hi all,
    > after having read "Beginning OpenGL Game Programming" by
    > Dave Astle and Kevin Hawkins, and "The Official Guide to
    > Learning OpenGL" I still have doubts about some subjects
    > I'm gonna list, hoping some nice soul here illuminates me.
    >
    > Vertex Transformations:
    > How do I disable all Vertex Transformations? I want to
    > use my own geometry engine (which is already written and
    > which has some features I really like), and thus I would
    > like to avoid OpenGL making multiplications all around
    > with the identity matrix, which would slow down things
    > (wether computed by the CPU or by the GPU) to perform
    > nothing useful anyway.
    > Basically I *only* need to draw texture mapped triangles
    > in 3 dimensions. I don't mind using "w" instead of "z",
    > if that is more natural, given the low-level I aim to.


    If I am not mistaken, enabling vertex programs will circumvent the
    entire upper part of the OpenGL pipeline -- meaning model
    transformation, lighting, and projection transformation -- and replace
    it with your vertex program. You could use an "empty" vertex program to
    get the effect you want.

    The more important question, though, is why you would want to do that.
    If you want to render 3D texture-mapped triangles, you will somehow need
    to project your triangles to the 2D screen. This involves some kind of
    math (unless your engine runs on pixie dust), and the kind of math
    typically involved is much better delegated to a special-purpose GPU
    than to a general-purpose CPU. GPUs are so good at transforming
    vertices, in fact, that you most probably won't notice any performance
    gain by disabling transformations in OpenGL; they are essentially for free.

    If you want a high-performance 3D rendering engine, the best way is to
    map as much of your functionality to OpenGL as you can, and focus
    instead on the parts of the rendering process where software does do a
    better job, namely primitive generation: tessellation, level-of-detail
    methods, frustum culling, and occlusion detection.

    Of course, all I say is moot if you want to do things yourself for
    educational purposes. But then, why worry about performance?

    > Lighting:
    > How does OpenGL implement, in the "back end", lighting?
    > After having done all its calculations, does it simply set
    > a R,G,B,(A?) value for each vertex (i.e. Gouraud Shading)
    > for both the primary and secondary colors, or is it more
    > than that? Does it use some hidden feature?


    No, as the redbook says: This is just it. Phong lighting plus Goraud
    shading is the name of the game.

    > Secondary Colors:
    > Although the capability is listed (GL_EXT_secondary_color)
    > when I check the supported extensions via glGetString(),
    > I can't find glSecondaryColor3f (nor the other functions
    > which begin with glSecondaryColor*) exported neither in
    > the OpenGL32.DLL nor in the glu32.DLL. Where are them?


    They would be in OpenGL32.DLL (not a Windows guy myself, but pretty
    sure). Try looking for glSecondaryColor3fEXT, which is the proper name
    of the extension function(s). You might also be confusing something
    here: glGetString will return the list of extensions (like
    GL_EXT_secondary_color), but not the names of the functions implementing
    the extensions. You get the latter via window-system specific calls such
    as wglGetProcAddress for Windows.

    > Max Texture Size:
    > I know that it has to be queried, and that the maximum
    > guaranteed is only 64x64. However, does anybody know if
    > there's a "de-facto" guaranteed minimum in Win32 OGLs?
    > And, if not, the best approach would be to load several
    > 64x64 textures (with borders?) and tesselate everything?
    > Ain't that annoying? I would much prefer if OpenGL did
    > it (or I would rather get all the fun and program the
    > hardware directly). Actually, the only significative
    > usefulness I see for something that forces itself
    > between you and the silicon is easing tasks like that.


    Well, the OpenGL texture abstraction is pretty good at hiding
    differences in hardware from an application programmer, and the
    implementation-dependent texture size limit is part of that. If you ever
    programmed for, say, a Voodoo graphics card (vintage 1998) before the
    OpenGL minidriver came about, you'd agree with me. If you would program
    the hardware directly, good luck with getting your program to run on a
    card from a different generation, or, let alone, by a different vendor.
    But to answer your question, texture tiling is so application-dependent
    that it is best left to software. Just read some papers on the topic;
    there are so many different ways to do it, and each works for only some
    applications, that forcing a standard would be bad. Even SGI did not do
    that at the time, although they do have a patent on so-called "clipmaps"
    - they were just smart enough to not make it part of OpenGL.

    > Last but not least:
    > Has anybody written a database listing all the common
    > PC video cards' supported features / which extensions
    > are standard, etc..? If so, can you point me to an URL
    > please?
    > Also, can you point me to the best utility to report
    > all the capabilities of the installed driver?


    If they would be standard, they wouldn't be extensions... just joking,
    it's a valid question. You can most probably find the supported
    extensions for particular graphics card families on the manufacturer's
    web pages (Nvidia has an extensive list, and extensive documentation,
    for their cards), but I am not aware of any database containing multiple
    vendors. If you find one, please post it.

    Best of luck,

    Oliver

    --
    Email: kreylos@cs.ucdavis.edu
    WWW: http://graphics.cs.ucdavis.edu/~okreylos

+ Reply to Thread

Similar Threads

  1. OpenGL?
    By Application Development in forum RUBY
    Replies: 2
    Last Post: 09-17-2007, 12:26 PM
  2. [ANN] OpenVG over OpenGL and OpenGL|ES
    By Application Development in forum Graphics
    Replies: 0
    Last Post: 07-07-2006, 09:40 AM
  3. [ANN] OpenVG over OpenGL and OpenGL|ES
    By Application Development in forum Graphics
    Replies: 0
    Last Post: 07-07-2006, 09:35 AM
  4. OpenGL to Renderman (newbie) questions
    By Application Development in forum Graphics
    Replies: 2
    Last Post: 11-30-2004, 06:38 AM