An image rendering method, apparatus, device, storage medium, and program product

By baking and blending the material information of virtual objects, a blended baked texture is generated, which solves the problem of resource waste caused by multi-material rendering and improves image rendering efficiency.

CN114359458BActive Publication Date: 2026-03-24TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

In existing technologies, using multiple materials in image rendering leads to a waste of a large amount of computing and communication resources, affecting image rendering performance.

Method used

By acquiring multiple material information from the first level of detail model, performing image baking, and then fusing the baked textures, rendering interface calls are reduced, and the image is rendered using the fusing baked textures.

Benefits of technology

It saves computing and communication resources and improves the overall performance of image rendering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114359458B_ABST
    Figure CN114359458B_ABST
Patent Text Reader

Abstract

The application provides an image rendering method and device, electronic equipment, computer readable storage medium and computer program product. The method comprises: obtaining a plurality of material information of a first detail level model, wherein each material information comprises at least one map; performing image baking processing on the map included in each material information to obtain a baked map corresponding to each material information; performing fusion processing on the baked maps corresponding to at least part of the material information respectively to obtain a fused baked map; and performing image rendering processing on a second detail level model to be rendered based on the fused baked map to obtain a rendered second detail level model. The first detail level model has a higher level of detail than the second detail level model. The application saves relevant computing resources and communication resources.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to application number 202111453285.0, filed on December 1, 2021, entitled "An Image Rendering Method, Apparatus, Device, Storage Medium and Program Product". Technical Field

[0002] This application relates to computer graphics and image technology, and more particularly to an image rendering method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology

[0003] Display technologies based on graphics processing hardware have expanded the channels for perceiving the environment and acquiring information. In particular, virtual scene display technologies can realize diverse interactions between virtual objects controlled by users or artificial intelligence according to actual application needs. They have various typical application scenarios. For example, in virtual scenes such as games, they can simulate the real battle process between virtual objects.

[0004] In a virtual scene, when a virtual object in the camera's field of view is far from the camera, the details of the virtual object will decrease, meaning the level of detail of the corresponding model of detail for the virtual object is low; when a virtual object in the camera's field of view is close to the camera, the details of the virtual object will increase, meaning the level of detail of the corresponding model of detail for the virtual object is high.

[0005] In related technologies, multiple materials are used in image rendering to render a detailed model of the corresponding virtual object. Since the rendering process involving one material is one rendering interface call (DC, DrawCall), this approach results in multiple DrawCalls, wasting a lot of computing and communication resources, and thus affecting the overall performance of image rendering. Summary of the Invention

[0006] This application provides an image rendering method, apparatus, electronic device, computer-readable storage medium, and computer program product that can fully utilize fused baked textures, saving related computing and communication resources.

[0007] The technical solution of this application embodiment is implemented as follows:

[0008] This application provides an image rendering method, including:

[0009] Obtain multiple material information of the first level of detail model, wherein each material information includes at least one texture;

[0010] Image baking is performed on the texture included in each of the material information to obtain the baked texture corresponding to each of the material information;

[0011] The baked textures corresponding to at least some of the material information are fused together to obtain a fused baked texture.

[0012] Based on the fused baked texture, image rendering processing is performed on the second level of detail model to be rendered to obtain the rendered second level of detail model.

[0013] The level of detail of the first level of detail model is higher than that of the second level of detail model.

[0014] This application provides an image rendering apparatus, including:

[0015] The acquisition module is used to acquire multiple material information of the first level of detail model, wherein each material information includes at least one texture.

[0016] The baking module is used to perform image baking processing on the texture included in each of the material information to obtain a baked texture corresponding to each of the material information.

[0017] The fusion module is used to perform fusion processing on the baked textures corresponding to at least some of the material information to obtain a fused baked texture.

[0018] The rendering module is used to perform image rendering processing on the second level of detail model to be rendered based on the fused baked texture, so as to obtain the rendered second level of detail model; wherein the level of detail of the first level of detail model is higher than that of the second level of detail model.

[0019] In the above technical solution, the baking module is further configured to perform the following processing for any type of texture included in each of the material information:

[0020] The texture is mapped to texture space using a baking tool to obtain the mapped texture.

[0021] The material parameters of the mapped texture are adjusted to obtain the baked texture corresponding to the texture.

[0022] The set of baked textures corresponding to the textures included in each of the material information is used as the baked texture corresponding to each of the material information.

[0023] In the above technical solution, the baking module is further used to determine the vertex colors included in the first level of detail model;

[0024] Based on the vertex colors included in the first level of detail model, the mapped texture is adjusted to obtain the baked texture corresponding to the texture.

[0025] The vertex color corresponds to the material properties of the first level of detail model.

[0026] In the above technical solution, the baking module is also used to obtain configuration parameters for baking;

[0027] Based on the configuration parameters used for baking, the mapped texture is adjusted to obtain the baking texture corresponding to the texture.

[0028] The configuration parameters include at least one of the following: baking channel and baking resolution.

[0029] In the above technical solution, the fusion module is further configured to perform the following processing on any type of baked texture:

[0030] At least a portion of the material information is merged into the corresponding baked texture to obtain a blended baked texture.

[0031] The rendering module is also used to take at least one set of fused baked textures corresponding to the baked texture as new material information;

[0032] Based on the new material information, image rendering processing is performed on the second level of detail model to be rendered to obtain the rendered second level of detail model.

[0033] In the above technical solution, the fusion module is further used to determine a two-dimensional texture coordinate set for sampling based on the baked texture;

[0034] Based on the two-dimensional texture coordinate set, at least a portion of the material information corresponding to the baked texture is sampled to obtain a sampled map including multiple masking regions, wherein the masking regions correspond to the material information;

[0035] Based on the sampling map including multiple masking regions, the baked texture is processed by merging texture channels to obtain the fused baked texture corresponding to the baked texture.

[0036] In the above technical solution, the fusion module is further used to merge all the material information into the corresponding baked textures to obtain the fused baked textures.

[0037] In the above technical solution, the fusion module is further used to merge some of the material information corresponding to the baked textures to obtain the fused baked textures corresponding to the baked textures;

[0038] The rendering module is also used to take at least one set of fused baked textures corresponding to the baked texture as new material information;

[0039] Based on the new material information and the material information corresponding to the unmerged baked texture, the second level of detail model to be rendered is subjected to image rendering processing to obtain the rendered second level of detail model.

[0040] In the above technical solution, before merging the partially material information corresponding to the baked textures to obtain the fused baked texture corresponding to the baked texture, the fusion module is also used to display the baked textures corresponding to the multiple material information respectively;

[0041] In response to the selection operation of the baked texture corresponding to the plurality of material information respectively, the selected baked texture is used as the baked texture corresponding to a portion of the material information respectively.

[0042] In the above technical solution, before merging the partial material information corresponding to the baked texture to obtain the fused baked texture, the fusion module is further used to filter the multiple material information based on the merging characteristics of the multiple material information to obtain the partial material information used for merging.

[0043] In the above technical solution, the merging feature of the multiple material information includes the similarity between the material information; the fusion module is also used to perform similarity processing on the multiple material information to obtain the similarity between any two material information.

[0044] Based on the similarity between any two material information items, the multiple material information items are sorted in descending order, and the material information item ranked first in the descending order is taken as part of the material information items.

