Image rendering method and device, electronic equipment, storage medium and program product

CN116740256BActive Publication Date: 2026-10-30TENCENT TECH (CHENGDU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210202833.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-03
Publication Date
2026-10-30
Estimated Expiration
2042-03-03

AI Technical Summary

Technical Problem

[0003]相关技术中,通常会对高动态范围的纹理资源进行压缩处理,从而减少纹理资源带来的带宽占用,但是基于压缩后的纹理资源进行渲染时难以达到较高的渲染效果,相关技术中尚无兼顾渲染资源以及渲染效果的方案

Benefits of technology

[0031]通过对第一纹理数据以及第二纹理数据分别进行渲染处理,并基于渲染结果之间的损失更新第一纹理数据以及基于第一纹理数据进行渲染时所涉及到的转换参数,由于第二纹理数据的图像范围信息优于第一纹理数据,且第一纹理数据的数据量由于第二纹理数据,从而基于更新得到的第一纹理数据以及转换参数进行实时图像渲染时,可以仅消耗较少的存储空间以及计算资源,达到对标第二纹理数据的渲染效果,进而有效提高渲染资源利用率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116740256B_ABST
    Figure CN116740256B_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 first texture data of a virtual object and conversion parameters of second texture data corresponding to the virtual object; performing fitting rendering processing on the virtual object based on the conversion parameters and the first texture data to obtain a fitting rendering image; determining a rendering loss between the fitting rendering image and a standard rendering image, and updating the conversion parameters and the first texture data based on the rendering loss, wherein the standard rendering image is a rendering image including the virtual object obtained by performing standard rendering processing on the second texture data; and performing real-time rendering processing on the virtual object based on the updated conversion parameters and the updated first texture data to obtain a target rendering image including the virtual object. Through the application, the utilization efficiency of rendering resources can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] 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

[0002] 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.

[0003] In related technologies, high dynamic range texture resources are usually compressed to reduce the bandwidth consumption caused by texture resources. However, it is difficult to achieve high rendering effect when rendering based on compressed texture resources. There is no solution in related technologies that takes into account both rendering resources and rendering effect. Summary of the Invention

[0004] This application provides an image rendering method, apparatus, electronic device, computer-readable storage medium, and computer program product that can utilize the loss between different rendered images to achieve higher rendering effects based on texture data with less bandwidth usage, thereby improving the utilization rate of rendering resources.

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

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

[0007] Obtain first texture data of a virtual object and conversion parameters for second texture data corresponding to the virtual object, wherein the amount of data in the first texture data is less than the amount of data in the second texture data, and the image information range of the first texture data is less than the image information range of the second texture data;

[0008] Based on the conversion parameters and the first texture data, the virtual object is subjected to fitting rendering processing to obtain a fitting rendering map;

[0009] Determine the rendering loss between the fitted rendering image and the standard rendering image, and update the transformation parameters and the first texture data based on the rendering loss, wherein the standard rendering image is a rendering image including the virtual object obtained by standard rendering processing based on the second texture data;

[0010] Based on the updated transformation parameters and the updated first texture data, the virtual object is rendered in real time to obtain a target rendering image including the virtual object.

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

[0012] The acquisition module is used to acquire the first texture data of the virtual object and the conversion parameters of the second texture data corresponding to the virtual object, wherein the amount of the first texture data is less than the amount of the second texture data, and the image information range of the first texture data is less than the image information range of the second texture data.

[0013] The fitting module is used to perform fitting rendering processing on the virtual object based on the transformation parameters and the first texture data to obtain a fitting rendering map;

[0014] The loss module is used to determine the rendering loss between the fitted rendering image and the standard rendering image, and to update the transformation parameters and the first texture data based on the rendering loss, wherein the standard rendering image is a rendering image including the virtual object obtained by standard rendering processing based on the second texture data;

[0015] The rendering module is used to perform real-time rendering processing on the virtual object based on updated transformation parameters and updated first texture data to obtain a target rendering map including the virtual object.

[0016] In the above scheme, the fitting module is further configured to: perform spatial transformation processing on the first texture data of the virtual object towards the second texture data based on the transformation parameters to obtain third texture data that is in the same dynamic range space as the second texture data; and perform fitting rendering processing on the virtual object based on the third texture data to obtain a fitting rendering map.

[0017] In the above scheme, the first texture data includes a first color value of each texture pixel, the second texture data includes a second color value of each texture pixel, and the transformation parameters include a first first-order parameter and a second first-order parameter; the fitting module is further configured to: perform the following processing for each texture pixel in the first texture data: determine a first product result between the first color value of the texture pixel and the first first-order parameter; determine a first summation result between the first product result and the second first-order parameter; determine the ratio between the first color value of the texture pixel and the first summation result as a third color value of the texture pixel that is in the same dynamic range space as the second color value; and combine the third color values ​​of multiple texture pixels to form the third texture data.

[0018] In the above scheme, the first texture data includes a first color value of each texture pixel, the second texture data includes a second color value of each texture pixel, and the transformation parameters include a first second-order parameter, a second second-order parameter, a third second-order parameter, a fourth second-order parameter, and a fifth second-order parameter; the fitting module is further configured to: perform the following processing for each texture pixel in the first texture data: determine the second product result between the square of the first color value of the texture pixel and the first second-order parameter, and the third product result between the first color value of the texture pixel and the second second-order parameter; and process the second product result, the third product result, and the... The third second-order parameter is summed to obtain a second summation result; the fourth product result between the first color value of the texture pixel and the fourth second-order parameter is determined; the square root of the second summation result, the fourth product result, and the square root of the third second-order parameter are summed to obtain a third summation result; the fourth summation result between the first color value of the texture pixel and the fifth second-order parameter is determined; the ratio between the third summation result and the fourth summation result is determined as the third color value of the texture pixel that is in the same dynamic range space as the second color value; the third color values ​​of multiple texture pixels are combined to form the third texture data.

[0019] In the above scheme, the third texture data includes the third color value of each texture pixel; the fitting module is further configured to: obtain the two-dimensional texture coordinates of the virtual object; obtain the differentiable rendering framework corresponding to the fitting rendering process; and perform forward propagation of the two-dimensional texture coordinates and the third color value of each texture pixel in the differentiable rendering framework to obtain the fitting rendering map.

[0020] In the above scheme, the loss module is further configured to: determine the overall pixel value difference between the standard rendering image and the fitted rendering image in screen space; and determine the rendering loss based on the overall pixel value difference, the length of the fitted rendering image, and the width of the fitted rendering image.

[0021] In the above scheme, the loss module is further configured to: perform the following processing for each pixel in the screen space of the fitted rendering image: determine the first pixel value of the pixel, and determine the second pixel value of the corresponding pixel in the standard rendering image; take the absolute value of the difference between the first pixel value and the second pixel value as the pixel value difference of the pixel; sum the pixel value differences of multiple pixels in the fitted rendering image to obtain the overall pixel value difference.

[0022] In the above scheme, the loss module is further configured to: perform partial derivative processing on the first texture data based on the rendering loss to obtain the gradient corresponding to the first texture data; perform partial derivative processing on the transformation parameter based on the rendering loss to obtain the gradient corresponding to the transformation parameter; update the first texture data based on the gradient corresponding to the first texture data, and update the transformation parameter based on the gradient corresponding to the transformation parameter.

[0023] In the above scheme, the loss module is further configured to: multiply the set learning rate by the gradient corresponding to the first texture data to obtain the data change value of the first texture data; add the data change value of the first texture data to the first texture data to obtain the updated first texture data; multiply the set learning rate by the gradient corresponding to the transformation parameter to obtain the data change value of the transformation parameter; and add the data change value of the transformation parameter to the transformation parameter to obtain the updated transformation parameter.

[0024] In the above scheme, the rendering module is further configured to: when the rendering loss is less than the loss threshold, perform real-time rendering processing on the virtual object based on the updated transformation parameters and the updated first texture data; or when the number of updates reaches the update number threshold, perform real-time rendering processing on the virtual object based on the updated transformation parameters and the updated first texture data.

