Single pass radiosity from depth peels

Techniques for single pass radiosity from depth peels are described. In one or more embodiments, radiosity for frames of a graphics presentation is computed using depth peel techniques. This may occur by rendering geometry for a frame and then computing two depth peels per frame based on the geometry, which can be used to determine occlusion of secondary bounce lights as well as color and intensity of third bounce lights for radiosity. The two depth peels may be generated in a single rendering pass by reusing rejected geometry of a front depth peel as geometry for a back depth peel. The use of depth peels in this manner enables accelerated radiosity computations for photorealistic illumination of three dimensional graphics that may be performed dynamically at frame rates typical for real-time game play and other graphics presentations.

BACKGROUND

When rendering graphics/frames for a real-time application, such as a video game, it may be difficult and costly to incorporate realistic lighting simulations for the graphics/frames because computations for realistic rendering of shadows and lights are resource intensive and time consuming. For example, traditional techniques for radiosity computations that account for the effects of reflected light and produce photorealistic illumination may take days or even weeks to compute for complex geometry of a frame. Due to these time constraints, traditional radiosity computations may take too long to be employed for real-time illumination changes at runtime (e.g., during game play). Accordingly, traditional techniques for radiosity computations may be limited to pre-computation off-line in a development environment. Moreover, pre-computation of the lighting may be unable to satisfactorily account for illumination changes in lighting due to dynamic movement of objects in a scene, such as user controlled game characters and other moving/dynamic objects.

SUMMARY

Techniques for single pass radiosity from depth peels are described. In one or more embodiments, radiosity for frames of a graphics presentation is computed using depth peel techniques. This may occur by rendering geometry for a frame and then computing two depth peels per frame based on the geometry, which can be used to determine occlusion of secondary bounce lights as well as color and intensity of third bounce lights for radiosity. The two depth peels may be generated in a single rendering pass by reusing rejected geometry of a front depth peel as geometry for a back depth peel. The use of depth peels in this manner enables accelerated radiosity computations for photorealistic illumination of three dimensional graphics that may be performed dynamically at frame rates typical for real-time game play and other graphics presentations.

DETAILED DESCRIPTION

Overview

Techniques for single pass radiosity from depth peels are described. In one or more embodiments, radiosity for frames of a graphics presentation is computed using depth peel techniques. This may occur by rendering geometry for a frame and then computing two depth peels per frame based on the geometry, which can be used to determine occlusion of secondary bounce lights as well as color and intensity of third bounce lights for radiosity. The two depth peels may be generated in a single rendering pass by reusing rejected geometry of a front depth peel as geometry for a back depth peel. The use of depth peels in this manner enables accelerated radiosity computations for photorealistic illumination of three dimensional graphics that may be performed dynamically at frame rates typical for real-time game play and other graphics presentations.

In the discussion that follows, a section titled “Operating Environment” is provided and describes one environment in which one or more embodiments can be employed. Following this, a section titled “Techniques for Single Pass Radiosity from Depth Peels” describes example implementation details in accordance with one or more embodiments. Last, a section titled “Example System” describes example computing systems and devices that can be utilized to implement one or more embodiments.

Operating Environment

FIG. 1illustrates an operating environment in accordance with one or more embodiments, generally at100. The environment100includes a computing device102having one or more processors104(e.g., CPUs), one or more computer-readable media106, an operating system108, and one or more applications110that reside on the computer-readable media and which are executable by the processor(s). The one or more processors104may retrieve and execute computer-program instructions from applications110to provide a wide range of functionality to the computing device102, including but not limited to gaming, office productivity, email, media management, printing, networking, web-browsing, and so forth. A variety of data and program files related to the applications110can also be included, examples of which include games files, office documents, multimedia files, emails, data files, web pages, user profile and/or preference data, and so forth.

The computing device102can be embodied as any suitable computing system and/or device such as, by way of example and not limitation, a gaming system, a desktop computer, a portable computer, a tablet or slate computer, a handheld computer such as a personal digital assistant (PDA), a cell phone, a set-top box, and the like. For example, as shown inFIG. 1the computing device102can be implemented as a television client device112, a computer114, and/or a gaming system116that is connected to a display device118to display media content. Alternatively, the computing device may be any type of portable computer, mobile phone, or portable device120that includes an integrated display122. Any of the computing devices can be implemented with various components, such as one or more processors and memory devices, as well as with any combination of differing components. One example of a computing system that can represent various systems and/or devices including the computing device102is shown and described below inFIG. 5.

