Advanced Rasterization
#141
Posted 26 May 2010 - 10:17 AM
#142
Posted 27 May 2010 - 11:16 AM
Geri said:
#143
Posted 28 May 2010 - 09:09 PM
#144
Posted 30 May 2010 - 05:36 PM
#145
Posted 30 May 2010 - 07:23 PM
jiti said:
Quote
Anyway, it depends on the application, and you'll need to experiment to see what works best.
#146
Posted 30 May 2010 - 08:37 PM
Yes nick. Development of programs is all about experiments .. As you see i experimented with full z-buffer pyramide and i learned new things. :)
I understand your algorhytm with the fill-convention. The rule is, it must be done with integer numbers because of the finite precision (i experimented with it, but only integers worked well).
But how can be your integer-fill-convention-algorhytm combined with the 2d homogenous rasterization?
The 2d homogenous rasterization needs calculations to be done in floating point, but the fill-convention doesn't work with floating-point numers
So the question is: HOW CAN I COMBINE THEM? :(
#147
Posted 31 May 2010 - 06:16 AM
#148
Posted 31 May 2010 - 02:53 PM
thebigT said:
Then gradient-values can be overfloved (in case of integer calculations) if the area of the triangle is smaller then 1. So we need to draw those triangles, they have area bigger or equal then 1. The area is calculated if we check the back-facing (in 2d) of the triangle. Its logical, that the triangles with area smaller then 1 we cant see. :)
Yes TheBigT i found the description in the paper about the conversion from float to fixed numbers, but if i do it on per tile for the line-edge interpolants, the fill-convention won't work, because the edge interpolatns was interpolated thru floating point numbers. I can't mix pricisions of floating point numbers and integer numbers on the line-edge-interpolants. If the triangle is huge, the line-edge intepolants have big numbers, thay can't be converted to integer numers because, they can't fit in 32-bit integer, as u say, and some pricision in floating-point numbers is lost. Nick's fill-convention need precise bit-wise number precision, so just fixed-point numbers can be used.
if we don't find any good solution how to find a working fill-convention, then the 2d homogenouse for rasterization and clipping is for me useless and i go back to standart 3d poly-plane clipping. :(
A pseudo algorhytm would be good for better understand.
#149
Posted 02 June 2010 - 02:36 AM
#150
Posted 02 June 2010 - 11:01 AM
thebigT said:
Adding more bits don't have sense. You know 2d homogeneouse rasterization is about detecting if a 3d point in space is in convex pohyhedron constructed from frustum-cliping planes and planes constructed from triangle edges. The position of the point is interpolated across the triangle and we are detecting if the point is inside or outside of the polyhedron. Similar like creating triangle from lines and detecting if a 2d point is in same halfspace of all 3 lines (tutorial of this thread). The space of the polyhedron or the size of triangle can be huge or very small, so we operate with true space positions (no normalization tricks- no numbers between -1 and 1) and need variable precision, so we can use only floating point numbers. This is the only type of number who is flexible enough for the calculations. As you said, with fixed number of bits we can easy overflow the integer number or we can lost all precision if the number is too small. The problem can rise if we are dividing by z ( or w).
Have anyone a functional combination of 2d homogeneouse rasterization with fill-convention? Is there any trick? Or we close this problem without solution? :(
Damn my head hurts !!
#151
Posted 26 June 2010 - 01:19 AM
I'm currently using floating point math, which is enough precision for the resolution I need (probably about 256 pixels wide, perhaps 512). How does integer SSE math compare to float SSE?
-
Currently working on: the 3D engine for Tomb Raider.
#152
Posted 26 June 2010 - 09:29 AM
#153
Posted 26 June 2010 - 09:48 AM
#154
Posted 26 June 2010 - 10:56 AM
I wish i could write similar article with similar quality like Nick :worthy: , but as part 2 of "advanced rasterization" with my research and code (pascal-asm) snippets.There is one problem, my english is horrible... :wallbash:
Oh, and I coded texture fetching with bilinear interpolation with clamp-repeat options. No mip-mapping yet.
The graphic oddysey continues.... :cool:
#155
Posted 26 June 2010 - 01:19 PM
jiti said:
I snap my vertex coords on a grid by adding and subtracting 16777216/subpixelgridsize, and then I add 1/subpixelgridsize to the halfplane value for topleft edges. I've currently defined subpixelgridsize as 16, which corresponds to the number of bits after the fixed point in Nicks solution, but I'm still experimenting with it. 64 gives smoother results for slow moving polygons, but it takes away precision and I might get into trouble for polygons way larger than the screen and I'll probably have to clip at some point. Then again, it's for visibility determination only, so I can afford to be off a pixel or two.
Also, I need to be able to run on 360 and PS3 as well. I know the cell SPU's have vector int arithmetic, but I'm not so sure about AltiVec in the PowerPC.
Anyway, currently, on an Intel Core 2 I'm able to push 5000 on-screen cubes within 7 million cycles (2.33ms on a single 3GHz core) using a 256x144 zbuffer. When quadrupling the buffer size to 512x288 it goes up to 9.8ms.
-
Currently working on: the 3D engine for Tomb Raider.
#156
Posted 26 June 2010 - 02:02 PM
.oisyn said:
I snap my vertex coords on a grid by adding and subtracting 16777216/subpixelgridsize, and then I add 1/subpixelgridsize to the halfplane value for topleft edges. I've currently defined subpixelgridsize as 16, which corresponds to the number of bits after the fixed point in Nicks solution, but I'm still experimenting with it. 64 gives smoother results for slow moving polygons, but it takes away precision and I might get into trouble for polygons way larger than the screen and I'll probably have to clip at some point. Then again, it's for visibility determination only, so I can afford to be off a pixel or two.
Also, I need to be able to run on 360 and PS3 as well. I know the cell SPU's have vector int arithmetic, but I'm not so sure about AltiVec in the PowerPC.
Ok i take it in to the count... The rounding idea can help me a lot. thnx. Check my project on the sourceforge. Maybe some ideas from my source-code can help you....
#157
Posted 27 June 2010 - 09:10 PM
-
Currently working on: the 3D engine for Tomb Raider.
#158
Posted 28 June 2010 - 05:52 AM
.oisyn said:
It doesn't really matter for opaque geometry, but it definitely does matter for blended primitives.
#159
Posted 28 June 2010 - 07:56 AM
-
Currently working on: the 3D engine for Tomb Raider.
#160
Posted 03 July 2010 - 09:24 AM
I compared "tile bilinear sampler" against "linear (standart in memory image representation on PC) bilinear sampler" and the speed stayed almost the same... linear representation of the texture was a bit slower,because of not cache-friendly representation of the texture. Tiled texture is good for big textures, because if the texture is in high resolution , the speed don't drop so fast down as in linear (standart) representation of the texture. Of course the linear calculation of the sample adress from texture coordinates is much simpler, but the cache-polution is much bigger and is causing much bigger slowdowns. :geek:
https://sourceforge....cts/phenomenon/
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users