[0025] In the above scheme, the rendering module is further configured to: perform spatial transformation processing on the updated first texture data towards the second texture data based on the updated transformation parameters to obtain fourth texture data in the same dynamic range space as the second texture data; determine at least one two-dimensional texture coordinate of the virtual object; perform the following processing for each two-dimensional texture coordinate: sample the texture image corresponding to the two-dimensional texture coordinate from the fourth texture data, and perform a bonding processing on the sampled texture image; and generate a target rendering image including the virtual object based on the bonding result of each two-dimensional texture coordinate.

[0026] This application provides an electronic device, including:

[0027] Memory, used to store executable instructions;

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

[0029] This application provides a computer-readable storage medium storing executable instructions for implementing the image rendering method provided in this application when executed by a processor.

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

[0031] By rendering the first texture data and the second texture data separately, and updating the first texture data and the transformation parameters involved in rendering based on the loss between the rendering results, since the image range information of the second texture data is better than that of the first texture data, and the amount of data of the first texture data is greater than that of the second texture data, real-time image rendering based on the updated first texture data and transformation parameters can consume less storage space and computing resources to achieve the same rendering effect as the second texture data, thereby effectively improving the utilization rate of rendering resources. Attached Figure Description

[0032] Figure 1A-Figure 1B This is a schematic diagram of the architecture of the image rendering system provided in the embodiments of this application;

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

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

[0035] Figure 4 This is a rendering diagram of the image rendering method provided in the embodiments of this application;

[0036] Figure 5 This is a schematic diagram of the fitting rendering process of the image rendering method provided in the embodiments of this application;

[0037] Figures 6A-6E This is a schematic diagram of the dynamic range conversion of the image rendering method provided in the embodiments of this application;

[0038] Figures 7A-7B This is a rendering diagram of the image rendering method provided in the embodiments of this application;

[0039] Figure 8 This is a schematic diagram of the rasterization rendering process of the image rendering method provided in the embodiments of this application;

[0040] Figure 9 This is a schematic diagram of a machine learning fitting scene for the image rendering method provided in the embodiments of this application;

[0041] Figure 10 This is a schematic diagram of the fitted texture of the image rendering method provided in the embodiments of this application;

[0042] Figure 11 This is a schematic diagram of the machine learning fitting process of the image rendering method provided in the embodiments of this application;

[0043] Figure 12 This is a schematic diagram of the initialization values ​​of the first texture data in the image rendering method provided in the embodiments of this application;

[0044] Figure 13 This is a screen space rendering image of the virtual object of the image rendering method provided in this application embodiment;

[0045] Figure 14 This is a screen space rendering image of the virtual object of the image rendering method provided in this application embodiment;

[0046] Figure 15 It is a screen space rendering image of the virtual object fitted by the image rendering method provided in the embodiments of this application;

[0047] Figure 16 This is a schematic diagram showing the pixel difference between the standard rendering result and the fitting result of the image rendering method provided in the embodiments of this application in screen space;

[0048] Figure 17 This is a schematic diagram illustrating the loss effect of the image rendering method provided in the embodiments of this application;

[0049] Figure 18 This is a schematic diagram of fitting the dynamic range space transformation function of the image rendering method provided in the embodiments of this application. Detailed Implementation

[0050] 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.

[0051] 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.

[0052] 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.

[0053] 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.

[0054] 1) Client: An application running in a terminal that provides various services, such as a video playback client, a game client, etc.

[0055] 2) Virtual Scene: A virtual game scene displayed (or provided) by a game application when running on a 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 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.

[0056] 3) Virtual Objects: These are interactive representations 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.

[0057] 4) 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 pixel-based printers. Image rendering, or rasterization, is the representation of a three-dimensional scene using N-dimensional raster and pixel-based 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.

[0058] 5) Tone Mapping: Its function is to map high dynamic range (HDR) colors to low dynamic range (LDR) colors so that the monitor can display them correctly. Its corresponding dynamic range space conversion function (Inverse ToneMapping) maps low dynamic range (LDR) colors to high dynamic range (HDR) colors, restoring the original brightness range of colors.

[0059] High Dynamic Range Rendering (HDRR) and High Dynamic Range Mapping (HDRT) are crucial technologies in real-time game rendering. The combined rendering effect of these two technologies significantly surpasses that of combining Low Dynamic Range Rendering (LDRR) and Low Dynamic Range Mapping (LDRT). This difference becomes even more pronounced when the game's lighting range is large or when there are significant brightness differences between different areas. In implementing the embodiments of this application, the applicant discovered that while combining HDRR and HDRT provides more realistic rendering effects, the rendering cost of this combination is high. For example, in uncompressed HDRT, each channel requires 32 bits, resulting in 96 bits per pixel (including 3 channels). However, in uncompressed LDRT, each channel requires 8 bits, and even less after compression. In implementing the embodiments of this application, the applicant discovered that HDRT and HDRT not only burden the game with package size and memory usage, but also bring more bandwidth overhead and computational burden during rendering. Therefore, for various games, especially mobile games with scarce resources, HDRT is compressed and HDRT is optimized in terms of calculation. The purpose is to minimize the package size and bandwidth usage caused by HDRT, reduce the computational consumption of HDRT, and get as close as possible to the rendering effect provided by the original HDRT and HDRT.

[0060] Related technologies provide a method for compressing HDRT to LDRT. This method calculates the difference between LDRT and HDRT in texture space, then uses the Levenberg-Marquadt algorithm to obtain the transformation parameters of the tone mapping function that minimizes the difference. These transformation parameters are then used to convert HDRT to LDRT for packaging. However, in implementing the embodiments of this application, the applicant discovered that related technologies only consider texture differences in texture space. For rendering, the differences between rendering results should also be considered for more accurate results.

[0061] This application provides an image rendering method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can utilize the loss between different rendered images to achieve high rendering effects based on texture data with less bandwidth consumption, thereby improving the utilization rate of rendering resources. To facilitate a clearer understanding of the image rendering method provided in this application, exemplary implementation scenarios of the image rendering method provided in this application 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 the terminal and server.

[0062] 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.

[0063] In one implementation scenario, see Figure 1A , Figure 1A This is a schematic diagram of the architecture of the image rendering system provided in this application embodiment. 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.

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

[0065] 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.

[0066] As an example, a client 410 (e.g., a standalone game application) runs on terminal 400. During the operation of client 410, it outputs 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, a virtual object 401 is displayed in the virtual scene 100. The virtual object 401 can be a game character controlled by the user (or player), which 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 401 can also be artificial intelligence (AI) trained and set up in the virtual scene battle. The virtual object 401 can also be a non-user character (NPC) set up in the virtual scene interaction. Character); Virtual object 401 can also be an inactive or active object in virtual scene 100.

[0067] For example, terminal 400 is a terminal used by game developers. During the game development and packaging stage, terminal 400 obtains the first texture data of virtual object 401 and the conversion parameters of the corresponding second texture data of virtual object. The data volume of the first texture data is smaller than that of the second texture data, and the image information range of the first texture data is smaller than that of the second texture data. Based on the conversion parameters and the first texture data, the virtual object is subjected to fitting rendering processing to obtain a fitting rendering image. The rendering loss between the fitting rendering image and the standard rendering image is determined, and the conversion parameters and the first texture data are updated based on the rendering loss. The standard rendering image is a rendering image including virtual object obtained by standard rendering processing based on the second texture data. Up to this point, all the processing is performed before the game starts. During the testing stage, that is, during the game installation and operation, terminal 400 performs real-time rendering processing on the virtual object based on the updated conversion parameters and the updated first texture data to obtain a target rendering image including the virtual object, and performs human-computer interaction in the virtual scene based on the target rendering image, such as game confrontation.

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

[0069] 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.

[0070] As an example, a client 410 (e.g., a network-based game application) runs on terminal 400 and interacts with other users through connection to server 200 (e.g., a game server). Terminal 400 outputs a virtual scene 100 from client 410. Taking the virtual scene 100 as an example, virtual objects 401 are displayed in the virtual scene 100. Virtual objects 401 can be game characters controlled by users (or players) 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). Virtual objects 401 can also be artificial intelligence (AI) trained and set in virtual scene battles. Virtual objects 401 can also be non-user characters (NPCs) set in virtual scene interactions. Virtual objects 401 can also be inactive or movable objects in the virtual scene 100.