[0045] In the above technical solution, the merging feature of the multiple material information includes the level of detail of the material information; the fusion module is also used to determine the regions of the first level of detail model corresponding to the multiple material information respectively;

[0046] The level of detail of the material information is determined based on the level of detail corresponding to the region.

[0047] Based on the level of detail of the multiple material information, the multiple material information is sorted in ascending order, and the material information that appears first in the ascending order is taken as part of the material information.

[0048] This application provides an electronic device for image rendering, the electronic device comprising:

[0049] Memory, used to store executable instructions;

[0050] The processor, when executing executable instructions stored in the memory, implements the image rendering method provided in the embodiments of this application.

[0051] This application provides a computer-readable storage medium storing executable instructions for inducing a processor to execute and implement the image rendering method provided in this application.

[0052] This application provides a computer program product, including a computer program or instructions, characterized in that the computer program or instructions, when executed by a processor, implement the image rendering method provided in this application.

[0053] The embodiments of this application have the following beneficial effects:

[0054] By fusing the baked textures corresponding to at least some of the material information to obtain a fused baked texture, and performing image rendering processing on the second level of detail model to be rendered based on the fused baked texture, the fused baked texture is fully utilized, rendering interface calls are reduced, thereby saving rendering-related computing and communication resources and improving the overall performance of image rendering. Attached Figure Description

[0055] Figure 1A-Figure 1B This is a schematic diagram illustrating the application mode of the image rendering method provided in the embodiments of this application;

[0056] Figure 2 This is a schematic diagram of the structure of an electronic device for image rendering provided in an embodiment of this application;

[0057] Figures 3A-3C This is a schematic flowchart of the image rendering method provided in the embodiments of this application;

[0058] Figure 4 These are schematic diagrams of different levels of detail models in the engine provided by related technologies;

[0059] Figure 5 This is a schematic flowchart of the image rendering method provided in the embodiments of this application;

[0060] Figure 6 This is a schematic diagram of the configuration settings in the baking process provided in the embodiments of this application;

[0061] Figure 7 This is a schematic diagram of the sampling map (ID Map) provided in the embodiments of this application;

[0062] Figure 8 This is a schematic diagram of the building model provided in the embodiments of this application;

[0063] Figure 9 It is the baked texture provided in the embodiments of this application;

[0064] Figure 10 This is the merged result of the texture merging provided in the embodiments of this application;

[0065] Figure 11 This is the rendered building model provided in the embodiments of this application;

[0066] Figure 12 This is a comparative diagram of the rendering information of each channel required and the final result provided in the embodiments of this application;

[0067] Figure 13 This is a material schematic diagram provided in the embodiments of this application;

[0068] Figure 14 This is a material schematic diagram provided in the embodiments of this application. Detailed Implementation

[0069] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0070] In the following description, the terms "first" and "second" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first" and "second" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0071] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0072] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.

[0073] 1) Responding to: used to indicate the conditions or states on which the operation is performed depends. When the conditions or states on which it depends are met, one or more operations can be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations are performed.

[0074] 2) Client: An application running on a terminal that provides various services, such as a video playback client, a game client, etc.

[0075] 3) Virtual Scene: A virtual scene displayed (or provided) by the application when it runs on the terminal. This virtual scene can be a simulation of the real world, a semi-simulated / semi-fictional virtual environment, or a purely fictional virtual environment. The virtual scene can be any of a two-dimensional, 2.5-dimensional, or three-dimensional virtual scene; this application embodiment does not limit the dimension of the virtual scene. For example, a virtual scene may include the sky, land, ocean, etc., and the land may include environmental elements such as deserts and cities. Users can control virtual objects to move within this virtual scene.

[0076] 4) Virtual Objects: These are interactive images of people and objects within a virtual scene, or movable objects within the virtual scene. These movable objects can be virtual characters, virtual animals, anime characters, etc., such as people or animals displayed in a virtual scene. A virtual object can be a virtual avatar representing the user within the virtual scene. A virtual scene can include multiple virtual objects, each with its own shape and volume, occupying a portion of the space within the virtual scene.

[0077] 5) Scene data: This represents the characteristic data of the virtual scene, such as the area of ​​the construction area in the virtual scene, the current architectural style of the virtual scene, etc.; it can also include the location of the virtual building in the virtual scene, and the area occupied by the virtual building, etc.

[0078] 6) Image Baking: Baking objects using lightmap technology is a technique to enhance the lighting effects of a scene. It makes the scene look more realistic, richer, and more three-dimensional with lower performance. Baking involves rendering the details of a high-precision model using textures, and then applying the rendered textures to a low-precision model, making the low-precision model appear to have the details of the high-precision model.

[0079] 7) Level of Detail (LOD): This technique optimizes rendering efficiency by allocating rendering resources (such as face count and shader count) based on the model's position and importance in the 3D environment. When virtual objects in a virtual scene are far from the camera, the amount of detail visible is greatly reduced. The level of detail (i.e., the number of triangular meshes) of virtual objects can be adjusted according to their distance from the camera. Different precision LODs are activated for different distances, presenting virtual objects in the virtual scene based on different precision LODs.

[0080] 8) GPU instance: Using GPU instance, multiple copies of the same mesh can be rendered at once, using only a small number of draw calls. It is suitable for rendering objects that appear repeatedly in the scene, such as buildings, trees, and grass.

[0081] 9) Rendering Interface Call (DC, DrawCall): This is the operation where the Central Processing Unit (CPU) calls the graphics programming interface (such as DirectX or OpenGL) to instruct the Graphics Processing Unit (GPU) to perform rendering. It is used to measure rendering performance. The CPU adds commands to the command buffer through the graphics programming interface, while the GPU retrieves commands from the buffer and processes them. DrawCall is the number of times OpenGL renders. A simple OpenGL drawing sequence is: set color → drawing mode → vertex coordinates → draw → end.

[0082] 10) Image rendering: The process of converting three-dimensional light energy transfer processing into a two-dimensional image. Representing scenes and objects in three dimensions is closer to the real world and easier to manipulate and transform, while image display devices are mostly two-dimensional raster displays and pixelated printers. Image rendering, or rasterization, is the representation of a three-dimensional scene using N-dimensional raster and pixelated methods. A raster display can be viewed as a pixel matrix; any image displayed on a raster display is actually a collection of pixels with one or more colors and grayscale levels.

[0083] This application provides an image rendering method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can fully utilize blended baked textures, saving related computing and communication resources. To facilitate a clearer understanding of the image rendering method provided in this application, exemplary implementation scenarios of the image rendering method are first described. The virtual objects in the image rendering method provided in this application can be entirely based on terminal output, or based on collaborative output from both the terminal and the server.

[0084] In some embodiments, the virtual scene can be an environment for game characters to interact, such as a virtual scene for game characters to fight each other. By controlling the actions of the game characters, the two sides can interact in the virtual scene, thereby allowing users to relieve life stress during the game.

[0085] In one implementation scenario, see Figure 1A , Figure 1AThis is a schematic diagram of the application mode of the image rendering method provided in the embodiments of this application. It is applicable to some application modes that can complete the relevant data calculation of the virtual scene 100 by relying entirely on the graphics processing hardware computing power of the terminal 400, such as stand-alone / offline games, and complete the output of the virtual scene through various types of terminals 400 such as smartphones, tablets and virtual reality / augmented reality devices.

