UNIFORM DENSITY CUBE MAP RENDERING FOR SPHERICAL PROJECTIONS
20190295310 ยท 2019-09-26
Inventors
Cpc classification
G06T3/06
PHYSICS
G09B29/005
PHYSICS
International classification
G09G5/36
PHYSICS
Abstract
A cube map is used for determining the appearance of a surface by means of a precomputed texture image. Embodiments of the present invention are drawn computer systems and methods for rendering a spherical projection as a cube map that mitigates non-uniform pixel density near the edges of the cube map to avoid artifacts and increase rendering performance.
Claims
1. A computer implemented method for rendering a spherical projection as a cube map, said method comprising: dividing at least one cube face of the cube map into quadrant surfaces; assigning viewports to the quadrant surfaces; determining coordinates of world-space vertexes projected onto the quadrant surfaces; rendering views of the viewports using said coordinates, wherein said views comprise said vertexes; and expanding the views into the at least one cube face, wherein the views expanded into the at least one cube face comprise an approximately uniform pixel density.
2. A method as described in claim 1, wherein said determining coordinates of world-space vertexes projected onto the quadrant surfaces is performed using the transformation function:
3. A method as described in claim 2, further comprising: performing a first rendering pass to determine the coordinates of world-space vertexes projected onto the quadrant surfaces; and performing a second rendering pass to expand the views into the at least one cube face.
4. A method as described in claim 2, wherein said expanding the views into the at least one cube face is performed using the transformation function:
5. A method as described in claim 1, further comprising rendering a scene using said cube map and wherein said cube map comprises at least one map from the group of maps comprising: an environment map; and a shadow map.
6. A method as described in claim 1, wherein graphics processor unit (GPU) hardware configured for multi-view rendering is used to perform said rendering views of the viewports.
7. A method as described in claim 1, further comprising storing said cube map in a memory of a computer system.
8. A computer system for rendering a spherical projection as a cube map, said computer system comprising: a memory operable for storing data and instructions of an application; a processor configured to execute said instructions for controlling rendering of three-dimensional (3D) environments; and a graphics processing unit communicatively coupled to the processor and the memory, wherein the graphics processing unit is configured to perform, responsive to said instructions, a method of rendering a spherical projection as a cube map, said method of rendering comprising: dividing at least one cube face of the cube map into quadrant surfaces; assigning viewports to the quadrant surfaces; determining coordinates of world-space vertexes projected onto the quadrant surfaces; rendering views of the viewports using said coordinates, wherein said views comprise said vertexes; and expanding the views into the at least one cube face, wherein a pixel density of the views expanded into the at least one cube face is approximately uniform.
9. A computer system as described in claim 8, wherein said determining coordinates of world-space vertexes projected onto the quadrant surfaces is performed using the transformation function:
10. A computer system as described in claim 9, wherein said method further comprises: performing a first rendering pass to determine the coordinates of world-space vertexes projected onto the quadrant surfaces; and performing a second rendering pass to expand the views into the at least one cube face.
11. A computer system as described in claim 9, wherein said expanding the views onto the cube faces comprises performing the calculation:
12. A computer system as described in claim 8, wherein said method further comprises rendering a scene using said cube map and wherein said cube map comprises at least one map from the group of maps comprising: an environment map; and a shadow map.
13. A computer system as described in claim 8, wherein hardware of said graphics processing unit configured for multi-view rendering is used to perform said rendering views of the viewports.
14. A computer system as described in claim 8, further comprising storing said at least one cube face as a cube map in said memory.
15. A non-transitory computer readable medium comprising a plurality of programmed instructions, which when executed by a processor in a computing device are operable to perform rendering of a spherical projection as a cube map, the programmed instructions comprising: instructions to divide at least one cube face of the cube map into quadrant surfaces; instructions to assign viewports to the quadrant surfaces; instructions to determine coordinates of world-space vertexes projected onto the quadrant surfaces; instructions to render views of the plurality of viewports using said coordinates, wherein said views comprise said vertexes; and instructions to expand the views onto the at least one cube face, wherein the views expanded onto the at least one cube face comprise an approximately uniform pixel density.
16. A non-transitory computer readable medium as described in claim 15, wherein said instructions for determining coordinates of world-space vertexes projected onto the quadrant surfaces comprise instructions for performing the transformation function:
17. A non-transitory computer readable medium as described in claim 16, wherein said programmed instructions further comprise instructions for performing a first rendering pass to determine the coordinates of world-space vertexes projected onto the quadrant surfaces, and for performing a second rendering pass to expand the views into the at least one cube face.
18. A non-transitory computer readable medium as described in claim 16, wherein said instructions for expanding the views onto the at least one cube face comprise instructions for performing the transformation function:
19. A non-transitory computer readable medium as described in claim 15, wherein said cube map comprises at least one map from the group of maps comprising: an environment map; and a shadow map.
20. A non-transitory computer readable medium as described in claim 15, wherein said programmed instructions further comprise instructions for using graphics processor unit (GPU) hardware configured for multi-view rendering to execute said instructions for rendering views of the viewports.
21. A non-transitory computer readable medium as described in claim 15, further comprising instructions for storing said at least one cube face as a cube map in a memory of a computer system.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention:
[0014]
[0015]
[0016]
[0017]
[0018]
[0019]
[0020]
[0021]
[0022]
[0023]
[0024]
DETAILED DESCRIPTION
[0025] Reference will now be made in detail to several embodiments. While the subject matter will be described in conjunction with the alternative embodiments, it will be understood that they are not intended to limit the claimed subject matter to these embodiments. On the contrary, the claimed subject matter is intended to cover alternative, modifications, and equivalents, which may be included within the spirit and scope of the claimed subject matter as defined by the appended claims.
[0026] Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the claimed subject matter. However, it will be recognized by one skilled in the art that embodiments may be practiced without these specific details or with equivalents thereof. In other instances, well-known methods, procedures, components, and circuits have not been described in detail as not to unnecessarily obscure aspects and features of the subject matter.
[0027] Portions of the detailed description that follows are presented and discussed in terms of a method. Although steps and sequencing thereof are disclosed in a figure herein (e.g.,
[0028] Some portions of the detailed description are presented in terms of procedures, steps, logic blocks, processing, and other symbolic representations of operations on data bits that can be performed on computer memory. These descriptions and representations are the means used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art. A procedure, computer-executed step, logic block, process, etc., is here, and generally, conceived to be a self-consistent sequence of steps or instructions leading to a desired result. The steps are those requiring physical manipulations of physical quantities. Usually, though not necessarily, these quantities take the form of electrical or magnetic signals capable of being stored, transferred, combined, compared, and otherwise manipulated in a computer system. It has proven convenient at times, principally for reasons of common usage, to refer to these signals as bits, values, elements, symbols, characters, terms, numbers, or the like.
[0029] It should be borne in mind, however, that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. Unless specifically stated otherwise as apparent from the following discussions, it is appreciated that throughout, discussions utilizing terms such as accessing, writing, including, storing, transmitting, traversing, associating, identifying or the like, refer to the action and processes of a computer system, or similar electronic computing device, that manipulates and transforms data represented as physical (electronic) quantities within the computer system's registers and memories into other data similarly represented as physical quantities within the computer system memories or registers or other such information storage, transmission or display devices.
Exemplary Computer System
[0030] Embodiments of the present invention are drawn to computer systems for rendering a spherical projection into a cube map that mitigates non-uniform pixel density near the edges of the cube map to avoid artifacts and increase performance. The following discussion describes such exemplary computer systems.
[0031] In the example of
[0032] A communication or network interface 108 allows the computer system 112 to communicate with other computer systems, networks, or devices via an electronic communications network, including wired and/or wireless communication and including an Intranet or the Internet. The display device 110 may be any device capable of displaying visual information in response to a signal from the computer system 112 and may include a flat panel touch sensitive display, for example. The components of the computer system 112, including the CPU 101, memory 102/103, data storage 104, user input devices 106, and graphics subsystem 105 may be coupled via one or more data buses 100.
[0033] In the embodiment of
[0034] The graphics sub-system 105 may be configured to perform multi-viewport rendering, where scenes for multiple viewports are rendered in a single pass. The graphics sub-system may perform operations such as determining projected cube map face screen coordinates {u, v} based on the value of Cartesian coordinates {x, y}, and unwrapping a cube face projection for 2D screen space (e.g., clip space) using a best fit representation by performing a perspective divide so that the projection comprises approximately uniform pixel density. According to some embodiments, the graphics sub-system 105 may include specialized cube map texture fetching hardware resident therein for quickly and efficiently fetching cube map textures.
[0035] Some embodiments may be described in the general context of computer-executable instructions, such as program modules, executed by one or more computers or other devices. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. Typically the functionality of the program modules may be combined or distributed as desired in various embodiments.
Exemplary Cube Map Face Rendering
[0036] With regard to
[0037] With regard to
[0038] With regard to
[0039] With regard to
[0040]
[0041]
[0042]
Exemplary Cube Map Face Transformation and Best Fit Unwrapping
[0043] As mentioned above, a transformation function may be used to determine the coordinates of the world-space vertexes projected onto the cube map faces, or quadrant surfaces thereof. The transformation function determines the coordinates of the projected cube map face from Cartesian coordinates using Equation I:
[0044] Equation I determines the projected cube map face screen coordinates {u, v} based on the value of Cartesian coordinates {x, y}. As mentioned above with regard to
[0045]
[0046] According to some embodiments, the value of is determined by calculating
The value of can be similarly determined:
The and values are sheared projection coefficients for projecting world space vertexes onto a surface. Here, the a and B values are used to determine the best fit for fitting the spherical projection inside the unwrapped projection relative to an outermost corner (see
According to some embodiments, the a and B values are determined such that the cube face quadrants cumulatively represent a 90 degree range in azimuth and elevation of the total spherical projection. According to some embodiments, the absolute value of equals the absolute value of for each respective viewport when the projection is symmetrical, such as for a cube map spherical projection.
[0047] The value of w represents the width relative to the depth of the vertex (e.g., perspective), and the value of w equals 1 at the point of the plane of projection that is farthest away from the viewport. The best fit may be determined for one viewport, and subsequently applied (e.g., transversely) to the remaining viewports. Alternatively, the best fit may be calculated independently for each viewport. According to some embodiments, each cube map face is divided into quadrants, and each quadrant is assigned a viewport.
[0048] With regard to
[0049] At step 401, the six faces of the cube map are portioned into equal sized quadrants (e.g., quadrant surfaces). At step 402, viewports are assigned to the quadrants. For example, one viewport may be assigned to each quadrant, totaling 24 viewports per cube map. At step 403, coordinates of vertexes projected onto the quadrants in a three-dimensional coordinate system (e.g., world space) are determined. The coordinate positions of the projected vertexes {u, v} can be determined using the formula:
This step results in a distorted cube face projection having non-uniform pixel density.
[0050] At step 404, the views from the perspective of the viewports are rendered. At this stage, the respective views of the viewports are distorted and have non-uniform pixel density. At step 405, the distorted cube face projection is unwrapped/expanded for 2D screen space (e.g., clip space) using a best fit representation of the 3D cube map face. A transformation function is applied such that the 2D projection comprises approximately uniform pixel density, and the resultant unwrapped and undistorted views are stored in the faces of the cube map. The formula
can be used to expand (e.g., transform or unwrap) the views onto the cube faces, where
At step 406, the resultant cube map is stored in computer memory. Subsequently, a lookup operation may be performed to determine values of a scene using the cube map, where the cube map is a shadow map or environment map, for example, and the scene may be rendered according to the values.
[0051] With regard to
[0052] According to some embodiments of the present invention, the cube map is an environment map used for light capture probes. According to other embodiments, the cube map is an omni-directional shadow map. According to other embodiments, the cube map is used to determine a radiance value of a pixel or texel used for light calculation.
[0053] According to some embodiments, lookup operations performed on a cube map generated by embodiments of the present invention are performed using cube map texture fetching hardware. According to some embodiments, the cube map texture fetching hardware is a component of a GPU.
[0054] Embodiments of the present invention are thus described. While the present invention has been described in particular embodiments, it should be appreciated that the present invention should not be construed as limited by such embodiments, but rather construed according to the following claims.