[0071] For example, server 200 obtains the first texture data of virtual object 401 and the conversion parameters of the corresponding second texture data of virtual object. The data volume of the first texture data is smaller than that of the second texture data, and the image information range of the first texture data is smaller than that of the second texture data. Based on the conversion parameters and the first texture data, the virtual object is subjected to fitting rendering processing to obtain a fitting rendering image. The rendering loss between the fitting rendering image and the standard rendering image is determined, and the conversion parameters and the first texture data are updated based on the rendering loss. The standard rendering image is a rendering image including the virtual object obtained by standard rendering processing based on the second texture data. All of these processes are performed before the game starts. For example, during the game development and packaging stage, terminal 400 receives the updated first texture data and updated conversion parameters (which can be packaged in the installation package) sent by server 200. During the game installation and operation, terminal 400 performs real-time rendering processing on the virtual object based on the updated conversion parameters and updated first texture data to obtain a target rendering image including the virtual object, and performs human-computer interaction in the virtual scene based on the target rendering image, such as game confrontation.

[0072] 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.

[0073] 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. Illustratively, the virtual object can be a virtual character, such as a realistic or anime character.

[0074] 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.

[0075] 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.

[0076] Example, Figure 1B The 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 and server can be directly or indirectly connected via wired or wireless communication, which is not limited in this embodiment of the invention.

[0077] 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. Figure 2 The terminal 400 shown includes at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. The various components in the terminal 400 are coupled together via a bus system 440. It is understood that the bus system 440 is used to implement communication between these components. In addition to a data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2 The general labeled all buses as Bus System 440.

[0078] The processor 410 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. The general-purpose processor can be a microprocessor or any conventional processor, etc.

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

[0080] The memory 450 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 450 may optionally include one or more storage devices physically located away from the processor 410.

[0081] The memory 450 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 450 described in this application embodiment is intended to include any suitable type of memory.

[0082] In some embodiments, memory 450 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.

[0083] Operating system 451 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;

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

[0085] Presentation module 453 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 431 (e.g., a display screen, a speaker, etc.) associated with user interface 430;

[0086] The input processing module 454 is used to detect and translate one or more user inputs or interactions from one or more input devices 432.

[0087] In some embodiments, the image rendering apparatus provided in this application can be implemented in software. Figure 2 An image rendering apparatus 455 stored in memory 450 is shown. This apparatus can be software in the form of programs and plugins, and includes the following software modules: an acquisition module 4551, a fitting module 4552, a loss module 4553, and a rendering module 4554. These modules are logically linked and can therefore be arbitrarily combined or further separated according to their implemented functions. The functions of each module will be described below.

[0088] 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.

[0089] 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 Steps 101-104 are shown and explained.

[0090] 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 451, software modules and scripts mentioned above. Therefore, the client should not be regarded as a limitation on the embodiments of this application.

[0091] In step 101, the first texture data of the virtual object and the conversion parameters of the corresponding second texture data of the virtual object are obtained.

[0092] As an example, before rendering, the virtual object is in a state of waiting to be rendered. The virtual object in the state of waiting to be rendered is a base object model. The base object model includes the body of the virtual object, but does not include display information used to decorate the virtual object. For example, display information includes makeup used to modify the virtual object's face (such as lip shape, eyeshadow, pupils, iris, blush, etc.) and clothing used to modify the virtual object's limbs (such as ancient costumes, battle clothes, etc.).

[0093] As an example, the first texture data can be an LDRT texture, and the second texture data can be an HDRT texture. The LDRT texture includes the first color value of each texture pixel, and the HDRT texture includes the second color value of each texture pixel. The amount of data in the first texture data is less than that in the second texture data. In LDRT, each channel requires 32 bits, so each pixel (including 3 channels) requires 96 bits. However, in LDRT, each channel requires 8 bits, so each pixel (including 3 channels) requires 24 bits. The image information range of the first texture data is smaller than that of the second texture data. The image information range includes dynamic range, which is the ratio of the highest brightness to the lowest brightness. The dynamic range of HDRT is higher than that of LDRT.

[0094] As an example, the first texture data can be the pixel parameters of each pixel in the initialized texture image, including material parameters and texture parameters. The first texture data can also be obtained through the (n-1)th iteration in the iteration process, so that the first texture data obtained in the (n-1)th iteration is used as the input of the nth iteration, where n is an integer greater than 1. Steps 102 and 103 need to be executed in each iteration.

[0095] It should be noted that when the first texture data is the pixel parameters of each pixel in the initialized texture image, before step 101, it is also necessary to initialize the rendering scene, including loading the model (basic object model), texture, material, etc., and then setting the position and orientation of the camera, the position and orientation of the model, and the parameters of various lights.

[0096] In step 102, based on the transformation parameters and the first texture data, the virtual object is subjected to fitting rendering processing to obtain a fitting rendering map.

[0097] It should be noted that in actual game operation, virtual objects will not always be in the same orientation. Therefore, it is necessary to fit the rendering effect of virtual objects in various orientations to ensure the fitting effect of virtual objects in various orientations. The orientation of virtual objects in the standard rendering image is the same as the orientation set during the fitting rendering process. Using the obtained first texture data as a resource, the first texture data is fitted and rendered using the rendering method of unlit material to obtain the fitted rendering image.

[0098] In some embodiments, see Figure 3B , Figure 3B This is a flowchart illustrating the image rendering method provided in this application embodiment. In step 102, based on the transformation parameters and the first texture data, the virtual object undergoes fitting rendering processing to obtain a fitted rendering image, which can be used... Figure 3B Steps 1021 to 1022 are implemented.

[0099] In step 1021, based on the transformation parameters, the first texture data of the virtual object is spatially transformed toward the second texture data to obtain the third texture data which is in the same dynamic range space as the second texture data.

[0100] In some embodiments, the first texture data includes a first color value for each texture pixel, the second texture data includes a second color value for each texture pixel, and the transformation parameters include a first first-order parameter and a second first-order parameter. In step 1021, based on the transformation parameters, the first texture data of the virtual object is spatially transformed towards the second texture data to obtain third texture data in the same dynamic range space as the second texture data. This can be achieved through the following technical solution: For each texture pixel in the first texture data, the following processing is performed: determining the first product result between the first color value of the texture pixel and the first first-order parameter; determining the first summation result between the first product result and the second first-order parameter; determining the ratio between the first color value of the texture pixel and the first summation result as the third color value of the texture pixel in the same dynamic range space as the second color value; and combining the third color values ​​of multiple texture pixels to form the third texture data. Through spatial transformation processing, the first texture data can be mapped to the dynamic range space of the corresponding second texture data, thereby achieving a wider brightness range and thus a better rendering effect.

[0101] As an example, spatial transformation is implemented using a first-order high dynamic range spatial transformation function, which can be found in formula (1):

[0102]

[0103] Where p and q are the parameters to be fitted to the first-order tone mapping function, p is the first-order parameter, and q is the second-order parameter. Different p and q correspond to different curves. H It is the third color value, c L It is the first color value. Figure 6D The figure shows different curves corresponding to different p and q.

[0104] In some embodiments, the first texture data includes a first color value for each texture pixel, the second texture data includes a second color value for each texture pixel, and the transformation parameters include a first second-order parameter, a second second-order parameter, a third second-order parameter, a fourth second-order parameter, and a fifth second-order parameter. In step 1021, based on the transformation parameters, the first texture data of the virtual object undergoes a spatial transformation towards the second texture data to obtain the third texture data. This can be achieved through the following technical solution: For each texture pixel in the first texture data, the following processing is performed: determining the second product result between the square of the first color value of the texture pixel and the first second-order parameter, and the product result between the square of the first color value of the texture pixel and the second second-order parameter. The third product result between the second-order parameters; summing the second product result, the third product result, and the third second-order parameter to obtain the second summation result; determining the fourth product result between the first color value of the texture pixel and the fourth second-order parameter; summing the square root of the second summation result, the fourth product result, and the square root of the third second-order parameter to obtain the third summation result; determining the fourth summation result between the first color value of the texture pixel and the fifth second-order parameter; determining the ratio between the third summation result and the fourth summation result as the third color value of the texture pixel in the same dynamic range space as the second color value; combining the third color values ​​of multiple texture pixels to form the third texture data. Through spatial transformation, the first texture data can be mapped to the dynamic range space of the corresponding second texture data, thus achieving a wider brightness range and thus a better rendering effect.

