Method and system for 0 phase motion vectors in 3D graphics
By generating and utilizing motion vectors with depth information in 3D graphics rendering for frame interpolation, the problems of high processing requirements and artifacts in frame rate conversion are solved, achieving more efficient frame rate conversion and resource saving.
Patent Information
- Application Number
- CN202210190985.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-28
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2042-02-28
AI Technical Summary
Existing technologies cannot effectively utilize depth information for accurate frame interpolation during frame rate conversion in 3D graphics rendering, resulting in high processing requirements and a tendency to produce artifacts.
By generating and using 1-phase motion vectors (MV1) and 0-phase motion vectors (MV0) with depth information, converting them into block motion vectors, separating objects with and without motion vectors, and performing image processing to reduce artifacts and improve frame rate.
It improves the accuracy of frame interpolation, reduces processing requirements, saves computing resources and battery life, and reduces the occurrence of artifacts.
Smart Images

Figure CN116704086B_ABST
Abstract
Description
Technical Field
[0001] The implementation of the subject matter disclosed in this article relates to the field of three-dimensional (3D) computer graphics, and more specifically to how to improve the rendering of interpolated frames in a 3D environment. Background Technology
[0002] Over the years, advancements in computer processing power have made real-time video rendering (such as in video games or certain animations) increasingly complex. For instance, early video games were characterized by pixelated sprites moving across a fixed background, while contemporary video games feature realistic 3D scenes filled with characters. Meanwhile, the miniaturization of processing components has enabled mobile devices (such as handheld video game consoles and smartphones) to effectively support real-time rendering of high frame rates and high resolution video.
[0003] 3D graphics video can be output at various frame rates and screen resolutions. It may be desirable to convert a video with 3D graphics from one frame rate (and / or resolution) to another. To save computational power while still increasing the frame rate, interpolated frames can be used instead of rendering all frames within the video. Interpolated frames can be efficiently generated using motion vectors (also referred to as MVs in this paper), which track the positional differences of objects between the current frame (CF) and the previous frame (PF). Summary of the Invention
[0004] This document discloses an implementation for calculating and transferring motion vectors in the context of 3D computer graphics. In one example, a method includes: generating a 1-phase motion vector (MV1) and a 0-phase motion vector (MV0) for each pixel of one or more objects to be rendered in the current frame, each MV1 and MV0 having an associated depth value, thereby forming an MV1 texture and an MV0 texture, each MV0 being determined based on a camera MV0 and an object MV0; converting the MV1 texture into a set of MV1 pixel blocks and the MV0 texture into a set of MV0 pixel blocks; and outputting the set of MV1 pixel blocks and the set of MV0 pixel blocks for image processing. Attached Figure Description
[0005] Figure 1 An exemplary diagram of a computing system is shown.
[0006] Figure 2 This is an exemplary block diagram schematically illustrating a pipeline for transmitting and using motion vector data.
[0007] Figure 3 An exemplary 3D coordinate system and two points in 3D space are shown.
[0008] Figure 4An exemplary 2D coordinate system and two points in 2D space are shown.
[0009] Figure 5 A flowchart illustrating an exemplary method for creating 2.5D blocks MV0 and 2.5D blocks MV1 and outputting them to an image processing module is shown.
[0010] Figure 6A A flowchart illustrating an exemplary rendering pipeline, its internal space, and the transformations between spaces is shown.
[0011] Figure 6B An example of a view frustum within a 3D digital scene including close clippings is shown.
[0012] Figure 6C Show Figure 6B A close-up zoomed-in image.
[0013] Figure 7A and Figure 7B Exemplary methods for generating MV1 and MV0 are shown respectively.
[0014] Figure 8 An exemplary method is shown for determining the correct MV0 given multiple MV0 values as input.
[0015] Figure 9A An exemplary diagram is shown illustrating an exemplary projection from CF to PF using projection MV.
[0016] Figure 9B An exemplary diagram of the projection MV from PF to CF is shown.
[0017] Figure 9C An exemplary method for interpolating a projection from the PF to the CF is shown.
[0018] Figure 10 A flowchart illustrating an exemplary method for determining whether a pixel is double-confirmed or not is shown.
[0019] Figure 11 A flowchart illustrating an exemplary method for adjusting the MV in a non-double-confirmation region is shown.
[0020] Figures 12A to 12B This shows an example of searching for the nearest pixel in a double-confirmation region.
[0021] Figure 13 A flowchart illustrating an exemplary method for calculating block motion vectors using pixel-by-pixel motion vectors as input is shown.
[0022] Figure 14 This schematically illustrates an example of converting a pixel-by-pixel MV into a block MV. Detailed Implementation
[0023] This document describes systems and methods for calculating motion vectors for use in frame interpolation, frame rate conversion, or other actions. As previously explained, motion vectors are generated to track the positional differences of an object between the current frame (CF) and the previous frame (PF). As explained herein, frame interpolation can be performed using two types of motion vectors: 1-phase MV (MV1) and 0-phase MV (MV0). MV0 represents motion from PF to CF, and MV1 represents motion from CF to PF. MVs are generated for each pixel (or group of pixels) on the screen, thus forming a texture or set of MVs for the pixels on the screen. As used herein, a texture is defined as a mapping from the set of pixels in a frame to a set of one or more numbers (e.g., components of a vector or a single number).
[0024] If motion vectors are used during frame rate conversion, a typical rendering engine outputs only a two-dimensional MV1 texture. Therefore, the texture contains no depth content and only includes information about changes in relative screen position, as seen in a virtual camera's frame of reference. The depth of the per-pixel motion vectors tells how to calculate the 2D components of the block motion vectors. Block motion vectors can represent the average of the motion vectors of a block of pixels (e.g., a five-by-five pixel block) and can be used for frame interpolation or other image processing tasks to, for example, reduce processing requirements. Scene regions within a specific depth range are called the foreground (closer to the camera), background (farther from the camera), or intermediate range (between the foreground and background). In image processing, it may be desirable to determine which of the following depth ranges dominates each pixel block: foreground, background, or intermediate range.
[0025] As an example, two objects can be positioned at different distances from the (virtual) camera or viewpoint. If the two objects move in the same direction at equal world-space distances, the farther object will appear to have moved less distance in eye space, creating a parallax effect where the object farther from the viewpoint appears to have moved less than the object closer to the viewpoint.
[0026] When most pixels in a block are in the background, most pixels will have small motion vectors (MV) because MV is evaluated from the camera / viewpoint perspective. If a small number of pixels in the block are, for example, in the foreground, the foreground pixels will have larger motion vector magnitudes. If all motion vectors within the block are averaged, the (relatively smaller) MV of the foreground will dominate the average MV. This can distort the relatively small, noticeable motion of background pixels, thus favoring the MV of foreground pixels.
[0027] By including depth information in the pixel MV, the dominant depth range of each block can be resolved: foreground, background, or intermediate range. Motion vector values within the block that do not fall within the dominant range can then be ignored to facilitate evaluation of the average value of pixels only within the dominant range. When the block is dominated by background pixels, the resulting motion vectors more closely match intra-frame motion.
[0028] The added depth information also provides additional flexibility to the image processing module. The depth component of MV can, for example, be used as input to a weighting function, which can then be used to apply different levels of image correction to regions at different depths.
[0029] Therefore, according to the implementation described herein, a depth texture can be attached to MV1, which allows for more accurate frame interpolation by taking into account depth variations. Furthermore, an MV0 texture with depth can be similarly generated. Both MV0 and MV1 can be used as input to a frame rate conversion algorithm, which facilitates the interpolation step.
[0030] Furthermore, each frame can consist of two types of objects: objects with motion vectors and objects without motion vectors. Objects characterized by motion vectors can include moving characters or other objects, the user's view, and portions of the game map. Objects without motion vectors can include, for example, smoke effects, full-screen or partial screen scene transitions (such as fade-in and fade-out and wipe), and / or particle effects. By separating objects with motion vectors from those without, improved image processing can be performed. Traditionally, algorithms may attempt to exclude screen areas characterized by objects without motion vectors. However, this approach is not perfect and can lead to the blending of nearby objects during frame rate conversion. Therefore, separating objects with and without motion vectors before transmission to the image processor reduces artifacts caused by conventionally known exclusion methods.
[0031] Traditionally, motion vectors are also sampled on a pixel-by-pixel basis, with each pixel on the screen having an associated MV0 and MV1. However, the sampling resolution of motion vectors can be dynamically reduced or increased. Reducing the resolution can also reduce the computing power required for MV computation. Since many devices (e.g., smartphones) have limited computing resources and battery life, reducing computational costs can save processing power and battery life. As described herein, "pixel-by-pixel" or "each pixel" may not refer to an individual pixel, but rather to a set of pixels in the context of evaluating the motion vector. In some implementations, low-resolution MV generation can be performed by reducing the sampling resolution when computing the MV. For example, the MV can be calculated only for every fourth pixel in the x-direction and every fourth pixel in the y-direction.
[0032] First, the motion vectors described here are generated on a pixel-by-pixel basis, and then transformed into a block form with depth texture. The block motion vectors can then be divided into separate channels for objects with and without motion vectors, reaching the image processing module. The image processing module can then use the block motion vectors to perform visual enhancements, such as frame rate conversion.
[0033] By separating objects with and without MV, the exclusion algorithm may not be necessary. Therefore, even in regions blurred by particle effects, separation allows for the generation of interpolated frame data. Including depth information in the pixel MV allows for more accurate block MV calculations because blocks dominated by background pixels are better represented than by averaging.
[0034] This document describes aspects of the disclosure with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and computer program products according to embodiments disclosed herein. To the extent that such block diagrams, flowcharts, and / or examples contain one or more functions and / or operations, those skilled in the art will understand that each function and / or operation within such block diagrams, flowcharts, or examples can be implemented individually and / or collectively using a wide range of hardware, software, firmware, or virtually any combination thereof via computer-readable instructions. The described systems are exemplary in nature and may include additional elements and / or omitted elements. The subject matter of this disclosure includes all novel and non-obvious combinations and sub-combinations of the various systems and configurations disclosed, as well as other features, functions, and / or characteristics. Therefore, the methods can be performed by executing instructions stored on a machine-readable storage medium using one or more logical means (e.g., a processor) in conjunction with one or more additional hardware elements (such as storage devices, memories, hardware network interfaces / antennas, switches, actuators, clock circuits, etc.). The described methods and associated actions can also be performed in various sequences, in parallel, and / or simultaneously, other than the sequence described herein. The processor of the logical subsystem can be single-core or multi-core, and the program executing on it can be configured for parallel or distributed processing. The logical subsystem may optionally include individual components distributed across two or more devices, which can be remotely located and / or configured for coordinated processing. One or more aspects of the logical subsystem can be virtualized and executed by remotely accessible networked computing devices configured in a cloud computing configuration.
[0035] Figure 1An example of a computer system 100 is schematically depicted, which may include one or more processors 110 (e.g., a central processing unit (CPU) and / or a graphics processing unit (GPU)), volatile and / or non-volatile memory 120 (e.g., random access memory (RAM) and / or one or more hard disk drives (HDDs)). The computer system may also include one or more displays, such as display 130, which may include any number of visual interface technologies. Furthermore, exemplary embodiments may include a user interface 140 (e.g., a keyboard, computer mouse, touchscreen, controller, etc.) to allow a user to provide input to the computer system. In some embodiments, the computer system may be a mobile phone or a tablet computer.
[0036] Figure 2 A block diagram 200 schematically illustrates a pipeline (including components capable of generating and processing MVs) for generating and using MVs. Block diagram 200 includes a game engine 202 that outputs one or more 3D models. Game engine 202 can be configured to generate and output a 3D model 204 to be rendered, which can specify the desired positions of objects and any possible particle effects. Game engine 202 generates multiple image frame data sequentially, which may include CF data 208 and PF data 206. Finally, one or more interpolated frames can be generated between CF and PF. 3D model 204 is output to a 3D motion vector module, which in this instance may be a software development kit and therefore referred to as a game SDK 210, which uses an internal rendering matrix and information from the 3D model to generate 3D pixel MV0 textures 212 and 3D pixel MV1 textures 214. 3D pixel MV1 textures 214 may include multiple 3D MV1s, one 3D MV1 per pixel or group of pixels. Each 3DMV1 (for example, for a given pixel) may include vertical position changes, horizontal position changes, and depth position changes of an object at that pixel from a previous frame to the current frame. The 3D pixel MV0 texture 212 may include multiple 3D MV0s, one 3D MV0 per pixel or group of pixels. Each MV0 (for example, for a given pixel) may include vertical position changes, horizontal position changes, and depth position changes of an object at that pixel from a previous frame to the current frame.
[0037] Because of the non-exclusive projection of objects from the PF to the CF, the process of generating 3D pixel MV0 texture 212 and 3D pixel MV1 texture 214 may include generating multiple possible MVs for one or more pixels. In the 2D domain, a pixel in the PF can be projected onto multiple pixels in the CF. The multiple possible MVs are then compared with depth textures and other objects in the 3D scene for double verification of the MVs. Double verification is the process of selecting the correct MV from the multiple MVs. One exemplary method is to compare the depth buffers of 3D pixel MV0 212 and 3D pixel MV1 214 with the depth textures of the PF and CF, respectively.
[0038] The (double-confirmed) 3D pixel MV0 texture 212 and (double-confirmed) 3D pixel MV1 texture 214 can then be output to the block motion vector module. In this example, the block motion vector module can be a software development kit and therefore may be referred to as the algorithm SDK 216. The block motion vector module can process the input to generate 2.5D block textures MV0 218 and 2.5D block MV1 texture 220, which are textures that can be used to generate interpolated frames. Block texturing is a process of averaging the motion vector values within each of a plurality of blocks (as described below). Figure 5 (As explained). The 2.5D block MV0 texture 218 and 2.5D block MV1 texture 220 are output to the image processing module 222, which may or may not be a separate piece of hardware from the other processor 110. The image processing module 222 also receives CF data 208 and PF data 206. During the transmission of the 2.5D block MV0 texture 218 and 2.5D block MV1 texture 220, objects with MV are separated from objects without MV. The separated data may be transmitted to the image processing module 222 on two physically separate or two logically separate channels.
[0039] The image processing module 222 can then use the 2.5D block MV0 texture 218 and the 2.5D block MV1 texture 220 as input and use PF data 206 and CF data 208 to perform an interpolation step or frame rate conversion. The image processing module 222 can output PF data 206, one or more interpolated frames 224, and CF data 208, which can then be visually displayed on the display 130 (in the listed order). Therefore, generating interpolated frames 224 allows for an increase in frame rate.
[0040] The game engine 202, game SDK 210, and algorithm SDK 216 can each execute on the same processor 110 or a different processor of the computer system 100 according to instructions stored in volatile and / or non-volatile memory 120. In at least some instances, the image processing module 222 may be a separate piece of hardware from the game engine 202, game SDK 210, and algorithm SDK 216.
[0041] As used herein, the terms "system" or "module" can include hardware and / or software systems that operate to perform one or more functions. For example, a module or system can include a computer processor, controller, or other logic-based device that performs operations based on instructions stored on a tangible and non-transitory computer-readable storage medium, such as computer memory. Alternatively, a module or system can include hardwired devices that perform operations based on the device's hardwired logic. The various modules or units shown in the accompanying drawings may represent hardware that operates based on software or hardwired instructions, software that directs the hardware to perform operations, or a combination thereof.
[0042] It should be noted that the techniques discussed in this article are applicable not only to games, but also to any animation rendering of 3D models, although the advantages offered by this method are most significant in real-time rendering scenarios.
[0043] Figure 3 A 3D coordinate system 300 is shown with two 3D points, Q_PF 302 and Q_CF 304. The two points have x, y, and z coordinates, where Q_PF 302 has coordinates (x0, y0, z0) and Q_CF has coordinates (x1, y1, z1). The z-value is also called depth, and in some instances, it is provided by a separate texture or may need to be calculated using methods involving, for example, rays from the camera position to the point's location. Based on these two points in space, two 3D motion vectors can be calculated using, for example, the following formula:
[0044] MV0=(x0-x1, y0-y1, z0-z1)=(Δx0, Δy0, Δz0),
[0045] MV1=(x1-x0, y1-y0, z1-z0)=(Δx1, Δy1, Δz1)=-MV0.
[0046] According to these definitions, MV0 represents the 3D transformation an object undergoes from Q_PF 302 to Q_CF 304. On the other hand, MV1 represents the transformation in the opposite direction from Q_CF 304 to Q_PF 302.
[0047] Although Figure 3The 3D motion vectors represent points in 3D space, but these points are projected onto a 2D display for viewing. In a typical instance, the motion vectors are generated as 2D textures, which are then used to generate visual enhancements and create interpolated frames. In addition to regular MV information, the implementation described herein also uses depth textures, but in a different way than pure 3D MV. For example, this depth texture can be computed by allowing the depth of each point on the screen to be evaluated by projecting rays from a near clip in viewing space onto each pixel of the object. A near clip, as defined herein, is the nearest plane in 3D space where the object is still visible. Objects closer than a near clip are not visible in the scene.
[0048] Therefore, the method for calculating 3D MV0 and 3D MV1 can be applied to generate the above information. Figure 2 The 3D pixel MV discussed is then double-verified according to a process described in more detail below. For example, the double-verified 3D pixel MV0 and double-verified 3D pixel MV1 can be converted into 2.5D block MV0 and 2.5D block MV1, and then the 2.5D block MV0 and the 2.5D block MV1 are output to the image processing module for frame rate conversion.
[0049] Figure 4 This demonstrates how 2.5D motion vectors can be calculated, and thus shows a 2D coordinate system 400 with projections of Q_PF 402 and Q_CF 404. These projected points only have x and y coordinates. Projection can be performed using a rendering matrix applied to points in 3D space (such as the one mentioned above). Figure 2 The rendering matrix discussed is used to perform this. A 2D coordinate system of 400 can represent, for example, the view position of a pixel on a 2D screen as viewed from the perspective of a virtual camera. Using the projected coordinates of two points and a depth value, a 2.5D motion vector can be calculated. It should be noted that these are different from 3D motion vectors. A 2.5D motion vector can be calculated, for example,
[0050] MV0 2.5D = (Δx0, Δy0, z0),
[0051] MV1 2.5D = (Δx1, Δy1, z1) ≠ -MV0 2.5D .
[0052] It should be noted that in both cases, the depth changes between frames are not recorded; instead, the original depth values z1 and z0 are used.
[0053] Figure 5A flowchart illustrating a method 500 for generating 2.5D block motion vectors is shown. Method 500 can be executed according to instructions stored in computer memory (such as volatile and / or non-volatile memory 120) and executed on one or more processors (such as processor 110). In some instances, method 500 can be... Figure 2 The game SDK 210 and / or algorithm SDK 216 are executed. At 502, the CF and PF frame pixels and the view projection matrix (e.g., a rendering matrix) are obtained. In some instances, the CF and PF frame pixels and the view projection matrix are received from the game SDK 210 or the game engine 202. At 504, the depth textures of the CF and PF are calculated. The depth textures may include the depth variation of the corresponding object from CF to PF for each pixel (for the MV1 texture) and the depth variation from the corresponding object PF to CF for each pixel (for the MV0 texture). At 506, a double-verification process is applied to double-verify the MV1 and MV0 of each 3D pixel of the texture. Double-verification selects the correct motion vector from one or more possible choices based on factors such as pixel occlusion and may contribute to rendering more accurate motion vectors. To double-verify the MV1 or MV0 of the selected pixel, the method may verify that the coordinates of the selected pixel in the current frame match the coordinates of the pixel mapped back to the previous frame using the MV1 or MV0 of the selected pixel, where the coordinates of the selected pixel include depth coordinates. For example, in a 2D domain, a pixel in the PF (PF Matrix) can be projected onto several pixels in the CF (CF Matrix). In a 3D domain, there is a one-to-one correspondence between each pixel. The depth buffer can then be used to determine which MV (Mount View) is correct.
[0054] Depth_buffer[i] = cf_mv_z_i + depth_i; if Depth_PF = Depth_buffer[j], then the buffered MV_j is the correct MV0.
[0055] Alternatively, the MV (coordinates X0, Y0, depth0) of a pixel in the PF is (delta_x0, delta_y0, delta_z0). The corresponding pixel in the CF can have coordinates (X1, Y1, depth1). If X1 = X0 + delta_x; Y1 = Y0 + delta_y; and depth1 = depth0 + delta_z, then this pixel is called double-identified. In other words, if the MV (with coordinates X1, Y1, depth1) of a pixel in the CF is (delta_x1, delta_y1, delta_z1), then if delta_x0 = -delta_x1, delta_y0 = -delta_y1, and delta_z0 = -delta_z1, then pixels Q_CF and Q_PF are double-identified. Any pixel that is not double-identified is outside the double-identified region.
[0056] If a pixel / MV is determined to be in an unconfirmed region, any unconfirmed MV1 and / or MV0 can be adjusted based on the most recent double-confirmed MV1 and / or MV0 (or the most recent double-confirmed MV1 or MV0 of the same object) to transform one or more unconfirmed MV1 and / or MV0 into one or more double-confirmed MV1 and / or MV0. For example, for a given pixel P0, the nearest pixel with double-confirmed MV could be PF. To adjust the MV of P0, the MV0 of P0 could be the sum of the MV1 of PF and the delta MV of PF. The delta MV of PF can be calculated as the MV0 of PF plus the MV1 of P0. At 508, the double-confirmed 3D pixel MV0 can be output, and at 510, the double-confirmed 3D pixel MV1 can be output (e.g., to the algorithm SDK). Using the double-confirmed 3D pixel MV0, a 2.5D block MV0 is generated at 512, and the 2.5D block MV0 is output at 514. Similarly, at 513, the double-confirmed 3D pixel MV1 is converted to block MV1, and at 516, block MV1 is output. To convert 3D pixel MV1 to 2.5D block MV1, for each of a plurality of pixel blocks, the dominant pixel type in the pixel block is identified. If the dominant pixel type is a background pixel, an average MV1 is calculated for all pixels in the pixel set. Otherwise, an average MV1 is calculated only for the foreground pixels in the pixel set. The average MV1 is then set as the MV1 of the pixel block, where the set of MV1 blocks includes the average MV1 of each pixel block. A similar process can be performed for the conversion from 3D pixel MV0 to 2.5D block MV0. Furthermore, instead of including depth variations in the MV, the depth variations are replaced with the depth values of the pixels. 3D MV represents the motion of an object in three dimensions between frames. 2.5DMV represents the motion of an object within a 2D screen, where depth values are added to represent object occlusion. That is, the depth values indicate which objects are in front of other objects, which can help generate interpolated frames.
[0057] At position 518, objects with MV (Modular Value) and those without MV are separated into two channels. In some implementations, the channels are physically separated. When physically separated channels are not feasible, logically separated channels (spatially or temporally) can be used. Separating objects with MV from those without MV eliminates the need to exclude regions from the screen during frame rate conversion. Exclusion algorithms may produce visual artifacts at the boundaries of regions with particle effects. Separating these objects allows them to be processed differently, thus improving the results.
[0058] At 526, various information is sent to the image processing module. The information sent to the image processing module includes blocks MV0 and MV1 (as indicated at 520), image data (as indicated at 522), and frame-level metadata (as indicated at 524). Image data 522 may include the objects discussed above, and therefore image data 522 may be sent through more than one physical or logical channel.
[0059] Figure 6A Shown in game engines (such as Figure 2 An exemplary diagram of a rendering pipeline 600 executed on a game engine (202). As mentioned herein, a rendering pipeline is a set of internal spaces within a game engine that provides 3D rendering data in various forms. Rendering pipeline 600 illustrates the process for rendering a 3D scene to a 2D screen. The 3D scene may be based on a 3D model created as part of a video game or other 3D animation, such that rendering pipeline 600 depicts the process of transforming the 3D model into 2D frames for display on a display device. At least some of the information from the rendering pipeline (e.g., rendering matrices and depth textures) may be output to the game and / or algorithm SDK for calculating motion vectors, as explained in more detail below. Rendering pipeline 600 begins with data represented in a local space 602, which specifies the position of vertices in the 3D model relative to the origin of the 3D model. Thus, local space 602 captures the geometry of the 3D model and may also be referred to as model space. The 3D model may include one or more objects (e.g., characters, buildings, etc.) represented as meshes, each with a local origin. Using model matrix 604, a 3D model can be embedded within world space 608, which represents the position of objects in the 3D model relative to the origin within the 3D world. The 3D world can be a virtual world, such as the 3D world of a game. As used herein, the term "matrix" refers to any set of numbers indexed by two natural numbers. The matrices discussed herein are all nonsingular, and therefore the inverse of each matrix can be computed.
[0060] Objects in world space 608 can be transformed into eye space 614 via view matrix 610. Eye space position represents the view position of a 3D object relative to a virtual camera located at the origin of eye space 614. In this way, objects in world space can be viewed from a specific camera position via eye space 614. Projection matrix 616 maps points in eye space 614 to homogeneous clipping space 620. Homogeneous clipping space 620 can represent positions within a square pyramidal view frustum; therefore, the projection matrix can scale the xyz position in eye space to the shape of the view frustum.
[0061] Figure 6BA view frustum 650 is shown, which serves as the visible area of the 3D scene. The coordinate system in the view frustum 650 space has a virtual camera 660 at the origin, representing the viewer's perspective. One or more objects 652 may be represented in the view frustum 650. To generate a 2D view of the scene, objects are projected onto a near clip 654. For example, if object 652 is a sphere, its projection 662 may be a circle. The screen may include an array of pixels, where each pixel corresponds to one or more objects within the scene. For example, a 3D object 652 is represented by its projection 662 on the near clip 654. Pixel 664 represents the position on the near clip 654 corresponding to projection 662. Calculating the object's eye-space position involves drawing a ray 658 from the origin at the virtual camera 660 to each point on the projected object (such as pixel 664). This ray, which may be a vector with one or more values, as described further below, is multiplied by linear depth information from the game engine. The resulting ray may have an amplitude and direction reflecting the object's world-space position.
[0062] Figure 6C A magnified view of close-up clip 654 is shown, with virtual camera 660 located at the origin in space. Corners 670, 672, 674, and 676 represent corners of close-up clip 654 (starting from the top left corner and proceeding clockwise). Rays can be drawn from the origin (e.g., virtual camera 660) to each of the corners. The corner ray of corner 670 is ray 671, the corner ray of corner 672 is ray 673, the corner ray of corner 674 is ray 675, and the corner ray of corner 676 is ray 677. Ray 658, representing pixel 664, can be selected as the corner ray associated with the nearest corner of close-up clip 654 (e.g., the corner closest to pixel 664). For example, if pixel 664 is located in the lower left quadrant of the near clip 654, it will be closest to corner 676, so ray 677 will represent the corner ray of pixel 664. The determination of the corner ray (e.g., ray 677) can be performed in the vertex shader. Ray 677 is then interpolated using a rasterization algorithm to produce ray 658 pointing from virtual camera 660 to pixel 664. Ray 658 can be interpolated based on the relative positions of virtual camera 660 and pixel 664.
[0063] Return to Figure 6A The view matrix 610 is combined with the projection matrix 616 (e.g., multiplied) to produce the view projection matrix 622, which directly transforms the position in world space 608 to homogeneous clip space 620 (e.g., without forming intermediate eye space 614).
[0064] To transform from homogeneous clip space 620 to normalized device space 628, homogeneous division 626 can be performed. In computer graphics, position can be represented by a four-dimensional vector (a set of numbers indexed by a single natural number). In many instances, the first three coordinates can constitute the x, y, and z (depth) values of the position. The fourth coordinate can then represent a scaling factor (or w) value, as used in projective geometry, which is applied to scale the eye-space position to the frustum shape of the homogeneous clip space. Perspective division is the process of normalizing the four-dimensional vector by dividing all entries by the w value (thus creating the "correct" position vector with w = 1). The final step in the rendering pipeline 600 is the transformation to viewport space 630. This involves projecting onto a specific display device (such as display 130) used to display the 3D scene. The final projection to viewport space 630 creates a 2D image to be displayed on a screen (e.g., display 130), where the x and y positions of the normalized device space are preserved and the z position is applied to sort (e.g., resize) objects to give a depth appearance on the 2D image.
[0065] The inverse process of aspects of the rendering pipeline 600 can be performed to perform certain actions, such as mapping the position of a user input device pointer (e.g., a mouse pointer) to a specific object, and can also be used to generate MV0, as will be explained below. For example, the inverse view projection matrix 624 can be obtained by multiplying the inverse projection matrix 618 (applied to transform homogeneous clip space 620 back to eye space 614) by the inverse view matrix 612 (applied to transform eye space 614 back to world space 608). Furthermore, the inverse model matrix 606 can be applied to transform objects in world space 608 to local space 602.
[0066] Figure 7A and Figure 7BMethods 700 and 750 for generating per-pixel MV1 and MV0 textures are shown respectively. Methods 700 and 750 create MVs, which are the sum of object motion vectors and camera motion vectors. Methods 700 and 750 can be performed as part of method 500, for example, to generate per-pixel MV0 and MV1 textures at step 505 of method 500. The textures created by methods 700 and 750 can be 2.5D or full 3D, wherein method 700 can be adjusted to generate either. The generation of per-pixel MV0 and MV1 can be performed for each pixel or group of pixels on the screen / 2D image to be displayed, and methods 700 and 750 are described herein as generating MV1 and MV0 for selected pixels or groups of pixels, respectively. It should be understood that the process of methods 700 and 750 can be applied to each vertex within a frame, and the per-pixel MV0 and per-pixel MV1 textures can then be generated by finding the pixel position corresponding to each of the vertices. Reducing the sampling resolution of the MV can result in assigning vertices to groups of pixels instead of individual pixels. For example, MVs can be distributed within a 2x2 pixel set.
[0067] First, referring to method 700, which includes, at 702, determining the camera MV1 for each vertex of the current frame. Camera MV1 can represent the motion of a vertex of an object within the current frame (CF) to the previous / last frame (PF) due to changes in the virtual camera's position. To determine camera MV1, the world space position of the selected vertex is calculated, and a motion vector is calculated based on the world space position. Therefore, determining the camera MV1 of the selected vertex includes obtaining the CF eye space position (vPos) based on the depth and ray of the selected vertex, as indicated at 704. To obtain the world space position of the selected vertex, the eye space position of the vertex is first determined. The eye space position is calculated based on the depth value of the selected vertex, sampled from a depth buffer (e.g., a stored depth texture) generated by a game engine, where the depth buffer stores non-linear depth information for each vertex. The xy-screen position of the selected vertex is used to sample the depth buffer. As explained above, a ray is a vector from the origin (e.g., the virtual camera position) to the vertex on the near clip of the view frustum. vPos can be the position in the xyz of eye space determined by multiplying the depth by the ray.
[0068] At position 706, the world-space position (wPos) of the vertex is calculated based on vPos. Using the vertex's vPos, the vertex's position in world space is determined. To calculate wPos, the vPos determined at 706 is multiplied by the inverse view matrix (such as...). Figure 6A The inverse view matrix 612), said matrix is the inverse of the view matrix used to transform the world spatial position to the eye spatial position, as described above regarding... Figure 6AThe inverse view matrix is obtained from the game engine. At 707, based on wPos, the position (Pos) of the vertex in the homogeneous clip space of the current frame is determined, and the previous position (Prepos) of the vertex in the homogeneous clip space of the previous frame is also determined. To determine Pos, wPos is multiplied by the view matrix (which is generated / output by the game engine). To determine Prepos, wPos is multiplied by the view matrix of the previous frame. The view matrix of the previous frame can be generated / output by the game engine during the generation / rendering of the previous frame and can be cached for calculating the camera MV1. The view matrix of the current frame can be cached for calculating the camera MV1 of the next frame.
[0069] At 708, homogeneous division is performed to scale Pos and Prepos, such that the xyz positions in the current and previous homogeneous clip space are normalized by a scaling factor (w). In some instances, scaling results in Pos and Prepos values in the range [-1, 1]. At 710, the camera MV1 is returned based on the scaled Pos and Prepos. MV1 may include velocities calculated as Pos minus Prepos on the x, y, and z axes. In some instances, the velocity may be multiplied by 0.5 to obtain a motion vector in the range [0, 1]. Furthermore, the depth value of the current frame in the normalized device space (e.g., after scaling) is also included as part of the camera MV1. The camera MV1 may therefore include the positional changes of the pixels (in x, y, and z) from the current frame to the previous frame, as well as the depth values of the vertices in the current frame. Vertices within a frame may be assigned pixel values based on their positions in the xy screen space. It should be noted that if the sampling resolution is reduced, the pixels assigned to each vertex for MV generation purposes may not be exactly the nearest pixels.
[0070] It should be noted that the camera MV1 calculation assumes that the selected vertices of the object have not moved from the previous frame to the current frame because the same wPos is used. For moving objects, wPos will be different in the previous and current frames. Therefore, the object motion vector (object MV1) is also determined for each vertex, as indicated at 712. To determine the object MV1, at 714, the eye space position (CF vPos) of each vertex in the current frame and the eye space position (PF vPos) of each vertex in the previous frame are determined. The eye space position of each vertex in the current frame is determined by multiplying the current frame position of each vertex in model / local space by the model matrix, and then multiplying the product by the view projection matrix. The eye space position of each vertex in the previous frame is determined by multiplying the previous frame position of each vertex in model / local space (which is obtained by caching the current frame position of vertices in the previous MV1 calculation (e.g., from the frame before PF to PF)) by the previous frame model matrix, and then multiplying the product by the previous frame view projection matrix, which is also cached (e.g., calculated according to the previous MV1).
[0071] At 716, CF vPos and PF vPos are interpolated into homogeneous clip space to generate input Pos and input Prepos. Thus, the eye space position is interpolated into homogeneous clip space. For each segment, homogeneous division (as indicated at 718) is performed to generate scaled input Pos and scaled input Prepos (e.g., normalized based on a scaling factor w) in normalized device space. Scaled input Pos and scaled input Prepos may each include xyz values. At 720, an object MV1 for the selected pixels is returned based on the scaled input Pos and scaled input Prepos for the selected vertices. Object MV1 may include velocities calculated as input Pos minus input Prepos along the x, y, and z axes. In some instances, the velocity may be multiplied by 0.5 to obtain a motion vector in the range [0,1]. Furthermore, the depth value of the current frame in normalized device space (e.g., after scaling) is also included as part of object MV1. The object MV1 may therefore include the positional changes of the vertex (in x, y, and z) from the current frame to the previous frame, as well as the depth value of the vertex in the current frame.
[0072] At step 722, the MV1 of the pixels is output based on camera MV1 and object MV1. Step 722 includes finding the pixels associated with the vertices for the purpose of generating the MV1 texture. The pixels selected for each vertex may also depend on the sampling resolution of the motion vector. MV1 can be generated by adding camera MV1 and object MV1. Method 700 returns.
[0073] Next, referring to method 750, it includes determining the camera MV0 for each vertex within the current frame at 752. Camera MV0 may represent the motion of a vertex within the object from the previous / last frame (PF) to the current frame (CF) due to changes in the virtual camera's position. To determine camera MV0, the world space position of the selected vertex in the previous frame is calculated, and a motion vector is calculated based on the world space position. Therefore, determining the camera MV0 of the selected vertex includes obtaining the PF eye space position (vPos) based on the previous depth and ray of the selected vertex, as indicated at 754. To obtain the previous frame world space position of the selected vertex, the eye space position of the vertex in the previous frame is first determined. The PF eye space position is calculated based on the previous depth value of the selected vertex, as sampled from a previous frame depth buffer generated by the game engine, where the previous frame depth buffer stores non-linear depth information for each vertex. The xy screen position of the selected pixel is used to sample the previous depth buffer. As explained above, a ray is a vector from the origin (e.g., the virtual camera position) to the vertex on the near clip of the view frustum. vPos can be the position in the xyz of the eye space determined by multiplying the previous depth by the ray.
[0074] At 756, the world space position (wPos) of the vertex is calculated based on vPos. Using the vertex's vPos, the vertex's position in world space is determined. To calculate wPos, the vPos determined at 756 is multiplied by the inverse view matrix of the previous frame. The inverse view matrix may initially be obtained from the game engine and then cached (e.g., the camera-to-world matrix of the previous frame is cached and then obtained to determine wPos). At 757, based on the wPos determined at 756, the vertex's position (Pos) in the homogeneous clip space of the current frame is determined, and the vertex's previous position (Prepos) in the homogeneous clip space of the previous frame is determined. To determine Pos, wPos is multiplied by the view matrix (which is generated / output by the game engine). To determine Prepos, wPos is multiplied by the view matrix of the previous frame. The view matrix of the previous frame may be generated / output by the game engine during the generation / rendering of the previous frame and may be cached for calculating the camera MV0. The view matrix of the current frame may be cached for calculating the camera MV0 of the next frame.
[0075] At 758, homogeneous division is performed to scale Pos and Prepos, such that the xyz positions in the current and previous homogeneous clip space are normalized by a scaling factor (w). At 760, camera MV0 is returned based on the scaled Pos and Prepos. MV0 may include the velocity calculated as Pos(xyz) minus Prepos(xyz) on the x, y, and z axes. In some instances, the velocity may be multiplied by 0.5 to obtain a motion vector in the range [0,1]. Furthermore, the depth value of the previous frame in the normalized device space (e.g., scaled so that the depth value is the z-value of Prepos(xyz)) is also included as part of camera MV0. Therefore, camera MV0 may include the positional change of the pixel (in x, y, and z) from the current frame to the previous frame and the depth value of the pixel in the current frame.
[0076] It should be noted that the camera MV0 calculation assumes that the selected vertices of the object have not moved from the previous frame to the current frame because the same wPos is used. For moving objects, wPos will be different in the previous and current frames. Therefore, the object motion vector (object MV0) is also determined for each vertex, as indicated at 762. To determine object MV0, at 764, the eye space position (CF vPos) of each vertex in the current frame and the eye space position (PF vPos) of each vertex in the previous frame are determined, similar to the eye space position determination performed when calculating object MV1. The eye space position of each vertex in the current frame is determined by multiplying the current frame position of each vertex in model / local space by the model matrix, and then multiplying the product by the view projection matrix. The eye space position of each vertex in the previous frame is determined by multiplying the previous frame position of each vertex in the model / local space (which is obtained by caching the current frame position of the vertex in the previous MV0 calculation (e.g., from the frame before PF to PF)) by the previous frame model matrix, and then multiplying the product by the previous frame view projection matrix, which is also cached (e.g., calculated based on the previous MV0).
[0077] At 766, CF vPos and PF vPos are interpolated into homogeneous clip space to generate input Pos and input Prepos. Thus, the eye space position is interpolated into homogeneous clip space. For each clip, homogeneous division (as indicated at 768) is performed to generate scaled input Pos and scaled input Prepos in normalization device space (e.g., normalized based on a scaling factor w). Scaled input Pos and scaled input Prepos may each include xyz values. At 770, the object MV0 of the selected vertex is returned based on the scaled input Pos and scaled input Prepos. Object MV0 may include velocities calculated as input Pos(xyz) minus input Prepos(xyz) on the x, y, and z axes. In some instances, the velocity may be multiplied by 0.5 to obtain a motion vector in the range [0,1]. Furthermore, the depth values of previous frames in the interpolated homogeneous clip space (e.g., after scaling) are also included as part of object MV0 (e.g., the z-value of input Prepos(xyz)). Therefore, object MV0 can include the positional changes of the vertex (in x, y, and z) from the previous frame to the current frame, as well as the depth values of the vertex in the previous frame. The vertex can then be assigned to a pixel (or group of pixels) based on its position on the screen and the sampling rate of the motion vector.
[0078] Therefore, object MV0 may include the positional changes of the pixel (in x, y, and z) from the current frame to the previous frame and the depth value of the pixel in the current frame.
[0079] At 772, the MV0 of the pixel is output based on the camera MV0 and the object MV0. Step 772 includes finding the pixel associated with the vertex for the purpose of generating the MV0 texture. The pixel selected for each vertex may also depend on the sampling resolution of the motion vector. The camera MV0 and the object MV0 can be added together to generate MV0. Method 750 returns.
[0080] Figure 8 A method 800 for selecting the correct MV0 from multiple possible MV0 inputs is shown. The selection of the correct MV0 can be done alone, or in addition to a double-acknowledgment process. When double-acknowledging a current frame pixel Q_CF and a previous frame pixel Q_PF, the MV values of Q_CF and Q_PF have the same magnitude but opposite signs. This feature improves the representation of the generated interpolated pixels between CF and PF. Depth can represent occlusion relationships between objects. When projecting from CF to PF, several pixels may be projected to the same location. A depth buffer helps in selecting which MVs to double-acknowledge.
[0081] Method 800 resolves the correct motion vector in the 2D domain because projecting from the PF to the CF can result in several possible resulting pixels. Method 800 takes depth values as input and begins at 804, where pixels in the PF are projected onto multiple pixels in the CF. For each pixel in the CF, the potential MV0 is calculated and stored at 808. Next, the depth buffer is calculated at 810 using, for example, the following formula:
[0082] DepthBuffer = MV1 z +Depth,
[0083] MV1 z It is the z component of 3D MV1, and Depth refers to the depth texture value in the current frame.
[0084] At 812, the PF depth can be compared with the PF depth. If the depth buffer of this pixel matches the PF depth of the pixel, then the MV0 corresponding to the PF pixel is correct (as indicated by 814), and it is returned. If the MV0 is incorrect, the loop continues with other possible projected pixels.
[0085] Figure 9A and Figure 9B An alternative method is shown for generating MV0 from MV1 by projecting pixels from CF to PF and from PF to CF.
[0086] Figure 9A The process of projecting from CF 902 to PF 920 via MV1 is illustrated. Due to the one-to-one correspondence from CF 902 to PF 920, each pixel can be uniquely projected. In the illustrated example, CF pixels 904, 906, 908, and 910 are shown as being projected onto PF pixels 922, 924, 926, and 928, respectively.
[0087] Figure 9B This illustrates the process of projecting from PF to CF, with the projection direction reversed. Pixel 932 in PF 930 can be mapped in the 2D domain to several pixels in CF, such as, for example, 934, 936, 938, etc. Multiple projections may be the result of projecting from 3D to 2D when projecting to a near clip. Method 800 can be implemented to select the correct projection in CF.
[0088] Figure 9CThe interpolation of PF pixel 940 in CF 950 is shown. Pixels 954, 956, 958, and 960 represent four possible corresponding pixels within a possible projection (such as 934). Since the projected pixel 952 may lie between several pixels (such as pixels 954, 956, 958, and 960), values for any such corners can initially be assigned to the projection, and then interpolated during rasterization, as per the description of... Figures 6A to 6C As detailed above.
[0089] In addition to evaluating a correct MV0, a double confirmation process can be performed. One example is... Figure 10 Method 1000 can be executed according to instructions stored in computer memory (such as volatile and / or non-volatile memory 120) and executed on one or more processors (such as processor 110). In some instances, method 1000 can be performed by... Figure 2 The game SDK 210 and / or algorithm SDK 216 are executed. Double confirmation method 1000 begins at 1002 by calculating the MV0 value of the selected pixel in the PF. At 1004, the corresponding pixel is found in the CF, for example, using method 800. At 1006, the corresponding pixel in the CF is compared with the selected pixel in the PF, where one or more criteria are compared. If the criteria are met, the pixel is designated as double-confirmed at 1008. Otherwise, at 1010, the pixel is not double-confirmed. Criteria applicable to double-confirm the selected pixel may include: confirming that the motion vector of the pixel in the PF, when added to the pixel's coordinates in the current frame, will produce the pixel's coordinates in the current frame. For example, the MV of the pixel at position (X0, Y0, Z0) in the PF is (delta_x0, delta_y0, delta_z0). The position of the corresponding pixel in the CF is determined to be (X1, Y1, Z1). If X1 = X0 + delta_x; Y1 = Y0 + delta_y; and Z1 = Z0 + delta_z, then this pixel is called double-confirmed.
[0090] Figure 11 A method 1100 for adjusting the MV of pixels in a non-double-confirmation region is shown. At 1102, the selected pixel is evaluated to determine whether the pixel is in a double-confirmation region. If the pixel is in a double-confirmation region (e.g., the pixel has passed the above regarding...), ... Figure 10 (The described process is double-confirmed), then the delta MV of the pixel is calculated at 1104. The delta MV of the pixel can be calculated by the following formula:
[0091] ΔMV=MV1 PF +MVO PF .
[0092] The value of delta MV can then be returned. If the pixel is not in the double-confirmed region, a search is performed at 1106 to identify the nearest double-confirmed pixel on the same object. Further details regarding the identification of the nearest double-confirmed pixel are presented below. At 1108, the MV0 of the selected pixel is set to the sum of the MV1 of the selected pixel and the delta MV of the nearest pixel, where delta MV is calculated as explained above at 1104 (e.g., because the nearest pixel is double-confirmed), such that the delta MV of the nearest pixel is the sum of the MV0 and MV1 of the nearest pixel. In some instances, the delta MV of a double-confirmed pixel may be calculated only if the pixel has been identified as the nearest pixel to a non-double-confirmed pixel, and it may not be necessary to calculate it for all double-confirmed pixels. At 1110, the delta MV of the selected pixel can be set to the sum of the MV0 and MV1 of the nearest pixel.
[0093] Figure 12A An exemplary set of pixels 1200 is shown for a frame (e.g., the current frame) including pixels in the double-confirmation region 1202 and pixels not in the double-confirmation region 1204. An exemplary input pixel 1206 (e.g., the selected pixel) is shown having two neighboring pixels: a first pixel 1208 and a second pixel 1210. Both the first pixel 1208 and the second pixel 1210 are in the double-confirmation region 1202. In this example, the second pixel 1210 is closer to the input pixel 1206 than the first pixel 1208. However, the second pixel 1210 is part of a different object than the input pixel 1206, while the first pixel 1208 is part of the same object as the input pixel 1206, so the first pixel 1208 can be used as the nearest pixel in step 1106 of method 1100.
[0094] Figure 12B A set of exemplary pixels 1221 is shown. Using this set of exemplary pixels 1221, a window search method can be performed to locate the nearest pixel of a non-double-confirmation input pixel 1224. The non-double-confirmation input pixel 1224 is located in a non-double-confirmation region 1222. Figure 12BThe other pixels shown (such as first pixel 1226, second pixel 1228, third pixel 1230, and fourth pixel 1232) are in the double confirmation region 1220. The search for the nearest pixel begins at the center of the input pixel 1224, then moves left (e.g., to identify fourth pixel 1232), right (e.g., to identify second pixel 1228), up (e.g., to identify third pixel 1230), and down (e.g., to identify first pixel 1226) to locate the nearest double confirmation pixel. In the example shown, third pixel 1230 and fourth pixel 1232 are part of the same object as input pixel 1224, while first pixel 1226 and second pixel 1228 are part of different objects. The total number of vertical and horizontal movements from input pixel 1224 to third pixel 1230 and from input pixel 1224 to fourth pixel 1232 can then be calculated to determine the distance from input pixel 1224 to each identified nearest pixel, and the pixel with the shortest distance can be selected as the nearest pixel. The method of counting the total vertical and horizontal movement between an input pixel and the nearest double-confirmed pixel can be called "chess distance".
[0095] In some instances, the nearest double-confirmed pixel belonging to the same object as the input pixel / non-double-confirmed pixel may not be identified. For example, all pixels of a given object may be non-double-confirmed, and therefore all double-confirmed pixels surrounding a non-double-confirmed region may belong to different objects. In such instances, the non-double-confirmed region exhibits linear motion (e.g., a ball moving in a virtual world), and the MV0 of pixels in the non-double-confirmed region may be set as the inverse vector of the MV1 of those pixels.
[0096] Figure 13 A method 1350 for calculating block MV based on pixel-by-pixel MV is shown. Method 1350 occurs during the pixel-to-block MV conversion performed at 512 and 513 of method 500, which can be calculated using processor 110 and instructions in volatile and / or non-volatile memory 120. At 1351, the pixels on the screen are divided into multiple blocks, such as rectangular sets of pixels of finite size. In one example (see...) Figure 14 The block can be a 4x4 pixel square. Typically, the blocks do not need to be of equal size or square. At 1352, two depth thresholds (depth threshold 1 and depth threshold 2) are calculated. The depth thresholds can be given, for example, by the following formula:
[0097]
[0098]
[0099] Among them Depth Max It is the maximum depth value of the block, and DepthMin This is the minimum depth value within the block. In this example, a larger depth corresponds to an object that is farther away from the camera or viewer.
[0100] At position 1355, create foreground (FG), background (BG), and middle range (MID) bins and assign each bin an initial value of 0. The size of each bin can be stored as N. FG N BG and N MID As indicated at 1356, for each pixel in the block, at 1370, the pixel's depth value (and therefore the depth value of the 2.5D motion vector) is compared to two thresholds. If the depth is greater than depth threshold 1, the BG bin is incremented at 1372. If the depth is less than depth threshold 2, the FG bin is incremented at 1374. Otherwise, the MID bin is incremented at 1376. It should be noted that only one bin should be incremented for each pixel within the block.
[0101] Once each pixel within a block has been compared, the values of the FG, BG, and MID bins are compared at 1380 to identify the distribution of pixel types. Pixel type distribution identification can be performed to determine whether the depth component of the MV exhibits a bimodal distribution; a bimodal distribution indicates the presence of two types of objects within the block: foreground objects and background objects. If a bimodal distribution is not detected, ignoring MVs with extreme depth components yields a more stable distribution. In this case, the pixels in the intermediate range should be averaged. However, since the disclosed method only creates three bins to classify pixels, and the number of pixels in each block may be small (e.g., 16), a bimodal distribution may appear biased towards the foreground and background bins. Either case can indicate the presence of foreground objects. The size of the primary bin (denoted as N in this document) can be given, for example, by a procedure specified by the following pseudocode:
[0102]
[0103]
[0104] It should be noted that the two constants K1 and K2 can be chosen such that 0 ≤ K1 ≤ 2 and K1 ≤ K2. The two constants can be determined empirically to achieve a stable distribution of the depth component of the block MV. In some implementations, K1 = K2 = 0. In this way, when a bimodal distribution is detected (e.g., where the block includes at least one foreground pixel and at least one background pixel) such that both foreground and background objects are detected in the block, the MV of only the foreground pixels is averaged and set as the block MV (even if there are more background pixels than foreground pixels in the block), which allows for the preservation of foreground objects in one or more interpolated frames that might otherwise be lost. When a bimodal distribution is not detected, only one type of object (whether foreground or background) is detected in the block, and the MV of only the pixels in the intermediate range is averaged and set as the block MV.
[0105] At 1382, method 1350 includes the step of averaging the MV based on the distribution of pixel type. For example, the block MV can be given by a formula such as the following:
[0106]
[0107] Where N represents which bin is being averaged, as determined in step 680 above. The summation is performed on all pixel-by-pixel MVs (MV0 or MV1) within the bin corresponding to N, for example, if N = N... BG Then, summation is performed on all background pixels, etc. The addition here is performed according to standard vector addition (e.g., (x1, y1, z1) + (x2, y2, z2) = (x1 + x2, y1 + y2, z1 + z2)). Method 1350 then returns, using the average MV as its return value.
[0108] Figure 14 This illustrates an example of processing pixel MVs into block MVs. In this case, block 1440 of the pixel MVs includes a set 1454 of foreground range pixel MVs (in... Figure 14 (shown diagonally in the text), a set of 1450 background range pixels MV (in...) Figure 14 The set 1452 (shown as a dot pattern) and the intermediate range of pixels MV (in) Figure 14(Seen as crosshairs in the diagram). Depth is used to determine which range each pixel belongs to; for example, pixels MV in the first depth range are assigned as background pixels, pixels in the second depth range are assigned as middle range pixels, and pixels in the third depth range are assigned as foreground pixels. Since most (10 out of 16) pixels MV within block MV 1440 fall within the foreground depth range, the depth values of foreground range pixels MV 1454 are averaged to produce a single depth value, which is applied to all pixels MV in block MV, thus generating block MV 1456. Furthermore, the x and y components (not shown) of the foreground MV are averaged and output in block MV. Therefore, block MV consists of three semi-independent textures: an x component, a y component, and a depth component, each of which is independently averaged within the pixels fitted to the depth range. This technique applies to both MV1 and MV0.
[0109] The technical effect of generating the MV1 and MV0 textures for the current frame (where both MV1 and MV0 textures include depth values) is that the depth values can be used to convert the MV1 and MV0 textures into MV1 and MV0 blocks respectively, allowing the resulting motion vectors to more closely match the motion occurring within the frame. Another technical effect is that frame interpolation can be performed using blocks MV1 and MV0 with depth values, thereby improving the frame rate.
[0110] This disclosure also provides support for a method comprising: generating a 1-phase motion vector (MV1) and a 0-phase motion vector (MV0) for each pixel of one or more objects to be rendered in the current frame, each MV1 and MV0 having an associated depth value, thereby forming an MV1 texture and an MV0 texture, each MV0 being determined based on a camera MV0 and an object MV0; converting the MV1 texture into a set of MV1 pixel blocks and converting the MV0 texture into a set of MV0 pixel blocks; and outputting the set of MV1 pixel blocks and the set of MV0 pixel blocks for image processing. In a first embodiment of the method, the position change of a vertex at the pixel from the current frame to a previous frame is represented, wherein each MV0 represents the position change of the vertex at the pixel from the previous frame to the current frame, wherein the camera MV0 represents the position change of the vertex at the pixel from the previous frame to the current frame due to a change in the position or orientation of a virtual camera, and wherein the object MV0 represents the position change of the vertex at the pixel from the previous frame to the current frame due to a change in the position of the object in world space. In a second instance of the method, which optionally includes the first instance, the method further includes: determining the camera MV0 of the selected pixel based on the world space position of the corresponding vertex of the selected pixel in the previous frame. In a third instance of the method, which optionally includes one or both of the first and second instances, determining the camera MV0 of the selected pixel based on the world space position of the corresponding vertex of the selected pixel in the previous frame includes: determining the eye space position of the vertex based on the depth of the selected vertex in the previous frame and a ray from the virtual camera to a near clipping in homogeneous clip space; applying an inverse view matrix from the previous frame to the eye space position to determine the world space position; applying a first view matrix of the current frame to the world space position to generate the position of the selected vertex in the homogeneous clip space; applying a second view matrix of the previous frame to the world space position to generate a previous position of the selected vertex in the homogeneous clip space; and calculating the camera MV0 as the difference between the position and the previous position on each of the vertical, horizontal, and depth axes. In a fourth instance where the method optionally includes one or more of the first to the third instances, or each of them, the method further includes: for the selected pixel, determining the object MV0 of the selected pixel based on the eye spatial position of the selected vertex corresponding to the selected pixel in the previous frame.In a fifth instance of the method, which optionally includes one or more of the first to fourth instances, determining the object MV0 of the selected pixel based on the eye spatial position of the selected vertex in the previous frame includes: calculating the eye spatial position of the selected vertex in the previous frame and calculating the eye spatial position of the selected vertex in the current frame, each based on a corresponding model matrix and view projection matrix; interpolating the eye spatial position in the previous frame and the eye spatial position in the current frame into homogeneous clip space to generate an input position and an input previous position, respectively; assigning the object MV0 as the difference between the input position and the input previous position on each of the vertical, horizontal, and depth axes; and assigning the object MV0 to the selected pixel based on the on-screen position of the selected vertex. In a sixth instance of the method, which optionally includes one or more, or each of the first to fifth instances, converting the MV1 texture into the set of MV1 pixel blocks includes: identifying the pixel type distribution in each of the plurality of pixel blocks of the MV1 texture, and converting the MV1 texture into the set of MV1 pixel blocks based on the pixel type distribution of each pixel block. In a seventh instance of the method, which optionally includes one or more, or each of the first to sixth instances, converting the MV1 texture into the set of MV1 pixel blocks based on the pixel type distribution of each pixel block includes: if the distribution of the selected pixel blocks is bimodal, such that there is at least one background pixel and at least one foreground pixel in the selected pixel blocks, then the average MV1 is calculated only for the foreground pixels in the selected pixel blocks; otherwise, the average MV1 is calculated only for pixels in the intermediate range of the selected pixel blocks. In an eighth instance of the method, which optionally includes one or more, or each of the first to seventh instances, converting the MV0 texture into the set of MV0 pixel blocks includes: identifying the pixel type distribution in each of the plurality of pixel blocks of the MV0 texture, and converting the MV0 texture into the set of MV0 pixel blocks based on the pixel type distribution of each pixel block. In a ninth instance of the method, which optionally includes one or more, or each of the first to eighth instances, converting the MV0 texture into the set of MV0 pixel blocks based on the pixel type distribution of each pixel block includes: if the distribution of the selected pixel blocks is bimodal, such that there is at least one background pixel and at least one foreground pixel in the selected pixel blocks, then the average MV0 is calculated only for the foreground pixels in the selected pixel blocks; otherwise, the average MV0 is calculated only for pixels in the intermediate range of the selected pixel blocks.In a tenth instance of the method, which optionally includes one or more, or each of the first to ninth instances, the method further includes: applying a double verification process to each MV0 and each MV1, wherein the double verification process includes verifying each associated depth value. In an eleventh instance of the method, which optionally includes one or more, or each of the first to tenth instances, applying the double verification process includes: for a selected pixel in the current frame, in response to coordinate matching of the selected pixel in the current frame using the MV1 or MV0 of the selected pixel to map back to the coordinates of the pixel in the previous frame, the coordinates of the selected pixel including depth coordinates.
[0111] This disclosure also provides support for a system for rendering 3D graphics, the system comprising: one or more processors and non-transitory memory allocated to form: a motion vector module configured to receive 3D model information from a game engine and configured to output a plurality of 1-phase motion vectors (MV1) and a plurality of 0-phase motion vectors (MV0) based on the 3D model information, each MV1 including vertical position change, horizontal position change and depth position change of an object at a corresponding vertex from the current frame to the previous frame, and each MV0 including vertical position change, horizontal position change and depth position change of a corresponding vertex from the previous frame to the current frame. The motion vector module caches a subset of the 3D model information to compute each MV0, including caching a depth buffer and inverse view matrix from the previous frame; and a block motion vector module is configured to generate block MV1 textures and block MV0 textures based on the plurality of MV1s and the plurality of MV0s, respectively, and output the block MV1 textures and the block MV0 textures for image processing to form an image to be displayed on a monitor, wherein the block MV1 textures comprise a plurality of MV1 blocks, each MV1 block being formed by a corresponding subset of the plurality of MV1s, and wherein the block MV0 textures comprise a plurality of MV0 blocks, each MV0 block being formed by a corresponding subset of the plurality of MV0s. In a first instance of the system, the block MV1 textures and the block MV0 textures can be used to interpolate frames between the current frame and the previous frame. In a second instance of the system, which optionally includes the first instance, the selection is based on the corresponding camera MV0 and the corresponding object MV0, wherein the camera MV0 of the selected vertex is determined based on the world space position of the selected vertex in the previous frame, the world space position being determined based on the depth buffer and inverse view matrix of the cache, and the object MV0 of the selected vertex is determined based on the eye space position of the selected vertex in the previous frame and the eye space position of the selected vertex in the current frame. In a third instance of the system, which optionally includes one or both of the first and second instances, corresponding pixels are assigned based on the position of the corresponding vertex. In a fourth instance of the system, which optionally includes one or more of the first to third instances, or each of them, corresponding pixels are assigned based on the position of the corresponding vertex.In a fifth instance of the system, which optionally includes one or more of the first to fourth instances, or each of them, a block includes: the average horizontal position change of the corresponding subset of the plurality of MV1s, the average vertical position change of the corresponding subset of the plurality of MV1s, and the average depth value of the corresponding subset of the plurality of MV1s, and wherein each MV0 block includes: the average horizontal position change of the corresponding subset of the plurality of MV0s, the average vertical position change of the corresponding subset of the plurality of MV0s, and the average depth value of the corresponding subset of the plurality of MV0s.
[0112] This disclosure also provides support for a method comprising: receiving from a game engine 3D model information usable for rendering a first current frame on a 2D screen; caching a subset of the 3D model information, including caching a depth texture and an inverse view projection matrix; receiving from the game engine updated 3D model information usable for rendering a second current frame on the 2D screen, including updated depth texture and updated inverse view projection matrix; calculating a plurality of zero-phase motion vectors based on the updated 3D model information and the cached depth texture and inverse view projection matrix; and outputting the plurality of zero-phase motion vectors as block zero-phase motion vectors for image processing. In a first embodiment of the method, the 3D model information includes the first current frame, and the updated 3D model information includes the second current frame, and the method further comprises: calculating a plurality of one-phase motion vectors based on the updated 3D model information, the updated depth texture, and the inverse view projection matrix; and outputting the plurality of one-phase motion vectors as block one-phase motion vectors for image processing.
[0113] As used herein, elements or steps described in the singular and beginning with the word "a" or "an" should be understood to not exclude the plural form of the elements or steps, unless such exclusion is explicitly stated. Furthermore, references to "an embodiment" of the invention are not intended to exclude the existence of other embodiments that also incorporate the described features. Moreover, unless explicitly stated otherwise, embodiments that "comprise," "include," or "have" one or more elements having a particular characteristic may include additional such elements that do not have said characteristic. The terms "comprise" and "in which" are used as concise linguistic equivalents to the corresponding terms "comprise" and "wherein." Furthermore, the terms "first," "second," "third," etc., are used merely as labels and are not intended to impose numerical requirements or a particular order of position on their objects.
[0114] This written description uses examples to disclose the invention, including the best mode, and also enables those skilled in the art to practice the invention, including making and using any apparatus or system and performing any incorporated methods. The patentable scope of the invention is defined by the claims and may include other examples that would occur to those skilled in the art. Such other examples are intended to be within the scope of the claims if they have structural elements that are indistinguishable from the literal language of the claims, or if they include equivalent structural elements that are not substantially indistinguishable from the literal language of the claims.
Claims
1. A method comprising: For each pixel of one or more objects to be rendered in the current frame, generate a 1-phase motion vector (MV1) and a 0-phase motion vector (MV0). Each MV1 and MV0 has an associated depth value, thus forming an MV1 texture and an MV0 texture. Each MV0 is determined based on the camera MV0 and the object MV0. The MV1 texture is converted into a set of MV1 pixel blocks, and the MV0 texture is converted into a set of MV0 pixel blocks; as well as Output the set of MV1 pixel blocks and the set of MV0 pixel blocks for image processing.
2. The method of claim 1, wherein each MV1 represents a position change of a vertex at the pixel from the current frame to a previous frame, wherein each MV0 represents a position change of the vertex at the pixel from the previous frame to the current frame, wherein the camera MV0 represents a position change of the vertex at the pixel from the previous frame to the current frame due to a change in the position or orientation of a virtual camera, and wherein the object MV0 represents a position change of the vertex at the pixel from the previous frame to the current frame due to a change in the position of the object in world space.
3. The method of claim 2, further comprising: For the selected pixel, the camera MV0 of the selected pixel is determined based on the world space position of the corresponding vertex of the selected pixel in the previous frame.
4. The method of claim 3, wherein determining the camera MV0 of the selected pixel based on the world space position of the corresponding vertex of the selected pixel in the previous frame comprises: The eye space position of the selected vertex is determined based on the depth of the selected vertex in the previous frame and the ray of the selected vertex on the near clipping from the virtual camera to the homogeneous clipping space, and the inverse view matrix from the previous frame is applied to the eye space position to determine the world space position. The first view matrix of the current frame is applied to the world space position to generate the position of the selected vertex in the homogeneous clip space; The second view matrix of the previous frame is applied to the world space location to generate the previous position of the selected vertex in the homogeneous clip space; as well as The camera MV0 is calculated as the difference between the current position and the previous position on each of the vertical, horizontal, and depth axes.
5. The method of claim 2, further comprising: For the selected pixel, the object MV0 of the selected pixel is determined based on the eye spatial position of the selected vertex corresponding to the selected pixel in the previous frame.
6. The method of claim 5, wherein determining the object MV0 of the selected pixel based on the eye spatial position of the selected vertex in the previous frame comprises: The eye spatial position of the selected vertex in the previous frame and the eye spatial position of the selected vertex in the current frame are calculated, respectively based on the corresponding model matrix and view projection matrix; The eye spatial position in the previous frame and the eye spatial position in the current frame are interpolated into homogeneous clip space to generate the input position and the input previous position, respectively. The object MV0 is calculated as the difference between the input position and the previous input position on each of the vertical axis, horizontal axis, and depth axis. as well as The object MV0 is assigned to the selected pixel based on the screen position of the selected vertex.
7. The method of claim 2, wherein converting the MV1 texture into the set of MV1 pixel blocks comprises: For each pixel block in the plurality of pixel blocks of the MV1 texture, the pixel type distribution in the pixel block is identified, and the MV1 texture is converted into the set of MV1 pixel blocks based on the pixel type distribution of each pixel block.
8. The method of claim 7, wherein converting the MV1 texture into the set of MV1 pixel blocks based on the pixel type distribution of each pixel block comprises: If the distribution of the selected pixel block is bimodal, such that there is at least one background pixel and at least one foreground pixel in the selected pixel block, then the average MV1 is calculated only for the foreground pixels in the selected pixel block; otherwise, the average MV1 is calculated only for the pixels in the middle range of the selected pixel block.
9. The method of claim 2, wherein converting the MV0 texture into the set of MV0 pixel blocks comprises: For each pixel block in the plurality of pixel blocks of the MV0 texture, the pixel type distribution in the pixel block is identified, and the MV0 texture is converted into the set of MV0 pixel blocks based on the pixel type distribution of each pixel block.
10. The method of claim 9, wherein converting the MV0 texture into the set of MV0 pixel blocks based on the pixel type distribution of each pixel block comprises: If the distribution of the selected pixel block is bimodal, such that there is at least one background pixel and at least one foreground pixel in the selected pixel block, then the average MV0 is calculated only for the foreground pixels in the selected pixel block; otherwise, the average MV0 is calculated only for the pixels in the middle range of the selected pixel block.
11. The method of claim 2, further comprising: A double verification process is applied to each MV0 and each MV1, wherein the double verification process includes verifying each associated depth value.
12. The method of claim 11, wherein applying the dual verification process comprises: For a selected pixel in the current frame, in response to the coordinate matching of the selected pixel in the current frame using the MV1 or MV0 of the selected pixel to map back to the coordinates of the pixel in the previous frame, the MV1 or MV0 of the selected pixel is double-confirmed, and the coordinates of the selected pixel include depth coordinates.
13. A system for rendering 3D graphics, comprising: One or more processors and non-transitory memory, said one or more processors and non-transitory memory are allocated to form: A motion vector module is configured to receive 3D model information from a game engine and to output multiple 1-phase motion vectors (MV1) and multiple 0-phase motion vectors (MV0) based on the 3D model information. Each MV1 includes the vertical, horizontal, and depth position changes of an object at a corresponding vertex from the current frame to a previous frame. Each MV0 includes the vertical, horizontal, and depth position changes of a corresponding vertex from the previous frame to the current frame. The motion vector module caches a subset of the 3D model information to compute each MV0, including caching a depth buffer and an inverse view matrix from the previous frame. A block motion vector module is configured to generate block MV1 textures and block MV0 textures based on the plurality of MV1 and the plurality of MV0 respectively, and output the block MV1 textures and the block MV0 textures for image processing to form an image to be displayed on a display, wherein the block MV1 textures include a plurality of MV1 blocks, each MV1 block being formed by a corresponding subset of the plurality of MV1, and wherein the block MV0 textures include a plurality of MV0 blocks, each MV0 block being formed by a corresponding subset of the plurality of MV0.
14. The system of claim 13, wherein the block MV1 texture and the block MV0 texture can be used to interpolate frames between the current frame and the previous frame.
15. The system of claim 13, wherein each MV0 is determined based on a corresponding camera MV0 and a corresponding object MV0, wherein the camera MV0 of the selected vertex is determined based on the world space position of the selected vertex in the previous frame, the world space position being determined based on the depth buffer and inverse view matrix of the cache, wherein the object MV0 of the selected vertex is determined based on the eye space position of the selected vertex in the previous frame and the eye space position of the selected vertex in the current frame.
16. The system of claim 13, wherein each MV1 is assigned a corresponding pixel based on the position of the corresponding vertex.
17. The system of claim 13, wherein each MV0 is assigned a corresponding pixel based on the position of the corresponding vertex.
18. The system of claim 13, wherein each MV1 block comprises: The average horizontal position change of the corresponding subsets of the plurality of MV1, the average vertical position change of the corresponding subsets of the plurality of MV1, and the average depth value of the corresponding subsets of the plurality of MV1, wherein each MV0 block includes: the average horizontal position change of the corresponding subsets of the plurality of MV0, the average vertical position change of the corresponding subsets of the plurality of MV0, and the average depth value of the corresponding subsets of the plurality of MV0.
19. A method comprising: Receive 3D model information from the game engine that can be used to render the first current frame on a 2D screen; A subset of the 3D model information is cached, including the depth texture and the inverse view projection matrix. Receive updated 3D model information from the game engine that can be used to render a second current frame on the 2D screen, including updated depth textures and updated inverse view projection matrices; Calculate multiple zero-phase motion vectors based on the updated 3D model information and the cached depth texture and inverse view projection matrix; The plurality of zero-phase motion vectors are output as block zero-phase motion vectors for image processing.
20. The method of claim 19, wherein the 3D model information includes the first current frame, and the updated 3D model information includes the second current frame, and the method further comprises: Calculate multiple 1-phase motion vectors based on the updated 3D model information, the updated depth texture, and the inverse view projection matrix; as well as The plurality of 1-phase motion vectors are output as block 1-phase motion vectors for image processing.
Citation Information
Patent Citations
Asynchronous frame extrapolation pipeline method and system suitable for VR real-time rendering application
CN112203073A
Techniques to generate interpolated video frames
US20220038654A1