The computer-readable media can include, by way of example and not limitation, all forms of volatile and non-volatile memory and/or storage media that are typically associated with a computing device. Such media can include ROM, RAM, flash memory, hard disk, removable media and the like. Computer-readable media can include both “computer-readable storage media” and “communication media,” examples of which can be found in the discussion of the example computing system ofFIG. 5.

The computing device102also includes a graphics processing unit (GPU)124separate from the processor(s)104that operates to perform various processing related to graphics output by the computing device for display on the display device118or integrated display122. The GPU124is a hardware component of the computing device that is dedicated to graphics processing. Functionality provided by the GPU124may include controlling aspects of resolution, pixel shading operations, color depth, texture mapping, 3D rendering, and other tasks associated with rendering user interfaces and computer generated imagery (CGI) for applications. This can include processing tasks such as polygon drawing, bitmap transfers and painting, window resizing and repositioning, line drawing, font scaling, buffering, and so forth. As illustrated, the GPU may include or otherwise make use of pixels shaders126and/or other processing hardware and software components to perform various processing for graphics outputs. The GPU124may be capable of handling processing tasks in hardware at greater speeds than software that is executed on the processor(s)104. Thus, the dedicated graphics processing capability of the GPU124can accelerate graphics processing, reduce the workload of the processor(s)104, and free up system resources for other tasks.

The computing device102also includes a radiosity module128that may reside on the computer-readable media and which is executable by the processor(s). The radiosity module128represents functionality to perform various techniques for single pass radiosity from depth peels as described above and below. In at least some embodiments, the radiosity module128may be implemented as a component of an application110used to control aspects of graphics processing for the application. For instance, the radiosity module128may be provided as part of a game application for a gaming system to facilitate radiosity computations for the game via the GPU124in accordance with techniques described herein. The radiosity module128may also be implemented in other ways such as being configured as a standalone module as depicted inFIG. 1, as an integrated module of the GPU124, and so forth.

In one or more embodiments, the GPU124may be operated under the influence of the radiosity module128to perform radiosity computations. Radiosity accounts for reflection of direct lighting sources diffusely from the surfaces of objects in a scene/frame. Such diffusely reflected or “bounced” light may contribute to the color, intensity, and/or shading of other objects in the scene/frame. Pixels shaders126of the GPU may be employed to output pixels having color, intensity, and/or shading that is determined based at least in part upon radiosity data computed by the radiosity module128. In general, the radiosity module128is configured to use depth peels to implement radiosity computations that are much faster than traditional radiosity techniques. For example, radiosity computations using depth peel techniques described above and below may occur at frame rates typical for real-time game play and other graphics output rather than the hours or days it may take for traditional radiosity computations employed in a development environment.

By way of introduction, depth peeling is a technique traditionally used to render transparent objects by successive passes in which a geometry layer and corresponding surfaces that are nearest to the eye or viewpoint are selected and rendered. In each pass, the surfaces at the next nearest z-depth of the geometry are selected using depth tests to obtain depth and color information for the surfaces. Effectively, depth peels may be used to identify, manipulate, and render successive layers that are composited to generate a transparent looking object. This occurs without having to sort polygons in order. In accordance with the inventive principles described in greater detail below, the concept of depth peeling may be leveraged to implement fast radiosity computations that may be employed to generate photorealistic illumination effects in real-time during graphics output (e.g., at a frame rate for the output) as well as to facilitate creation of such effects for graphics/games in a development environment. Additional details regarding radiosity computations and depth peeling may be found in relation to the following figures.

Having described an example operating environment, consider now example techniques for single pass radiosity from depth peels in accordance with one or more embodiments.

Techniques for Single Pass Radiosity from Depth Peels

This section describes example implementation details and techniques for single pass radiosity from depth peels that may be implemented using the various devices and components described above and below. Radiosity computations may be employed to simulate realistic shadows and lighting within the context of global illumination for graphics rendering/CGI in video games, films, and other graphics presentation.

In particular, global illumination for frames of a graphics presentation may incorporate a radiosity algorithm to account for both light which comes directly from a light source (e.g., direct illumination) and “bounced” light due to reflection of direct light by geometry and surfaces in the scene (e.g., indirect illumination). In general, radiance leaving each point/pixel for surfaces of the geometry for a frame is computed as the sum of the emitted and reflected radiance. Typically, computing radiosity involves applying direct lighting and then accounting for a selected number of subsequent bounces of the light off of diffuse and reflective surfaces of the frame geometry. For each particular surface, the intensity of the particular surface depends upon the direct and reflected light contribution for the other surfaces in the frame.

