View Full Version : finding used texels...
05-01-2002, 07:44 AM
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.
05-01-2002, 12:08 PM
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.
05-02-2002, 04:53 AM
Would feedback help with this? Or is the information returned by feedback insufficient.
05-02-2002, 10:47 AM
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?
someone gave me this link the other day http://developer.nvidia.com/view.asp?IO=Show_Footprint
05-03-2002, 07:48 AM
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:
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 ;-)
>>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
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.