[0086] As an example, types of graphics processing hardware include central processing units (CPUs) and graphics processing units (GPUs).

[0087] When visual perception of virtual scene 100 is formed, terminal 400 calculates the data required for display through graphics computing hardware, and completes the loading, parsing and rendering of display data. The graphics output hardware outputs video frames that can form visual perception of virtual scene. For example, two-dimensional video frames are presented on the display screen of a smartphone, or video frames that achieve three-dimensional display effect are projected on the lenses of augmented reality / virtual reality glasses. In addition, in order to enrich the perception effect, terminal 400 can also use different hardware to form one or more of auditory perception, tactile perception, motion perception and taste perception.

[0088] As an example, a client 410 (e.g., a standalone game application) runs on terminal 400. During the operation of client 410, the output includes a virtual scene for role-playing. The virtual scene can be an environment for game characters to interact with, such as plains, streets, valleys, etc., for game characters to fight. Taking the virtual scene 100 displayed in a first-person perspective as an example, the virtual object 101 located in the camera's field of view in the virtual scene 100 can be a game character controlled by the user (or player). That is, the virtual object 101 is controlled by the real user (enemy) and will operate in the virtual scene in response to the real user's operation of buttons (including joystick buttons, attack buttons, defense buttons, etc.). For example, when the real user moves the joystick button to the left, the virtual object will move to the left in the virtual scene. It can also remain stationary, jump, and use various functions (such as skills and items). The virtual object 101 can also be artificial intelligence (AI) trained and set in the virtual scene battle. The virtual object 101 can also be a non-user character (NPC) set in the virtual scene interaction. Character); Virtual object 101 can also be an inactive or active object in virtual scene 100.

[0089] For example, taking a first-person, top-down view of a virtual scene 100 as an example, a virtual object 101 is displayed in the camera's field of view within the virtual scene. This virtual object 101 is displayed using multiple detail level models with varying degrees of detail. For instance, the detail level models of the virtual object 101 are quickly obtained as follows: the detail level model acquires multiple material information from the first detail level model of the virtual object 101; the baked textures corresponding to at least some of the material information are then blended to obtain a blended baked texture; and image rendering processing is performed on the second detail level model to be rendered based on the blended baked texture to obtain the rendered second detail level model. After obtaining multiple detail level models of the virtual object 101, the virtual object controlled by the player in the virtual scene dives downwards, i.e., the camera dives downwards. As a result, the virtual object 101 in the camera's field of view gets closer and closer to the camera, determining a detail level model that is adapted to the camera's distance. This allows for smooth switching of the virtual object 101 based on an accurate and adapted detail level model, improving the human-computer interaction effect of the virtual scene and enhancing the user experience.

[0090] In another implementation scenario, see Figure 1B , Figure 1B This is a schematic diagram of the application mode of the image rendering method provided in the embodiments of this application. It is applied to the terminal 400 and the server 200 and is suitable for the application mode that relies on the computing power of the server 200 to complete the virtual scene calculation and output the virtual scene on the terminal 400.

[0091] Taking the visual perception of virtual scene 100 as an example, server 200 calculates display data related to the virtual scene (such as scene data) and sends it to terminal 400 via network 300. Terminal 400 relies on graphics computing hardware to load, parse, and render the calculated display data, and relies on graphics output hardware to output the virtual scene to form visual perception. For example, two-dimensional video frames can be displayed on the screen of a smartphone, or video frames with a three-dimensional display effect can be projected onto the lenses of augmented reality / virtual reality glasses. As for the perception of the form of the virtual scene, it can be understood that it can be achieved with the help of the corresponding hardware output of terminal 400, such as using a microphone to form auditory perception, using a vibrator to form tactile perception, and so on.

[0092] As an example, a client 410 (e.g., a network-based game application) runs on terminal 400. It interacts with other users through a connection to server 200 (e.g., a game server). Terminal 400 outputs a virtual scene 100 from client 410. For example, the virtual scene 100 is displayed in a first-person perspective. Within the virtual scene 100, a virtual object 101 is located in the camera's field of view. The virtual object 101 can be a game character controlled by a user (or player), meaning it is controlled by the real user (or enemy) and will respond to the real user's actions on buttons (including joystick buttons, attack buttons, defense buttons, etc.) in the virtual scene. For example, when the real user moves the joystick button to the left, the virtual object will move to the left in the virtual scene. It can also remain stationary, jump, and use various functions (such as skills and items). The virtual object 101 can also be artificial intelligence (AI) trained and set up for virtual scene battles. Furthermore, the virtual object 101 can be a non-user character (NPC) set up for interaction in the virtual scene. Character); Virtual object 101 can also be an inactive or active object in virtual scene 100.

[0093] For example, taking a first-person, top-down view of a virtual scene 100 as an example, a virtual object 101 is displayed in the camera's field of view within the virtual scene. This virtual object 101 is displayed using multiple detail level models with varying degrees of detail. For instance, the detail level models of the virtual object 101 are quickly obtained through image rendering: the detail level model acquires multiple material information from the first detail level model of the virtual object 101, and the baked textures corresponding to at least some of the material information are fused to obtain a fused baked texture. Based on the fused baked texture, the second detail level model to be rendered is processed using image rendering to obtain the rendered second detail level model. After obtaining multiple detail level models of the virtual object 101, the virtual object controlled by the player in the virtual scene dives, i.e., the camera dives. As a result, the virtual object 101 in the camera's field of view gets closer and closer to the camera, determining a detail level model that is adapted to the camera's distance. This allows for smooth switching of the virtual object 101 based on an accurate and adapted detail level model, improving the human-computer interaction effect of the virtual scene and enhancing the user experience.

[0094] In some embodiments, the terminal 400 can implement the image rendering method provided in this application embodiment by running a computer program. For example, the computer program can be a native program or software module in the operating system; it can be a native application (APP), that is, a program that needs to be installed in the operating system to run, such as a dress-up game APP (i.e., the client 410 mentioned above); it can also be a mini-program, that is, a program that only needs to be downloaded into the browser environment to run; or it can be a game mini-program that can be embedded in any APP. In short, the above-mentioned computer program can be any form of application, module or plugin.

[0095] Taking a computer program as an example, in actual implementation, terminal 400 has an application that supports virtual scenes installed and running. This application can be any of the following: a first-person shooter (FPS) game, a third-person shooter game, a virtual reality application, a 3D map application, or a multiplayer shooting survival game. Users use terminal 400 to manipulate virtual objects located in the virtual scene, and these activities include, but are not limited to: adjusting body posture, crawling, walking, running, riding, jumping, driving, picking up items, shooting, attacking, throwing, and constructing virtual buildings—at least one of these. For illustrative purposes, the virtual object can be a virtual character, such as a realistic or anime character.

[0096] In some embodiments, the present application embodiments can also be implemented with the aid of cloud technology, which refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to realize the computation, storage, processing, and sharing of data.

[0097] Cloud technology is a general term encompassing network technology, information technology, integration technology, management platform technology, and application technology based on the cloud computing business model. It can form resource pools, allowing for on-demand use with flexibility and convenience. Cloud computing technology will become a crucial support. The backend services of cloud computing systems require substantial computing and storage resources.

[0098] Example, Figure 1BThe server 200 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, CDN, and big data and artificial intelligence platforms. The terminal 400 can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The terminal 400 and server 200 can be directly or indirectly connected via wired or wireless communication, which is not limited in this embodiment.

