Closed Thread Icon

Topic awaiting preservation: Sub pixel accuracy... (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=26716" title="Pages that link to Topic awaiting preservation: Sub pixel accuracy... (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Sub pixel accuracy... <span class="small">(Page 1 of 1)</span>\

 
sonyafterdark
Bipolar (III) Inmate

From: Bucharest, Romania, Eastern Europe
Insane since: Sep 2004

posted posted 09-24-2005 17:08

So...

There is a square array of N by N (N is finite) squares (the squares themselves are 1 by 1 ). This is the texture map.
Each square has a positive integer (the colour, we are treating each of the ARGB components in part not altogether) assigned to it (this is a channel texturemap).
This channel texture map is tiled to infinity in any direction upon some arbitrary plane(a polygon, which cannot be infinite, actually, but for the sake of argument).
The edges of the maps are aligned (obvious, this is texture mapping).

An arbitrary triangle is drawn upon this plane. It may be however large or small, near to or far from the origin of the plane's system. I need to calculate the average colour of the triangle. This means that for each and every single square that comes under the arbitrary triangle, even partially, I will add to a sum (initially 0) the square's_colour_value/area_of_the_square_that_is_inside_the_triangle. After having done this for every single square that falls inside the triangle (even partially) I will have the average colour of the triangle; which leads me to my problem. Given the fact that the triangle may be however large, applying this complex method to any possible arbitrary triangle is not wise.

Is there any way in hell to scale down the triangle to within one of the finite map tiles (first one for example) in such a way that I can be certain the cromatic average is not at all altered, in order to make it easier to calculate its cromatic average? Or would some other method work, other than scaling (it just popped into mind)?

You can see how being able to somehow reduce the triangle to a single texture tile with no disturbance of the cromatic average is so wonderful.

Perfect actually. Especially considering how the triangle may be however large or far away from the centre of the plane's system. For an especially large one I might (the computer) have to work for minutes/hours...

And this triangle is only half a screen pixel projected from some polygon (the plane).

Can you imagine going through that immensly slow process for 4*(colour channels)*2(half pixels)*1024*768*(at least)25 times a second?

Please enlighten.


Cheers, Vishy.

(Edited by sonyafterdark on 09-24-2005 17:19)

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 09-24-2005 17:36

I'm not sure to really understand your goal, but the first thing that pop in my mind is MIP MAPPING.

Sub-pixel is method to decrease the stairs effect induced by the interpolation of the edges of the polygons. I think what you really mean is sub-texel, which is a general term for interpolation ( generally bilinear or trilinear ) of the colors of a texel.

« BackwardsOnwards »

Show Forum Drop Down Menu