In the area of computer graphics and video processing, there is a constant effort to improve the rendering capabilities of such systems to achieve more realistic images with less computational effort.
Traditionally, texture mapping onto projections of 3D surfaces have been performed by inverse mapping from an area of the pixel onto surface texture. An alternative approach is shown in “3-d transformations of images in scanline order” by Edwin Catmull and Alvy Ray Smith, In Computer Graphics (SIGGRAPH '80 Proceedings), volume 14(3), pages 279-285, 1980. The texture surface is transformed as a 2D image until it conforms to a projection of a polygon placed arbitrarily in 3D space. This 2D transformation or mapping can be decomposed into a sequence of two orthogonal 1D transformations, namely in a horizontal and in a vertical scanline order. In other words, multi-dimensional image transformations of resampling operations can be executed as a sequence of one dimensional transformation.
However, one problem, that may arise within such a sequence of 1D transformations, is the occurrence of aliasing due to shear. The shear problem is illustrated in
One solution to the shear problem is the so-called super-sampling technique proposed by George Wolberg and Terrance E. Boult in “Separable image warping with spatial lookup tables”, in Computer Graphics (Proc. Siggraph '89), volume 23(3), pages 369-378, July 1989. Accordingly, the problem of aliasing occurs due to an under-sampling, so that a suggested solution is to increase the resolution by sampling the mapping function more densely. Therefore, the rasterisation is performed at a finer resolution (i.e. it is super-sampled), causing extra intermediate lines to be generated, with a black pixel at intermediate positions filling the holes. If this is done for shear introduced by a first pass, the second pass will down-scale the larger intermediate image to its final resolution. If shear in the second pass would be treated using the same supersampling approach, a third pass would be needed to reduce the generated higher horizontal resolution to the output resolution. Accordingly, the super-sampling technique is a compute intensive approach.
Another approach to overcome the aliasing problem is based on a box filtering technique as described by Alvy Ray Smith, in “Planar 2-pass texture mapping and warping”, in Computer Graphics (Proceedings Siggraph 1987), volume 21(4), pages 263-272, 1987. Here, prefiltering is applied and constitutes a process of checking whether a pixel is inside e.g. a triangle (for the case of inverse mapping). The prefilter may have a delta function, a box function or the like. Without prefiltering each texel in the input texture is either mapped to screen space or not depending whether its position lies within the triangle. A prefilter is used to determine which texels should contribute to a subsequent resampling, i.e. also possibly those not totally inside the triangle, in order to reduce edge aliasing. An amount of overlap is determined between the triangle and a footprint of the prefilter, wherein the footprint of a prefilter corresponds to the area of the prefilter in the u/v directions in texture space.
In
The pixel color being box filtered is composed of the average of the texel colors whose footprints of the box reconstruction filter intersects the mapped footprint 73 of the pixel. A weighting function is performed on the texels in accordance of the size of the footprint area of the reconstruction filter 72 intersecting with the pixel's mapped footprint 73, i.e. in accordance with the area overlap of the footprint area of the reconstruction filter and the footprint of the mapped pixel. Although, a more accurate average can thus be achieved than a strictly 1D average over the midline ML of these areas (selecting only the dark texel to contribute in
It is therefore an object of the invention to provide a computer graphics processor and a method of rendering images which are capable of further reducing aliasing due to shear with moderate computing requirements.
This object is solved by a computer graphics processor according to claim 1 and a method of rendering according to claim 8.
Therefore, a computer graphics processor with a forward mapping renderer is provided. The renderer comprises a texture space rasterizer TS for rasterizing a primitive in texture space, a color generating unit PS for determining the color of the output of the texture space rasterizer TS and for forwarding a color sample along with coordinates, a 2-pass screen space resampler SSR1, SSR2 for resampling the color sample determined by the color generating unit PS, and at least one one-dimensional blur filter unit 1PB, 2PB associated to at least one pass of said screen space resampler SSR1, SSR2 for performing a 1D filtering before performing at least one pass.
Therefore, only 1D calculations need to be performed during the resampling operation. In order to avoid the gaps shown in
According to an aspect of the invention, said processor comprises a first and second one-dimensional blur filter unit. Said screen space resampler comprises a first pass and a second pass screen space resampler. Said first blur filter unit is arranged before said first pass screen space resampler and said second blur filter unit is arranged before a second pass screen space resampler. Accordingly, the blur may be applied to both passes.
According to a preferred aspect of the invention said first and second blur filter units are one-dimensional blur filters having footprints with a size depending on a corresponding shear factor, so that more blur may be introduced when there is more shear. Thus aliasing due to shear is effectively prevented.
According to a further aspect of the invention, said first and second blur filter units are box low pass filter having a weighted footprint. With such a footprint the contribution of a 2D footprint may be approximated more efficiently.
The invention also relates to a method of rendering images based on a forward mapping rendering. A primitive is rasterized in texture space. The color of the output of the rasterizing step is determined and a color sample is forwarded along with coordinates. A 2-pass screen space resampling of the color sample determined in the color generating step is performed. At least one one-dimensional blur filtering is performed before performing at least one pass resampling.
The invention furthermore relates to a computer program product comprising program code means stored on a computer readable medium for performing an above method when said program is run on a computer
Further aspects of the invention are defined in the dependent claims.
The invention is based on the idea to avoid the computation of an area overlap of the texel's footprint with the mapped footprint of a pixel, i.e. a 2D computation. Instead only 1D computations are used by applying a 1D filter to the texel.
In the drawings:
First of all, the basic operation of the forward rendering pipeline is described. The rasterization is performed in texture space and the texture space rasteriser TS traverses a projection of a primitive onto a texture map by selecting texture coordinates as variables for the rasterization process. The texture space rasterizer TS may transverse the texture map on a texture grid. Texels being confined with the primitive or polygon being rasterized are to be splat on pixels in screen space.
Therefore, the pixel shader PS and the texture space resampler TSR (of which there may be one or more, for serial or parallel fetching of texture samples, if several textures are present) correspond to those in a traditional pipeline. The pixel shader PS receives a set of (interpolated) attributes, including texture and screen coordinates, for one location. The texture coordinates, along with the shading program, determine where to index the texture maps via the texture space resampler TSR. The shader can also modify texture coordinates before sending them to the texture space resampler TSR to implement dependent texturing, as in the same way as in a traditional pipeline.
The shader PS passes the shaded color on to the screen space resampler SSR, along with the associated screen coordinates. These in general are not integer, but this is similar to how a pixel shader in a traditional pixel shader pipeline might receive sub-pixel screen positions when performing super-sampling. The screen space resampler SSR splats the mapped texels to integer screen positions, so that an image of the primitive is provided on the screen. The pixel fragments from the screen space resampler SSR may be combined in the pixel fragment combiner PFC.
The shaded color sample resulting from the pixel shading process is forwarded to the screen space resampler SSR along with its screen coordinates. The screen space resampler SSR resamples these color samples, (located generally at non-integer pixel positions) to the integer pixel positions needed for display.
The screen space resampling is now described in more detail. The approach to reduce the aliasing due to shear in the screen space resampling is based on an approximation of the box filtering technique and is directed to avoiding the computation of the area overlap of the (box reconstructed) footprint of a texel with the mapped footprint of a pixel. This process is approximated using only 1D computations over the midline: a 1D blur (low pass) filter is applied to the texels with the filter footprint size depending on the local shear factor (resulting in more blur with more shear). The shear factor may be received from the texture space rasterizer TS. The blur may be applied both in the first (e.g. horizontal) pass and in the second (e.g. vertical) pass.
However, the averaging of n stretched texels requires a delay unit which is able to contain n stretched texels. A maximum of n may be 8, so that, a maximum of 8 delay elements is used. In such a case the stretched texels may be limited to a width of 8 texel spacings. However, alternative widths of the stretched texels are also possible.
Alternatively to the above box reconstruction filter, principle of shear anti-aliasing may also be used for wider (higher order) reconstruction filters. However, the averaging of the stretched texels (now weighted along their footprint with the higher order filter) will become more difficult.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design many alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word “comprising” does not exclude the presence of elements or steps other than those listed in a claim. The word “a” or “an” preceding an element does not exclude the presence of a plurality of such elements. In the device claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.
Furthermore, any reference signs in the claims shall not be construed as limiting the scope of the claims.
Number | Date | Country | Kind |
---|---|---|---|
03104947.1 | Dec 2003 | EP | regional |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/IB04/52872 | 12/21/2004 | WO | 6/22/2006 |