[0099] See Figure 2 , Figure 2 This is a schematic diagram of the structure of an electronic device for image rendering provided in an embodiment of this application. The description uses terminal 400 as an example. Figure 2 The illustrated electronic device 400 includes at least one processor 420, a memory 460, at least one network interface 430, and a user interface 440. The various components in the terminal 400 are coupled together via a bus system 450. It is understood that the bus system 450 is used to implement communication between these components. In addition to a data bus, the bus system 450 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in… Figure 2 The general labeled all buses as Bus System 450.

[0100] Processor 420 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor.

[0101] User interface 440 includes one or more output devices 441 that enable the presentation of media content, including one or more speakers and / or one or more visual displays. User interface 440 also includes one or more input devices 442, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0102] The memory 460 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 460 may optionally include one or more storage devices physically located away from the processor 420.

[0103] The memory 460 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 460 described in this application embodiment is intended to include any suitable type of memory.

[0104] In some embodiments, memory 460 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.

[0105] Operating system 461 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;

[0106] The network communication module 462 is used to reach other computing devices via one or more (wired or wireless) network interfaces 430, exemplary network interfaces 430 including: Bluetooth, WiFi, and Universal Serial Bus (USB), etc.

[0107] Presentation module 463 is configured to enable the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 441 (e.g., a display screen, a speaker, etc.) associated with user interface 440;

[0108] The input processing module 464 is used to detect and translate one or more user inputs or interactions from one or more input devices 442.

[0109] In some embodiments, the image rendering apparatus provided in this application can be implemented in software. Figure 2 An image rendering apparatus 465 stored in memory 460 is shown. It may be software in the form of programs and plug-ins, including the following software modules: acquisition module 4651, baking module 4652, fusion block 4653, and rendering module 4654. These modules are logical and can therefore be arbitrarily combined or further split according to the functions they implement.

[0110] In other embodiments, the image rendering apparatus provided in this application can be implemented in hardware. As an example, the image rendering apparatus provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the image rendering method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0111] The image rendering method provided in the embodiments of this application will now be described in detail with reference to the accompanying drawings. Figure 1A Terminal 400 can be executed independently, or it can be... Figure 1B Terminal 400 and server 200 work together to execute.

[0112] Below, by Figure 1A The following description uses the example of terminal 400 executing the image rendering method provided in this embodiment of the application independently. See also... Figure 3A , Figure 3A This is a flowchart illustrating the image rendering method provided in the embodiments of this application, which will be combined with... Figure 3A The steps shown are explained.

[0113] It should be noted that, Figure 3A The method shown can be executed by various forms of computer programs running on terminal 400, and is not limited to the client 410 described above. It can also be the operating system 461, software modules and scripts mentioned above. Therefore, the client should not be regarded as a limitation on the embodiments of this application.

[0114] In the following steps, the level of detail of the first level of detail model is higher than that of the second level of detail model.

[0115] In step 101, multiple material information of the first level of detail model is obtained, wherein each material information includes at least one texture.

[0116] It should be noted that in a virtual scene, virtual objects are presented using multiple levels of detail (level of detail) models. When a virtual object is close to the camera in the virtual scene, it needs to be presented using a lower level of detail model, such as the first level of detail model (e.g., LOD0). When a virtual object is far from the camera in the virtual scene, it needs to be presented using a higher level of detail model, such as the second level of detail model (e.g., LOD1).

[0117] To quickly obtain more levels of detail models, the first level of detail model is used as the basis, and multiple material information required for rendering the first level of detail model is obtained. Each material information (distinguished by a material identifier (ID)) includes at least one texture. For example, a certain material information includes a diffuse map, a normal map, and an RMA map (indicating that the RBG channels store roughness, metallicity, and ambient occlusion (AO) information respectively).

[0118] In step 102, image baking is performed on the texture included in each material information to obtain the baked texture corresponding to each material information.

[0119] For example, before rendering an image based on the textures included in the material information, it is necessary to perform image baking on each texture included in the material information to obtain a baked texture (i.e., a baked texture) corresponding to each material information. Then, image rendering is performed based on the baked textures corresponding to each material information to obtain a second level of detail model that is higher than the first level of detail model.

[0120] See Figure 3B , Figure 3B This is an optional flowchart illustrating the image rendering method provided in an embodiment of this application. Figure 3B Show Figure 3A Step 102 can be implemented through steps 1021-1023: In step 1021, the following processing is performed on any texture included in each material information: the texture is mapped to texture space using a baking tool to obtain the mapped texture; in step 1022, the material parameters of the mapped texture are adjusted to obtain the baked texture corresponding to the texture; in step 1023, the set of baked textures corresponding to the textures included in each material information is taken as the baked texture corresponding to each material information.

[0121] For example, for any texture included in each material information, the following processing is performed: The texture is output to a complete texture using the Bake Out Materials function in Unreal Engine 4 (UE4), i.e., mapped to a flat 2D texture coordinate set (UV Set) to obtain the mapped texture. Then, based on the material parameter configuration, the material parameters of the mapped texture are adjusted to obtain the corresponding baked texture. The set of baked textures corresponding to the textures included in each material information is used as the baked texture for each material information. For example... Figure 9 As shown, textures 901, 902, and 903 are the baked textures.

[0122] It should be noted that the following processing is performed on any texture included in each material information: the material parameters of the texture are adjusted using a baking tool to obtain the baked texture corresponding to the texture; the baked texture corresponding to the texture is then processed by texture space mapping to obtain the mapped texture (the mapped texture); and the set of mapped textures corresponding to the textures included in each material information is used as the baked texture corresponding to each material information.

[0123] In some embodiments, adjusting the material parameters of the mapped texture to obtain a baked texture corresponding to the texture includes: determining the vertex colors included in the first level of detail model; adjusting the parameters of the mapped texture based on the vertex colors included in the first level of detail model to obtain a baked texture corresponding to the texture; wherein the vertex colors correspond to the material properties of the first level of detail model.

[0124] For example, when the configuration information of material parameters is obtained, if the Use Mesh Data switch in the configuration information is turned on, it indicates that the vertex colors of the first level of detail model participate in the baking calculation. The vertex colors participate in the material attribute calculation of the level of detail model, such as color and metallicity. Based on the vertex colors included in the first level of detail model, the parameters of the mapped texture are adjusted. The baked texture can reflect the baking result after the influence of color, metallicity, etc., thus reflecting the influence of color, metallicity, etc. of the level of detail model.

[0125] In some embodiments, the material parameters of the mapped texture are adjusted to obtain the baked texture corresponding to the texture, including: obtaining configuration parameters for baking; adjusting the parameters of the mapped texture based on the configuration parameters for baking to obtain the baked texture corresponding to the texture; wherein the configuration parameters include at least one of the following: baking channel, baking resolution.

[0126] For example, the configuration information of material parameters is obtained, and the parameters of the mapped texture are adjusted based on the configuration parameters for baking in the configuration information. For example, the configuration parameters for baking include the channel to be baked (baking channel) and the resolution of the output texture (baking resolution). For example, setting the texture resolution (e.g., 512, 1024, etc.) means that the resolution of the output baked texture is 512, 1024, etc. The resolution can directly affect the quality of the baked texture.