[0105] As an example, spatial transformation is achieved through a second-order high dynamic range spatial transformation function. The first-order high dynamic range spatial transformation function is shown in formula (2):

[0106]

[0107] Where p, q, r, s, and t are the parameters to be fitted to the second-order high dynamic range space transformation function, with p being the first second-order parameter, q the second second-order parameter, r the third second-order parameter, s the fourth second-order parameter, and t the fifth second-order parameter. Different values ​​of p, q, r, s, and t correspond to different curves. H It is the third color value, c L It is the first color value. Figure 6E The figure shows different curves corresponding to different values ​​of p, q, r, s, and t.

[0108] In step 1022, based on the third texture data, a fitting rendering process is performed on the virtual object to obtain a fitting rendering image.

[0109] In some embodiments, the third texture data includes the third color value of each texture pixel; in step 1022, a fitting rendering process is performed on the virtual object based on the third texture data to obtain a fitting rendering map. This can be achieved through the following technical solution: obtaining the two-dimensional texture coordinates of the virtual object; obtaining the differentiable rendering framework corresponding to the fitting rendering process; and forward propagating the two-dimensional texture coordinates and the third color value of each texture pixel within the differentiable rendering framework to obtain the fitting rendering map. The differentiable rendering framework is obtained by software encapsulating the hardware-based rendering process. The hardware-based rendering process can be a rendering method without light-receiving materials. Due to the software encapsulation, it is differentiable and can be used for backpropagation based on gradients.

[0110] As an example, the two-dimensional texture coordinates of the virtual object are obtained. These coordinates are either pre-defined or automatically generated. They can be UV2 coordinates, as all image files are two-dimensional planes. The horizontal direction is U, and the vertical direction is V. The two-dimensional plane allows positioning of any pixel in the image, defining the positional information of each point. These points are interconnected with the model to determine the position of the surface texture map. The UV coordinates precisely map each point in the image to the surface of the model object. A differentiable rendering framework for fitting rendering is obtained. The two-dimensional texture coordinates and the third color value of each texture pixel are forward-propagated within this framework to obtain the fitted rendering map. Data involved in the forward propagation also includes rendering resources such as materials and lighting. See [link to relevant documentation]. Figure 8 , Figure 8This is a schematic diagram of the rasterization rendering process provided in the embodiments of this application. The modified rasterization rendering process is implemented through the Compute Unified Device Architecture (CUDA) and runs as a module of a machine learning library (such as PyTorch). The entire rendering process can backpropagate gradients, so the whole process is differentiable. All relevant assets are connected via a transitive gradient computational connection to obtain model tangent / normal data, generate lightmap texture coordinates, and compute animation and skinning. The model tangent / normal data, lightmap texture coordinates, animation, and skinning are then connected via a transitive gradient computational connection to obtain clipspace coordinates (ClipSpace Pos). All relevant assets are then connected via a regular computational connection to obtain triangle index data (Index Buffer). Rasterization is then performed based on the clipspace coordinates and triangle index data to obtain the coordinates (u, v) and... Based on coordinates (u,v), Interpolation is performed on vertex attribute data to obtain interpolated attribute data and the derivatives of pixel-level attribute data. Texture sampling is then performed based on the interpolated attribute data, the derivatives of pixel-level attribute data, and the texture to obtain filtered samples. Ground truth shading is then performed on the target to be fitted based on the lighting (Lights Camera), material parameters, interpolated attribute data, and filtered samples to obtain an aliased image. Antialiasing is then performed on the aliased image to obtain the final fitted image.

[0111] In step 103, the rendering loss between the fitted rendering image and the standard rendering image is determined, and the transformation parameters and the first texture data are updated based on the rendering loss.

[0112] As an example, a standard rendering image is a rendering image including virtual objects obtained by standard rendering processing based on second texture data. The standard rendering image is obtained by performing physically based rendering processing on the virtual objects based on their second texture data. For example, by loading the second texture data of virtual objects using Physically Based Rendering (PBR) and rendering the second texture data based on physical laws, a standard rendering image conforming to physical laws is obtained. This rendering method can bring optimal rendering results, but at the cost of requiring significant storage and computing resources.

[0113] In some embodiments, see Figure 3C , Figure 3C This is a flowchart illustrating the image rendering method provided in this application embodiment. In step 103, the rendering loss between the fitted rendering image and the standard rendering image is determined, which can be achieved through... Figure 3C Steps 1031 to 1032 are implemented.

[0114] In step 1031, the overall pixel value difference between the standard rendering image and the fitted rendering image in screen space is determined.

[0115] In some embodiments, determining the overall pixel value difference between the standard rendered image and the fitted rendered image in screen space in step 1031 can be achieved through the following technical solution: For each pixel in the fitted rendered image in screen space, perform the following processing: determine the first pixel value of the pixel and determine the second pixel value of the corresponding pixel in the standard rendered image; use the absolute value of the difference between the first pixel value and the second pixel value as the pixel value difference; sum the pixel value differences of multiple pixels in the fitted rendered image to obtain the overall pixel value difference. Using each pixel as the smallest unit for measuring the difference can effectively improve the value of the rendering loss, thereby obtaining transformation parameters and first texture data with better rendering effects when updating based on the rendering loss.

[0116] In step 1032, the rendering loss is determined based on the overall pixel value difference, the length of the fitted rendering map, and the width of the fitted rendering map.

[0117] As an example, the rendering loss is obtained based on formula (3):

[0118]

[0119] Where Img1 and Img2 represent the standard rendering image and the fitted rendering image, respectively, and H and W represent the length and width of Img1 (or Img2), respectively. This represents the difference in pixel values ​​between the standard rendered image and the fitted rendered image in screen space, where (i,j) represents any pixel in the standard rendered image in screen space.

[0120] It should be noted that the rendering loss in this application embodiment is not limited to formula (3), but can also be other modified formulas.

[0121] In some embodiments, the step 103 of updating the transformation parameters and the first texture data based on the rendering loss can be implemented by the following technical solution: performing partial derivative processing on the first texture data based on the rendering loss to obtain the gradient of the corresponding first texture data; performing partial derivative processing on the transformation parameters based on the rendering loss to obtain the gradient of the corresponding transformation parameters; updating the first texture data based on the gradient of the corresponding first texture data, and updating the transformation parameters based on the gradient of the corresponding transformation parameters.

[0122] In some embodiments, updating the first texture data based on the gradient of the first texture data can be achieved by the following technical solutions: multiplying the set learning rate by the gradient of the corresponding first texture data to obtain the data change value of the first texture data; adding the data change value of the first texture data to the first texture data to obtain the updated first texture data; updating the transformation parameter based on the gradient of the corresponding transformation parameter can be achieved by the following technical solutions: multiplying the set learning rate by the gradient of the corresponding transformation parameter to obtain the data change value of the transformation parameter; adding the data change value of the transformation parameter to the transformation parameter to obtain the updated transformation parameter.

[0123] It should be noted that the process of updating the first texture data based on the rendering loss is similar to the backpropagation process in machine learning. The first texture data is input into a differentiable rasterizer. Through the forward rendering process of the differentiable rasterizer, a fitted rendering image is output. Since there is an error (rendering loss) between the output of the differentiable rasterizer (fitted rendering image) and the standard rendering image, the error between the output and the standard rendering image is calculated, and backpropagation is performed based on the error. Backpropagation is implemented based on the gradient descent algorithm. During the backpropagation process, the first texture data and transformation parameters are adjusted according to the error. For example, the partial derivative of the rendering loss with respect to the first texture data is calculated, and the gradient of the rendering loss with respect to the first texture data is generated. Since the direction of the gradient indicates the direction of error amplification, the gradient descent algorithm is used to update the first texture data. The partial derivative of the rendering loss with respect to the transformation parameters is calculated, and the gradient of the rendering loss with respect to the transformation parameters is generated. Since the direction of the gradient indicates the direction of error amplification, the gradient descent algorithm is used to update the transformation parameters. The above process is iterated until the iteration termination condition is met.

[0124] In step 104, based on the updated transformation parameters and the updated first texture data, the virtual object is rendered in real time to obtain a target rendering image including the virtual object.

[0125] In some embodiments, the real-time rendering of the virtual object based on the updated transformation parameters and the updated first texture data in step 104 can be achieved through the following technical solutions: when the rendering loss is less than the loss threshold, the virtual object is rendered in real time based on the updated transformation parameters and the updated first texture data; or when the number of updates reaches the number of updates threshold, the virtual object is rendered in real time based on the updated transformation parameters and the updated first texture data.