To compute radiosity in a traditional manner, surfaces of a frame may be divided up into one or more smaller surfaces (e.g., surface patches). View factors that reflect how patches are arranged one to another are computed for each pair of patches. The view factors may be configured as coefficients that depend upon factors such as distance between patches, orientation of patches one to another, objects/geometry positioned between a pair of patches that may cause light occlusion, and so forth. View factor values assigned to surface patch pairs may increase as the amount of light energy transferred between the surface patch pairs increases.

The view factors are used to iteratively compute the radiosity, (e.g., brightness/intensity) of each patch in a series of successive light bounces. Each bounce produces intermediate values which are used as a starting point for the next bounce. The photorealism of the illumination may increase with each bounce. The number of bounces employed may be selected to achieve a defined quality threshold and/or to reach imperceptible levels. Such traditional radiosity techniques involve exhaustively computing the respective light intensity contributions of each patch to each other patch for each bounce, which causes significant computation times on the order of hours and day.

In accordance with techniques described herein, though, depth peels are employed to reduce the number of surface patches considered with respect to each light source. Accordingly, surfaces that are not relevant with respect to a particular light source and/or surface may be culled according to the depth peels. This dramatically increases the speed with which radiosity may be computed for each light source in each bounce to a matter of milliseconds. In other words, the repurposing of depth peels for radiosity computation as described herein accelerates computation by reducing the surface patches considered for each pass to surface patches that are relevant for each particular light source as determined by the depth peels.

Moreover, because the speed with which the computations may be completed for each light source is increased, the number of light sources and bounces employed may also be increased to further add to photorealism achieved for the resulting illumination. For example, a light source count and/or a bounce count may be selected to optimize radiosity processing such that further additions of lights/bounces would not produce changes that are perceptible to a viewer. In some embodiments, each visible pixel is taken as a possible light source. Thus, the count of light sources used to compute radiosity and illumination for a scene may be increased up to a per visible pixel density.

As noted above, depth peeling is a technique ordinarily used to render translucent polygonal geometry without having to sort polygons. For the purpose of computing single pass radiosity, the surface patch geometry for a frame being processed may be peeled with respect to each light source considered into one front depth peel and one back depth peel by applying existing depth peeling techniques. These front and back depth peels may be quickly computed in a single pass for each lighting position.

In particular, for each light source the geometry within light source's visible frustum is considered. A surface patch facing a light source within its visible frustum occludes the light from the source and blocks its contribution, and the remaining non-occluded light which surface patches do not block contributes to the illumination. The front depth peel of the culled subset of the geometry is employed to determine the surface patches that occlude the light from the source. Specifically, the front depth peel gives the positions for occluders of second bounce light. The corresponding back depth peel is derived from the front depth peel as the rejected geometry of the front depth peel. The back depth peel is employed to determine colors and intensities of corresponding surfaces, which may then be used to modulate the characteristics of surface patches that are not occluded for the next layer of bounces (e.g., third bounce light)

To further illustrate the foregoing concepts, considerFIG. 2which is a diagram that depicts generally at200an example that represents aspects of using depth peels to compute radiosity. In particular,FIG. 2depicts representative geometry202that may be illuminated by one or more light sources, such as the example light204. In this example, a front depth peel206is shown as a thick line that represents surface patches that occlude second bounce light. Likewise, a back depth peel208is shown as a thick line that represents surfaces off of which bounced light210(e.g., 2ndbounce light) may be further reflected and/or diffused in a subsequent light bounce (e.g., 3rdbounce light). As such, the colors and intensities of the back depth peel208provide color modulation data used to adjust surfaces to which the light is reflected in the subsequent light bounce. As mentioned, the back depth peel208may be derived from the rejected geometry from the front depth peel206. In other words, the back depth peel208is the backside of the occlusion surfaces included in the front depth peel206. Effectively, using the depth peels enables computation of three bounces for radiosity simultaneously in a single-pass which results in the acceleration of processing as described previously. Additional details regarding these and other aspects of techniques for single pass radiosity from depth peels are described in relation to the following procedures.

Consider now the following discussion of example flow diagrams that describe techniques for single pass radiosity from depth peels that can be implemented in accordance with one or more embodiments. The example procedure(s) depicted can be implemented in connection with any suitable hardware, software, firmware, or combination thereof. In at least some embodiments, the methods can be implemented by way of a suitability configured computing device, such as the example computing device102ofFIG. 1that includes or otherwise makes use of a radiosity module128.