[0127] In step 103, the baked textures corresponding to at least some of the material information are fused to obtain a fused baked texture.

[0128] For example, after obtaining the baked texture (i.e. the baked texture) corresponding to each material information, the baked textures corresponding to at least some of the material information are fused to obtain a fused baked texture. Image rendering is then performed based on the fused baked texture to obtain a second level of detail model with a higher level than the first level of detail model. This allows for image rendering based on fewer textures, reduces rendering interface calls, saves rendering-related computing and communication resources, and improves the overall performance of image rendering.

[0129] In step 104, the second level of detail model to be rendered is processed by image rendering based on the fused baked texture to obtain the rendered second level of detail model.

[0130] For example, after obtaining the blended baked map (i.e. the blended baked map), image rendering is performed based on the blended baked map to obtain a second level of detail model with a higher level than the first level of detail model. This allows image rendering to be performed based on fewer maps, reducing rendering interface calls, thereby saving rendering-related computing and communication resources and improving the overall performance of image rendering.

[0131] It should be noted that rendering the second level of detail model based on the fused baked texture is a single rendering interface call, while rendering the second level of detail model based on baked textures containing multiple material information is a multiple rendering interface call. For example, if the first level of detail model contains three material information, then three rendering interface calls are required, which increases the number of rendering interface calls and reduces the overall performance of image rendering.

[0132] See Figure 3C , Figure 3C This is an optional flowchart illustrating the image rendering method provided in an embodiment of this application. Figure 3C Show Figure 3AStep 103 can be implemented through step 1031: In step 1031, the following processing is performed for any type of baked texture: at least some material information is merged into the corresponding baked texture to obtain the fused baked texture corresponding to the baked texture. Figure 3C Show Figure 3A Step 104 can be implemented through steps 1041-1042: In step 1041, the set of fused baked maps corresponding to at least one baked map is used as new material information; in step 1042, based on the new material information, the second level of detail model to be rendered is subjected to image rendering processing to obtain the rendered second level of detail model.

[0133] For example, for any baked texture (e.g., a diffuse texture) among multiple material information, such as a first level of detail model including three material information, it has the following characteristics: Figure 9 The three diffuse textures shown are combined to obtain the following result: Figure 10 The merged result shown (i.e., the blended baked map corresponding to the diffuse map) is finally used as the final diffuse map. The set of blended baked maps corresponding to at least one baked map is used as new material information. That is, at least some material information is merged into a new material information. Based on the new material information, the image rendering process is performed on the second level of detail model to be rendered, and the rendered second level of detail model is obtained. Thus, image rendering is performed based on less material information, reducing rendering interface calls, thereby saving rendering-related computing and communication resources and improving the overall performance of image rendering.

[0134] In some embodiments, at least some material information is merged with corresponding baked textures to obtain a blended baked texture, including: determining a two-dimensional texture coordinate set for sampling based on the baked texture; sampling the baked texture corresponding to at least some material information based on the two-dimensional texture coordinate set to obtain a sampling map including multiple masking regions, wherein the masking regions correspond to the material information; and merging texture channels of the baked texture based on the sampling map including multiple masking regions to obtain a blended baked texture.

[0135] For example, the baking process also maps the baked texture to a fully expanded initial 2D texture coordinate set (UV Set) to obtain a 2D texture coordinate set for sampling. A model or vertex can have multiple UV Sets simultaneously, and these UV Sets do not affect each other. In this embodiment, the fully expanded UV Set represents the second set of 2D texture coordinates (UV). Based on the 2D texture coordinate set, at least a portion of the material information corresponding to the baked texture is sampled to obtain a sample map (ID Map) including multiple masking regions. The masking regions correspond to material information; for example, if masking regions are distinguished by different colors, then a masking region of one color corresponds to one material information. Using a baking ID Map tool, the baked texture is combined with the sample map including multiple masking regions to merge the texture channels, resulting in a fused baked texture corresponding to the baked texture. That is, baked textures with different material information are distinguished by different colors and stored in the texture color channel. By individually extracting the masking region corresponding to a specific color, the masking region of that material information in the second set of UVs can be extracted. The extracted masking regions are then merged to obtain the fused baked texture corresponding to the baked texture.

[0136] In some embodiments, at least some material information is merged with the corresponding baked textures to obtain a blended baked texture, including: merging all material information with the corresponding baked textures to obtain a blended baked texture.

[0137] For example, in order to minimize rendering interface calls, all material information is merged into a new material information by baking the corresponding textures. This allows rendering to be performed based on the textures included in the new material information, thereby reducing the overall number of samples and improving rendering efficiency.

[0138] As an example, the first level of detail model has three material information pieces. These three material information pieces are merged into a new material information piece, and rendering is performed based on the textures included in this new material information, resulting in... Figure 11 The building model 1101 shown is rendered using material information 1102.

[0139] In some embodiments, merging at least some material information corresponding to baked maps to obtain a blended baked map corresponding to the baked map includes: merging some material information corresponding to baked maps to obtain a blended baked map corresponding to the baked map; performing image rendering processing on the second level of detail model to be rendered based on the blended baked map to obtain a rendered second level of detail model, including: using a set of blended baked maps corresponding to at least one baked map as new material information; performing image rendering processing on the second level of detail model to be rendered based on the new material information and the material information corresponding to the unmerged baked maps to obtain a rendered second level of detail model.

[0140] For example, considering that some material information includes textures with significant differences, embodiments of this application can merge some material information and their corresponding baked textures to obtain a blended baked texture. A set of at least one blended baked texture corresponding to a baked texture is then used as new material information. Based on this new material information and the material information corresponding to the unmerged baked textures, image rendering processing is performed on the second level of detail (LLD) model to be rendered, resulting in the rendered second LLD model. By retaining some material information, the difference between the second LLD model and the first LLD model is reduced, thereby ensuring high-quality rendering effects at long distances while optimizing the rendering logic for distant scenes and achieving smooth transitions between LODs, thus improving the overall performance of scene rendering.

[0141] As an example, the first level of detail model includes three material information sets (e.g., material 1, material 2, and material 3), each requiring three texture maps (e.g., diffuse map, normal map, and RMA). Material 1 and material 2 are merged to obtain new material information (including diffuse map, normal map, and RMA). Based on this new material information (including diffuse map, normal map, and RMA) and material information 3 (including diffuse map, normal map, and RMA), the second level of detail model to be rendered is processed to obtain the rendered second level of detail model.

[0142] In some embodiments, before merging the baked textures corresponding to the partial material information to obtain the fused baked texture, the baked textures corresponding to the multiple material information are displayed; in response to the selection operation of the baked textures corresponding to the multiple material information, the selected baked texture is used as the baked texture corresponding to the partial material information.

[0143] For example, multiple baked textures corresponding to different material information can be displayed. Users can manually select and merge these textures. Based on the new material information and the material information from the unmerged baked textures, image rendering is performed on the second level of detail (LHD) model to be rendered, resulting in the rendered LHD model. This allows for the merging of some material information according to user preferences, reducing rendering API calls and improving the overall performance of scene rendering.

[0144] In some embodiments, before merging the partial material information corresponding to the baked textures to obtain the fused baked texture, the multiple material information is filtered based on the merging characteristics of the multiple material information to obtain the partial material information used for merging.

