Image rendering method, device, apparatus and storage medium
Patent Information
- Application Number
- CN202310254630.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-07
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2043-03-07
Smart Images

Figure CN116258807B_ABST
Abstract
Description
Technical Field
[0001] The exemplary embodiments disclosed herein generally relate to the field of computers, and particularly to image drawing methods, apparatus, devices, and computer-readable storage media. Background Technology
[0002] With the development of computer technology, various forms of electronic devices can greatly enrich people's daily lives. For example, electronic devices can present virtual scenes by drawing images of virtual scenes.
[0003] In recent years, virtual scenes have become increasingly complex, often involving many different types of physical objects. During the rendering process, there is a growing desire to improve the realism of virtual scene rendering. Summary of the Invention
[0004] In a first aspect of this disclosure, an image rendering method is provided. The method includes: rendering a set of objects in a virtual scene to generate a first set of pixels; adjusting the overlay information of the first object in the virtual scene; rendering the first object in the set of objects based on the adjusted overlay information to generate a second set of pixels; determining a set of fused pixels associated with the first object based on the first set of pixels and the second set of pixels; and determining target rendering information of the set of fused pixels based on at least one of first rendering information of the first object and second rendering information of a second object associated with the fused region, to render an image of the virtual scene, wherein the fused region is determined based on the set of fused pixels.
[0005] In a second aspect of this disclosure, an image rendering apparatus is provided. The apparatus includes: a first rendering module configured to render a set of objects in a virtual scene to generate a first set of pixels; an overlay adjustment module configured to adjust overlay information of the first object in the virtual scene; a second rendering module configured to render the first object in the set of objects based on the adjusted overlay information to generate a second set of pixels; a pixel determination module configured to determine a set of fused pixels associated with the first object based on the first set of pixels and the second set of pixels; and a fusion rendering module configured to determine target rendering information of the set of fused pixels based on at least one of first rendering information of the first object and second rendering information of a second object associated with a fusion region, to render an image of the virtual scene, wherein the fusion region is determined based on the set of fused pixels.
[0006] In a third aspect of this disclosure, an electronic device is provided. The device includes at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit. When executed by the at least one processing unit, the instructions cause the device to perform the method of the first aspect.
[0007] In a fourth aspect of this disclosure, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program that can be executed by a processor to implement the method of the first aspect.
[0008] It should be understood that the content described in this content section is not intended to limit the key or essential features of the embodiments of this disclosure, nor is it intended to restrict the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0009] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:
[0010] Figure 1 An example image is shown based on a conventional scheme;
[0011] Figure 2 A schematic diagram of an example environment in which embodiments of the present disclosure can be implemented is shown;
[0012] Figure 3 A flowchart of a process for image drawing according to some embodiments of the present disclosure is shown;
[0013] Figures 4A-4C A schematic diagram illustrating the determination of a set of fused pixels according to some embodiments of the present disclosure is shown;
[0014] Figure 5 A schematic structural block diagram of an image rendering apparatus according to certain embodiments of the present disclosure is shown; and
[0015] Figure 6 A block diagram of an electronic device capable of implementing several embodiments of the present disclosure is shown. Detailed Implementation
[0016] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0017] It should be noted that the headings of any section / subsection provided herein are not limiting. Various embodiments are described throughout this document, and embodiments of any type may be included under any section / subsection. Furthermore, embodiments described in any section / subsection may be combined in any way with any other embodiments described in the same section / subsection and / or different sections / subsections.
[0018] In the description of embodiments of this disclosure, the term "comprising" and similar terms should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below. The terms "first", "second", etc., may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0019] The embodiments of this disclosure may involve user data, data acquisition, and / or use. All of these aspects comply with applicable laws, regulations, and relevant provisions. In the embodiments of this disclosure, all data collection, acquisition, processing, manipulation, forwarding, and use are conducted with the user's knowledge and confirmation. Accordingly, in implementing the embodiments of this disclosure, the type, scope of use, and usage scenarios of any data or information that may be involved should be communicated to the user and their authorization obtained in accordance with relevant laws and regulations through appropriate means. The specific methods of notification and / or authorization may vary depending on the actual situation and application scenario, and the scope of this disclosure is not limited in this respect.
[0020] In this specification and the embodiments, any processing of personal information will be carried out only under the premise of legality (such as obtaining the consent of the personal information subject, or being necessary for the performance of a contract), and will only be carried out within the scope stipulated or agreed upon. A user's refusal to process personal information other than that necessary for basic functions will not affect the user's use of basic functions.
[0021] As briefly mentioned earlier, some complex virtual scenes currently involve drawing multiple different types of objects. In the rendering process of virtual scenes, depth information is used to represent the positional relationships between different objects. However, relying solely on depth information can lead to overly abrupt boundaries between some objects, resulting in an unrealistic image.
[0022] For example, Figure 1 An example of a drawn image 100 according to a conventional scheme is shown. In drawn image 100, there is adjacency between surface objects and rock objects. In a drawing example considering only depth information, such as Figure 1As shown, drawing image 100 may result in harsh dividing lines 110, which will greatly affect the realism of the image.
[0023] Embodiments of this disclosure propose a scheme for image rendering. According to various embodiments of this disclosure, an electronic device can render a set of objects in a virtual scene to generate a first set of pixels; adjust the overlay information of the first object in the set of objects in the virtual scene; render the first object in the set of objects based on the adjusted overlay information to generate a second set of pixels; determine a set of fused pixels associated with the first object based on the first set of pixels and the second set of pixels; and determine target rendering information of the set of fused pixels based on at least one of first rendering information of the first object and second rendering information of a second object associated with the fused region to render an image of the virtual scene, wherein the fused region is determined based on the set of fused pixels.
[0024] In this way, the embodiments of this disclosure can determine the object fusion area by drawing twice, and achieve the fusion drawing effect based on the drawing information of the object to be fused, thereby greatly improving the realism of the picture.
[0025] The following describes various example implementations of this solution in further detail with reference to the accompanying drawings. The embodiments of this disclosure can be applied to various fields such as simulation, modeling, virtual reality, and augmented reality.
[0026] Example Environment
[0027] Figure 2 A schematic diagram of an example environment 200 in which embodiments of the present disclosure can be implemented is shown. For example... Figure 2 As shown, example environment 200 may include terminal device 210.
[0028] In this example environment 200, terminal device 210 may run an application 220 that supports virtual scenes. Application 220 may be any suitable type of application for presenting virtual scenes, examples of which may include, but are not limited to, simulation applications, game applications, virtual reality applications, augmented reality applications, etc., and embodiments of this disclosure are not limited in this respect. User 240 may interact with application 220 via terminal device 210 and / or its attached devices.
[0029] exist Figure 2 In environment 200, if application 220 is active, terminal device 210 can render an image 250 associated with the virtual environment through application 220. In some examples, such image 250 may be drawn by server 220 and transmitted to terminal device 210 for rendering. Alternatively, such image 250 may also be drawn locally by terminal device 210.
[0030] In some embodiments, terminal device 210 communicates with server 220 to provide services to application 220. Terminal device 210 can be any type of mobile terminal, fixed terminal, or portable terminal, including mobile phones, desktop computers, laptop computers, notebook computers, netbook computers, tablet computers, media computers, multimedia tablets, handheld computers, portable gaming terminals, VR / AR devices, personal communication system (PCS) devices, personal navigation devices, personal digital assistants (PDAs), audio / video players, digital cameras / camcorders, positioning devices, television receivers, radio receivers, e-book devices, gaming devices, or any combination thereof, including accessories and peripherals of these devices or any combination thereof. In some embodiments, terminal device 210 can also support any type of user-facing interface (such as "wearable" circuitry).
[0031] Server 220 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks, and big data and artificial intelligence platforms. Server 220 may include, for example, computing systems / servers such as mainframes, edge computing nodes, computing devices in a cloud environment, etc. Server 220 can provide backend services for applications 220 supporting virtual scenarios in terminal device 210.
[0032] A communication connection can be established between server 220 and terminal device 210. This communication connection can be established via wired or wireless means. The communication connection may include, but is not limited to, Bluetooth, mobile network, Universal Serial Bus (USB), and Wireless Fidelity (WiFi) connections; the embodiments of this disclosure are not limited in this respect. In the embodiments of this disclosure, server 220 and terminal device 210 can achieve signaling interaction through the communication connection between them.
[0033] It should be understood that the structure and function of the various elements in environment 200 are described for illustrative purposes only and do not imply any limitation on the scope of this disclosure.
[0034] The following description will continue with reference to the accompanying drawings, which will provide some exemplary embodiments of this disclosure.
[0035] Example process
[0036] Figure 3 A flowchart of a process 300 for image drawing according to some embodiments of the present disclosure is shown. Process 300 can be implemented in a drawing device (e.g., Figure 2 The terminal device 210 and / or server 230 are located therein. For ease of discussion, reference will be made to... Figure 2 The environment 200 is used to describe the process 300.
[0037] In box 310, the drawing device draws a set of objects in the virtual scene to generate the first set of pixels.
[0038] In some embodiments, the rendering device can acquire object information in a virtual scene and render a set of objects included in the virtual scene accordingly. Such a set of objects can include any appropriate element in the virtual scene, such as surface objects, grass objects, stone objects, building objects, character objects, and so on.
[0039] In box 320, the drawing device adjusts the coverage information of the first object in a group of objects in the virtual scene.
[0040] In some embodiments, the rendering device may determine a first object in the virtual scene that needs to be included in the blending process. For example, such a first object may include a surface object in the virtual scene, thereby enabling the surface object to be blended with other objects on the adjacent surface.
[0041] It should be understood that the first object may also include other objects in the virtual scene that are suitable for fusion, such as sand, snow, and other appropriate objects.
[0042] In some embodiments, in order to determine the extent of the fusion region that needs to be merged with the first object, the rendering device may adjust the coverage of the first object in the virtual scene to cover more adjacent objects.
[0043] In some embodiments, the rendering device can adjust the height of the first object in the rendered image of the virtual scene. Taking a ground object as an example, the rendering device can, for instance, increase the height of the ground object in the rendered image of the virtual scene, thereby covering more of other objects on the ground, such as rocks, trees, etc.
[0044] In some other embodiments, the rendering device can also adjust the depth of the first object in the rendered image of the virtual scene. Continuing with the example of a surface object, the rendering device can, for instance, make the depth of the surface object closer to the viewpoint of the rendered image, thereby allowing it to, for example, cover more of other objects on the surface.
[0045] In some embodiments, the rendering device can adjust the coverage area of the first object in the virtual scene by a preset amount. For example, the rendering device can adjust the height of the first object by a preset amount, or adjust the depth of the first object by a preset amount.
[0046] In box 330, the drawing device draws the first object in a set of objects based on the adjusted overlay information to generate the second set of pixels.
[0047] Furthermore, the rendering device can perform a secondary rendering of the first object based on the adjusted overlay information. In some embodiments, to save on pixel rendering pipeline (PS) overhead, the rendering device determines updated vertex information of the first object based on the adjusted overlay information; and renders the first object based on the updated vertex information.
[0048] Taking a surface object as an example, its number of pixels is much greater than its number of vertices. Therefore, the rendering device can determine the updated vertex information of the surface object and use the vertex rendering pipeline (VS) to render the surface object. Thus, embodiments of this disclosure can effectively save the cost of secondary rendering.
[0049] In box 340, the drawing device determines a set of merged pixels associated with the first object based on the first set of pixels and the second set of pixels.
[0050] The following combination Figures 4A to 4C To describe the specific process of determining a set of merged pixels. For example... Figure 4A As shown, Figure 4A The results of a depth test in the second set of pixels are shown after raising the surface object to a predetermined height. Figure 4A The retained pixel 410 is the first candidate pixel 410 in the second group of pixels that passed the depth test.
[0051] Specifically, the rendering device can determine the first group of candidate pixels 410 that pass the depth test from the second group of pixels based on the depth information of the first group of pixels and the second group of pixels. For example, after increasing the height of a surface object by a certain amount, the rendering device can compare the updated depth information of the surface object with the depth information of the original object in the virtual scene to determine the depth test result of the second group of pixels and retain the first group of candidate pixels 410 that pass the depth test.
[0052] In some embodiments, during the initial rendering process (i.e., the rendering process discussed in reference box 310), the rendering device may mark pixels associated with the first object to indicate that the pixel's stencil test result is failed. During rendering, the stencil test is used in conjunction with the depth test to determine whether a particular pixel's color value is retained or discarded. If the target test passes, the value is further processed, such as through blending operations, to ultimately obtain the pixel color to be rendered. Conversely, if the stencil test fails, no further processing is performed.
[0053] Furthermore, such as Figure 4B As shown, Figure 4B The results of a template test in a second set of pixels are shown, for example, after raising a surface object to a predetermined height. Figure 4B The retained pixel 420 is the second candidate pixel 420 in the second group of pixels that passed the depth test.
[0054] Specifically, the rendering device can determine a second set of candidate pixels 420 that pass the template test from the second set of pixels based on the template test information of the first set of pixels and the second set of pixels. In this way, if a pixel in the enhanced surface object still corresponds to an area of the original surface object, such a pixel will not be retained as a candidate pixel 420.
[0055] Furthermore, such as Figure 4C As shown, the rendering device can determine a set of merged pixels 430 based on a first set of candidate pixels 410 and a second set of candidate pixels 420. Specifically, the rendering device can determine a set of merged pixels 430 based on the intersection of the first set of candidate pixels 410 and the second set of candidate pixels 420. For the above example, for instance, only pixels that pass both the stencil test and the depth test will be retained as a set of merged pixels 430 (e.g., ...). Figure 4C (As shown in the white part).
[0056] As can be seen, the number of pixels 430 in the group requiring fusion processing is significantly reduced compared to the number of pixels in the original surface area. Based on this approach, embodiments of this disclosure can quickly determine the fusion area requiring rendering with lower resource consumption.
[0057] Continue to refer to Figure 3 In box 350, the drawing device determines a set of target drawing information for fused pixels 430 based on at least one of first drawing information of a first object and second drawing information of a second object associated with the fused region, in order to draw an image of the virtual scene.
[0058] In some embodiments, the blending region is determined based on a set of blending pixels 430. For example, in a scenario where the first object is a surface object, the rendering device may determine one or more blending regions based on the positions of a set of blending pixels 430 to indicate the areas where the surface object is to be blended with one or more other objects of different types.
[0059] In some embodiments, the rendering device may determine a second object associated with the fused pixels corresponding to the fused region. Further, the rendering device may determine whether such a second object is suitable for fusion with the first object.
[0060] Examples of using surface objects as the first object, such as Figure 1 In the example, the stone object might be suitable for merging with the first object. However, for certain objects in a virtual scene, such as those associated with characters within the scene, merging with the first object might not be suitable. Typically, the elements representing a character should be independent; merging could result in a distorted effect.
[0061] In some embodiments, information regarding whether a second object is suitable for fusion with a first object can be pre-configured, for example, through fusion marker information. Such fusion marker information can be stored, for example, as a single bit of data in a template test. The rendering device can acquire the fusion marker information of the second object to determine whether it is suitable for fusion with the first object.
[0062] If it is determined that the second object is not suitable for merging with the first object, the drawing device may, for example, determine target drawing information for a set of merging pixels 430 based on the second drawing information of the second object. For example, the drawing device may directly retain the drawing result of the second object in the first drawing as the drawing result of the set of merging pixels 430, without performing the merging process of the first object and the second object.
[0063] Conversely, if it is determined that the second object is suitable for fusion with the first object, the drawing device can determine a set of fusion drawing information for fusion pixels 430 based on the first drawing information of the first object and the second drawing information of the second object.
[0064] In some embodiments, the rendering device may perform material fusion of the first object and the second object, rather than performing color fusion after determining the corresponding rendering colors. Specifically, the rendering device may, for example, determine the target rendering information of the set of fused pixels 430 during the geometry processing stage, and then, during the lighting processing stage, determine the lighting information of the image to be rendered based on the target rendering information, and further determine the final color information of the image.
[0065] In some embodiments, the drawing device may, for example, use a blending method to overlay the drawing result of the first object onto the original drawing result of the second object in a semi-transparent manner, thereby achieving material blending.
[0066] In some embodiments, the rendering device may also place the information of the target pixel that does not require fusion processing into the pixel's transparency channel (e.g., alpha channel), and during output, the alpha channel can retain its original information without being fused. Such information that does not require fusion processing may include, for example, the object's material ID.
[0067] In this scenario, under a blending-based processing approach, the primary colors (e.g., RGB color channel values) of different objects will be assigned a common blending weight. In some embodiments, such a blending weight can be determined, for example, by the distance from the pixel to be blended to the first object. The closer the pixel is to the first object, the higher the blending weight of the first object's primary color can be set, for example. Conversely, the farther the pixel is from the first object, the lower the blending weight of the first object's primary color can be set, for example.
[0068] In some embodiments, the rendering device can also acquire the rendered color information of the group of fused pixels 430 (e.g., corresponding to the second object). Specifically, when the rendering device is a mobile terminal, leveraging the advantages of tile rendering, the mobile terminal can acquire the color of the G-buffer of the pixel to be processed at virtually no cost. This reduces the cost of acquiring rendered color information.
[0069] In some embodiments, the rendering device can set different blending weights for different rendering attributes. For example, taking different primary colors as an example, the blending weights of the primary colors corresponding to the R, G, and B channels can be set to different weights.
[0070] For example, the first information of the target pixel (e.g., the value of the R primary color) may correspond to a first rendering attribute (e.g., the R primary color), and the second information (e.g., the value of the G primary color) may correspond to a second rendering attribute (e.g., the G primary color). In some embodiments, the first fusion weight used to determine the first information (e.g., the fusion weight used to fuse the R primary color) may be different from the second fusion weight used to determine the second information (e.g., the fusion weight used to fuse the G primary color). Based on this approach, embodiments of this disclosure can further provide flexibility in fusion.
[0071] Alternatively, other factors that can be used for blending include the material information of the objects, such as metallicity and roughness. The material information of the first object and the material information of the second object can also be blended accordingly based on the blending weights to determine the rendering information of the blended pixels.
[0072] Similarly, in performing blending based on different weights, the blending weights can be determined, for example, based on the distance from the target pixel to the first object, resulting in stronger blending of pixels adjacent to the first object and weaker blending of pixels farther from the first object. This can further improve the realism of object blending (e.g., blending surface objects with objects near the surface).
[0073] Based on the drawing process discussed above, the embodiments of this disclosure can determine the object fusion area through two drawing processes and achieve the fusion drawing effect based on the drawing information of the objects to be fused. Therefore, the present disclosure can greatly enhance the realism of the image by simulating the effect of material transitions.
[0074] Example devices and equipment
[0075] Embodiments of this disclosure also provide corresponding apparatus for implementing the above methods or processes. Figure 5 A schematic structural block diagram of an image drawing apparatus 500 according to certain embodiments of the present disclosure is shown. The apparatus 500 may be implemented as or included in drawing devices as discussed above (e.g., such as...). Figure 2 In the terminal device 210 and / or server 230 shown. The various modules / components in the device 500 can be implemented by hardware, software, firmware or any combination thereof.
[0076] like Figure 5 As shown, the apparatus 500 includes a first rendering module 510 configured to render a set of objects in a virtual scene to generate a first set of pixels; an overlay adjustment module 520 configured to adjust the overlay information of the first object in the set of objects in the virtual scene; a second rendering module 530 configured to render the first object in the set of objects based on the adjusted overlay information to generate a second set of pixels; a pixel determination module 540 configured to determine a set of fused pixels associated with the first object based on the first set of pixels and the second set of pixels; and a fusion rendering module 550 configured to determine target rendering information of a set of fused pixels based on at least one of first rendering information of the first object and second rendering information of a second object associated with the fusion region to render an image of the virtual scene, wherein the fusion region is determined based on a set of fused pixels.
[0077] In some embodiments, the overlay adjustment module 520 is further configured to: adjust the height of the first object in the rendered image of the virtual scene; or adjust the depth of the first object in the rendered image of the virtual scene.
[0078] In some embodiments, the second drawing module 530 is further configured to: determine updated vertex information of the first object based on the adjusted coverage information; and draw the first object based on the updated vertex information.
[0079] In some embodiments, the first drawing module 510 is further configured to: mark the third group of pixels in the first group of pixels that correspond to the first object, and the mark indicates that the template test result of the third group of pixels is unsuccessful.
[0080] In some embodiments, the pixel determination module 540 is further configured to: determine a first group of candidate pixels that pass the depth test from the second group of pixels based on the depth information of the first group of pixels and the second group of pixels; determine a second group of candidate pixels that pass the template test from the second group of pixels based on the template test information of the first group of pixels and the second group of pixels; and determine a set of fused pixels based on the first group of candidate pixels and the second group of candidate pixels.
[0081] In some embodiments, the fusion drawing module 550 is further configured to: determine a second object associated with a set of fusion pixels; and, in response to determining that the second object is suitable for fusion with the first object, determine fusion drawing information of a set of fusion pixels based on first drawing information of the first object and second drawing information of the second object.
[0082] In some embodiments, the fusion drawing module 550 is further configured to: determine fusion marker information of the second object; and determine, based on the fusion marker information, that the second object is suitable for fusion with the first object.
[0083] In some embodiments, the fusion drawing module 550 is further configured to: in response to determining that the second object is not suitable for fusion with the first object, determine a set of target drawing information for fusion pixels based on the second drawing information of the second object.
[0084] In some embodiments, the second object includes an object associated with a character in a virtual scene.
[0085] In some embodiments, the fusion rendering module 550 is further configured to: for a target pixel in a set of fusion pixels: determine the distance from the target pixel to a first object; determine a fusion weight based on the distance; and fuse the first rendering information of the first object and the second rendering information of the second object based on the fusion weight to determine the target rendering information of the target pixel.
[0086] In some embodiments, the target rendering information includes at least first information corresponding to a first rendering attribute and second information corresponding to a second rendering attribute, and the first fusion weight used to determine the first information is different from the second fusion weight used to determine the second information.
[0087] In some embodiments, the fusion rendering module 550 is further configured to: determine target rendering information during the geometry processing stage, and the apparatus 500 further includes a lighting processing module configured to: determine the lighting information of the image to be rendered based on the target rendering information during the lighting processing stage.
[0088] In some embodiments, the first drawing information and / or the second drawing information are used to indicate the material information and / or color information of the corresponding object.
[0089] In some embodiments, the first object includes a surface object in a virtual scene.
[0090] The units included in device 500 can be implemented in various ways, including software, hardware, firmware, or any combination thereof. In some embodiments, one or more units may be implemented using software and / or firmware, such as machine-executable instructions stored on a storage medium. In addition to or as an alternative to machine-executable instructions, some or all of the units in device 500 may be implemented at least partially by one or more hardware logic components. By way of example and not limitation, exemplary types of hardware logic components that may be used include field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-chips (SoCs), complex programmable logic devices (CPLDs), and so on.
[0091] Figure 6 A block diagram of an electronic device 600 in which one or more embodiments of the present disclosure may be implemented is shown. It should be understood that... Figure 6 The electronic device 600 shown is merely exemplary and should not be construed as limiting the functionality and scope of the embodiments described herein. Figure 6 The electronic device 600 shown can be used to achieve Figure 2 Terminal device 210 and / or server 230.
[0092] like Figure 6 As shown, electronic device 600 is in the form of a general-purpose electronic device. Components of electronic device 600 may include, but are not limited to, one or more processors or processing units 610, memory 620, storage device 630, one or more communication units 640, one or more input devices 650, and one or more output devices 660. Processing unit 610 may be a physical or virtual processor and is capable of performing various processes according to programs stored in memory 620. In a multiprocessor system, multiple processing units execute computer-executable instructions in parallel to improve the parallel processing capability of electronic device 600.
[0093] Electronic device 600 typically includes multiple computer storage media. Such media can be any accessible media that is accessible to electronic device 600, including but not limited to volatile and non-volatile media, removable and non-removable media. Memory 620 can be volatile memory (e.g., registers, cache, random access memory (RAM)), non-volatile memory (e.g., read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. Storage device 630 can be a removable or non-removable medium and can include machine-readable media, such as flash drives, disks, or any other media that can be used to store information and / or data (e.g., training data for training) and can be accessed within electronic device 600.
[0094] Electronic device 600 may further include additional removable / non-removable, volatile / non-volatile storage media. Although not explicitly stated... Figure 6 As shown, disk drives for reading from or writing to removable, non-volatile disks (e.g., "floppy disks") and optical disk drives for reading from or writing to removable, non-volatile optical disks can be provided. In these cases, each drive can be connected to a bus (not shown) via one or more data media interfaces. Memory 620 may include computer program product 625 having one or more program modules configured to perform various methods or actions of various embodiments of this disclosure.
[0095] The communication unit 640 enables communication with other electronic devices via a communication medium. Additionally, the functionality of the components of the electronic device 600 can be implemented using a single computing cluster or multiple computing machines capable of communicating via communication connections. Therefore, the electronic device 600 can operate in a networked environment using logical connections to one or more other servers, network personal computers (PCs), or another network node.
[0096] Input device 650 can be one or more input devices, such as a mouse, keyboard, trackball, etc. Output device 660 can be one or more output devices, such as a monitor, speaker, printer, etc. Electronic device 600 can also communicate with one or more external devices (not shown) via communication unit 640 as needed. These external devices include storage devices, display devices, etc., and can communicate with one or more devices that enable user interaction with electronic device 600, or with any device that enables electronic device 600 to communicate with one or more other electronic devices (e.g., network card, modem, etc.). Such communication can be performed via input / output (I / O) interface (not shown).
[0097] According to an exemplary implementation of this disclosure, a computer-readable storage medium is provided that stores computer-executable instructions thereon, wherein the computer-executable instructions are executed by a processor to implement the methods described above. According to an exemplary implementation of this disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, which are executed by a processor to implement the methods described above.
[0098] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, devices, and computer program products implemented according to this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0099] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0100] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions that execute on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0101] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0102] Various implementations of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed implementations. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described implementations. The terminology used herein is chosen to best explain the principles, practical applications, or improvements to technology in the market, or to enable others skilled in the art to understand the various implementations disclosed herein.
Claims
1. An image drawing method, comprising: Draw a set of objects in the virtual scene to generate the first set of pixels; Adjust the coverage information of the first object in the group of objects in the virtual scene; Based on the adjusted coverage information, the first object in the set of objects is drawn to generate the second set of pixels; Based on the first group of pixels and the second group of pixels, a set of fused pixels associated with the first object is determined; as well as Based on at least one of the first rendering information of the first object and the second rendering information of the second object associated with the fusion region, target rendering information of the set of fused pixels is determined to render an image of the virtual scene, wherein the fusion region is determined based on the set of fused pixels. The set of fused pixels associated with the first object includes: Based on the depth information of the first group of pixels and the second group of pixels, a first group of candidate pixels that pass the depth test is determined from the second group of pixels; Based on the template test information of the first group of pixels and the second group of pixels, a second group of candidate pixels that have passed the template test is determined from the second group of pixels; and Based on the first group of candidate pixels and the second group of candidate pixels, the fused pixel set is determined.
2. The method according to claim 1, wherein adjusting the coverage information of the first object in the set of objects in the virtual scene comprises: Adjust the height of the first object in the rendered image of the virtual scene; or Adjust the depth of the first object in the rendered image of the virtual scene.
3. The method of claim 1, wherein drawing the first object in the set of objects comprises: Based on the adjusted coverage information, the updated vertex information of the first object is determined; as well as Based on the updated vertex information, the first object is drawn.
4. The method according to claim 1, further comprising: The third group of pixels in the first group of pixels, which corresponds to the first object, is marked, and the mark indicates that the template test result of the third group of pixels is failed.
5. The method according to claim 1, wherein determining the target rendering information of the set of fused pixels includes: Determine the second object associated with the set of fused pixels; as well as In response to determining that the second object is suitable for merging with the first object, merging drawing information of the set of merging pixels is determined based on the first drawing information of the first object and the second drawing information of the second object.
6. The method of claim 5, further comprising: Determine the fusion marker information of the second object; as well as Based on the fusion marker information, it is determined that the second object is suitable for fusion with the first object.
7. The method according to claim 5, further comprising: In response to determining that the second object is not suitable for fusion with the first object, target rendering information for the set of fused pixels is determined based on the second rendering information of the second object.
8. The method of claim 7, wherein the second object comprises an object associated with a character in a virtual scene.
9. The method according to claim 1, wherein determining the target rendering information of the set of fused pixels includes: For the target pixel in the aforementioned set of fused pixels: Determine the distance from the target pixel to the first object; Based on the distance, the fusion weights are determined; as well as Based on the fusion weight, the first drawing information of the first object and the second drawing information of the second object are fused to determine the target drawing information of the target pixel.
10. The method of claim 9, wherein the target rendering information includes at least first information corresponding to a first rendering attribute and second information corresponding to a second rendering attribute, and the first fusion weight used to determine the first information is different from the second fusion weight used to determine the second information.
11. The method of claim 1, wherein determining the target rendering information of the set of fused pixels includes determining the target rendering information during a geometry processing stage, the method comprising: In the lighting processing stage, the lighting information of the image to be drawn is determined based on the target drawing information.
12. The method according to claim 1, wherein at least one of the first drawing information and the second drawing information is used to indicate: material information of the corresponding object, or color information of the corresponding object.
13. The method according to claim 1, wherein the first object includes a surface object in the virtual scene.
14. An image rendering apparatus, comprising: The first drawing module is configured to draw a set of objects in the virtual scene to generate the first set of pixels; The coverage adjustment module is configured to adjust the coverage information of the first object in the group of objects in the virtual scene; The second drawing module is configured to draw the first object in the set of objects based on the adjusted coverage information to generate a second set of pixels; The pixel determination module is configured to determine a set of fused pixels associated with the first object based on the first set of pixels and the second set of pixels; as well as A blending rendering module is configured to determine target rendering information for the set of blended pixels based on at least one of first rendering information of the first object and second rendering information of a second object associated with the blending region, in order to render an image of the virtual scene, wherein the blending region is determined based on the set of blended pixels. The pixel determination module is further configured to: Based on the depth information of the first group of pixels and the second group of pixels, a first group of candidate pixels that pass the depth test is determined from the second group of pixels; Based on the template test information of the first group of pixels and the second group of pixels, a second group of candidate pixels that have passed the template test is determined from the second group of pixels; as well as Based on the first group of candidate pixels and the second group of candidate pixels, the fused pixel set is determined.
15. An electronic device comprising: At least one processing unit; as well as At least one memory, coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, which, when executed by the at least one processing unit, cause the electronic device to perform the method according to any one of claims 1 to 13.
16. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method according to any one of claims 1 to 13.
Citation Information
Patent Citations
Image processing method and device, computer equipment and storage medium
CN112907451A