In particular,FIG. 3depicts an example procedure300in which radiosity is computed using depth peels. Geometry for a frame is rendered (block302). For example, a GPU124of a computing device102may be used to process frames for a gaming application, a video playback, or other graphics presentation. In at least some embodiments, the GPU124may implement deferred rendering techniques. In deferred rendering, geometry data and lighting data for a frame are rendered into separate buffers that are then combined to produce a composite result. In this approach, geometry rendering is decoupled from the illumination for the frame. Other rendering techniques may also be employed. A deferred buffer may include information regarding initial colors, normal directions, and z-depths of pixels in the frame. Illumination may then be applied to compute output colors for the pixels based on one or more light sources defined for the scene/frame.

Radiosity contributions for each light source in the frame are computed using depth peels (block304). In accordance with techniques described herein, the illumination may encompass computation of radiosity effects that are determined using depth peels to account for indirect bounced light. In particular, the depth peels may be employed to compute three light bounces for radiosity in a single pass. The depth peels may be configured as specialized shadow maps indicative of surface patches and properties of the rendered geometry at selected depths relative to a viewpoint (e.g., camera position) for the frame. Here, a single pass may refer to one processing pass of a pixel shader126(implemented via a GPU or otherwise) to calculate pixel coloration pixel-by-pixel (e.g., color, shading, transparency, intensity, etc. for each pixel). The radiosity computation based on depth peels produces realistic lighting simulations for computer generated graphics. The radiosity computation may also be performed real-time for frames of a graphics presentation (e.g., frame-by-frame at runtime) to account for dynamic and/or user controlled movement of objects in the graphics presentation. Thus, real-time changes in illumination for a frame relative to a previous frame due to dynamically moving objects in the frame may be reflected in graphics presentations using the described techniques.

For example, a radiosity module128may be implemented to determine a front depth peel and a back depth peel with respect to each of the one or more light sources. In some embodiments, various processing for radiosity, including determining depth peels, may be performed by a graphics processing unit (GPU) under the influence of the radiosity module128. Processing may also occur via a central processing unit (CPU) or other processing system using various hardware, software, firmware, and/or combinations thereof.

Generally, the front depth peel and the back depth peel determined with respect to a particular one of the light sources are sufficient to compute three light bounces simultaneously for radiosity associated with the particular one of the light sources. Specifically, the front depth peel represents surface patches of rendered geometry that occlude second bounce light associated with a particular light source. The corresponding back depth peel represents color and intensities for third bounce light used to adjust surface patches of the geometry to which the third bounce light is reflected. In making modifications of direct and second bounce light based on the depth peels, the back depth peel may be applied to those surface patches that are not occluded as indicated by the front depth peel. Moreover, since the back depth peel corresponds to rejected geometry of the front depth peel, processing that is already performed to compute the front depth peel may be used to obtain the back depth peel directly. Additionally, the depth peel processing may replace shadow map processing used in traditional rendering techniques and therefore the depth peel computation is effectively “free” from a processing power/processing time consumption standpoint.

Pixels are shaded in accordance with the computed radiosity contributions (block306). Then, the frame is output with shading that reflects the radiosity contributions computed using the depth peels (block308). Here, a pixel shader126may be employed to apply the radiosity contributions determined based on the depth peels to produce output colors/illumination characteristics for the frame. In the case of deferred rendering, this may involve compositing multiple different intermediate frame buffers used to separate geometry, color, and lighting data including intermediate radiosity data computed for each light bounce. The result of compositing the frame buffers is an output frame that includes photorealistic illumination effects incorporating the radiosity contributions.

As mentioned, the use of depth peels enables the radiosity processing to occur in a matter of milliseconds for each frame. The techniques may therefore be used “in-game” for output of graphics for a gaming application or otherwise be applied in real-time during output of a graphics presentation. The techniques may also be used in a development environment as part of a graphics development system to accelerate illumination design processes and enhance production of games and other CGI development.

FIG. 4depicts an example procedure400in which front and back depth peels are employed to compute radiosity for a graphics presentation. Rendering is initialized for a frame of a graphics presentation (block402). Rendering may occur in various ways as previously discussed. A front depth peel and a back depth peel are computed for geometry of the frame (block404). In one approach, geometry for the frame may be rendered to an intermediate frame buffer. The radiosity module128may operate to compute a front depth peel and back depth peel with respect to a reference point using the frame buffer that defines the geometry for a frame. Here, the reference point may be the camera position, light position, or other viewpoint for the frame. The front depth peel and back depth peel may be determined at the same time by peeling layers from opposite directions relative to the reference point simultaneously. This provides a shadow map as the front depth peel that indicates surface patches acting as occluders for direct and secondary light. This also provides as the back depth peel a shadow map that indicates colors and intensities for light that bounces off of surface patches (e.g., those surface patches that are not occluded by the front depth peel occluder surfaces). The derived depth peels may be stored in one or more buffers and used for subsequent radiosity computations.

