Results 1 to 7 of 7

Thread: finding used texels...

  1. #1
    Member Newbie
    Join Date
    Oct 2001
    Posts
    30

    finding used texels...

    Hi all!

    I need to get the actual texels that are used by a triangle. That is I have the texture coordinates and an image, I now need to know exactly which texels are beeing used when the triangle is displayed.

    I have tried making a simple "triangle rasterizer" and this seems to be the way to go but my algo misses some texels in some cases.

    Any ideas?

    regards!

    /hObbE

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jul 2001
    Posts
    442

    Re: finding used texels...

    You cannot get this information from OpenGL. If you are doing your own rasterizer for triangles, the information is immediately available to you however. Unfortunately, your graphics card will skip texels or blend them depending on scale, mapping, alpha etc.

  3. #3
    Senior Member Regular Contributor
    Join Date
    Jan 2002
    Location
    Kingston, Jamaica, W.I.
    Posts
    282

    Re: finding used texels...

    Would feedback help with this? Or is the information returned by feedback insufficient.

  4. #4
    Senior Member Regular Contributor
    Join Date
    Jul 2001
    Posts
    442

    Re: finding used texels...

    Feedback refers primarily to the transform and lighting part of the pipeline. It allows you to get back transformed and lit vertex information so that your own code can do analysis or rasterize the geometry from there on in (can't think of many applications that would need to do this).

    If there is a particular application you need this for, we might be able to think up some alternative solution?

  5. #5
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Nov 2010
    Posts
    2,466

    Re: finding used texels...

    someone gave me this link the other day http://developer.nvidia.com/view.asp?IO=Show_Footprint

  6. #6
    Member Newbie
    Join Date
    Oct 2001
    Posts
    30

    Re: finding used texels...

    Thanx for the replies guys! Nice to know that one always can find help from U!

    Actually I reworked all my code today and fond a robust sollution. It is a subpixel accuracy DDA (I think it's called It seems to be working fine!

    Got the general idea from this page:
    http://cs-people.bu.edu/jisidoro/cs4...l/trirast5.htm

    I use this to calculate lightmaps in my application. That is I map the vertices of the poly, create a suitable image and then iterate over the texels actually visible performing lighting calcs. Works fine.

    Now my problem is that my triangle fan poly generator generates some degenerate (non convex) polygons messing up the whole thing. But I have the whole weekend to fix that one

    regards!
    /hObbE

  7. #7
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Nov 2010
    Posts
    2,466

    Re: finding used texels...

    >>I use this to calculate lightmaps in my application. That is I map the vertices of the poly, create a suitable image and then iterate over the texels actually visible performing lighting calcs. Works fine.<<

    easy with barycentric coordinates

Similar Threads

  1. translating texels in a texture
    By fiche in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 09-30-2010, 10:39 AM
  2. Mapping texels to pixels
    By skynet in forum OpenGL: Advanced Coding
    Replies: 12
    Last Post: 11-26-2004, 09:59 AM
  3. Is there a way to read only a few texels from a texture ?
    By fuxifuxi in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-26-2003, 08:09 AM
  4. Retreiving texels and NV_texture_shader
    By Ozzy in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 09-21-2003, 05:37 AM
  5. Luminous texels
    By Punchey in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 03-05-2001, 12:04 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