As computing devices have developed, they have become capable of displaying complex objects. To aid in the rapid analysis and display of these complex objects, processors have been developed called graphics processing units (GPUs). GPUs use circuitry designed to rapidly manipulate and alter memory which accelerates the building of images created from complex objects. A GPU's highly parallel structure makes it more efficient than a standard central processing unit (CPU) to process the large amounts of data inherent in processing complex objects.
A GPU applies a texture, or electronic image, to an object to create a texture object; for example, applying a map of the world onto a spherical object to create a globe. This is performed by dividing both the object and the texture, respectively, into a number of sections. Each section contains a number of vertices defined by a two-dimensional coordinate system. Both sets of vertex coordinates are then sent to the GPU to be combined into a single set of texture object vertices.
The accompanying drawings illustrate various examples of the principles described herein and are a part of the specification. The illustrated examples are merely examples and do not limit the scope of the claims.
Throughout the drawings, identical reference numbers designate similar, but not necessarily identical, elements.
While the circuitry of a GPU makes the process of applying a texture to an object more simple, the process still burdens the CPU's computing bandwidth as two sets of vertices are sent to the GPU to be processed. Each time a texture is to be projected onto an object it is divided into a number of texture sections that include a number of texture vertices, each vertex having a coordinate identifier. These sections are, for example, triangular in shape. The object onto which the texture is to be projected is also divided into a number of object sections. Similarly, each object section has a number of object vertices with each vertex having a coordinate identifier. Thus, each texture object vertex has two coordinates, a texture vertex coordinate and an object vertex coordinate. In this example, a texture vertex coordinate is projected onto a corresponding object vertex coordinate that has the same spatial relationship to other sections of their type.
The texture object is rendered by sending corresponding texture vertex coordinates and object vertex coordinates to the GPU and combining the corresponding texture vertex coordinates and object vertex coordinates into a single texture object vertex coordinate. The texture object is a projection of the texture onto the object. This process is computationally expensive because the GPU processes two data inputs for every one data output.
In light of these and other issues, the present specification discloses a method and a system for increasing efficiency in creating a texture object. In particular, the present specification discloses a method that uses a transformation matrix and the object vertex coordinates to project the texture onto the object. In this method, the texture vertex coordinate is not sent to the GPU for processing, and, instead the transformation matrix and the object vertex coordinates are utilized in creating a texture object. This decreases processing time, decreases processing bandwidth usage, and increases processing speed to improve the overall efficiency of texture object rendering. Consequently, more computing space is available to perform other operations and a texture object is quickly obtained. A system carrying out this method is also disclosed.
According to an example of the disclosure, the method begins by generating two different data sets; one that describes a texture which will be projected, and one that describes an object on which the texture will be projected. Next the object data set and the texture data set are divided into sections that are made up of a number of vertices, each vertex having coordinate identifiers. In this example, each texture section has a corresponding object section in which each texture section has the same spatial relationship to other texture sections as its corresponding object section has to other object sections.
After the different sections have been generated, a transformation matrix is created which mathematically defines the relationship between the texture vertex coordinates and the object vertex coordinates. This transformation matrix and the object vertex coordinates are then sent to the electronic device's GPU to calculate the texture vertex coordinate to be projected on a corresponding object vertex coordinate. The transformation matrix and the object vertex coordinates, and not the texture vertex coordinates are sent to the GPU. The GPU calculates the texture vertex coordinates using the transformation matrix and the object vertex coordinates. This reduces computing bandwidth usage because one set of coordinates is sent to the GPU along with the transformation matrix rather than both the object vertex coordinates and the texture vertex coordinates.
The present specification also discloses a system for carrying out the generation of a texture object using a transformation matrix. An example of the system includes a processor that generates an object and a texture, and divides the object and texture, respectively, into a number of sections. The processor also generates a transformation matrix that defines the mathematical relationship between the texture vertex coordinates and the object vertex coordinates. In this example, the system also includes a graphics processor programmed to project the texture onto the object by calculating the corresponding texture vertex coordinate given the transformation matrix and the object vertex coordinate.
As used in the present specification and in the appended claims, the term “texture” refers to a two-dimensional image that is projected onto an object, defined by points of color, or pixels organized in a matrix. The pixels, when viewed together, create a displayable image on a display device.
Additionally, as used in the present specification and in the appended claims, the term “texture coordinate” refers to the location of a vertex of a texture division. According to an example, each vertex of a texture division has a corresponding vertex in an object division.
Similarly, as used in the present specification and in the appended claims, the term “object coordinate” refers to the location of a vertex of an object division. According to an example, each vertex of an object division has a corresponding vertex in a texture division.
Still further, as used in the present specification and in the appended claims, the term “shader” refers to hardware or a combination of hardware and software that calculates how an individual element will be rendered. For example, a shader calculates the texture vertex coordinate based on the transformation matrix and the object vertex coordinate.
In the following description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the present systems and methods. It will be apparent, however, to one skilled in the art that the present apparatus, systems and methods may be practiced without these specific details. Reference in the specification to “an example” or similar language means that a particular feature, structure, or characteristic described in connection with the example is included in at least that one example, but not necessarily in other examples. The various instances of the phrase “in one example” or similar phrases in various places in the specification are not necessarily all referring to the same example.
Referring now to the drawings,
The processor (102) similarly creates an object onto which the texture will be projected. The processor (102) then divides the object and the texture respectively into a number of sections, each having a number of vertices that are defined by coordinate identifiers. The processor (102) stores the texture vertex coordinates (150) and object vertex coordinates (152) in, for example, the data storage device (116). In another example, the processor (102) stores the texture vertex coordinates (150) and object vertex coordinates (152) in the cache (106). Each texture vertex coordinate has a corresponding object vertex coordinate.
In addition, a transformation matrix (154) is created by the processor (102) that represents the mathematical relationship between the texture vertex coordinates (150) and the object vertex coordinates (152). Because the texture vertex coordinates (150) can be calculated from the transformation matrix (154) and the object vertex coordinates (152), the texture vertex coordinates (150) are not sent to the graphics processor (104) to be rendered. Instead, the transformation matrix (154) and the object vertex coordinates (152) are sent to the graphics processor (104).
According to an example, the processor (102) sends the transformation matrix (154) and the object vertex coordinates (152) to a cache (106) communicatively coupled to both the processor (102) and the graphics processor (104). With the information stored in the cache (106), any subsequent generation of the texture object can call the transformation matrix (154) and object vertex coordinates (152) from the cache (106) and perform the conversion.
Accordingly, the system (100) may also include a cache (106) which stores the transformation matrix (154) and the object vertex coordinates (152). According to an example of the system (100), once a texture object has been rendered, the processor (102) may provide space within the cache (106). Doing so clears processing space for future objects to be rendered. In one example, the processor (102) erases the transformation matrix (154) and the object vertex coordinates (152) from the cache (106). In another example, the processor (102) waits until the cache (106) is full before erasing it. In yet another example, the processor (102) writes over the data stored in the cache (106) as more data is stored to the cache (106).
The system (100) may also include a graphics processor (104) that is communicatively coupled to the processor (102) and the data storage device (116). In this example, the graphics processor (104) uses the transformation matrix (154) and the object vertex coordinates (152) to project the texture onto the object. This is performed by calculating the texture vertex coordinates (150) based on the transformation matrix (154) and object vertex coordinates (152). According to an example of the system (100), a shader (128) within the GPU performs this conversion. By using the transformation matrix (154) and the object vertex coordinates (152) to calculate the texture vertex coordinates (150), graphics processing bandwidth is efficiently used. Efficient use of the graphics processing bandwidth returns a texture object quickly, and frees the graphics processor (104) to perform other operations.
Once the texture vertex coordinates (150) have been calculated, the graphics processor (104) may also render the texture object into a rasterized object that can be viewed and displayed on the display device (108). A rasterized object is one that is defined by a grid of colored pixels.
Accordingly, the system (100) may also include a display device (108) that is communicatively coupled to the processor (102), the graphics processor (104), and the cache (106). In this example, once a texture object has been rendered, the processor (102) then transmits the rasterized texture object to the display device (108). The display device (108) is any electronic display device that is capable of displaying a rasterized object. Examples of a display device (108) include, but are not limited to, computer screens, personal computing device screens, a touch sensitive screen, a liquid crystal display (LCD), a plasma display, and a flat panel display. In one example, the system (100) displays the rasterized object on the display device (108) via a computer program such as, for example, an internet webpage or a computer-aided-drafting (CAD) program.
In the present example, for the purposes of simplicity in illustration, the computing device (112), graphics processor (104), cache (106), and display device (108) are communicatively coupled via bus (130). However, the principles set forth in the present specification extend equally to any alternative configuration in which a number of these elements are combined in a number of configurations. As such, examples within the scope of the principles of the present specification include examples in which the computing device (112), graphics processor (104), cache (106), and display device (108) are implemented by the same computing device. Other examples of an alternative configuration include examples in which the computing device (112), graphics processor (104), cache (106), and display device (108) are separate computing devices communicatively coupled to each other through a network or other communication paths. Still other examples of an alternative configuration include examples in which the functionality of the computing device (112) is implemented by multiple interconnected computers, for example, a server in a data center and a user's client machine. Still other examples of alternative configurations of the elements of
To achieve its desired functionality, the computing device (112) includes various hardware components. Among these hardware components may be a processor (102), a graphics processor (104), a data storage device (116), peripheral device adapters (118), and a network adapter (120). These hardware components may be interconnected through the use of a number of busses and/or network connections. In one example, the processor (102), graphics processor (104), data storage device (116), peripheral device adapters (118), and a network adapter (120) may be communicatively coupled via bus (130).
The processor (102) and graphics processor (104) may include the hardware architecture for retrieving executable code from the data storage device (116) and executing the executable code. The executable code may, when executed by the processor (102) and graphics processor (104), cause the processor (102) and graphics processor (104) to implement at least the functionality of pixel-dependent rendering according to the methods of the present specification described below. In the course of executing code, the processor (102) and graphics processor (104) may receive input from and provide output to a number of the remaining hardware units.
The data storage device (116) may include various types of memory modules, including volatile and nonvolatile memory. For example, the data storage device (116) of the present example includes Random Access Memory (RAM) (122), Read Only Memory (ROM) (124), and Hard Disk Drive (HDD) memory (126). Many other types of memory are available in the art, and the present specification contemplates the use of many varying type(s) of memory in the data storage device (116) as may suit a particular application of the principles described herein. In certain examples, different types of memory in the data storage device (116) may be used for different data storage needs. For example, in certain examples the processor (102) and graphics processor (104) may boot from Read Only Memory (ROM) (124), maintain nonvolatile storage in the Hard Disk Drive (HDD) memory (126), and execute program code stored in Random Access Memory (RAM) (122).
Generally, the data storage device (116) may comprise a computer readable storage medium. For example, the data storage device (116) may be, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the computer readable storage medium may include, for example, the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The hardware adapters (118, 120) in the computing device (112) enable the processors (102, 104) to interface with various other hardware elements, external and internal to the computing device (112). For example, peripheral device adapters (118) may provide an interface to input/output devices, such as, for example, output device (124), to create a user interface and/or access external sources of memory storage. Peripheral device adapters (118) may also create an interface between the processor (102) and graphics processor (104) and a display device (108) or other media output device. A network adapter (120) may additionally provide an interface to a network, thereby enabling the transmission of data to and receipt of data from other devices communicatively coupled within the network.
For similar reasons, the object is similarly generated (block 206) and divided into object sections (block 208). Each object section will have a number of vertices whose position is defined by a coordinate identifier. According to an example of the method (200) each object section has a corresponding texture section such that an object section has the same spatial relationship to other object sections as does its corresponding texture section to other texture sections. For example, a particular object section, A, is bordered by object sections B, C, and D. The corresponding texture section A is likewise bordered by texture sections B, C, and D. In this example, the number of object vertices of an object section will match the number of texture vertices of a texture section.
A transformation matrix (154) is then generated which defines the mathematical relationship between the texture vertex coordinates (150) and the object vertex coordinates (152) (block 210). In one example, this relationship is linear. This relationship can be defined mathematically by the equation Mx=t, where M is the transformation matrix (154), x is the object vertex coordinate, and t is the texture vertex coordinate. In one example, the transformation matrix (M) is a 3×3 matrix. Because processing the transformation matrix (154) utilizes less computational bandwidth than does the texture vertex coordinates (150) pertaining to an entire texture, a texture object may be generated quicker. The graphics processor (
Once the transformation matrix (154) has been generated, the object vertex coordinates (152) and the transformation matrix (154) are sent to the graphics processor (
For similar reasons, the object is similarly generated (block 306) and divided into object sections (block 308). Each object section will have a number of vertices whose position is defined by a coordinate identifier. According to an example of the method (300) each object section has a corresponding texture section such that an object section has the same spatial relationship to other object sections as does its corresponding texture section has to the other texture specifications. For example, a particular object section, A, is bordered by object sections B, C, and D. The corresponding texture section A is likewise bordered by texture sections B, C, and D. In this example, the number of object vertices of an object section will match the number of texture vertices of a texture section.
A transformation matrix (154) is then generated which defines the mathematical relationship between the texture vertex coordinates (150) and the object vertex coordinates (152) (block 310). In one example, this relationship is linear. This relationship can be defined mathematically using the equation Mx=t, where M is the transformation matrix (154), x is the object vertex coordinate, and t is the texture vertex coordinate. In one example, the transformation matrix (M) is a 3×3 matrix. Because processing the transformation matrix (154) utilizes less computational bandwidth than does the texture vertex coordinates (150) pertaining to an entire texture, a texture object is generated quicker and the graphics processor (
According to an example of the method (300), the transformation matrix (154) and the object vertex coordinates (152) are then stored to the cache (
Once the transformation matrix (154) has been calculated, the object vertex coordinates (152) and the transformation matrix (154) are sent to the graphics processor (
In this example, the shader (
An example of the method (300) may also include rendering the texture object into a rasterized texture object that can be displayed on the display device (
The methods described above may be accomplished in conjunction with a computer program product comprising a computer readable medium having computer usable program code embodied therewith that, when executed by a processor, performs the above processes and methods. Specifically, the computer usable program code, when executed by a processor, generates a data set that defines a texture; divides the texture into a number of texture sections comprising a number of texture vertices; generates a data set that defines an object; divides the object into a number of object sections comprising a number of object vertices; generates a transformation matrix (154) that defines the mathematical relationship between the texture vertices and their corresponding object vertices; and creates a data set that defines the texture object.
The preceding description has illustrated a method and system for pixel-dependent rendering. The method generates an object and texture and then divides each of them respectively into a number of sections. Next, a transformation matrix is calculated which defines the mathematical relationship between corresponding texture sections and object sections. This transformation matrix along with the object vertex coordinates are sent to a graphics processor which converts them into a texture object. The current method and system reduce the number of computations a graphics processor has to perform by sending one set of coordinates along with a transformation matrix which allows the calculation of the texture vertex coordinates. The reduction in computation, frees up computing bandwidth, and increases the efficiency of rendering texture objects.
The preceding description has been presented only to illustrate and describe examples of the principles described. This description is not intended to be exhaustive or to limit these principles to any precise form disclosed. Many modifications and variations are possible in light of the above teaching.