Direct lighting is generated for the frame (block406). Direct lighting is applied according to one or more direct light sources defined in the scene. The contribution of direct light to coloration/illumination for illuminated patches in the frame may be generated using existing techniques.

The direct lighting for the frame is then modified to account for radiosity effects determined using depth peels (block408). As represented inFIG. 4, this may involve applying the pre-computed depth peels to determine how to modulate and/or attenuate colors, shading, intensity, transparency, and/or illumination characteristics of pixels as indicated as a result of the direct lighting. In particular, the front depth peel is applied to occlude diffuse light for second bounce lighting (block410) and the back depth peel is utilized to modulate color of surfaces for third bounce light that is not occluded according to the front depth peel (block412). Here, the front depth peel is used to resolve which surfaces in the frame are occluded in the frame and which surfaces are affected by bounced light. The back depth peel is then employed to adjust the appropriate surfaces (e.g., the non-occluded surfaces to which light is reflected) in accordance with the colors and intensities indicated by the back depth peel. The computation as just described may be conducted with respect to one or more light sources and/or for multiple bounces. In some case, each surface patch/pixel defined by the intermediate frame buffer that is visible with respect to a selected reference point (e.g., selected camera position or light source) is used as a possible light source for reflected/diffuse lighting with respect to the reference point. Radiosity contributions computed for multiple reference points/light sources may be combined to ascertain overall radiosity effects for each relevant surface patch. Pixel illumination characteristics obtained based on direct lighting are then modified to produce illumination for the output frame that incorporates radiosity effects derived using depth peels.

Having considered example details of single pass radiosity from depth peels, consider a discussion of an example system in accordance with one or more embodiments.

Example System

FIG. 5illustrates an example system500that includes an example computing device502that is representative of one or more computing systems and/or devices that may implement the various techniques described herein. The computing device502may be, for example, a server of a service provider, a device associated with a client (e.g., a client device), an on-chip system, and/or any other suitable computing device or computing system.

Combinations of the foregoing may also be employed to implement various techniques and modules described herein. Accordingly, software, hardware, or program modules including the operating system108, applications110, radiosity module128, and other program modules may be implemented as one or more instructions and/or logic embodied on some form of computer-readable storage media and/or by one or more hardware elements510. The computing device502may be configured to implement particular instructions and/or functions corresponding to the software and/or hardware modules. Accordingly, implementation of modules as a module that is executable by the computing device502as software may be achieved at least partially in hardware, e.g., through use of computer-readable storage media and/or hardware elements510of the processing system. The instructions and/or functions may be executable/operable by one or more articles of manufacture (for example, one or more computing devices502and/or processing systems504) to implement techniques, modules, and examples described herein.

In various implementations, the computing device502may assume a variety of different configurations, such as for computer514, mobile516, and television518uses. Each of these configurations includes devices that may have generally different constructs and capabilities, and thus the computing device502may be configured according to one or more of the different device classes. For instance, the computing device502may be implemented as the computer514class of a device that includes a personal computer, desktop computer, a multi-screen computer, laptop computer, netbook, and so on.

The computing device502may also be implemented as the mobile516class of device that includes mobile devices, such as a mobile phone, portable music player, portable gaming device, a tablet computer, a multi-screen computer, and so on. The computing device502may also be implemented as the television518class of device that includes devices having or connected to generally larger screens in casual viewing environments. These devices include televisions, set-top boxes, gaming consoles, and so on.

The techniques described herein may be supported by these various configurations of the computing device502and are not limited to the specific examples of the techniques described herein. This is illustrated through inclusion of the radiosity module128on the computing device502. The functionality represented by the radiosity module128and other modules/applications may also be implemented all or in part through use of a distributed system, such as over a “cloud”520via a platform522as described below.

The cloud520includes and/or is representative of a platform522for resources524. The platform522abstracts underlying functionality of hardware (e.g., servers) and software resources of the cloud520. The resources524may include applications and/or data that can be utilized while computer processing is executed on servers that are remote from the computing device502. Resources524can also include services provided over the Internet and/or through a subscriber network, such as a cellular or Wi-Fi network.

The platform522may abstract resources and functions to connect the computing device502with other computing devices. The platform522may also serve to abstract scaling of resources to provide a corresponding level of scale to encountered demand for the resources524that are implemented via the platform522. Accordingly, in an interconnected device embodiment, implementation of functionality described herein may be distributed throughout the system500. For example, the functionality may be implemented in part on the computing device502as well as via the platform522that abstracts the functionality of the cloud520.

CONCLUSION