Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Texture pixel value

  1. #1
    Guest

    Texture pixel value

    I'm making a 2D platformer and I'd like to have per-pixel collsion detection. Rather than making a bit-mask for the textures I load to test for collisions, I'd like to simply get the color value located at a specific point within a texture. Is there any way that I can do this?

  2. #2
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    4,388

    Re: Texture pixel value

    Only to keep a copy of the texture in memory and test it. It may be better for your problem to store a bitmap for the image.

    Using OpenGL for texel level queries would be very inefficient by comparrison.

Posting Permissions

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