[0145] For example, after obtaining the baked texture, the merging feature of multiple material information is combined to automatically select the material information to be merged from multiple material information, thereby achieving fully automatic image rendering and improving the overall performance of scene rendering.

[0146] In some embodiments, the merging feature of multiple material information includes the similarity between material information; the filtering process of multiple material information based on the merging feature of multiple material information to obtain partial material information for merging includes: performing similarity processing on multiple material information to obtain the similarity between any two material information; performing descending sorting processing on multiple material information based on the similarity between any two material information, and taking the material information ranked first in the descending sorting result as partial material information.

[0147] For example, similarity processing is performed on multiple material information (including at least one texture) to obtain the similarity between any two material information pieces. For instance, similarity calculation is performed on baked textures included in any two material information pieces, and the calculated similarity is used as the similarity between the two material information pieces. Based on the similarity between the two material information pieces, the baked textures are sorted in descending order, and the material information that appears first in the descending sort result is used as part of the material information. Therefore, merging relatively similar material information reduces the difference between the second level of detail (LLD) model and the first level of detail (LLD) model. While ensuring high-quality rendering effects at long distances, it optimizes the rendering logic for distant scenes and achieves smooth transitions between LODs, improving the overall performance of scene rendering.

[0148] In some embodiments, the merging feature of multiple material information includes the level of detail of the material information; the multiple material information is filtered based on the merging feature to obtain partial material information for merging, including: determining the regions of the first level of detail model corresponding to the multiple material information; determining the level of detail of the material information based on the level of detail corresponding to the region; sorting the multiple material information in ascending order based on the level of detail of the multiple material information, and taking the material information ranked first in the ascending order as partial material information.

[0149] For example, multiple material information points are identified, each corresponding to a region in the first level of detail (LOD) model. The level of detail corresponding to each region is used as the level of detail for the material information. Based on these levels of detail, the multiple material information points are sorted in ascending order. The material information that appears first in the sorted result is then used as a partial material information point. Therefore, material information points with lower levels of detail are merged, thus avoiding the neglect and reduction of detail in the second level of detail (LOD) model. This ensures high-quality rendering at long distances while optimizing the rendering logic for distant scenes and achieving smooth transitions between LODs, thereby improving the overall performance of scene rendering.

[0150] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario.

[0151] This application's embodiments can be applied to games with Level of Detail (LOD) models. Based on the model's position and importance in the 3D environment, the resource allocation for object rendering (such as face count, number of shaders, etc.) is determined. For example, when a virtual object in a virtual scene is far from the camera, the amount of model detail visible will be greatly reduced. The amount of detail (i.e., the level of detail) of the virtual object can be adjusted according to its distance from the camera. Different levels of detail models are activated for different distances, presenting virtual objects in the virtual scene based on different levels of detail models.

[0152] The following explanation uses a virtual game scenario as an example:

[0153] Among related technologies, a widely used model rendering optimization scheme is to use Level of Detail (LOD) to classify the polygon count of models. This scheme uses LOD0 models with a high polygon count for near-viewing objects and LOD1 models with a low polygon count for distant objects. For simple models, this can achieve the optimization goal of using the same number of shaders across different LOD levels.

[0154] However, architectural models are quite complex. If different parts of the model need to be able to use different textures or texture blending, the faces of the architectural model need to be assigned to different material IDs (Identity Documents) and corresponding to different shaders. For example... Figure 4 As shown, when blending textures, mask textures or vertex colors are also used to distinguish regions. In the engine, the selection of LOD level is also important. The higher the LOD level, the lower the number of faces. For example, LOD0 has 1498 model faces, LOD1 has 771 model faces, and LOD2 has 28 model faces.

[0155] For architectural models using multi-texture hybrid rendering, multiple material IDs are needed to achieve the desired LOD0 effect, and each material ID requires multiple color texture samples to be mixed to achieve the final rendering result. This approach leads to the need for multiple material IDs at LOD1 and higher levels to maintain consistent results, resulting in multiple DrawCalls during the rendering process and placing a significant performance load on the entire scene rendering. Each DrawCall occurs when one of the model's materials is involved in the rendering process.

[0156] To address the aforementioned issues, this application provides a method for rendering a building LOD1 model using a single DrawCall, achieving a rendering effect nearly identical to that of rendering a LOD0 model using multiple variable texture blending and multiple DrawCalls. By reducing multiple materials to a single material, the entire process from texture baking to material rendering can maintain high-quality rendering effects at close range while optimizing distant scene rendering logic and achieving smooth transitions between LODs, thus reducing the overall performance degradation of scene rendering.

[0157] like Figure 5 As shown in the embodiment of this application, the process of rendering a building LOD1 model using a DrawCall includes adjusting the LOD0 material effects (each material uses multiple color map samples), baking the textures of the final rendering information, merging the textures according to the flattened two-dimensional texture coordinate set (UV Set), and creating a non-LOD0 material example using a new material. It should be noted that the two-dimensional texture coordinates (UV) include the vertex information of the polygon mesh. The overall technical solution will be described in detail below in conjunction with the actual use of Digital Content Creation (DCC) tools and engines.

[0158] 1) About baking

[0159] The baking process takes place in Unreal Engine 4 (UE4) and is accomplished through the Bake OutMaterials function in UE4. This function can output the final rendering result of each material ID to the entire texture (i.e., bake the final effect after material calculation and vertex color blending), including the blended texture of color map, normal map, roughness metallicity, etc.

[0160] Configuration settings during the baking process, such as Figure 6 As shown, LODs(601) represents the model quality level participating in baking. The Use Mesh Data switch 602 is used to ensure that information such as model vertex colors participate in the baking calculation. Vertex colors participate in the calculation of model material properties, such as color and metallicity. The baked texture can reflect the results after the effect. MaterialProperties is used to set the channels to be baked and the output texture resolution, such as setting the texture resolution (e.g., 512, 1024, etc.). The resolution can directly affect the texture quality.

[0161] 2) Regarding merging textures

[0162] After baking, the output files can be found in the same directory as the model. The output files include the rendered textures for each material ID and preview material instances automatically generated by the engine. In addition, the baking process will map the final texture calculation results to a fully unfolded UV set (a model / vertex can have multiple UV sets at the same time, and they do not affect each other). The fully unfolded UV set is designated by the artists as the model's second UV set.

[0163] The texture merging process is performed in Photoshop. The baked textures are exported to Photoshop, and layer blending is performed based on the ID Map (a texture where different colored areas represent areas of the model's UVs that use different materials). To facilitate texture merging based on material IDs, the ID Bake tool (a tool for baking ID Maps) developed based on the Maya Python API is used to bake the ID Maps. Figure 7 As shown, different material IDs are stored in color channels. By extracting a specific channel, the UV mask area of ​​that material ID can be extracted. Area 701 corresponds to one material, and area 702 corresponds to another material.

[0164] Taking architectural models as an example, such as Figure 8 As shown, the architectural model consists of three materials, distinguished by three colors: material 801 for the eaves, material 802 for the wall surface, and material 803 for the wall interior. In the rendering engine, each material originally required three texture maps (e.g., a diffuse map, a normal map, and an RMA (meaning the RGB channels store roughness, metallicity, and ambient occlusion information)). The optimization in this application involves baking a texture map based on a second set of UV samples within the engine.

[0165] For example, baking diffuse maps transforms the original three diffuse maps corresponding to three materials into something like this: Figure 9 The three diffuse maps shown are diffuse map 901, diffuse map 902, and diffuse map 903. However, this baking process involves more than just UV space changes; it also includes calculating some parameters in the material, such as multiplying by a certain color or vertex color, which affects the final diffuse rendering input. Figure 9 The three diffuse textures shown are merged according to the ID Map to obtain the following result: Figure 10 The merged result shown is used as the final diffuse map (different material IDs are distinguished by different colors and stored in the texture color channel; the mask area corresponding to a specific color can be extracted to obtain the mask area of ​​that material ID in the second set of UVs, and the merge is performed based on the extracted mask area). Normals and other maps are processed in the same way, allowing the three maps of three materials to be merged into three maps of one material. Finally, rendering is performed based on the three maps of one material to obtain the result shown. Figure 11 The building model 1101 shown reduces the overall number of samples, thus improving rendering efficiency.

[0166] 3) Regarding material rendering