[0126] As an example, the iteration termination condition includes at least one of the following: the value of the rendering loss function is less than the loss threshold; or the number of iterations reaches a set number. When the iteration termination condition is met, the updated transformation parameters and the updated first texture data are used as the final rendering base resources for actual rendering processing. When the number of iterations is not limited, the similarity between the target rendering image and the standard rendering image is defined by setting a loss threshold. The smaller the loss threshold, the more similar the target rendering image and the standard rendering image are. When the loss threshold is not limited, the similarity between the target rendering image and the standard rendering image is defined by setting the number of iterations. The larger the set number of iterations, the more similar the target rendering image and the standard rendering image are. Determining whether real-time rendering can be performed based on the currently updated first texture data and transformation parameters by using the loss threshold or the number of updates can improve fitting efficiency and prevent wasting fitting resources.

[0127] In some embodiments, the real-time rendering of the virtual object in step 104 based on the updated transformation parameters and the updated first texture data to obtain a target rendering image including the virtual object can be achieved through the following technical solution: based on the updated transformation parameters, the updated first texture data is spatially transformed towards the second texture data to obtain fourth texture data in the same dynamic range space as the second texture data; at least one two-dimensional texture coordinate of the virtual object is determined; for each two-dimensional texture coordinate, the following processing is performed: the texture image corresponding to the two-dimensional texture coordinate is sampled from the fourth texture data, and the sampled texture image is fitted; based on the fitting result of each two-dimensional texture coordinate, a target rendering image including the virtual object is generated.

[0128] As an example, the updated first texture data is saved to a texture image. After obtaining the texture image, it can be used for real-time image rendering during the game, avoiding the loading of multiple textures, saving related storage space and computing resources, and thus improving the rendering efficiency of virtual objects.

[0129] As an example, the two-dimensional texture coordinates of the virtual object are obtained. The two-dimensional texture coordinates are either pre-given or automatically generated. The two-dimensional texture coordinates can be UV2 coordinates. UV2 coordinates define the position information of each point on the image. These points are related to the model to determine the position of the surface texture map. UV coordinates accurately map each point on the image to the surface of the model object. The fourth texture data is sampled through UV2. The texture map composed of the sampled fourth texture data is applied to the base model of the virtual object, thereby realizing the real-time rendering process.

[0130] In this application embodiment, the first texture data and the second texture data are rendered respectively, and the first texture data and the transformation parameters involved in rendering based on the loss between the rendering results are updated. Since the image range information of the second texture data is better than that of the first texture data, and the amount of data of the first texture data is greater than that of the second texture data, when real-time image rendering is performed based on the updated first texture data and the transformation parameters, the rendering effect can be comparable to that of the second texture data, with less storage space and computing resources consumed, thereby effectively improving the utilization rate of rendering resources.

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

[0132] This application's embodiments can be applied to rendering scenarios in various games, such as competitive games, racing games, and dress-up games. In some embodiments, the server obtains first texture data of a virtual object and conversion parameters for the corresponding second texture data of the virtual object. The first texture data has a smaller data volume than the second texture data, and the image information range of the first texture data is smaller than that of the second texture data. Based on the conversion parameters and the first texture data, the virtual object undergoes fitting rendering processing to obtain a fitted rendering image. The rendering loss between the fitted rendering image and the standard rendering image is determined, and the conversion parameters and the first texture data are updated based on the rendering loss. The standard rendering image is a rendering image including the virtual object obtained by standard rendering processing based on the second texture data. All of this is the processing performed before the game starts. For example, during the game's development and packaging stage, the terminal receives updated first texture data and updated conversion parameters (which can be packaged in the installation package) sent by the server. During the game's installation and operation, the terminal performs real-time rendering processing on the virtual object based on the updated conversion parameters and updated first texture data to obtain a target rendering image including the virtual object. Human-computer interaction in the virtual scene is then performed based on the target rendering image, such as in competitive games. It should be noted that the embodiments of this application are applicable to most mobile game projects, especially those with high requirements for rendering performance and rendering effects. This solution can significantly improve rendering efficiency and achieve minimal difference from the original effect.

[0133] See Figure 4 , Figure 4 This is a rendering diagram provided in the embodiment of this application. The rendering effect in the game in this embodiment of the application only requires a texture and the corresponding UV2 vertex data. It can be regarded as attaching the fitted texture 401 to the model 402 (i.e. the virtual object to be rendered) using the second texture coordinate (UV2).

[0134] The following details the computational framework and machine learning fitting algorithm based on differentiable rendering provided in the embodiments of this application. See also Figure 5 , Figure 5 This is a schematic diagram of the fitting rendering process provided in the embodiments of this application, such as... Figure 5 As shown, the rendering process is a very complex function f. Its input is x, which is a parameter set containing data such as model vertex positions, material parameters, and texture parameters. The output y of f is the rendering result.

[0135] This application embodiment does not optimize vertex positions or other data. Only the first texture data and transformation parameters in x need optimization. The goal is to calculate x such that f(x) approximates the HDRR rendering result as closely as possible, given the HDRR rendering result. The degree of approximation is measured using a loss function. The optimization algorithm uses gradient descent. However, f is a very complex function, and the normal rendering process is not differentiable. Therefore, in order to use the gradient descent algorithm to find the optimal x, f needs to be differentiable. This application embodiment provides a differentiable (i.e., differentiable) rasterization rendering framework. It should be noted that f is the complete rasterization rendering process. To make it differentiable, this application embodiment has improved the rasterization rendering process. See [link to relevant documentation]. Figure 8 The modified rasterization rendering process is implemented through a unified computing device architecture (CUDA) and runs as a module of a machine learning library (such as PyTorch). The entire rendering process can backpropagate gradients, so the whole process is differentiable. All relevant assets are connected via a transitive gradient computational connection (Connection with Gradients) to obtain model tangent / normal data (ComputeTangent / Normal), generate lightmap texture coordinates (Lightmap UV Generation), and compute animation and skinning. The model tangent / normal data, lightmap texture coordinates, animation, and skinning are then connected via a transitive gradient computational connection (Connection with Gradients) to obtain clip space coordinates (Clip SpacePos). All relevant assets are then connected via a regular computational connection to obtain triangle index data (Index Buffer). Rasterization is then performed based on the clip space coordinates and the triangle index data to obtain the coordinates (u,v) and... Based on coordinates (u,v), Interpolation is performed on vertex attribute data to obtain interpolated attribute data and attribute pixel derivatives. Texture sampling is then performed based on the interpolated attribute data, the derivatives of the pixel attribute data, and the texture to obtain filtered sample data. Ground truth shading is then performed on the target to be fitted based on the lighting (Lights Camera), material parameters, interpolated attribute data, and filtered sample data to obtain an aliased rendered image. Antialiasing is then performed on the aliased rendered image to obtain the final rendered image.

[0136] The following details the application principle of the high dynamic range space transformation function in the image rendering method provided in this application embodiment. To reduce package size and memory usage, the final stored texture data is LDR T, which is data in the range [0-1]. During rendering, it is converted to high dynamic range space, and then rendering is performed based on the converted data. High dynamic range space has a wider data range and contains more data that the human visual system can perceive. The function used in this conversion process is the high dynamic range space transformation function, which can be regarded as the inverse process of tone mapping.

[0137] As an example, the tone mapping function Reinhard can be found in formula (4), and its function curve is as follows: Figure 6A The dashed curve in the image is shown below:

[0138]

[0139] Among them, c H It is the color value in the high dynamic range space, c L It is a color value in the low dynamic range space. Its corresponding high dynamic range space conversion function can be found in formula (5), and its function curve is as follows: Figure 6B The dashed curve in the image is shown below:

[0140]

[0141] As an example, the tone mapping function Aces can also be found in formula (6), and its function curve is as follows: Figure 6A The solid curve in the middle is shown

[0142]

[0143] Among them, c H It is the original HDR color value, c L This is the LDR color value. Its corresponding high dynamic range space conversion function can be found in formula (7), and its function curve is shown below. Figure 6B The solid curve in the image is shown below:

[0144]

