Results 1 to 5 of 5

Thread: Difference between Raster and texturing

  1. #1
    Junior Member Newbie
    Join Date
    May 2008
    Posts
    13

    Difference between Raster and texturing

    Hi all

    I am able to display an image using glRaster2i() and gluTex2DImage() as well. Both are doing well. What is the difference between them?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jan 2004
    Posts
    314

    Re: Difference between Raster and texturing

    Having used neither, I can only observe that one is from GL, in other words from the driver, and the other from GLU.
    The GLU routines are more programmer-friendly shells around the raw GL routines.
    You can probably use more intuitive arguments in that gluTex2DImage call. Also, since it has "Tex" in it, I guess it uses a texture somewhere.
    For the details use the reference pages on the site ( http://www.opengl.org/sdk/docs/man/ )

  3. #3
    Senior Member Frequent Contributor
    Join Date
    Apr 2004
    Posts
    990

    Re: Difference between Raster and texturing

    gluTex2DImage()? Never heard of that one...

  4. #4
    Junior Member Newbie
    Join Date
    May 2008
    Posts
    13

    Re: Difference between Raster and texturing

    sorry

    it is not gluTex2DImage().
    Actually it is glTexImage2D() and raster display is also by the function glRasterPos2i()...

  5. #5
    Senior Member Regular Contributor
    Join Date
    Jan 2004
    Posts
    314

    Re: Difference between Raster and texturing

    Ah, but those two functions do entirely different things.
    I take it you're only looking at 2D functionality at the moment.

    glTexImage2D uploads a bitmap to the graphics card so it can be used for texture mapping. It does not render anything.
    You only see the bitmap data when you render some polygons with this texture enabled. glRasterPos has no effect on this.

    glRasterPos places the 'cursor' for 2D overlay work (the functions glBitmap, glDrawPixels, and glCopyPixels.)
    You do not need to upload any textures for this functionality, however these functions operate directly on the framebuffer, and they have to get their data from CPU memory instead of from the video card, which makes them slower.

    The alternative, which is what you would be needing glTexture.. functions for, is to render screen-aligned texture-mapped quads.
    You would probably want to use glOrtho to set up a 1 to 1 mapping between screen coordinates and glVertex coordinates.

    The advantage of the Raster operations is that you can be certain that the image on screen is going to be exactly the same as the image in your bitmap, exactly positioned and without blurring.
    The disadvantages are that they are slow, <s>cannot be blended with other stuff already in the framebuffer,</s>(they can be blended, sorry about that) and that they cannot be scaled by OpenGL.

Similar Threads

  1. getting the raster pos
    By David Doria in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 12-06-2008, 11:04 AM
  2. Raster position
    By Alexei in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 04-22-2007, 09:31 AM
  3. bitmap as a raster pic
    By fortikur in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-13-2004, 02:13 PM
  4. raster
    By nutan mishra in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 02-19-2002, 06:17 AM
  5. Raster Position
    By Itch in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-22-2001, 03:07 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