Hybrid ray tracking method for modeling light reflections
By adopting a hybrid ray tracing method in a three-dimensional computer graphics environment and combining screen space reflection technology, the problem of inaccurate reflection surface drawing in the prior art is solved, and efficient and accurate reflection surface drawing and real-time ray tracing are achieved.
Patent Information
- Application Number
- CN202510095248.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2018-02-22
- Filing Date
- 2019-02-12
- Publication Date
- 2025-04-29
AI Technical Summary
In a three-dimensional computer graphics environment, existing screen space reflection (SSR) technology is difficult to accurately draw reflective surfaces, often resulting in anomalies, artifacts, and omissions.
The hybrid ray tracing method is adopted, combined with screen space reflection technology, to accelerate ray tracing by selecting most directions on the mirror surface and tracking only some rays when necessary to improve efficiency.
Improves the drawing accuracy of the reflective surface, reduces the occurrence of abnormalities and artifacts, while reducing computational costs and resource consumption, real-time ray tracing without reducing frame rates.
Smart Images

Figure CN119904565A_ABST
Abstract
Description
[0001] Related Applications
[0002] This application is a divisional application of the invention patent application with application number 201980014549.7 and invention name “Hybrid ray tracing method for modeling light reflection”. Technical Field
[0003] The present application relates to computationally efficient methods for rendering reflections in three-dimensional computer graphics environments. Background Art
[0004] In three-dimensional ("3D") computer graphics environments, accurate rendering of reflective surfaces is highly desirable in creating immersive, convincing experiences. For example, a reflective surface in an environment (e.g., a smooth, reflective floor or wall) ideally reflects other objects in the environment, after taking into account all relevant factors, such as the position of the light source, the shape and position of the object relative to the surface, and the position of the virtual camera.
[0005] Over the years, various techniques have been developed to model light reflections. One of the most widely used techniques is "screen space reflections" or "SSR". As the name implies, screen space reflections is a technique that reuses screen space data to calculate reflections. However, because the SSR technique is limited to using screen space data, it can produce a large number of anomalies, artifacts, and / or omissions. For example, if the data for drawing accurate reflections does not exist in screen space, the SSR technique will fail and will not provide correctly drawn pixel data for the reflective surface. Therefore, there is a need for improved techniques for drawing reflections in 3D computer graphics environments. Summary of the invention
[0006] This Summary is provided to introduce some concepts in a simplified form, which are further described in the Detailed Description below. This Summary is neither intended to identify key features or essential features of the claimed subject matter nor to be used to limit the scope of the claimed subject matter.
[0007] Among the various embodiments disclosed herein are example methods for using real-time ray tracing in a hybrid manner with screen space reflections ("SSR"). In some implementations, the two methods are combined in the process of deciding whether to use SSR or ray tracing for a given pixel during the preliminary analysis (pre-pass) of the pixels to be drawn.
[0008] Other implementations involve optimization techniques that speed up ray tracing with little quality loss by selecting majority directions on specular surfaces. Still further, some techniques involve speeding up ray tracing by tracing only a portion of the rays and using those rays (or interpolated or filtered versions of those rays) for neighboring pixels.
[0009] In one example embodiment, for example, a list of reflection ray origins and directions is generated for a frame. Then, for a selected pixel with a reflection ray: (a) determine whether the reflection ray for the selected pixel is reflected back to the virtual camera position of the frame; (b) if it is determined that the reflection ray is reflected back to the virtual camera position of the frame, perform a ray tracing technique to generate a resulting pixel value for the reflection ray; (c) if it is determined that the selected reflection ray is not reflected back to the virtual camera position of the frame, perform a screen space reflection technique to generate a resulting pixel value for the reflection ray. The resulting pixel value can then be used to draw the frame.
[0010] In addition, in some implementations, the method also includes: if the screen space reflection technique fails, performing a ray tracing technique on the reflected ray. In another implementation, the determination of whether the reflected ray is reflected back to the virtual camera position of the frame includes: calculating a dot product; and evaluating whether the resulting scalar value from the dot product is positive or negative. The dot product can be, for example, the dot product of a view vector for a selected pixel and a reflection vector for a selected pixel. In other implementations, the determination of whether the reflected ray is reflected back to the virtual camera position of the frame is performed by: calculating line segment endpoints, the line segment endpoints including the origin of the reflected ray and a point along the direction of the reflected ray; transforming the line segment endpoints into the projection camera space; constructing the reflected ray in the projection space from the line segment endpoints by subtracting them from each other; and determining that the direction of the reflected ray in the projection space faces the virtual camera, and thereby determining that the original reflected ray is reflected toward the virtual camera. In some example implementations, the reflected ray is determined to be reflected back to a virtual camera position of the frame, and the ray tracing technique further includes: (a) using a reduced resolution image of the frame for the ray tracing technique; or (b) selecting a representative normal for a group of pixel values adjacent to the selected pixel.
[0011] In another example technique disclosed herein, a rendering technique is adaptively selected from a plurality of available rendering techniques for use in rendering pixel values representing reflections in a computer-generated environment. In this embodiment, the plurality of available rendering techniques include a ray tracing technique. In some example implementations, the plurality of available rendering techniques also include a screen space reflection technique. The pixel values are then calculated using the selected technique, and the pixel values may be buffered in a hardware buffer.
[0012] In some example implementations, adaptively selecting a rendering technique includes: determining whether a reflected ray from a pixel position is reflected toward a virtual camera position of a computer-generated environment; and selecting a rendering technique based at least in part on the determination of whether the reflected ray from the pixel position is reflected toward the virtual camera position of the computer-generated environment. In other example implementations, adaptively selecting a rendering technique includes: determining whether a reflected ray from a pixel position is reflected toward a virtual camera position of a computer-generated environment; if the reflected ray is reflected toward the virtual camera position, selecting a ray tracing technique; and if the reflected ray is not reflected toward the virtual camera, selecting a second technique other than the ray tracing technique (e.g., a screen space reflection technique). Furthermore, in some example implementations, when using a screen space reflection technique, the method further includes: determining that the screen space reflection technique fails for the reflected ray; and performing a ray tracing technique for the reflected ray for which the screen space reflection technique fails.
[0013] In another example embodiment, a technique is selected from among a plurality of available techniques for drawing pixel values in a frame of a computer-generated environment. In this embodiment, the pixel values depict reflected rays in the frame of the computer-generated environment. Further, in this embodiment, the plurality of available techniques for drawing pixel values include ray tracing techniques and screen space reflection techniques. The pixel values are then calculated using the selected technique, and the frame is drawn using the calculated pixel values.
[0014] In some example implementations, the method further includes using a reduced resolution image of the frame for a ray tracing technique (e.g., a reduced resolution image of one quarter or other reduced resolution for pixel values). In other example implementations, the method further includes selecting a representative normal for a group of pixel values adjacent to the pixel value. In some cases, the representative normal is selected only after determining that the pixel value has a normal within a threshold percentage or distance of the group of pixel values.
[0015] The innovations described herein may be implemented as part of a method, as part of a computer system configured to perform the method, or as part of a tangible computer-readable medium storing computer-executable instructions for causing a computer system to perform the method when programmed by the method. The various innovations may be used in combination or separately. The foregoing and other objects, features and advantages of the present invention will become more apparent from the following detailed description with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The patent or application file contains at least one drawing drawn in color. Copies of this patent or patent application publication with color drawing(s) will be provided by the Office upon request and payment of the necessary fee.
[0017] Figure 1is a diagram illustrating an example computer system in which one or more of the methods described herein may be implemented.
[0018] Figure 2 is a diagram illustrating an example of ray tracing in a 3D computer graphics environment.
[0019] Figure 3 It is shown Figure 2 A diagram of an example of a bounding volume hierarchy (“BVH”) for a geometric object in an environment of FIG.
[0020] Figure 4 is a screenshot of a three-dimensional computer environment viewed from the origin of a first-person virtual camera.
[0021] Figure 5 is a screenshot of utilizing ray tracing techniques to supplement SSR techniques according to an embodiment of the disclosed technology.
[0022] Figure 6 is a screenshot of another three-dimensional computer environment viewed from a first-person perspective.
[0023] Figure 7 is a screenshot of utilizing ray tracing techniques to supplement SSR techniques according to an embodiment of the disclosed technology.
[0024] Figure 8 is a flow chart of an example embodiment for performing a blending technique for rendering pixels representing a reflective surface in accordance with an embodiment of the disclosed technology.
[0025] Fig. 9 Example code showing a process for determining whether a reflected ray is reflected back to the virtual camera origin of a frame.
[0026] Fig.10 is a flow chart of an example embodiment for performing a blending technique for rendering pixels representing a reflective surface in accordance with an embodiment of the disclosed technology.
[0027] Fig.11 is a flow chart of an example embodiment for performing a blending technique for rendering pixels representing a reflective surface in accordance with an embodiment of the disclosed technology. DETAILED DESCRIPTION
[0028] I. General considerations
[0029] Representative embodiments of methods, devices, and systems for drawing reflections in a three-dimensional computer graphics environment are disclosed herein. The disclosed methods, devices, and systems should not be construed as limiting in any way. On the contrary, the present disclosure relates to all novel and non-obvious features and aspects of the various disclosed embodiments, either alone or in various combinations and sub-combinations with each other. In addition, any features or aspects of the disclosed embodiments may be used with each other in various combinations and sub-combinations. For example, one or more method actions or features from one embodiment may be used together with one or more method actions or features from another embodiment, and vice versa. The disclosed methods, devices, and systems are not limited to any particular aspect or feature or combination thereof, nor do the disclosed embodiments require the presence of any one or more specific advantages or solutions to problems.
[0030] Although the operations of some methods in the disclosed methods are described in a specific sequential order for convenience of presentation, it should be understood that this description covers rearrangement unless the specific language set forth below requires a specific order. For example, in some cases, the operations described sequentially can be rearranged or performed simultaneously. In addition, for simplicity, the accompanying drawings may not show the various ways in which the disclosed methods can be used in combination with other methods. In addition, the description sometimes uses terms such as "determine" and "generate" to describe the disclosed tools and techniques. These terms are high-level abstractions of the actual operations performed. The actual operations corresponding to these terms can vary according to the specific implementation, and can be easily distinguished by those skilled in the art. In addition, as used herein, the term "and / or" refers to any one or any combination of terms in the phrase.
[0031] As used herein, the term "ray tracing" encompasses ray tracing operations for rendering in a 3D computer graphics environment or for special effects. The term "ray tracing" also encompasses other types of applications, such as ray tracing for collision detection in a physics simulation environment, visibility checking in a model of a real-world scene, ray tracing in a sound environment to model acoustic phenomena, or ray tracing in another computer-represented environment. A computer-represented environment may represent a real-world scene (e.g., constructed from imaging / scanning of a real-world scene), a synthetic virtual scene (e.g., constructed entirely by graphics processing tools, or created for virtual reality applications), or a hybrid scene that blends the results of imaging / scanning of a real-world scene with computer-generated content (e.g., constructed for augmented reality applications).
[0032] Although the operations described herein are described in some places as being performed by the GPU architecture of a graphics card for a game console, head-mounted display, or desktop computer system, in many cases, the operations may be performed by another type of architecture (e.g., a multi-core CPU architecture) and / or other types of computer systems (e.g., smart phones, tablet computers). More generally, various alternatives to the examples described herein are possible. For example, certain techniques described with reference to the flowcharts may be changed by changing the order of the stages shown in the flowcharts, by splitting, repeating, or omitting certain stages, and so on. Various aspects of the disclosed technology may be used in combination or separately. Different embodiments use one or more of the described innovations. Some of the innovations described herein solve one or more of the problems mentioned in the background technology. Typically, a given technology / tool cannot solve all such problems.
[0033] II. Example Computer System
[0034] Figure 1 A general example of a suitable computer system (100) in which some of the described innovations may be implemented is shown. The innovations described herein relate to ray tracing, which generally involves tracing a ray from a viewing point as it passes through an image and continues into a computer-represented environment. Ray tracing may involve ray ray tracing operations in a 3D computer graphics environment. Alternatively, ray tracing may be part of another type of application, such as ray tracing for collision detection of particles, objects, and the like in a physics simulation environment, ray tracing in an acoustic environment to model acoustic phenomena, ray tracing as part of visibility checking in a model of a real-world scene, or ray tracing in another computer-represented environment. Other than its use in ray tracing, the computer system (100) is not intended to imply any limitation on scope of use or functionality, as these innovations may be implemented in a variety of computer systems, including specialized computer systems suitable for graphics processing or complex environment modeling.
[0035] refer to Figure 1 , the computer system (100) includes processing units (110 ... 11x) of a central processing unit ("CPU") and local memory (118). The processing units (110 ... 11x) are, for example, processing cores on a single chip, and execute computer-executable instructions. The number of processing units (110 ... 11x) of the CPU depends on the implementation, and may be, for example, 4 or 8. The local memory (118) may be volatile memory (e.g., registers, cache, RAM), non-volatile memory (e.g., ROM, EEPROM, flash memory, etc.), or some combination of the two, accessible by the corresponding (multiple) processing units (110 ... 11x).
[0036] The computer system (100) also includes a processing unit (130 ... 13x) and a local memory (138) of a GPU. The number of processing units (130 ... 13x) of the GPU depends on the implementation. The processing unit (130 ... 13x) is, for example, a single instruction multiple data ("SIMD") unit of the GPU. The shader unit or other processing block of the GPU may include one or more SIMD units. The SIMD width n (which depends on the implementation) indicates the number of elements (sometimes called channels) of the SIMD unit. For example, for an ultra-wide SIMD architecture, the number of elements (channels) of the SIMD unit may be 16, 32, 64, or 128. Each element of the SIMD unit may be considered a separate thread of the SIMD unit. A group of n threads for a SIMD unit may also be referred to as a wave or a warp. The threads of a given SIMD unit execute the same code in lockstep on (potentially) different data. In some GPU architectures, a SIMD unit may have an additional data channel that is the same across all threads of the SIMD unit, resulting in a group of n threads plus one scalar thread for the SIMD unit (the scalar thread does not execute code like the n threads of the SIMD unit). The local memory (138) may be a volatile memory (e.g., registers, cache, RAM), a non-volatile memory (e.g., ROM, EEPROM, flash memory, etc.), or some combination of the two accessible by the corresponding (multiple) processing units (130...13x). The local memory (138) stores software (180) for implementing one or more innovations of the disclosed hybrid ray tracing technique.
[0037] The computer system (100) includes a shared memory (120), which may be a volatile memory (e.g., registers, cache, RAM), a non-volatile memory (e.g., ROM, EEPROM, flash memory, etc.), or some combination of the two accessible by the processing unit(s) (110 ... 11x) of the CPU and the processing units (130 ... 13x) of the GPU. The memory (120) stores software (180) in the form of computer executable instructions for implementing one or more innovations of the hybrid ray tracing technique as disclosed herein, at least for high-level control of operations performed by threads of the processing units (130 ... 13x). In a GPU, a thread (also referred to as an execution thread or thread of execution) typically executes a series of computer executable instructions and may have data (e.g., defined state) associated with it in a local memory (138) and / or in the shared memory (120). Threads also execute on the processing units (110 ... 11x) of the CPU, where such threads generally include a series of computer-executable instructions and may have data (eg, defined state) associated therewith in local memory (118) and / or shared memory (120).
[0038] Alternatively, the processing unit may be a processor in an application specific integrated circuit ("ASIC") or any other type of processor. The processing unit(s) (110...11x, 130...13x) may be part of a system on a chip ("SoC").
[0039] The computer system (100) includes one or more network interface devices (140). The network interface device(s) (140) enable communication with another computing entity (e.g., a server, other computer system) over a network. The network interface device(s) (140) may support wired and / or wireless connections for a wide area network, a local area network, a personal area network, or other network. For example, the network interface device(s) may include one or more Wi-Fi transceivers, Ethernet ports, cellular transceivers, and / or another type of network interface device, and associated drivers, software, etc. The network interface device(s) (140) transmit information such as computer executable instructions, audio or video input or output, or other data in a modulated data signal over the network connection(s) via a network connection. A modulated data signal is a signal in which one or more of the characteristics of the signal are set or changed in a manner that enables information to be encoded in the signal. By way of example and not limitation, the network connection may use electrical, optical, RF, or other carriers.
[0040] The camera input (eg, microphone / camera input 150) accepts video input in analog or digital form from a video camera that captures natural video. The audio input accepts audio input in analog or digital form from a microphone (eg, microphone / camera input 150) that captures audio.
[0041] The computer system (100) optionally includes a motion sensor / tracker input (152) for a motion sensor / tracker that can track the motion of a user and objects around the user. For example, the motion sensor / tracker allows a user (e.g., a game player) to interact with the computer system (100) through a natural user interface using gestures and voice commands. The motion sensor / tracker may include gesture recognition, facial recognition, and / or voice recognition.
[0042] The game controller input (154) receives control signals from one or more game controllers via a wired or wireless connection. The control signals may indicate user input from one or more directional pads, buttons, triggers, and / or one or more joysticks of the game controller. The control signals may also indicate user input from a touch pad or touch screen, a gyroscope, an accelerometer, an angular rate sensor, a magnetometer, and / or other controls or instruments of the game controller.
[0043] The computer system (100) optionally includes a media player (156) and a video input (158). The media player (156) can play DVDs, Blu-ray discs, other disk media, and / or other formats of media. The video input (158) can accept input video in analog or digital form (e.g., from a cable input, HDMI input, or other input).
[0044] The video output (e.g., audio / video output 160) provides video output to a display device. The video output (e.g., audio / video output 160) can be an HDMI output or other type of output. The audio output (e.g., audio / video output 160) provides audio output to one or more speakers.
[0045] The storage (170) may be removable or non-removable and include magnetic media (such as a disk, tape, or cassette), optical media, and / or any other media that can be used to store information and can be accessed within the computer system (100). The storage (170) stores instructions for software (180) that implement one or more innovations of the hybrid ray tracing techniques disclosed herein. The computer system (100) may have additional features. For example, the computer system (100) includes one or more other input devices and / or one or more other output devices. The other (multiple) input device(s) may be a touch input device such as a keyboard, a mouse, a pen or trackball, a scanning device, or another device that provides input to the computer system (100). The other (multiple) output device(s) may be a printer, a CD burner, or another device that provides output from the computer system (100).
[0046] An interconnection mechanism (not shown) such as a bus, controller, or network interconnects the components of the computer system (100). Typically, operating system software (not shown) provides an operating environment for other software executed in the computer system (100) and coordinates the activities of the components of the computer system (100).
[0047] The innovations may be described in the general context of computer-readable media. Computer-readable media is any available tangible media that can be accessed within a computing environment. By way of example and not limitation, for computer system (100), computer-readable media includes memory (118, 120, 138), storage (170), and combinations thereof. The term computer-readable media does not include transient propagating signals or carrier waves.
[0048] Innovation can be described in the general context of computer executable instructions, which are executed in a computer system on a target real or virtual processor, such as those included in a program module. Typically, a program module includes routines, programs, libraries, objects, classes, components, data structures, etc. that perform specific tasks or implement specific abstract data types. In various embodiments, the functions of a program module can be combined or split between program modules as needed. Computer executable instructions for program modules can be executed in a local or distributed computing system. Some code listings shown herein include instructions for a high-level shader language ("HLSL"). The HLSL code in the code listing can be compiled to run in a thread of a processing unit (e.g., a SIMD unit of a GPU). Alternatively, the method shown herein can be implemented in another programming language.
[0049] The terms "system" and "device" are used interchangeably herein. Unless the context clearly indicates otherwise, neither term implies any limitation on the type of computer system or device. In general, a computer system or device may be local or distributed and may include any combination of dedicated hardware and / or hardware and software that implements the functionality described herein.
[0050] For convenience of presentation, the detailed description uses terms such as "determining," "receiving," and "providing" to describe computer operations in a computing system. These terms represent operations performed by a computer and should not be confused with actions performed by a human. The actual computer operations corresponding to these terms vary depending on the implementation.
[0051] III. Ray Tracing Overview
[0052] In a three-dimensional ("3D") computer graphics environment, ray tracing may be used to generate an image from the perspective of a virtual camera or other viewpoint. An image includes a plurality of picture elements ("pixels") through which rays from a viewpoint pass and continue into the 3D computer graphics environment. For a given pixel, the path of a ray (primary ray) passing through the pixel from a viewpoint (e.g., a virtual camera) is traced until it intersects an object in the environment. The surface of the object may have a color associated with it at the intersection point, and may have values indicating albedo (reflectivity), scattering, refraction, diffusion, or other material properties. Such values may be interpolated, for example, between the values of the attributes of the object's vertices. At the intersection point, depending on the surface of the object, the ray may be reflected or refracted within the environment, or a scattered ray may be generated to simulate optical effects such as reflection, refraction / translucency, scattering, and dispersion. The angle of the surface at the intersection point may be determined by interpolating between the norms of the object's vertices, or the angle of the surface at the intersection point may be estimated as the angle of the object's facial plane.
[0053] Shadow rays may be generated in the direction of the light source to simulate optical effects such as shadows from the light source (blocking light from the light source). Such newly generated rays (secondary rays) are similarly traced in the environment, and other rays (tertiary rays) may be generated, and so on. Successive rays may be generated, for example, until a threshold number of levels is reached or a threshold distance is passed.
[0054] Ultimately, the value of a given pixel depends on the color of the surface of the object at the intersection point and the results reported from the secondary ray, which in turn can depend on the results reported from the tertiary ray, and so on, in order to simulate shadows, reflected light, refracted light, and other effects at the intersection point. Thus, in addition to the color of the surface at the intersection point, the value of a given pixel can also depend on the material properties of the object at the intersection point and the incident light.
[0055] By focusing on rays that reach a viewpoint (e.g., a virtual camera), ray tracing is much simpler than tracing the paths of light rays from (multiple) light sources in the environment in order to find out which rays reach the viewpoint. Even so, ray tracing is computationally intensive. An image can include hundreds of thousands of pixels, or even millions of pixels. Images can be drawn at rates of 30 frames per second or more. Typically, for each pixel, a ray passing through the pixel is tested to see if it intersects with some subset of objects in the environment. The environment can include many complex objects, which can change dynamically between images.
[0056] To simplify the representation of objects in the environment, complex objects can be represented by simpler geometric objects (such as triangles). For example, the surface of an object can be represented as a set of triangles that fit to the surface. In addition to having vertices and / or edges that define its shape and position in the environment, a given triangle can also have associated colors and material properties (or have colors and material properties associated with the vertices of a given triangle for interpolation of intersection points within a given triangle). Any surface can be approximated by a set of triangles. To approximate curves or complex shapes, successively smaller triangles can be used to provide finer details.
[0057] Although geometric objects such as triangles provide a convenient method for representing complex objects in an environment, the resulting representation may include a very large number of geometric objects. For example, a scene may include hundreds of thousands or even millions of geometric objects. These geometric objects can be enclosed in continuously larger groups, which are represented by a bounding volume hierarchy ("BVH"). The BVH is a tree structure. The geometric objects in the environment are wrapped in bounding volumes. The bounding volume encloses the geometric objects of the leaf nodes of the tree of the BVH. The leaf nodes are grouped into small sets, which generally correspond to adjacent areas of the environment. Non-leaf nodes (also called internal nodes) enclose a small set of leaf nodes. Furthermore, the set of non-leaf (internal) nodes is recursively enclosed in continuously larger bounding volumes for shallower non-leaf (internal) nodes until the "root" node of the BVH encloses all non-leaf (internal) nodes and leaf nodes. The BVH may be organized as a binary tree (where each non-leaf node has two child nodes), a quadtree (where each non-leaf node has four child nodes), an octree (where each non-leaf node has eight child nodes), or in other ways.
[0058] To test the intersection of a ray with a geometric object in a 3D computer graphics environment, the ray can be tested against the BVH. If there is an intersection between the ray and the bounding volume for the root node, the ray can be tested against the bounding volume of the corresponding child node of the root node, and so on. In this way, the ray can be tested against continuously smaller closed bounding volumes. If the shape of the bounding volume is a sphere or a box, the test for the intersection between the ray and the bounding volume is relatively simple. When there is an intersection between the ray and the bounding volume of a leaf node, the ray can be tested for intersection with the geometric object (e.g., a triangle) enclosed by the bounding volume of the leaf node. This is an example of a ray-triangle intersection test.
[0059] At any stage, if the ray does not intersect with a given bounding volume, then additional testing for bounding volumes (and geometric objects) within the given bounding volume can be skipped. In other words, if the bounding volume for the parent node of a child node is not intersected, then the bounding volume for the child node does not need to be evaluated. Similarly, if the bounding volume for a leaf node is not intersected, then the geometric objects (such as triangles) in the leaf node do not need to be evaluated.
[0060] Ray-triangle intersection testing is used when testing the intersection of a ray with one or more triangles. There are many different ways to perform ray-triangle testing in various application areas. Ray-triangle intersection testing is commonly used in computer graphics. In addition, ray-triangle intersection testing is widely used in scene modeling, physical simulation, collision detection, visibility checking, and various real-time processing scenarios. In some previous methods, for example, given the vertices and / or edges of a triangle, the ray-triangle test determines whether a given ray intersects with the triangle. The ray has an origin and a direction. The ray-triangle intersection test can find the distance from the ray origin to the intersection point, and whether the intersection point is within the triangle defined by the vertices / edges. Although attempts have been made to reduce the complexity of ray-triangle intersection testing in previous methods, ray-triangle intersection testing is still a very computationally intensive process.
[0061] Figure 2 An example of ray tracing in a 3D computer graphics environment (200) is shown. Ray tracing generates an image (220) from the perspective of a virtual camera (210), which represents a viewpoint. Rays (230 ... 23x) from the virtual camera (210) pass through pixels of the image (220) into the environment. The environment includes geometric objects (240) that are located at Figure 2 The triangles are fitted to the surfaces of more complex shapes in the environment. For illustration, Figure 2A very small image (220) and a few geometric objects (240) are shown. In practice, an image may include hundreds of thousands or even millions of pixels, and an environment may include hundreds of thousands or even millions of geometric objects (240).
[0062] Rays (230 ... 23x) from the virtual camera (210) (also called view rays or camera rays) are examples of principal rays. For a given pixel of the image (220), the path of the principal ray (230 ... 23x) through the pixel is traced until it intersects one of the geometric objects (240) in the environment. Figure 2 In , if each of the rays (230 . . . 23x) intersects one of the geometric objects (240), then the ray ends at the intersection point. Figure 2 , one of the principal rays (230) does not intersect any of the geometric objects (240). A given ray can potentially intersect multiple geometric objects (240), as shown by one of the rays (23x), where multiple intersections are marked with an x. In this case, the intersection closest to the virtual camera (210) is considered the intersection of the principal ray (23x).
[0063] Each of the geometric objects (240) has vertices and / or edges that define its shape and position in the environment. In addition, the surface of each of the geometric objects (240) can have a color associated with it, as well as values indicating albedo (reflectivity), scattering, refraction, diffusion, or other material properties (or, the vertices of the geometric objects (240) can have associated colors and material properties for interpolation at intersection points within the geometric objects (240)). At the intersection point, depending on the surface of the geometric object (240) at the intersection point, the rays (230...23x) can be reflected or refracted within the environment, or diffuse rays can be generated to simulate optical effects such as reflection, refraction / translucency, scattering, and dispersion. In addition, for each light source, shadow rays can be generated from the intersection point in the direction of the light source to simulate optical effects such as shadows from the light source (i.e., blocking light from the light source).
[0064] Reflected rays, refracted rays, diffuse rays, and shadow rays originating from the intersection point of the main ray (230 ... 23x) are examples of secondary rays. Such secondary rays are similarly tracked in the environment, and other rays (tertiary rays) can be generated, and so on. Continuous rays can be generated, for example, until a threshold level is reached or a threshold distance is passed. Ultimately, for a given pixel of the image (220), the value of the given pixel depends on the color of the surface of the object (240) at the intersection point, and the results reported back from the secondary rays, which in turn can depend on the results reported back from the tertiary rays, and so on. In this way, ray tracing can simulate shadows, reflected light, refracted light, and other effects at the intersection point for the main ray (230 ... 23x). Therefore, in addition to the color of the surface at the intersection point for the main ray (230 ... 23x), the value of a given pixel of the image (220) can also depend on the material properties of the object at the intersection point for the main ray (230 ... 23x) and the incident light.
[0065] Although geometric objects (240) such as triangles provide a convenient method for representing complex objects in an environment, the resulting representation may include a very large number of geometric objects (240). In order to organize the geometric objects (240) and simplify the process of finding intersection points for rays, the geometric objects (240) can be enclosed in successively larger groups, which are represented as a bounding volume hierarchy ("BVH").
[0066] Figure 3 Shown for Figure 2 An example of a BVH of geometric objects in an environment (300). The BVH (300) is structured as a tree. For a leaf node (390) of the BVH (300), a subset of the geometric objects (240) in the environment is enclosed in a bounding volume. The bounding volume is typically a sphere (i.e., a parametric sphere) or a box (i.e., a rectangular prism or a cube). For example, the bounding volume is an axis-aligned bounding box. In Figure 3 In the BVH (300) of FIG. 300, the bounding volume is a bounding box. In general, the bounding volume for a leaf node of the BVH (300) encloses all geometric objects in the geometric objects (240) of the environment.
[0067] Leaf nodes are grouped into small sets that typically correspond to adjacent areas of the environment. Non-leaf nodes (380), which may also be referred to as internal nodes, have a bounding volume that surrounds a small set of leaf nodes that are sub-leaf nodes of the non-leaf nodes (380). At the level of the BVH (300) above the leaf nodes, the non-leaf nodes have a bounding volume that collectively surrounds all leaf nodes in the leaf nodes. Recursively, the set of non-leaf nodes at a given level is then enclosed in a continuously larger bounding volume through non-leaf nodes of arbitrary depth. Ultimately, the root node (310) of the BVH (300) surrounds all non-leaf nodes and leaf nodes of the BVH (300).
[0068] like Figure 3 As shown, non-leaf nodes (310, 380) have a bounding volume that surrounds the child nodes of the non-leaf nodes. Figure 3 , the root node (310) has non-leaf nodes (320 ... 32n) for the first child to the nth child. Typically, each non-leaf node (310, 380) has any number of child nodes (e.g., 2, 4, 8). Typically, each non-leaf node of the BVH (300) has the same number of sub-leaf nodes. Thus, the BVH (300) can be organized as a binary tree (where each non-leaf node has two child nodes), a quadtree (where each non-leaf node has four child nodes), an octree (where each non-leaf node has eight child nodes), or organized in other ways.
[0069] IV. Example hybrid approach for modeling light reflections
[0070] As mentioned above, one of the most widely used techniques for modeling light reflections is called "screen space reflections" or "SSR". As the name suggests, screen space reflections is a technique that reuses screen space data to calculate reflections. However, because the SSR technique is limited to using screen space data, it can produce a lot of anomalies, artifacts, and / or omissions.
[0071] Figure 4 and Figure 6 are screen shots (400) and (600) showing screens drawn using only SSR. Figure 5 and Figure 7 are screen shots (500) and (700) showing screens rendered using SSR supplemented with ray tracing in accordance with an embodiment of the disclosed technology.
[0072] In particular, Figure 4is a screenshot (400) of a three-dimensional computer environment viewed from the origin of a first-person camera. In this image, rendering of light reflections is performed using only SSR techniques. Some notable artifacts appear in screenshot (400). For example, as shown at (410), because the SSR technique does not allow reflections of objects out of screen space, the reflections at the top of the drapery are cut off prematurely. This results in unrealistic aberrations of the modeled environment and makes the reflected portions completely incomplete. In addition, as shown at (412), the reflections of the hanging lanterns include large blacked-out portions that do not accurately represent the reflected light that actually exists in a real, realistic environment.
[0073] Figure 5 is a screenshot of a ray tracing technique used to supplement the SSR technique according to an embodiment of the disclosed technology. For example, as shown at (510), the reflection of the top of the drapery that was previously cut off is now completed using the reflection of the top of the drapery generated by the ray tracing technique. In addition, as shown at (512), the reflection of the hanging lantern now no longer includes Figure 4 Instead of blacking out the parts of the image, you fill in the pixels that will actually be reflected.
[0074] Figure 6 is a screenshot (600) of another three-dimensional computer environment viewed from a first-person perspective. In this image, the rendering of light reflections is performed using only SSR techniques. Some noticeable artifacts appear in screenshot 600. For example, as shown at (610), the reflections of the hanging lanterns include large blacked-out portions that do not accurately represent the reflected light that actually exists in a real, realistic environment.
[0075] Figure 7 is a screenshot of a ray tracing technique used to supplement SSR techniques according to an embodiment of the disclosed technology. For example, as shown at (710), the reflection of the hanging lantern now no longer includes Figure 4 Instead of blacking out the parts of the image, you fill in the pixels that will actually be reflected.
[0076] Figure 8 is a flow chart (800) of an example technique for performing a hybrid ray tracing technique according to the disclosed technology. The technique (800) may be performed, for example, by one or more processing units of a computer system implementing a graphics tool or other ray tracing tool. In some example implementations, the processing unit is a shader unit or other processing block of a GPU. Alternatively, the processing unit may be a processor core of one or more CPUs. In addition to presenting a new method for drawing reflections, Figure 8The example techniques also provide a number of technical advantages. For example, the example techniques improve the capabilities of the computer itself by providing a hybrid approach that not only improves the accuracy of the resulting image, but also improves the computational, power, and / or memory efficiency of the rendering process by balancing the computationally intensive ray tracing process with less taxing techniques (e.g., SSR techniques). In addition, because Figure 8 The technique allows rendering of an image to be performed faster than using ray tracing alone, which helps enable real-time ray tracing with little or no reduction in the desired frame rate (e.g., 30 frames per second).
[0077] At (810), a list of reflected ray origins and directions is generated. In some examples, the reflected ray origin is represented as three values that can be normalized and referred to as O (e.g., floating point Cartesian values x, V, z). In addition, the reflected ray direction can also be represented as three values that can be normalized and referred to as D (e.g., floating point Cartesian values x, V, z). The list can be generated using various techniques. For example, in an example implementation, the list is generated based on normal information (information indicating the direction of the normal from the reflective surface) and depth information (the distance from the virtual camera to the pixel) that are generally available in a game engine. For example, the normal information and depth information can be obtained from a geometry buffer that is calculated as part of drawing a frame within the game engine. It is simple to obtain the origin and direction information from the normal information and depth information. In this regard, since the geometry buffer (g buffer) contains normal and depth values at each pixel, the reflection vector origin and direction can be constructed based on this information. For example, the origin of the reflection ray in world space can be obtained by: (a) calculating the projection space homogeneous vector (e.g., p = [(X / ScreenWidthInpixels)*2-1), ((Y / ScreenHeightInPixels)*2-1), D, 1]); (b) Multiply the projection space homogeneous coordinate for the pixel by the inverse matrix of the world view projection matrix (e.g., O p ′=Inverse(WorldViewProjectionMatrix)*O p ); and (c) projecting the vector back into world space (e.g., O) by eliminating it. w =O p′.xyz / O p′.w ). As for the reflection direction of the ray, the regular reflection formula can be used. For example, as an example, let each pixel world space normal be N, and the distance from the virtual camera origin to the pixel be O wThe world space view direction of the coordinate is V; then the vector to be obtained is R=V-2*dot(V,N)*N.
[0078] It should also be noted that the list of reflection ray origins and directions is relative to the reflection ray, so pixels with non-reflective surfaces (e.g., sky or cloth or other non-reflective surfaces) are excluded from the list, further reducing the computational burden of solving the problem.
[0079] At (812), the selected reflected ray for the pixel is considered for image processing, and a determination is made as to whether the reflected ray is reflected back toward the virtual camera (but may still be reflected into the scene). The order in which the reflected rays are considered may vary depending on the implementation. For example, the reflected rays may be considered in raster order, in reverse raster order, in a weighted order based on position in the screen (e.g., weighted toward the center of the screen), or in any other order.
[0080] Several techniques can be used to determine whether a ray is reflected back to the virtual camera.
[0081] For example, for each reflected ray, a vector dot product can be used. For example, a dot product can be performed, R times V, where V is the view vector (which starts at the virtual camera origin and ends at the pixel, and can be normalized (e.g., so that its length is 1)), and where R is the reflection vector (which starts at the reflected ray origin O and has a ray direction D). In addition, the dot product can be calculated in the projected space. If the result of R times V (which is a positive scalar value or a negative scalar value) is negative, the reflected ray is not directed to the virtual camera; if the result of R times V is positive, the reflected ray is directed to the virtual camera. It should be understood that variations of the described dot product calculations may also be used. For example, as is known in the art, a half vector H may be used instead of R.
[0082] Another example implementation for determining whether a reflected ray is directed toward a virtual camera is shown as Fig. 9 900 in . In short, the code operates as follows. Given a ray with a world space origin O and a direction D, the goal is to determine whether the ray is reflected back to the virtual camera in the projected space. To do this, and in this example, the coordinates of a point along the ray that is sufficiently far from the origin (and possibly toward the virtual camera origin) are calculated. For example, the ray end E can be calculated in normalized device coordinate (NDC) space, where the ray length is long enough to extend beyond the virtual camera. For example, in the illustrated embodiment:
[0083] E=O+D*10
[0084] As mentioned above, O and E are projected into normalized device coordinate space.
[0085] Then, perform another transformation:
[0086] O′=O*WorldViewProjectionMatrix
[0087] E′=E*WorldViewProjectionMatrix
[0088] Where "WorldViewProjectionMatrix" is the matrix that moves the vertices into the world space viewed by the virtual camera. Now, the two points are in a homogenous space with the z-axis pointing away from the virtual camera. Then, subtract the z-axis coordinates of the two points from each other (starting from the Ez value) to see if the result is negative:
[0089] DeltaZ=E Z -O Z .
[0090] If DeltaZ is negative, the ray is pointing towards the virtual camera; if DeltaZ is positive, the ray is pointing away from the virtual camera. In other implementations, the equation can be reversed to give an equivalent result. Conceptually, you are determining whether the ray was reflected towards the virtual camera and whether it is possible to perform it through SSR.
[0091] At (814), if it is determined that the ray is reflected toward the virtual camera, the process proceeds to (820) where ray tracing is performed for the pixel. The ray tracing method for the pixel can be as described above, or can be any other suitable ray tracing method, such as any of the methods described in: U.S. patent application No. 15 / 818,540, entitled “RAY-TRIANGLE INTERSECTION TESTING WITH TETRAHEDRAL PLANES,” filed on November 20, 2017; U.S. patent application No. 15 / 862,521, entitled “NON-DIVERGENT PARALLEL TRAVERSAL OF A BOUNDING VOLUME HIERARCHY,” filed on January 4, 2018; and / or U.S. patent application No. 62 / 547,679, entitled “NON-DIVERGENT PARALLEL TRAVERSAL OF A BOUNDING VOLUME HIERARCHY,” filed on August 18, 2017, the entire contents of which are incorporated herein by reference.
[0092] Likewise, at (814), if it is determined that the ray is not reflected into the virtual camera, it is still possible that the ray is reflected into the scene. Therefore, the process proceeds to (816), where a screen space reflection technique is first performed on the ray.
[0093] At (816), the screen space reflection technique performed for the pixel can be any suitable screen space reflection technique. In addition, the screen space reflection technique may still fail for the pixel (e.g., because the pixel data that should be reflected extends outside of screen space). Therefore, at (818), it is determined whether the screen space reflection for the pixel is successful. If so, the process proceeds to (822), where it is determined whether there are any other pixels to be processed. If the screen space reflection technique for the pixel is not successful, ray tracing is performed for the pixel at (822). Again, the ray tracing method for the pixel can be as described above, or can be any other suitable ray tracing method, such as any of the methods described in: U.S. patent application No. 15 / 818,540, filed on November 20, 2017, entitled “RAY-TRIANGLE INTERSECTION TESTING WITH TETRAHEDRAL PLANES”; U.S. patent application No. 15 / 862,521, filed on January 4, 2018, entitled “NON-DIVERGENT PARALLEL TRAVERSAL OF A BOUNDING VOLUME HIERARCHY”; and / or U.S. patent application No. 62 / 547,679, filed on August 18, 2017, entitled “NON-DIVERGENT PARALLELTRAVERSAL OF A BOUNDING VOLUME HIERARCHY,” the entire contents of which are incorporated herein by reference.
[0094] With respect to (816) and (818), in some embodiments, the screen space reflection process proceeds along a stepping process looking for intersection points, and when the edge of screen space is reached without intersection, the process fails, resulting in the execution of a ray tracing technique (820). However, the vertex at which the screen space reflection process failed (which may be the point where the frustrum intercepts the ray) may be used as a starting point for the ray tracing technique. This allows the ray tracing technique to move faster in its processing. However, in other embodiments, the ray tracing may be restarted from the origin of the reflected ray.
[0095] After performing the ray tracing technique at (820), a determination is made at (822) to check if there is another pixel to be processed. If so, the process repeats from (810); otherwise, the process terminates. The image processing pipeline can then continue for the frame. For example, additional rendering processes can be performed to produce a final frame for the reflective surfaces in the frame, the final frame including the pixels formed by Figure 8 The final frame can then be displayed on a display device.
[0096] Figure 8 The technology of the disclosed technology may include multiple variations according to the principles of the disclosed technology. Generally, these variations are intended to increase the speed at which ray tracing is performed for an image or image portion, thereby increasing the possibility that real-time ray tracing can be performed without losing the desired frame rate.
[0097] For example, in one example embodiment, a reduced resolution image is used for ray tracing, thereby reducing the number of ray tracing operations to be performed. For example, a frame (or a portion of a frame in which ray tracing is to be performed) can be transformed into a reduced resolution frame (or a portion of a frame). For example, in some embodiments, the resolution can be reduced by 1 / 2 in the x and y axes, resulting in a total resolution reduction of 1 / 4. The resolution reduction can also be by any other factor.
[0098] After performing ray tracing for pixels on the image or image portion with reduced resolution, any suitable smoothing, blending or interpolation technique may be used to calculate pixel values for the normal resolution image. For example, in some examples, the pixel values obtained from the ray tracing of the image with reduced resolution are used for all pixels in the corresponding pixels in the image or image portion with normal resolution. In other examples, the pixel values obtained from the ray tracing of the image with reduced resolution are used as input values for smoothing, blending or interpolation filters about adjacent values. For example, the average value between the pixel value obtained from the ray tracing of the image with reduced resolution and one or more adjacent pixels may be calculated. In other examples, a bilinear interpolation filter may be applied, which includes the pixel values obtained from the ray tracing of the image with reduced resolution, and the adjacent pixels. In another example, a smoothing or interpolation filter with any number of inputs and weights may be used to derive pixel values for the image with normal resolution. In yet another example, a temporal filter is used to smooth the pixel values obtained from the ray tracing of the image with reduced resolution. For example, the temporal filter may use data from one or more previous frames for the same pixel space to calculate the current pixel value.
[0099] In further embodiments, a representative normal may be selected for a group of adjacent pixels (e.g., for 4 pixels, 16 pixels, etc.). For example, in one example implementation, when ray tracing is to be performed for a selected pixel (e.g., at (820)), a group of pixels adjacent to the selected pixel may be evaluated to see if they have normal directions similar enough to the selected pixel so that a single representative normal may be selected for the group and used for ray tracing, thereby eliminating the need to perform a separate ray tracing process for each pixel in the group. This similarity test may be performed using a number of techniques, such as evaluating whether the normal directions of the pixels in the group are within a threshold percentage (or distance) of each other (e.g., less than 2% difference, less than 5% difference, less than 10% difference, or less than n% difference, where n is a number selected to represent a desired tolerance for mirror reproduction). Additionally, in some embodiments, the depth of the group of pixels may be used to alter the threshold percentage (or distance), since pixels farther from the virtual camera will produce greater diffusion of reflected rays when their normals differ slightly. For example, the threshold percentage (or distance) may decrease as depth increases (according to a linear function or other function). Additionally, if the threshold percentage is met, the representative ray selected for the group may be any one of the normals in the group or an average of the normals in the group.
[0100] Another approach is to evaluate not only the "closeness" of the normal, but also the material properties in order to detect whether the normal meets the importance sampling criteria. For example, some material definitions use a parametric function to represent how light bounces off the material surface. With this representation, the "importance" of each incoming ray can be calculated. For example, if a material has a very strong and "narrow" shiny component (e.g., highlights on a polished metal), most of the output signal of the function is concentrated in these shiny areas. By using importance sampling, these parameters can be detected and more rays can be cast there. In other words, importance sampling can be used to detect more important rays because these rays will be determined to contribute a lot of "energy" to the output image.
[0101] Fig.10 is a flow chart (1000) of an example technique for performing a hybrid ray tracing technique according to the disclosed technology. The technique (1000) may be performed, for example, by one or more processing units of a computer system implementing a graphics tool or other ray tracing tool. In some example implementations, the processing unit is a shader unit or other processing block of a GPU. Alternatively, the processing unit may be a processor core of one or more CPUs. In addition to presenting a new method for drawing reflections, Fig.10The example techniques also provide a number of technical advantages. For example, the example techniques improve the capabilities of the computer itself by providing a hybrid approach that not only improves the accuracy of the resulting image, but also improves the computational, power, and / or memory efficiency of the rendering process by balancing the computationally intensive ray tracing process with less taxing techniques (e.g., SSR techniques). In addition, because Fig.10 The technique allows rendering of images to be performed faster than using ray tracing alone, which helps to achieve real-time ray tracing with little or no reduction in the desired frame rate (e.g., 30 frames per second).
[0102] At (1010), a rendering technique is adaptively selected from a plurality of available rendering techniques for rendering pixel values representing reflections in a computer-generated environment. In the illustrated embodiment, the plurality of available rendering techniques includes a ray tracing technique. In some example implementations, the plurality of available rendering techniques also includes a screen space reflection technique.
[0103] At (1012), pixel values are calculated using the selected technique.
[0104] At (1014), the pixel values are buffered in a hardware buffer (eg, a buffer of a GPU).
[0105] In some example implementations, adaptively selecting a rendering technique includes: determining whether a reflected ray from a pixel position is reflected toward a virtual camera position of a computer-generated environment; and selecting a rendering technique based at least in part on the determination of whether the reflected ray from the pixel position is reflected toward the virtual camera position of the computer-generated environment. In other example implementations, adaptively selecting a rendering technique includes: determining whether a reflected ray from a pixel position is reflected toward a virtual camera position of a computer-generated environment; if the reflected ray is reflected toward the virtual camera position, selecting a ray tracing technique; and if the reflected ray is not reflected toward the virtual camera, selecting a second technique other than the ray tracing technique (e.g., a screen space reflection technique). Furthermore, in some example implementations, when using a screen space reflection technique, the method further includes: determining that the screen space reflection technique fails for the reflected ray; and performing a ray tracing technique for the reflected ray for which the screen space reflection technique fails.
[0106] Fig.11is a flow chart (1100) of an example technique for performing a hybrid ray tracing technique according to the disclosed technology. The technique (1100) can be performed, for example, by one or more processing units of a computer system implementing a graphics tool or other ray tracing tool. In some example implementations, the processing unit is a shader unit or other processing block of a GPU. Alternatively, the processing unit can be a processor core of one or more CPUs. In addition to presenting a new method for drawing reflections, Fig.11 The example technology also provides many technical advantages. For example, the example technology improves the function of the computer itself by providing a hybrid method that not only improves the accuracy of the resulting image, but also improves the computational, power and / or memory efficiency of the rendering process by balancing the hardware resource-intensive ray tracing process with less burdensome techniques (e.g., SSR techniques). In addition, because Fig.11 The technique allows images to be rendered faster than using ray tracing alone, which helps to achieve real-time ray tracing with little or no reduction in the desired frame rate (e.g., 30 frames per second).
[0107] At (1100), a technique is selected from among a plurality of available techniques for drawing pixel values in a frame of a computer-generated environment. In this embodiment, the pixel values depict reflected rays in the frame of the computer-generated environment. Furthermore, in this embodiment, the plurality of available techniques for drawing pixel values include ray tracing techniques and screen space reflection techniques.
[0108] At (1112), pixel values are calculated using the selected technique.
[0109] At (1114), the calculated pixel values are used to render a frame of the computer-generated environment. For example, an additional rendering process may be performed to produce a final frame, including by Fig.11 The pixel values for the reflective surfaces in the frame are determined using a technique described in
[0014] The final frame can then be displayed on a display device.
[0110] In some example implementations, the method further includes using a reduced resolution image of the frame for a ray tracing technique (e.g., an image with a resolution reduced by one quarter or other reduction for the pixel values). In other example implementations, the method further includes selecting a representative normal for a group of pixel values adjacent to the pixel value. In some cases, the representative normal is selected only after determining that the pixel value has a normal within a threshold percentage or distance of the group of pixel values.
[0111] V. Conclusion
[0112] In view of the many possible embodiments to which the principles of the disclosed invention may be applied, it should be recognized that the illustrated embodiments are merely preferred examples of the invention and should not be considered as limitations on the scope of the invention. Instead, the scope of the invention is defined by the appended claims. Therefore, I claim that the invention within the scope and spirit of all such claims is my invention.
Claims
1. A computer-implemented method comprising: Generate a list of reflection ray origins and directions for a frame; For selected pixels with reflected rays: determining whether the reflected ray for the selected pixel is reflected back to a virtual camera position of the frame; if the reflected ray is determined to be reflected back to the virtual camera position of the frame, performing a first reflected ray technique to generate a resulting pixel value for the reflected ray; as well as if the selected reflected ray is determined not to be reflected back to the virtual camera position of the frame, performing a second reflected ray technique to generate the resulting pixel value for the reflected ray; as well as The frame is drawn for display on a display device, the drawn frame including the obtained pixel values.
2. The method according to claim 1, wherein the operation further comprises: If the second reflected ray technique fails, the first reflected ray is performed on the reflected ray.
3. The method of claim 1 , wherein determining whether the reflected ray is reflected back to the virtual camera position for the frame comprises: Calculate the dot product; as well as Evaluates whether the resulting scalar value from the dot product is positive or negative. 4 . The method of claim 3 , wherein the dot product is a dot product of a view vector for the selected pixel and a reflection vector for the selected pixel.
5. The method of claim 1 , wherein determining whether the reflected ray is reflected back to the virtual camera position for the frame is performed by: Calculating line segment endpoints, wherein the line segment endpoints include the origin of the reflected ray and a point along the direction of the reflected ray; Transforming the line segment endpoints into projection camera space; constructing reflected rays in projected space from the line segment endpoints by subtracting them from each other; as well as The direction of the reflected ray in the projection space is determined to face the virtual camera, and thus the original reflected ray is determined to be reflected toward the virtual camera.
6. The method of claim 1 , wherein the reflected ray is determined to be reflected back to the virtual camera position of the frame, and wherein the ray tracing technique comprises: a. using a reduced resolution image of the frame for the ray tracing technique; or b. selecting a representative normal for a group of pixel values neighboring the selected pixel.
7. A method of rendering pixels in a computer system, the pixels depicting reflections from a reflective surface of a computer-represented environment, the method comprising: adaptively selecting a rendering technique from among a plurality of available rendering techniques for rendering pixel values representing reflections in a computer-generated environment; calculating the pixel value using the selected technique; as well as buffering said pixel values in a hardware buffer, The adaptively selecting the drawing technology includes: determining a virtual camera position at which a reflected ray from a pixel position is not reflected toward the computer-generated environment; as well as A screen space reflection technique is performed on the reflected ray.
8. The method according to claim 7, further comprising: determining that the screen space reflection technique fails for the reflected ray; as well as Another technique is performed for the reflected rays for which the screen-space reflection technique fails.
9. The method of claim 7, wherein adaptively selecting the rendering technique from among a plurality of available rendering techniques reduces the computational burden of rendering the frame.
10. A system comprising: Computer processors; as well as One or more computer-readable memories storing computer-readable instructions that, when executed by the computer processor, cause the computer processor to perform a method comprising: adaptively selecting a rendering technique from among a plurality of available rendering techniques for rendering pixel values representing reflections in a computer-generated environment; Calculating said pixel value using said selected technique; and buffering said pixel values in a hardware buffer, The adaptively selecting the drawing technology includes: determining a virtual camera position at which a reflected ray from a pixel position is not reflected toward the computer-generated environment; and A screen space reflection technique is performed on the reflected ray.
11. The system of claim 10, wherein the method further comprises: The reduced resolution image of the frame is used for one of the plurality of available techniques.
12. The system of claim 11, wherein the reduced resolution image comprises an image with one-quarter the pixel values reduced.
13. The system of claim 11, wherein the reduced resolution image is used to draw a plurality of pixels and thereby reduce the computational burden of drawing the frame.
14. The system of claim 10, wherein the method further comprises: A representative normal is selected for a group of pixel values neighboring the pixel value.
15. The system of claim 14, wherein the representative normal is selected only after determining that the pixel value has a normal within a threshold percentage or distance of a group of pixel values.
16. The system of claim 10, wherein the method further comprises: determining that the screen space reflection technique fails for the reflected ray; as well as Another technique is performed for the reflected rays for which the screen-space reflection technique fails.
Citation Information
Patent Citations
Non-divergent parallel traversal of a bounding volume hierarchy
US20190057539A1
Ray-triangle intersection testing with tetrahedral planes
US20190156550A1