[0145] In this application embodiment, LDRT needs to be fitted for different rendering effects of different HDRRs, so that the rendering effect of unlit materials based on LDRT can approximate that of HDRR. For different rendering effects, their brightness ranges are actually different. The parameters of a single high dynamic range space transformation function are not optimal solutions. Whether it is the high dynamic range space transformation function corresponding to Reinhard or the high dynamic range space transformation function corresponding to Aces, their parameters are fixed and cannot well adapt to various different rendering brightness ranges.

[0146] See Figures 7A-7B , Figures 7A-7B This is a rendering diagram of the image rendering method provided in the embodiments of this application. Figure 7A The color brightness range of virtual objects is more concentrated in the dark areas. Figure 7B The color brightness range of virtual objects is more concentrated in the bright areas, so ideally their high dynamic range space transformation function curve should be... Figure 6C As shown, Figure 7A For virtual objects, dashed curves should be used. This means allocating a larger range of texture data to the darker color space, with the dashed curve allocating the texture data range [0-0.9] to the brightness range [0-0.2], and a smaller range of texture data to the brighter color space, with the dashed curve allocating the texture data range [0.9-1.0] to the brightness range [0.2-1.6], and controlling the maximum brightness to around 1.6. This data allocation allows for higher precision and better fit in the darker areas of the rendered result. Figure 7B In the rendering of virtual objects, solid curves should be used, meaning a larger range of texture data should be allocated to the brighter color space. For example, a solid curve allocates a texture data range of [0.44-1.0] to the brightness range of [0.2-4.34], and a smaller range of texture data should be allocated to the darker color space. For example, a solid curve allocates a texture data range of [0-0.44] to the brightness range of [0-0.2], with the maximum brightness controlled to around 4.34. This data allocation allows for higher precision and better fit in the brighter areas of the rendered result.

[0147] As can be seen from the above, in order to achieve the best fitting effect, the curve of the high dynamic range space transformation function needs to be customized and automatically fitted. When implementing the embodiments of this application, the applicant was inspired by the formulas of the tone mapping function Reinhard and the tone mapping function Aces, and implemented the automatic fitting of the parameters of the high dynamic range space transformation function in the following two forms. Furthermore, the image rendering method provided by the embodiments of this application is not limited to the high dynamic range space transformation function in the following forms. Other games can be customized according to different needs and different game computational overhead.

[0148] As an example, the first-order tone mapping function is shown in formula (8):

[0149]

[0150] Where a, b, c, and d are all parameters of the first-order tone mapping function, c H It is the original HDR color value, c L It is the LDR color value.

[0151] As an example, the first-order high dynamic range space transformation function corresponding to the first-order tone mapping function is shown in Equation (9):

[0152]

[0153] Where e, f, g, and h are all parameters of a first-order high dynamic range space transformation function, and c H It is the original HDR color value, c L It is the LDR color value.

[0154] Through subsequent machine learning fitting algorithms, the optimal e, f, g, h parameters will be fitted for each rendering effect of HDRR, and, due to c L When c is 0 H Since f is also 0, the parameter f is always 0. After simplification, we can obtain formula (10):

[0155]

[0156] Where p and q are the parameters to be fitted to the first-order high dynamic range space transformation function, and different p and q correspond to different curves, c H It is the original HDR color value, c L It is the LDR color value. Figure 6D The figure shows different curves corresponding to different p and q.

[0157] As an example, the second-order tone mapping function is shown in formula (11):

[0158]

[0159] Where a, b, c, d, e, and f are all parameters of the second-order tone mapping function, c H It is the original HDR color value, c L It is the LDR color value.

[0160] As an example, the second-order high dynamic range space transformation function corresponding to the second-order tone mapping function is shown in Equation (12):

[0161]

[0162] Where p, q, r, s, t, u, v are all parameters of the second-order high dynamic range space transformation function, and c H It is the original HDR color value, c L It is the LDR color value.

[0163] Through subsequent machine learning fitting algorithms, optimal p, q, r, s, t, u, v parameters will be fitted for each rendering effect of HDRR. Additionally, because c L When c is 0 H Since u and v are also 0, the parameters are always 0. After simplification, we can obtain formula (13):

[0164]

[0165] Where p, q, r, s, and t are all parameters that need to be fitted to the second-order high dynamic range space transformation function. Different p, q, r, s, and t correspond to different curves, and c H It is the original HDR color value, c L It is the LDR color value. Figure 6E The figure shows different curves corresponding to different p and q.

[0166] The second-order high dynamic range spatial transformation function can provide more curve shapes than the first-order high dynamic range spatial transformation function and supports more compression methods for the brightness range. The computational cost of the first-order high dynamic range spatial transformation function is less than that of the second-order high dynamic range spatial transformation function.

[0167] The following section will detail how to use a differentiable rendering framework and machine learning algorithms to fit the optimal transformation parameters and first texture data (LDRT).

[0168] like Figure 9 As shown, the input includes: 1) the original virtual object rendered by PBR, including model 901, material sphere, and lighting 902 (which may include parallel light, point light, surface light, etc.); 2) camera 903, which remains stationary throughout the fitting process.

[0169] The output includes: 1) an automatically generated model UV2, used to map texture space to the model rendering result; 2) a texture 1001 unfolded based on UV2, such as... Figure 10 As shown, when the fitting ends, this texture contains the baked LDRT data. The pixel parameters of this texture are represented by φ in the following description; 3) The parameters of the optimal high dynamic range spatial transformation function (Inverse Tone Mapping) obtained by fitting.

[0170] like Figure 11 The complete fitting process shown, under given input and output conditions, mainly consists of 8 steps, each of which will be explained in detail below:

[0171] In step 801, the scene and various parameters are initialized.

[0172] Before performing machine learning fitting, the scene is initialized, including loading the model, textures, materials, etc. Then, the camera position and orientation are set (without optimization), the model position and orientation are set, and the parameters of various lights are set (without optimization). The automatically generated model UV2 is also configured. Additionally, the data for each pixel of the texture map (first texture data) and the parameters θ of the high dynamic range spatial transformation function (Inverse Tone Mapping) need to be initialized. Generally, initialization can be done as follows: Figure 12 The gray constants are shown. During the machine learning fitting process, the camera's position, orientation, and lighting parameters are not optimized (not optimized).

[0173] In step 802, the orientation of the virtual object (i.e., the model) is set during the machine learning fitting process.

[0174] In actual game operation, virtual objects will not always be in the same orientation, so it is necessary to fit the rendering effect of the character in various orientations to ensure that the fitting effect of the virtual object in each state is relatively accurate. For example Figure 13 The example shown illustrates the orientation settings for virtual objects. Virtual object 1301 has three different orientations, and the orientation of a virtual object is randomly set during each iteration.

[0175] In step 803, standard rendering processing (HDRR) is performed.

[0176] HDRR rendering results are standard rendering effects that need to be fitted. This requires first performing PBR rendering using HDRT to obtain, as shown below. Figure 14 The rendering (i.e., standard rendering) of the virtual object 1401 in a certain orientation is shown.

[0177] In step 804, fitting and rendering processing is performed.

[0178] Then, using the same virtual object orientation and the first texture data as the resource, it is rendered using the unlit material rendering method, resulting in the following: Figure 15 The renderings shown are of the same orientation (i.e., the fitted renderings).

[0179] In step 805, the rendering loss is calculated.

[0180] To make the fitted render approximate the standard render approximate the standard render approximate the texture, the fitted texture needs to be modified. First, the difference between the fitted render approximate and the standard render approximate needs to be calculated. Figure 16 To determine the pixel difference between the two in screen space, this application embodiment uses the L1Loss function, as shown in formula (14):

[0181]

[0182] Where Img1 and Img2 represent the standard rendering image and the fitted rendering image, respectively, and H and W represent the length and width of Img1 (or Img2), respectively. This represents the difference in pixel values ​​between the standard rendered image and the fitted rendered image in screen space, where (i,j) represents any pixel in the standard rendered image in screen space.

[0183] In step 806, when the rendering loss is greater than the loss threshold, the gradient of the first texture data and the gradient of the transformation parameters are calculated.

[0184] After calculating the loss, the gradient of the rendering loss loss with respect to the first texture data and the gradient with respect to the transformation parameters can be calculated using the PyTorch framework and the differentiable rasterizer renderer.

