The disclosed technology relates to a method of selecting a MIP-MAP level and a texture mapping system using the same, and, more particularly, to a method of selecting the MIP-MAP levels of texture images and a texture mapping system using the same.
Texture mapping is a scheme for drawing detailed texture or painting a color on a surface of a virtual 3-dimensional object in the computer graphics field. In texture mapping, Mathematical Equation or a 2-dimensional picture can be drawn on a surface of a 3-dimensional object by using several kinds of methods as if the math formula or the 2-dimensional picture looks feel like a real object.
A MIP-MAP is for improving the rendering speed in the texture mapping field of 3-dimensional graphics and composed of a basic texture and textures consecutively reduced from the basic texture.
From among embodiments, a method of selecting a MIP-MAP level for a global illumination based texture mapping is provided. In the method of selecting a MIP-MAP level, object information about at least one object in a screen is identified. The object information may include the number of at least one object, shape(s) of the at least one object, material(s) of the at least one object in the screen and/or location(s) of a corresponding object on a space in the screen. A MIP-MAP level selection algorithm is determined based on the object information. The MIP-MAP level selection algorithm may include a differential method and/or a distance measuring method, the differential method may select a MIP-MAP based on the differential values of adjacent rays, and the distance measuring method may select a MIP-MAP by calculating a distance in which a ratio of a pixel and a texel becomes 1:1. A MIP-MAP level is selected based on the determined method. In one embodiment, the demand an image quality and/or a processing speed for an image to be provided may be identified. The MIP-MAP level selection algorithm may be determined based on a result of the identification. For example, when, as a result of the identification, the demand level of the image quality for the corresponding image is higher, the differential method may be selected as the MIP-MAP level selection algorithm. For another example, when, as a result of the identification, the demand level of the processing speed for the corresponding image is higher, the distance measuring method may be selected as the MIP-MAP level selection algorithm. In one embodiment, the method of selecting a MIP-MAP level includes calculating a size of a pixel for a texel based on a size of a texture and a size of a screen, calculating the number of texels included in a triangle based on texture coordinates corresponding to three vertexes of the triangle of the texture, calculating a size of the triangle based on the calculated size of the pixel and the calculated number of the texels, calculating the size of a given triangle based on model coordinates corresponding to the three vertexes of the given triangle, and calculating a distance in which a ratio of a pixel and a texel becomes 1:1 based on the two calculated values for the size of the triangle.
From among the embodiments, a texture mapping system using a method of selecting a MIP-MAP level includes an object information storage unit, an object information identification unit, an algorithm determination unit, a distance measuring method operation unit, and a MIP-MAP level selection unit is provided. The object information storage unit stores object information about an object to be displayed in a screen. The object information may include the number of objects and the shapes and materials of the objects present in the screen and/or the locations of the corresponding objects on the space appearing in the screen. The object information identification unit fetches object information about a target object to be displayed in the screen from the object information storage unit and identifies the fetched object. The algorithm determination unit analyzes the object information fetched from the object information identification unit and determines an algorithm for selecting a MIP-MAP level based on the analyzed object information. The distance measuring method operation unit receives the object information of the target object from the object information identification unit and calculates a distance in which a ratio of a pixel and a texel becomes 1:1 according to a result of the determination of the algorithm determination unit. The MIP-MAP level selection unit selects the MIP-MAP level based on the distance calculated by the distance measuring method operation unit. In one embodiment, the distance measuring method operation unit may calculate the size of a pixel for a texel based on a size of a texture and a size of a screen, calculate the number of texels included in a triangle based on texture coordinates corresponding to three vertexes of the triangle of the texture, calculates the size of the triangle based on the calculated size of the pixel and the calculated number of the texels, calculates the size of a given triangle based on model coordinates corresponding to the three vertexes of the given triangle, and calculates a distance in which a ratio of a pixel and a texel becomes 1:1 based on the two calculated values for the size of the triangle. The texture triangle can include a unit triangle that forms the texture, and texture coordinates can include 2-dimensional coordinates. In one embodiment, the texture mapping system using a method of selecting a MIP-MAP level further includes a differential method operation unit for receiving the object information of the target object from the object information identification unit and calculating the differential value of a ray according to the determination of the algorithm determination unit, wherein the MIP-MAP level selection unit may select the MIP-MAP level based on the differential value calculated by the differential method operation unit.
From among the embodiments, a texture mapping system using a method of selecting a MIP-MAP level includes a pre-processing unit, a triangle information storage unit, a comparison distance fetching unit, a ray information storage unit, a final distance calculation unit, and a MIP-MAP level selection unit is provided. The pre-processing unit calculates a comparison distance in which a ratio of a pixel and a texel becomes 1:1 by a distance measuring method. The triangle information storage unit maps information about a primitive triangle to the comparison distance calculated by the pre-processing unit and stores the mapped information and comparison distance. The comparison distance fetching unit receives the number of the primitive triangle to be subject to texture conversion and fetches the comparison distance of the primitive triangle corresponding to the corresponding number from the triangle information storage unit. The ray information storage unit accumulates and stores pieces of the information about a distance of a ray. The final distance calculation unit sums up a distance up to a triangle hit by a current ray from a staring point and the distance accumulated and stored in the ray information storage unit. The MIP-MAP level selection unit selects a MIP-MAP level based on the distance summed up by the final distance calculation unit. In one embodiment, the pre-processing unit calculates the size of a pixel for a texel based on the size of a texture and a size of a screen, calculates the number of texels included in a triangle based on texture coordinates corresponding to three vertexes of the triangle of the texture, calculates the size of the triangle based on the calculated size of the pixel and the calculated number of the texels, calculates the size of a given triangle based on model coordinates corresponding to the three vertexes of the given triangle, and calculates a distance in which a ratio of a pixel and a texel becomes 1:1 based on the two calculated values for the size of the triangle. The texture triangle can include a unit triangle that forms the texture, and texture coordinates can include 2-dimensional coordinates. In one embodiment, the texture mapping system using the method of selecting a MIP-MAP level can further include a texture information storage unit for storing information about the texture, a texture information fetching unit for receiving a texture identifier and fetching the information about the texture corresponding to the texture identifier from the texture information storage unit, and a filtering unit for mapping the texture fetched by the texture information fetching unit to a corresponding primitive.
A description of the disclosed technology is only embodiments for structural and/or functional descriptions. The scope of the disclosed technology should not be construed as being limited to the following embodiments. That is, the embodiments may be modified in various forms, and the scope of the disclosed technology should be understood as including equivalents which may realize the technical spirit.
Meanwhile, the meanings of terms described in this application should be understood as follows.
Terms, such as the “first” and the “second”, are used to distinguish one element from the other element, and the scope of the disclosed technology should not be restricted by the terms. For example, a first element may be named a second element. Likewise, a second element may be named a first element.
A term “and/or” should be understood to include all combinations which may be presented from one or more related items. For example, “a first item, a second item and/or a third item” means “at least one of the first item, the second item, and the third item” and means a combination of all items which may be presented from two or more of not only the first, second, or third item, but also the first, the second, and the third items.
When it is said that one element is described as being “connected” to the other element, the one element may be directly connected to the other element, but it should be understood that a third element may be interposed between the two elements. In contrast, when it is said that one element is described as being “directly connected” to the other element, it should be understood that a third element is not interposed between the two elements. Meanwhile, the same principle applies to other expressions, such as “between ˜” and “just between ˜” or “adjacent to ˜” and “adjacent just to ˜”, which describe a relation between elements.
An expression of the singular number should be understood to include plural expressions, unless clearly expressed otherwise in the context. Terms, such as “include” or “have”, should be understood to indicate the existence of a set characteristic, number, step, operation, element, part, or a combination of them and not to exclude the existence of one or more other characteristics, numbers, steps, operations, elements, parts, or a combination of them or a possibility of the addition of them.
In each of steps, symbols (e.g., a, b, and c) are used for convenience of description, and the symbols do not describe order of the steps. The steps may be performed in order different from order described in the context unless specific order is clearly described in the context. That is, the steps may be performed according to described order, may be performed substantially at the same time, or may be performed in reverse order.
All terms used herein, unless otherwise defined, have the same meanings which are commonly understood by those having ordinary skill in the art. In general, terms, such as ones defined in dictionaries, should be interpreted as having the same meanings as terms in the context of relevant technology, and should not be interpreted as having ideal or excessively formal meanings unless clearly defined in this application.
A ray tracing method, that is, one of methods of a graphic processor selecting a MIP-MAP level for texture mapping, is a method of generating a ray for each pixel and inversely tracing triangle that affects the corresponding ray. In this ray tracing method, a global illumination effect can be made possible. For example, a shadow effect, a reflection effect, a refraction effect, and a transparent effect can be basically provided.
In one embodiment, the method of selecting a MIP-MAP level based on the ray tracing method includes a method based on a “ray differential” value. The ray tracing method has chiefly been applied to offline processing because it requires a massive computational load, but recently can also be applied to real-time processing with the development of semiconductor technology.
In another embodiment, in a method of selecting a MIP-MAP level, the level of the texture MIP-MAP of an object can be selected by calculating a distance value between a point of time of each primitive and the level ‘0’ of a MIP-MAP for the corresponding primitive and a value for the amount of a change of a texel against the amount of a change of a pixel when pre-processing is performed and using a value calculated when pre-processing is performed on the corresponding object that crosses the ray when rendering is performed and the length value of the entire ray calculated by “on-the-fly”. This distance measuring method can reduce a computational load as compared with the ray tracing method.
Consequently, in the disclosed technology, a MIP-MAP can be selected by using the ray tracing method or the distance measuring method according to the characteristics of a desired image, for example, image quality for the image to be provided and/or the demand level of the processing speed.
Referring to
The object information storage unit 110 stores object information about an object to be displayed in a screen. In one embodiment, the object information can include the number of objects and the shapes and materials of the objects that are present in a screen and/or the locations of the corresponding objects on a space that appears in the screen. For example, the object can include a dining table, a chair, a window, and a sink shown in
The object information identification unit 120 fetches object information about a target object to be displayed in a screen from the object information storage unit 110 and identifies the fetched object.
The algorithm determination unit 130 analyzes the object information fetched by the object information identification unit 120 and determines an algorithm for selecting a MIP-MAP level based on a result of the analysis. For example, the algorithm for selecting the MIP-MAP level can include a differential method and/or a distance measuring method. In one embodiment, the algorithm determination unit 130 can identify the demand levels of image quality and/or the processing speed for an image to be provided, select the distance measuring method operation unit 140 when the demand level of the processing speed is higher, and select the differential method operation unit 150 when the demand level of the image quality is higher.
The distance measuring method operation unit 140 performs pre-processing for selecting the MIP-MAP level according to the distance measuring method algorithm. In one embodiment, the distance measuring method operation unit 140 can receive the object information of the target object from the object information identification unit 120 and calculate a distance in which a ratio of a pixel and a texel becomes 1:1 based on a result of the determination of the algorithm determination unit 130. For example, the distance measuring method operation unit 140 can calculate the size of a texel for a pixel, calculate the number of texels included in a texture triangle for the three vertexes of the texture triangle, calculate the size of the pixel for the triangle consisting of the texels based on the calculated number of texels, calculate the size of the triangle for the three vertexes, and calculate the distance in which a ratio of a pixel and a texel becomes 1:1 based on the calculated size of the triangle. The texture triangle can include a unit triangle that forms a texture, and texture coordinates can include 2-dimensional coordinates.
The differential method operation unit 150 receives the object information of the target object from the object information identification unit and calculates the differential value of a ray according to the determination of the algorithm determination unit 130.
The MIP-MAP level selection unit 160 selects a MIP-MAP level based on the distance calculated by the distance measuring method operation unit 140 or the differential value calculated by the ray tracing method operation unit 150. In one embodiment, a method that is used the most when selecting the MIP-MAP level can be to use a ratio of the amounts of a changes pixel and texel for a long axis in a texture space. For example, the MIP-MAP level can be selected based on Mathematical Equation 1, below.
lod=log2(max(|du|,|dv|)) (Mathematical Equation 1)
Here, (du, dv) is an increment vector value for a texture coordinate system (u,v) when a texture space is mapped in the screen space of a corresponding pixel. It can be seen that a greater value from among increment vector values is selected by Mathematical Equation 1.
Meanwhile, if an image is extended in texture mapping, an “interpolation” scheme can be used. If an image is reduced, picture quality is severely deteriorated. Accordingly, in the disclosed technology, a greater value from among the increment vector values can be selected, and an “LOD” having a higher level (i.e., a selected image having a smaller size) can be selected.
In the texture mapping system 100 using the method of selecting a MIP-MAP level, the MIP-MAP level selection unit 160 can perform texture mapping based on a selected MIP-MAP.
In
Next, a MIP-MAP level selection algorithm is determined based on the object information (step S220). In one embodiment, the MIP-MAP level selection algorithm can include a differential method and/or a distance measuring method. For example, in the differential method, a MIP-MAP can be selected based on the differential values of adjacent rays. In the distance measuring method, a distance in which a ratio of a pixel and a texel becomes 1:1 can be calculated and a MIP-MAP can be selected based on the calculated distance. In one embodiment, the demand levels of image quality and/or the processing speed for an image to be provided can be identified, and the MIP-MAP level selection algorithm can be determined based on a result of the identification. For example, when the demand level of image quality for a corresponding image is higher, the differential method can be selected as the MIP-MAP level selection algorithm. In another embodiment, when the demand level of the processing speed for an image is higher, the distance measuring method can be selected as the MIP-MAP level selection algorithm.
Finally, a MIP-MAP level is selected based on the determined method (step S230).
Referring to
Referring to
Referring to
If the length of a ray for the corresponding triangle that crosses the ray is “Pl” and the corresponding triangle is vertical to a vector at the point of time, a MIP-MAP level for the texture of the corresponding triangle can be calculated by Mathematical Equation 2, below.
Here, Ps is a result of multiplying Pi by S, and S refers to the amount of a change that is a basis at the location Pb. In one embodiment, S refers to a greater value, from among the amounts of a change of the two axes (u,v) of a texel for the two coordinate axes (x,y) of a pixel. In one embodiment, if values are asymmetrically changed as shown in
Referring to
Here, “XPS” is the size of the texel for the pixel, “Texturesize” is the size of the texture, and “Resolution” is the size of the screen that is displayed. If texture coordinates corresponding to the three vertexes of the triangle of the texture are (s0, t0), (s1, t1), and (s2, t2), the number of texels included in the triangle can be calculated based on the three coordinates (step S620). For example, the size can be calculated by Mathematical Equation 4, below.
Here, “TXN” is the number of texels included in the triangle.
The size of the triangle including texels can be calculated based on the values calculated at the step “S610” and the step “S620” (step S630). For example, the size of the texel can be calculated by Mathematical Equation 5, below.
T
XS
=T
XN
T
PS (Mathematical Equation 5)
Here, “TXS” is the size of the triangle including texels, and “TXN” is the number of texels.
If model coordinates corresponding to the three vertexes of the given triangle are (x0, y0, z0), (x1, y1, z1), and (x2, y2, z2), the size of a triangle can be calculated based on the three coordinates (step S640). For example, the size of the triangle can be calculated by Mathematical Equation 6, below.
(xt,yt,zt)={(x1,y1,z1)−(x0,y0,z0)}×{(x2,y2,z2)−(x0,y0,z0)}Tarea=√{square root over (xt2+yt2+zt2)} (Mathematical Equation 6)
Here, “Tarea” is the size of the triangle.
A distance in which a ratio of a pixel and a texel becomes 1:1 can be calculated based on the values calculated at the step “S630” and the step “S640” (step S650). For example, the distance in which a ratio of a pixel and a texel becomes 1:1 can be calculated by Mathematical Equation 7, below.
Here, “Pb” is the distance in which a ratio of a pixel and a texel becomes 1:1, “TXS” is an actual size of the texel, and “Tarea” is the size of the triangle.
A MIP-MAP level can be selected by Mathematical Equation 1 based on the calculated distance (step S660).
Referring to
The pre-processing unit 710 can calculate a comparison distance where a ratio of a pixel and a texel becomes 1:1 for every triangle by using the distance measuring method of
The triangle information storage unit 720 maps information about a primitive triangle to the comparison distance calculated by the pre-processing unit and stores the mapped information and comparison distance.
The comparison distance fetching unit 730 receives the number of the primitive triangle that will be subject to texture conversion and fetches the comparison distance of the primitive triangle, corresponding to the corresponding number, from the triangle information storage unit 720. In one embodiment, the number of the triangle can be assigned to a triangle that has now been hit by a ray from a starting point.
The ray information storage unit 740 accumulates and stores pieces of information about the distance of the ray. In one embodiment, the information about the distance of the ray can include “Pl” that has been accumulated and stored before. When the reflection and refraction of the ray are generated at the same time, the ray information storage unit 740 can “push” information about one ray in a stack and perform ray tracing on the other ray. If this process is terminated, the ray information storage unit 740 can “pop” information about the ray that is at the top of the stack and can trace the ray through the popped information.
The final distance calculation unit 750 sums up a distance up to a triangle not hit by a ray from a stating point and the distance that has been accumulated and stored in the ray information storage unit 740.
The MIP-MAP level selection unit 760 selects a MIP-MAP level based on the distance summed up by the final distance calculation unit.
The texture information storage unit 770 stores information about the texture. In one embodiment, the information about the texture can include the color, brightness, and color and alpha data of the corresponding texture.
The texture information fetching unit 780 receives a texture identifier Texture_id to be converted and fetches information about the texture corresponding to the texture identifier from the texture information storage unit.
The filtering unit 790 maps the texture, fetched from the texture information fetching unit, to a corresponding primitive.
In
Referring to
Referring to
Referring to
Referring to
Referring to
The disclosed technology can have the following effects. However, it does not mean that a specific embodiment should include all the following effects or include only the following effects, and thus it should not be understood that the scope of the disclosed technology is restricted by them.
The method of selecting a MIP-MAP level in accordance with one embodiment can improve the speed of texture mapping. This is because a texture MIP-MAP for each primitive can be selected using a more efficient method.
Furthermore, the method of selecting a MIP-MAP level in accordance with one embodiment can reduce the miss rate of a direct-mapped cache. This is because an efficient MIP-MAP level can be selected and a texture level having a size most appropriate for a corresponding object when the object approaches texture data can be selected. Accordingly, reliability of the texture mapping system using the method of selecting a MIP-MAP level can be improved.
Furthermore, a variety of filtering schemes for putting a texture without distortion on an object that is inclined or rotated can be applied to the method of selecting a MIP-MAP level in accordance with one embodiment.
Although the preferred embodiments of this application have been described above, a person having ordinary skill in the art will appreciate that this application can be modified and changed in various ways without departing from the spirit and scope of this application which are written in the claims below.
This application is the United States National Phase under 35 U.S.C. §371 of PCT International Patent Application No. PCT/KR2010/005766, which designated the United States of America, and having an International Filing date of Aug. 27, 2010.
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/KR10/05766 | 8/27/2010 | WO | 00 | 3/6/2014 |