[0167] Create a master material specifically for long-distance Level of Dimension (LOD) architecture within the engine. This material uses basic Physically Based Rendering (PBR) and samples color maps, normal maps, and roughness / metallization blending maps during the rendering process. By configuring the merged textures in the material instance, the rendering effect of LOD0 can be reproduced.

[0168] For example, the information of each channel required for rendering and the final result Figure 12 As shown, the final LOD1 rendering result, except for the slight blurring caused by texture precision, can match the color and normal information with LOD0, and completes a smooth transition when switching LOD levels.

[0169] In summary, as Figure 13 As shown, rendering a long-distance LOD model requires three materials; specifically, LOD0 requires three material IDs (material 1301, material 1302, and material 1303) to complete the rendering, resulting in three DrawCalls. Figure 14As shown, this embodiment reduces the number of DrawCalls required for rendering a long-distance LOD model from three to one (by merging three materials into one material 1401). Specifically, LOD1 requires only one material ID for rendering, totaling one DrawCall. Furthermore, the number of texture samples in each DrawCall is optimized to the minimum required amount. Therefore, this embodiment reduces overall scene performance while maintaining high-quality rendering results, improving game performance, and is particularly suitable for mobile games.

[0170] The exemplary application and implementation of the terminal provided in the embodiments of this application have been used to describe the image rendering method provided in the embodiments of this application. The following describes the cooperation of the various modules in the image rendering device 465 provided in the embodiments of this application to implement the image rendering scheme.

[0171] The acquisition module 4651 is used to acquire multiple material information of the first level of detail model, wherein each material information includes at least one texture; the baking module 4652 is used to perform image baking processing on the texture included in each material information to obtain a baked texture corresponding to each material information; the fusion module 4653 is used to perform fusion processing on the baked textures corresponding to at least some of the material information to obtain a fused baked texture; the rendering module 4654 is used to perform image rendering processing on the second level of detail model to be rendered based on the fused baked texture to obtain a rendered second level of detail model; wherein the level of detail of the first level of detail model is higher than the level of detail of the second level of detail model.

[0172] In some embodiments, the baking module 4652 is further configured to perform the following processing on any texture included in each of the material information: perform texture space mapping processing on the texture using a baking tool to obtain a mapped texture; perform material parameter adjustment processing on the mapped texture to obtain a baked texture corresponding to the texture; and take the set of baked textures corresponding to the textures included in each of the material information as the baked texture corresponding to each of the material information.

[0173] In some embodiments, the baking module 4652 is further configured to determine the vertex colors included in the first level of detail model; perform parameter adjustment processing on the mapped texture based on the vertex colors included in the first level of detail model to obtain a baked texture corresponding to the texture; wherein the vertex colors correspond to the material properties of the first level of detail model.

[0174] In some embodiments, the baking module 4652 is further configured to obtain configuration parameters for baking; perform parameter adjustment processing on the mapped texture based on the configuration parameters for baking to obtain a baked texture corresponding to the texture; wherein, the configuration parameters include at least one of the following: baking channel, baking resolution.

[0175] In some embodiments, the fusion module 4653 is further configured to perform the following processing on any baked texture: merge at least a portion of the material information corresponding to the baked texture respectively to obtain a fused baked texture corresponding to the baked texture; the rendering module 4654 is further configured to take a set of at least one fused baked texture corresponding to the baked texture as new material information; and perform image rendering processing on the second level of detail model to be rendered based on the new material information to obtain the rendered second level of detail model.

[0176] In some embodiments, the fusion module 4653 is further configured to determine a two-dimensional texture coordinate set for sampling based on the baked texture; perform sampling processing on at least a portion of the material information corresponding to the baked texture based on the two-dimensional texture coordinate set to obtain a sampling map including multiple masking regions, wherein the masking regions correspond to the material information; and perform texture channel merging processing on the baked texture based on the sampling map including multiple masking regions to obtain a fused baked texture corresponding to the baked texture.

[0177] In some embodiments, the fusion module 4653 is further configured to merge all the material information corresponding to the baked texture respectively to obtain the fused baked texture corresponding to the baked texture.

[0178] In some embodiments, the fusion module 4653 is further configured to merge some of the material information corresponding to the baked textures to obtain a fused baked texture corresponding to the baked texture; the rendering module 4654 is further configured to take at least one set of fused baked textures corresponding to the baked textures as new material information; based on the new material information and the material information corresponding to the unmerged baked textures, perform image rendering processing on the second level of detail model to be rendered to obtain the rendered second level of detail model.

[0179] In some embodiments, before merging the partially material information corresponding to the baked textures to obtain the fused baked texture, the fusion module 4653 is further configured to display the baked textures corresponding to the plurality of material information respectively; in response to the selection operation of the baked textures corresponding to the plurality of material information respectively, the selected baked texture is used as the baked texture corresponding to the partially material information respectively.

[0180] In some embodiments, before merging the partially material information corresponding to the baked textures to obtain the fused baked texture, the fusion module 4653 is further configured to filter the multiple material information based on the merging features of the multiple material information to obtain the partially material information for merging.

[0181] In some embodiments, the merging feature of the multiple material information includes the similarity between the material information; the fusion module 4653 is further configured to perform similarity processing on the multiple material information to obtain the similarity between any two material information; and to perform descending sorting processing on the multiple material information based on the similarity between the two material information, and to take the material information ranked first in the descending sorting result as part of the material information.

[0182] In some embodiments, the merging feature of the multiple material information includes the level of detail of the material information; the fusion module 4653 is further configured to determine the regions of the first level of detail model corresponding to the multiple material information respectively; determine the level of detail of the material information based on the level of detail corresponding to the region; sort the multiple material information in ascending order based on the level of detail of the multiple material information, and take the material information ranked first in the ascending order as part of the material information.

[0183] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the image rendering method described in this application.

[0184] This application provides a computer-readable storage medium storing executable instructions. When these executable instructions are executed by a processor, they cause the processor to execute the image rendering method provided in this application. For example, ... Figures 3A-3C The image rendering method shown.

[0185] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.

[0186] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0187] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., a file that stores one or more modules, subroutines, or code sections).

[0188] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.