[0185] In step 807, the first texture data and transformation parameters are updated with the corresponding gradients, and steps 802 to 805 are executed.

[0186] After calculating the gradient of the first texture data, the first texture data is updated using the PyTorch optimizer. After calculating the gradient of the transformation parameters, the transformation parameters are updated using the PyTorch optimizer. Then, the next iteration begins, and the iterative process of steps 802-807 is repeated continuously. The first texture data and the transformation parameters will gradually converge and approach the optimal value.

[0187] In step 808, when the rendering loss is not greater than the loss threshold, the format of the first texture data and the conversion parameters is converted and output.

[0188] When the rendering loss value is less than the loss threshold, it indicates that the fitted rendering map is very close to the standard rendering map. At this point, the entire iteration process can be exited, the first texture data and transformation parameters can be saved, and UV2 can be used to sample the obtained texture map in the game to obtain a rendering result close to HDRR.

[0189] Step 804 is described in detail below. It includes two sub-steps, addressing how to use the first texture data for Unlit rendering. First, the first texture data in LDR space is converted to HDR space using formula (10) or formula (13). At the beginning of the algorithm, the parameters of the formula are the default initial values. Later, in each iteration, the parameters of the formula (conversion parameters) are updated based on the previous iteration. During the algorithm iteration, the parameters are gradually updated to the optimal values ​​through Gradient. Next, the sampled HDR space texture data is rendered into world space using UV2 texture coordinates to obtain the final screen space rendering result.

[0190] See Figure 17 , Figure 17 This is a schematic diagram illustrating the loss effect of the image rendering method provided in this application embodiment. 1701 is a standard rendering image, and 1702 is a target rendering image obtained by using the first texture data output in step 808, and then rendering it by fitting a high dynamic range space transformation function. The high dynamic range space transformation function is as follows: Figure 18 As shown, the transformation parameters in the high dynamic range space transformation function are output in step 808. 1703 is the pixel difference between the target rendering image and the standard rendering image. It can be seen that the pixel difference between the two is very small.

[0191] This application provides an image rendering method that can automatically fit the HDRR rendering method and obtain LDRT to replace HDRT as the rendering basis, greatly reducing the amount of texture data, achieving a rendering effect close to HDRR with very low overhead, significantly improving the game's frame rate, and reducing power consumption.

[0192] It is understood that in the embodiments of this application, data such as user information are involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0193] The following description continues to illustrate the exemplary structure of the image rendering apparatus 455 provided in the embodiments of this application as a software module. In some embodiments, such as Figure 2As shown, the software modules stored in the image rendering device 455 in the memory 450 may include: an acquisition module 4551, used to acquire first texture data of a virtual object and conversion parameters of second texture data corresponding to the virtual object, wherein the amount of data of the first texture data is less than the amount of data of the second texture data, and the image information range of the first texture data is less than the image information range of the second texture data; a fitting module 4552, used to perform fitting rendering processing on the virtual object based on the conversion parameters and the first texture data to obtain a fitted rendering image; a loss module 4553, used to determine the rendering loss between the fitted rendering image and the standard rendering image, and update the conversion parameters and the first texture data based on the rendering loss, wherein the standard rendering image is a rendering image including the virtual object obtained by performing standard rendering processing on the second texture data; and a rendering module 4554, used to perform real-time rendering processing on the virtual object based on the updated conversion parameters and the updated first texture data to obtain a target rendering image including the virtual object.

[0194] In some embodiments, the fitting module 4552 is further configured to: perform spatial transformation processing on the first texture data of the virtual object toward the second texture data based on the transformation parameters to obtain third texture data that is in the same dynamic range space as the second texture data; and perform fitting rendering processing on the virtual object based on the third texture data to obtain a fitting rendering map.

[0195] In some embodiments, the first texture data includes a first color value for each texture pixel, the second texture data includes a second color value for each texture pixel, and the transformation parameters include a first first-order parameter and a second first-order parameter; the fitting module 4552 is further configured to: perform the following processing for each texture pixel in the first texture data: determine a first product result between the first color value of the texture pixel and the first first-order parameter; determine a first summation result between the first product result and the second first-order parameter; determine the ratio between the first color value corresponding to the texture pixel and the first summation result as a third color value of the texture pixel that is in the same dynamic range space as the second color value; and combine the third color values ​​of multiple texture pixels to form third texture data.

[0196] In some embodiments, the first texture data includes a first color value for each texture pixel, the second texture data includes a second color value for each texture pixel, and the transformation parameters include a first second-order parameter, a second second-order parameter, a third second-order parameter, a fourth second-order parameter, and a fifth second-order parameter; the fitting module 4552 is further configured to: perform the following processing for each texture pixel in the first texture data: determine the second product result between the square of the first color value of the texture pixel and the first second-order parameter, and the third product result between the first color value of the texture pixel and the second second-order parameter; and process the second product result and the third product... The results and the third second-order parameter are summed to obtain the second summation result; the fourth product result between the first color value of the texture pixel and the fourth second-order parameter is determined; the square root of the second summation result, the fourth product result, and the square root of the third second-order parameter are summed to obtain the third summation result; the fourth summation result between the first color value of the texture pixel and the fifth second-order parameter is determined; the ratio between the third summation result and the fourth summation result is determined as the third color value of the texture pixel that is in the same dynamic range space as the second color value; the third color values ​​of multiple texture pixels are combined to form the third texture data.

[0197] In some embodiments, the third texture data includes the third color value of each texture pixel; the fitting module 4552 is further configured to: obtain the two-dimensional texture coordinates of the virtual object; obtain the differentiable rendering framework corresponding to the fitting rendering process; and perform forward propagation of the two-dimensional texture coordinates and the third color value of each texture pixel in the differentiable rendering framework to obtain the fitting rendering map.

[0198] In some embodiments, the loss module 4553 is further configured to: determine the overall pixel value difference between the standard rendered image and the fitted rendered image in screen space; and determine the rendering loss based on the overall pixel value difference, the length of the fitted rendered image, and the width of the fitted rendered image.

[0199] In some embodiments, the loss module 4553 is further configured to: perform the following processing for each pixel in the screen space of the fitted rendering image: determine a first pixel value of the pixel and determine a second pixel value of the corresponding pixel in the standard rendering image; take the absolute value of the difference between the first pixel value and the second pixel value as the pixel value difference of the pixel; and sum the pixel value differences of multiple pixels in the fitted rendering image to obtain the overall pixel value difference.

[0200] In some embodiments, the loss module 4553 is further configured to: perform partial derivative processing on the first texture data based on the rendering loss to obtain the gradient of the corresponding first texture data; perform partial derivative processing on the transformation parameter based on the rendering loss to obtain the gradient of the corresponding transformation parameter; update the first texture data based on the gradient of the corresponding first texture data, and update the transformation parameter based on the gradient of the corresponding transformation parameter.

[0201] In some embodiments, the loss module 4553 is further configured to: multiply the set learning rate by the gradient of the corresponding first texture data to obtain the data change value of the first texture data; add the data change value of the first texture data to the first texture data to obtain the updated first texture data; multiply the set learning rate by the gradient of the corresponding transformation parameter to obtain the data change value of the transformation parameter; and add the data change value of the transformation parameter to the transformation parameter to obtain the updated transformation parameter.

[0202] In some embodiments, the rendering module 4554 is further configured to: perform real-time rendering processing on the virtual object based on the updated transformation parameters and the updated first texture data when the rendering loss is less than the loss threshold; or perform real-time rendering processing on the virtual object based on the updated transformation parameters and the updated first texture data when the number of updates reaches the update number threshold.

[0203] In some embodiments, the rendering module 4554 is further configured to: perform a spatial transformation process on the updated first texture data toward the second texture data based on the updated transformation parameters to obtain fourth texture data that is in the same dynamic range space as the second texture data; determine at least one two-dimensional texture coordinate of the virtual object; and perform the following processing for each two-dimensional texture coordinate: sample the texture image corresponding to the two-dimensional texture coordinate from the fourth texture data and perform a bonding process on the sampled texture image; and generate a target rendering map including the virtual object based on the bonding result of each two-dimensional texture coordinate.

[0204] 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.

[0205] 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.

[0206] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EP ROM, 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.

[0207] 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.