[0189] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. An image rendering method, characterized in that, The method includes: Obtain multiple material information of the first level of detail model, wherein each material information includes at least one texture; For each texture included in each of the material information, the following processing is performed: the texture is mapped to texture space using a baking tool to obtain a mapped texture; the mapped texture is adjusted based on the vertex colors included in the first level of detail model to obtain a baked texture corresponding to the texture, wherein the vertex colors correspond to the material properties of the first level of detail model, and the baked texture can reflect the material properties of the second level of detail model to be rendered; the set of baked textures corresponding to each texture included in each of the material information is taken as the baked texture corresponding to each of the material information. The process of merging at least a portion of the material information corresponding to the baked textures to obtain a blended baked texture corresponding to the baked textures includes: determining a two-dimensional texture coordinate set for sampling based on the baked textures; sampling at least a portion of the material information corresponding to the baked textures based on the two-dimensional texture coordinate set to obtain a sampling map including multiple masking regions, wherein the masking regions correspond to the material information, and the baked textures corresponding to different material information are distinguished by different colors and stored in the texture color channel; extracting the masking regions corresponding to at least a portion of the colors from the sampling map including multiple masking regions to obtain the masking regions of the material information corresponding to the at least a portion of the colors in the two-dimensional texture coordinate set; and performing texture channel merging processing on the baked textures based on the extracted at least a portion of the masking regions to obtain the blended baked texture. Based on the fused baked texture, image rendering processing is performed on the second level of detail model to be rendered to obtain the rendered second level of detail model, wherein the level of detail of the first level of detail model is higher than that of the second level of detail model.

2. The method according to claim 1, characterized in that, The step of performing image rendering processing on the second level of detail model to be rendered based on the fused baked texture to obtain the rendered second level of detail model includes: Use at least one set of fused baked textures corresponding to the baked texture as new material information; Based on the new material information, image rendering processing is performed on the second level of detail model to be rendered to obtain the rendered second level of detail model.

3. The method according to claim 1, characterized in that, The step of merging at least a portion of the material information corresponding to the baked textures to obtain a blended baked texture corresponding to the baked textures includes: All the material information is merged into the corresponding baked texture to obtain the blended baked texture.

4. The method according to claim 1, characterized in that, The step of merging at least a portion of the material information corresponding to the baked textures to obtain a blended baked texture corresponding to the baked textures includes: The material information is partially merged into the baked texture to obtain the blended baked texture corresponding to the baked texture. The step of performing image rendering processing on the second level of detail model to be rendered based on the fused baked texture to obtain the rendered second level of detail model includes: Use at least one set of fused baked textures corresponding to the baked texture as new material information; Based on the new material information and the material information corresponding to the unmerged baked texture, the second level of detail model to be rendered is subjected to image rendering processing to obtain the rendered second level of detail model.

5. The method according to claim 4, characterized in that, Before merging the partially defined material information with the corresponding baked textures to obtain the merged baked texture, the method further includes: Display the baked textures corresponding to the multiple material information; In response to the selection operation of the baked texture corresponding to the plurality of material information respectively, the selected baked texture is used as the baked texture corresponding to a portion of the material information respectively.

6. The method according to claim 4, characterized in that, Before merging the partially defined material information with the corresponding baked textures to obtain the merged baked texture, the method further includes: Based on the merging characteristics of the multiple material information, the multiple material information is filtered to obtain a portion of the material information used for merging.

7. The method according to claim 6, characterized in that, The merging feature of the multiple material information includes the similarity between the material information; The step of filtering the multiple material information based on the merging feature of the multiple material information to obtain a portion of the material information used for merging includes: The similarity of the multiple material information is processed to obtain the similarity between any two material information. Based on the similarity between any two material information items, the multiple material information items are sorted in descending order, and the material information item ranked first in the descending order is taken as part of the material information items.

8. The method according to claim 6, characterized in that, The merging feature of the multiple material information includes the level of detail of the material information; The step of filtering the multiple material information based on the merging feature of the multiple material information to obtain a portion of the material information used for merging includes: Determine the regions of the first level of detail model corresponding to the multiple material information; The level of detail of the material information is determined based on the level of detail corresponding to the region. Based on the level of detail of the multiple material information, the multiple material information is sorted in ascending order, and the material information that appears first in the ascending order is taken as part of the material information.

9. An image rendering apparatus, characterized in that, The device includes: The acquisition module is used to acquire multiple material information of the first level of detail model, wherein each material information includes at least one texture. The baking module is used to perform the following processing on any texture included in each of the material information: mapping the texture to texture space using a baking tool to obtain a mapped texture; adjusting the parameters of the mapped texture based on the vertex colors included in the first level of detail model to obtain a baked texture corresponding to the texture, wherein the vertex colors correspond to the material properties of the first level of detail model, and the baked texture can reflect the material properties of the second level of detail model to be rendered; and using the set of baked textures corresponding to the textures included in each of the material information as the baked texture corresponding to each of the material information. A fusion module is used to merge at least a portion of the material information corresponding to the baked textures to obtain a fused baked texture corresponding to the baked textures. The merging of at least a portion of the material information corresponding to the baked textures to obtain the fused baked texture includes: determining a two-dimensional texture coordinate set for sampling based on the baked textures; sampling at least a portion of the material information corresponding to the baked textures based on the two-dimensional texture coordinate set to obtain a sampling map including multiple masking regions, where each masking region corresponds to a material information, and baked textures corresponding to different material information are distinguished by different colors and stored in a texture color channel; extracting masking regions corresponding to at least a portion of the colors from the sampling map including multiple masking regions to obtain masking regions of the material information corresponding to each of the at least a portion of the colors in the two-dimensional texture coordinate set; and performing texture channel merging processing on the baked textures based on the extracted at least a portion of the masking regions to obtain the fused baked texture. The rendering module is used to perform image rendering processing on the second level of detail model to be rendered based on the fused baked texture, so as to obtain the rendered second level of detail model, wherein the level of detail of the first level of detail model is higher than that of the second level of detail model.

10. The apparatus according to claim 9, characterized in that, The device further includes: The baking module is also used to obtain configuration parameters for baking; and to perform parameter adjustment processing on the mapped texture based on the configuration parameters for baking to obtain the baked texture corresponding to the texture; wherein, the configuration parameters include at least one of the following: baking channel, baking resolution.

11. The apparatus according to claim 9, characterized in that, The device further includes: The fusion module is further configured to merge some of the material information corresponding to the baked textures to obtain a fused baked texture corresponding to the baked textures; The rendering module is further configured to take at least one set of merged baked textures corresponding to the baked textures as new material information; and based on the new material information and the material information corresponding to the unmerged baked textures, perform image rendering processing on the second level of detail model to be rendered to obtain the rendered second level of detail model.

12. The apparatus according to claim 9, characterized in that, The device further includes: The fusion module is further configured to display baked textures corresponding to the plurality of material information respectively; in response to the selection operation of the baked textures corresponding to the plurality of material information respectively, the selected baked texture is used as part of the baked textures corresponding to the material information respectively.

13. An electronic device, characterized in that, The electronic device includes: Memory, used to store executable instructions; A processor, when executing executable instructions stored in the memory, implements the image rendering method according to any one of claims 1 to 8.

14. A computer-readable storage medium, characterized in that, It stores executable instructions for implementing the image rendering method according to any one of claims 1 to 8 when executed by a processor.

15. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the image rendering method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Three-dimensional model and material merging method and device, terminal, storage medium and rendering method

    CN111028361A

  • Role model processing method and device, medium and electronic equipment

    CN113590334A