[0208] 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 co-located files (e.g., files that store one or more modules, subroutines, or code sections).

[0209] 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.

[0210] In summary, by performing rendering processing on the first texture data and the second texture data respectively through the embodiments of this application, and updating the first texture data and the transformation parameters involved in rendering based on the loss between the rendering results, since the image range information of the second texture data is better than that of the first texture data, and the data volume of the first texture data is greater than that of the second texture data, when performing real-time image rendering based on the updated first texture data and transformation parameters, the rendering effect comparable to that of the second texture data can be achieved, while consuming less storage space and computing resources, thereby effectively improving the utilization rate of rendering resources.

[0211] 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 first texture data of a virtual object and conversion parameters corresponding to second texture data of the virtual object, wherein the amount of data in the first texture data is less than the amount of data in the second texture data, and the image information range of the first texture data is less than the image information range of the second texture data; Based on the conversion parameters and the first texture data, the virtual object is subjected to fitting rendering processing to obtain a fitting rendering map; Determine the rendering loss between the fitted rendering image and the standard rendering image, and update the transformation parameters and the first texture data based on the rendering loss, wherein the standard rendering image is a rendering image including the virtual object obtained by standard rendering processing based on the second texture data; Based on the updated transformation parameters and the updated first texture data, the virtual object is rendered in real time to obtain a target rendering image including the virtual object.

2. The method according to claim 1, characterized in that, The step of performing fitting rendering processing on the virtual object based on the transformation parameters and the first texture data to obtain a fitted rendering map includes: Based on the transformation parameters, the first texture data of the virtual object is subjected to spatial transformation processing toward the second texture data to obtain third texture data that is in the same dynamic range space as the second texture data; Based on the third texture data, a fitting rendering process is performed on the virtual object to obtain the fitting rendering map.

3. The method according to claim 2, characterized in that, The first texture data includes a first color value for each texture pixel, the second texture data includes a second color value for each texture pixel, and the transformation parameters include a first first-order parameter and a second first-order parameter; The step of performing a spatial transformation process on the first texture data of the virtual object, based on the transformation parameters, to orient it toward the second texture data, to obtain third texture data that is in the same dynamic range space as the second texture data, includes: For each texture pixel in the first texture data, the following processing is performed: Determine the first product result between the first color value of the texture pixel and the first first-order parameter; Determine the first summation result of the first product and the second first-order parameter; The ratio between the first color value of the texture pixel and the first summation result is determined as the third color value of the texture pixel, which is in the same dynamic range space as the second color value. The third texture data is composed of the third color values ​​of multiple texture pixels.

4. The method according to claim 2, characterized in that, The first texture data includes a first color value for each texture pixel, the second texture data includes a second color value for each texture pixel, and the transformation parameters include a first second-order parameter, a second second-order parameter, a third second-order parameter, a fourth second-order parameter, and a fifth second-order parameter. The step of performing a spatial transformation process on the first texture data of the virtual object, based on the transformation parameters, to orient it toward the second texture data, to obtain third texture data that is in the same dynamic range space as the second texture data, includes: For each texture pixel in the first texture data, the following processing is performed: Determine the result of the second product between the square of the first color value of the texture pixel and the first second-order parameter, and the result of the third product between the first color value of the texture pixel and the second second-order parameter; The second product result, the third product result, and the third second-order parameter are summed to obtain the second summation result; Determine the fourth product result between the first color value of the texture pixel and the fourth second-order parameter; The square root of the second summation result, the fourth product result, and the square root of the third second-order parameter are summed to obtain the third summation result; Determine the fourth summation result of the first color value of the texture pixel and the fifth second-order parameter; The ratio between the third summation result and the fourth summation result is determined as the third color value of the texture pixel that is in the same dynamic range space as the second color value; The third texture data is composed of the third color values ​​of multiple texture pixels.

5. The method according to claim 2, characterized in that, The third texture data includes the third color value for each texture pixel; The step of performing fitting rendering processing on the virtual object based on the third texture data to obtain a fitting rendering map includes: Obtain the two-dimensional texture coordinates of the virtual object; Obtain the differentiable rendering framework corresponding to the fitting rendering process; The two-dimensional texture coordinates and the third color value of each texture pixel are forward propagated in the differentiable rendering framework to obtain the fitted rendering map.

6. The method according to claim 1, characterized in that, Determining the rendering loss between the fitted rendering image and the standard rendering image includes: Determine the overall pixel value difference between the standard rendered image and the fitted rendered image in screen space; The rendering loss is determined based on the overall pixel value difference, the length of the fitted rendering map, and the width of the fitted rendering map.

7. The method according to claim 6, characterized in that, Determining the overall pixel value difference between the standard rendered image and the fitted rendered image in screen space includes: For each pixel in the screen space of the fitted rendering image, the following processing is performed: Determine the first pixel value of the pixel, and determine the second pixel value of the corresponding pixel in the standard rendering image; The absolute value of the difference between the first pixel value and the second pixel value is taken as the pixel value difference of the pixel; The pixel value differences of multiple pixels in the fitted rendering image are summed to obtain the overall pixel value difference.

8. The method according to claim 1, characterized in that, The step of updating the transformation parameters and the first texture data based on the rendering loss includes: Based on the rendering loss, the first texture data is processed by partial derivative to obtain the gradient corresponding to the first texture data; The gradient of the transformation parameter is obtained by performing partial derivative processing on the rendering loss. The first texture data is updated based on the gradient corresponding to the first texture data, and the transformation parameters are updated based on the gradient corresponding to the transformation parameters.

9. The method according to claim 8, characterized in that, The step of updating the first texture data based on the gradient corresponding to the first texture data includes: The learning rate is multiplied by the gradient corresponding to the first texture data to obtain the data change value of the first texture data; Add the data change value of the first texture data to the first texture data to obtain the updated first texture data; The step of updating the transformation parameters based on the gradient corresponding to the transformation parameters includes: The learning rate is multiplied by the gradient corresponding to the transformation parameter to obtain the data change value of the transformation parameter; The updated conversion parameters are obtained by adding the data change value of the conversion parameters to the conversion parameters.

10. The method according to claim 1, characterized in that, The real-time rendering process of the virtual object based on the updated transformation parameters and the updated first texture data includes: When the rendering loss is less than the loss threshold, the virtual object is rendered in real time based on the updated transformation parameters and the updated first texture data; or When the number of updates reaches the update threshold, the virtual object is rendered in real time based on the updated transformation parameters and the updated first texture data.

11. The method according to claim 1, characterized in that, The virtual object is rendered in real time based on the updated transformation parameters and the updated first texture data to obtain a target rendering image including the virtual object, including: Based on the updated transformation parameters, the updated first texture data is spatially transformed toward the second texture data to obtain fourth texture data that is in the same dynamic range space as the second texture data; Determine at least one two-dimensional texture coordinate of the virtual object; For each of the two-dimensional texture coordinates, the following processing is performed: The texture image corresponding to the two-dimensional texture coordinates is sampled from the fourth texture data, and the sampled texture image is then subjected to a bonding process. Based on the fitting results of each of the two-dimensional texture coordinates, a target rendering map including the virtual object is generated.

12. An image rendering apparatus, characterized in that, The device includes: The acquisition module is used to acquire the first texture data of the virtual object and the conversion parameters of the second texture data corresponding to the virtual object, wherein the amount of the first texture data is less than the amount of the second texture data, and the image information range of the first texture data is less than the image information range of the second texture data. The fitting module is used to perform fitting rendering processing on the virtual object based on the transformation parameters and the first texture data to obtain a fitting rendering map; The loss module is used to determine the rendering loss between the fitted rendering image and the standard rendering image, and to update the transformation parameters and the first texture data based on the rendering loss, wherein the standard rendering image is a rendering image including the virtual object obtained by standard rendering processing based on the second texture data; The rendering module is used to perform real-time rendering processing on the virtual object based on updated transformation parameters and updated first texture data to obtain a target rendering map including the virtual object.

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 11.

14. A computer-readable storage medium storing executable instructions, characterized in that, When the executable instructions are executed by the processor, they implement the image rendering method according to any one of claims 1 to 11.

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 11.

Citation Information

Patent Citations

  • Image texture processing method and device, storage medium and electronic device

    CN108230434A

  • Texture map generation method and device, electronic equipment and storage medium

    CN113963110A