Texture rendering processing method and device and related equipment
The object grid is optimized through the joint cross-processing of reference mask image and raster projection image, which solves the high consumption problem caused by the high data demand for training sample of neural network model, improves texture rendering efficiency and improves the effect.
Patent Information
- Application Number
- CN202410174486.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-07
- Publication Date
- 2025-08-08
AI Technical Summary
The texture rendering optimization method based on neural network models in the prior art requires a large amount of sample data training, resulting in high time and computing resource consumption and low efficiency.
By obtaining the reference mask image of the virtual object and the raster projection image for joint cross-processing, the object grid is optimized and the texture rendering quality is improved.
It reduces the time and computing resources required for texture rendering optimization, improves the optimization efficiency of texture rendering effects, and avoids camera drift and texture ghosting problems.
Smart Images

Figure CN120451362A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a texture rendering processing method, apparatus, and related equipment. Background Art
[0002] When rendering virtual objects in a virtual space (such as a game space), poor rendering results may occur due to camera drift, texture ghosting, and other factors. To improve the rendering of virtual objects, we can obtain images of the virtual objects from multiple perspectives and train a neural network model for texture optimization based on these images. The neural network model can then be used to optimize the texture rendering of the virtual objects, thereby improving the rendering of the virtual objects.
[0003] However, the inventors found in practice that the method of optimizing texture rendering of virtual objects based on a neural network model requires collecting a large amount of sample image data to train the neural network model, and during the use of the neural network model, the neural network model needs to be continuously trained to ensure the effectiveness of use. As a result, a lot of time and computing resources are required to train the neural network model for texture rendering optimization, resulting in low efficiency in optimizing the texture rendering effect of virtual objects. Summary of the Invention
[0004] The embodiments of the present application provide a texture rendering processing method, apparatus, and related equipment, which can optimize the object mesh of a virtual object by referring to a mask image, thereby improving the efficiency of optimizing the texture rendering effect of the virtual object.
[0005] On the one hand, an embodiment of the present application provides a texture rendering processing method, the method comprising:
[0006] Obtaining a first object image of the virtual object in the business space; the first object image is a business texture image whose texture rendering quality does not meet a rendering quality condition, the business texture image being obtained by performing a first rendering process on the virtual object based on posture parameters of a virtual camera in the business space and an object mesh of the virtual object, the object mesh including F facets constituting the virtual object, where F is a positive integer; performing a grating projection process on the F facets based on the posture parameters to obtain F grating projection images corresponding to the F facets, wherein one facet corresponds to one grating projection image;
[0007] Obtaining a reference mask image of the virtual object; the reference mask image is determined based on a model texture image of the virtual object under the pose parameters obtained in the model space; the image size of the reference mask image and the business texture image are consistent;
[0008] Performing joint cross processing on the reference mask image and the F grating projection images to obtain joint cross values of the F grating projection images; a joint cross value is used to represent the overlap between a grating projection image and the reference mask image;
[0009] Based on the joint cross-values of F grating projection images, the object mesh is optimized to obtain the object optimized mesh of the virtual object;
[0010] Based on the object optimization mesh and posture parameters, a second rendering process is performed on the virtual object to obtain a second object image of the virtual object; the texture rendering quality of the second object image is better than the texture rendering quality of the first object image.
[0011] On the one hand, an embodiment of the present application provides a texture rendering processing device, the device comprising:
[0012] A first image acquisition module is configured to acquire a first object image of the virtual object in a business space; the first object image is a business texture image whose texture rendering quality does not meet a rendering quality condition, the business texture image being obtained by performing a first rendering process on the virtual object based on posture parameters of a virtual camera in the business space and an object mesh of the virtual object, the object mesh including F facets constituting the virtual object, where F is a positive integer;
[0013] A grating projection module is used to perform grating projection processing on F facets based on the posture parameters to obtain F grating projection images corresponding to the F facets; one facet corresponds to one grating projection image; a mask image acquisition module is used to obtain a reference mask image of the virtual object; the reference mask image is determined based on the model texture image of the virtual object at the posture parameters obtained in the model space; the image size of the reference mask image and the business texture image are consistent;
[0014] a joint cross processing module for performing joint cross processing on the reference mask image and the F grating projection images to obtain joint cross values of the F grating projection images; a joint cross value is used to represent the degree of overlap between a grating projection image and the reference mask image;
[0015] A mesh optimization module is used to perform mesh optimization processing on the object mesh based on the joint intersection value of the F grating projection images to obtain an object optimized mesh of the virtual object;
[0016] The optimized rendering module is used to perform a second rendering process on the virtual object based on the object optimization grid and posture parameters to obtain a second object image of the virtual object; the texture rendering quality of the second object image is better than the texture rendering quality of the first object image.
[0017] The mesh optimization module includes: a threshold judgment unit, a face determination unit, and a face pruning unit;
[0018] a threshold judgment unit, configured to determine, from the F grating projection images, a grating projection image whose joint intersection value is less than or equal to a joint intersection threshold, and determine the grating projection image whose joint intersection value is less than or equal to the joint intersection threshold as a grating projection image to be pruned;
[0019] A patch determining unit is used to search for a patch corresponding to the grating projection image to be pruned among the F patches in the object grid, and determine the found patch as the patch to be pruned;
[0020] The facet pruning unit is used to prune the facets to be pruned in the object mesh to obtain the object optimized mesh of the virtual object.
[0021] The reference mask image and the F grating projection images each include pixels at H×W pixel positions, where H and W are both positive integers; the pixel values of the pixels included in the reference mask image are first pixel values; the pixel values of the pixels included in any of the F grating projection images are second pixel values; the F grating projection images include a grating projection image j, where j is a positive integer less than or equal to F; the joint cross processing module includes: a pixel position determination unit, a first comparison unit, a second comparison unit, and a cross value determination unit;
[0022] a pixel position determining unit, configured to determine a pixel position i from H×W pixel positions; i is a positive integer less than or equal to H×W;
[0023] a first comparing unit, configured to determine a minimum value between a first pixel value corresponding to pixel position i in the reference mask image and a second pixel value corresponding to pixel position i in the grating projection image j as a first comparison result corresponding to pixel position i;
[0024] a second comparing unit, configured to determine a maximum value between a first pixel value corresponding to pixel position i in the reference mask image and a second pixel value corresponding to pixel position i in the grating projection image j as a second comparing result corresponding to pixel position i;
[0025] The cross value determination unit is used to determine the joint cross value of the grating projection image j based on the first comparison result corresponding to the pixel position i and the second comparison result corresponding to the pixel position i, and obtain the joint cross value of F grating projection images based on the joint cross value of the grating projection image j.
[0026] The cross value determination unit is specifically configured to:
[0027] Determine a pixel position m different from the pixel position i from the H×W pixel positions; m is a positive integer less than or equal to H×W; m is different from i;
[0028] Obtain a first comparison result corresponding to pixel position m and a second comparison result corresponding to pixel position m;
[0029] Determining a first intersection value corresponding to the grating projection image j based on a first comparison result corresponding to the pixel position m and a first comparison result corresponding to the pixel position i;
[0030] Determining a second intersection value corresponding to the grating projection image j based on the second comparison result corresponding to the pixel position m and the second comparison result corresponding to the pixel position i;
[0031] Based on the first intersection value and the second intersection value, a joint intersection value of the grating projection image j is determined.
[0032] The reference mask image includes F reference mask sub-images; one reference mask sub-image corresponds to one patch; the F reference mask sub-images and the F grating projection images each include pixel points at H×W pixel positions, where H and W are both positive integers; the F grating projection images include grating projection image j, where j is a positive integer less than or equal to F;
[0033] The joint cross processing module further includes: a sub-image determination unit and a pixel comparison unit;
[0034] a sub-image determining unit, configured to determine the patch corresponding to the grating projection image j as a target patch, and to determine a reference mask sub-image corresponding to the target patch from among the F reference mask sub-images as a target reference mask sub-image;
[0035] a pixel position determining unit, configured to determine a pixel position i from H×W pixel positions; i is a positive integer less than or equal to H×W;
[0036] a pixel comparison unit, configured to determine a pixel comparison result corresponding to pixel position i based on a first pixel value corresponding to pixel position i in the target reference mask sub-image and a second pixel value corresponding to pixel position i in the grating projection image j;
[0037] The cross value determining unit is used to determine the joint cross value of the grating projection image j based on the pixel comparison result corresponding to the pixel position i, and obtain the joint cross value of F grating projection images based on the joint cross value of the grating projection image j.
[0038] Among them, the F grating projection images include grating projection image j, j is a positive integer less than or equal to F; the surface patch corresponding to the grating projection image j is the target surface patch;
[0039] The grating projection module includes: an initial image acquisition unit, a projection unit, a pixel determination unit, and a projection image determination unit;
[0040] an initial image acquisition unit, configured to acquire an initial image; the image size of the initial image being consistent with the image size of the first object image;
[0041] A projection unit is configured to perform raster projection processing on the target surface based on the posture parameter, and determine a projection area of the target surface in the initial image; the projection area includes a first pixel point, and the first pixel point has a corresponding mapping position on the target surface;
[0042] a pixel determining unit, configured to determine a second pixel value of the first pixel point based on a distance between the first pixel point and a mapping position of the first pixel point on the target patch;
[0043] The pixel determining unit is further configured to determine a pixel point other than the first pixel point in the initial image as a second pixel point, and determine a second pixel value of the second pixel point based on a preset pixel value;
[0044] A projection image determination unit is used to determine a grating projection image of the grating projection image j based on an initial image including the second pixel value of the first pixel point and the second pixel value of the second pixel point, and determine F grating projection images corresponding to the F facets based on the grating projection image of the grating projection image j.
[0045] The mask image acquisition module includes: a channel acquisition unit and a mask image determination unit; the channel acquisition unit is used to acquire a model texture image of the virtual object under the posture parameters in the model space; the model texture image includes a channel image under the target channel; the pixel value in the channel image of the target channel is used to represent the transparency of the model texture image;
[0046] The mask image determining unit is configured to determine a reference mask image of the virtual object based on the channel image under the target channel.
[0047] The texture rendering device further includes: a business texture image acquisition module and a quality judgment module;
[0048] A business texture image acquisition module is used to perform a first rendering process on the virtual object based on the posture parameters of the virtual camera in the business space, the object mesh of the virtual object, and the texture map of the virtual object to obtain a first business texture image; the texture map refers to the map resource configured when the virtual object is created in the model space;
[0049] The quality judgment module is configured to determine the first service texture image as the first object image when the texture rendering quality of the first service texture image does not meet the rendering quality condition.
[0050] Among them, the optimization rendering module includes: a texture optimization unit and a rendering unit;
[0051] A texture optimization unit, configured to perform texture optimization processing on a texture map based on an object optimization grid of the virtual object to obtain a texture optimization map of the virtual object;
[0052] The rendering unit is used to perform a second rendering process on the virtual object based on the object optimization grid, the texture optimization map and the posture parameters to obtain a second object image of the virtual object.
[0053] The texture rendering device further includes: a first rendering consumption recording module, a second rendering consumption recording module, a rendering comparison module, and an update module;
[0054] A first rendering consumption recording module is configured to perform a second rendering process on the virtual object based on the object mesh and the posture parameters in the model space, record a first rendering consumption time and first rendering consumption resources consumed by performing the second rendering process on the virtual object based on the object mesh and the posture parameters, and determine the first rendering consumption time and the first rendering consumption resources as first rendering consumption information;
[0055] a second rendering consumption recording module, which, when performing a second rendering process on the virtual object based on the object optimized mesh and posture parameters to obtain a second object image, records second rendering consumption resources and second rendering consumption duration consumed by performing the second rendering process on the virtual object based on the object optimized mesh and posture parameters, and determines the second rendering consumption resources and second rendering consumption duration as second rendering consumption information;
[0056] a rendering comparison module, configured to determine a rendering optimization detection result based on the first rendering consumption information, the second rendering consumption information, the texture rendering quality of the first object image, and the texture rendering quality of the second object image;
[0057] The updating module is used to update the object mesh based on the object optimization mesh when the rendering optimization detection result meets the optimization conditions associated with the virtual object; the updated object mesh is used to render the business texture image of the virtual object in the business space.
[0058] The texture rendering device further includes: an object coordinate system determination module and a posture parameter determination module; the object coordinate system determination module is used to obtain an object coordinate system created based on the virtual object; the object coordinate system takes the center position of the virtual object as the origin;
[0059] The attitude parameter determination module is used to determine the azimuth information, elevation information and distance information of the virtual camera relative to the virtual object based on the position of the virtual camera in the object coordinate system and the origin of the object coordinate system; the attitude parameter determination module is used to determine the attitude parameters of the virtual camera based on the azimuth information, elevation information and distance information.
[0060] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program is suitable for being loaded and executed by a processor so that a computer device having the processor executes the method provided by the embodiment of the present application.
[0061] On one hand, an embodiment of the present application provides a computer program product, including a computer program / instruction, and the computer program / instruction is executed by a processor to execute the method provided in the embodiment of the present application.
[0062] In an embodiment of the present application, it is possible to determine from the business space that the texture quality of the virtual object does not meet the rendering quality conditions of the business texture image, and then the texture rendering of the virtual object can be optimized. Specifically, a joint cross calculation can be performed based on the reference mask image and the grating projection images of F facets in the object grid, so that the joint cross value of the grating projection image corresponding to each facet and the reference mask image can be determined, thereby characterizing the overlap between the grating projection image corresponding to each facet and the reference mask image, and then the object grid is optimized based on the joint cross value, so as to render based on the optimized object grid and obtain the optimized image of the virtual object (i.e., the first object image). In this way, the object grid can be optimized based on the reference mask image of the virtual object under certain posture parameters, without the need to obtain a large amount of sample data for model training, which greatly reduces the time required for texture rendering optimization, thereby improving the efficiency of optimizing the texture rendering effect of the virtual object. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0064] Figure 1 This is a structural diagram of a data processing system provided in an embodiment of the present application;
[0065] Figure 2 This is a scenario diagram of a data processing method provided in an embodiment of the present application;
[0066] Figure 3This is a flow chart of a texture rendering processing method provided in an embodiment of the present application;
[0067] Figure 4 This is a schematic diagram of the effect of a posture parameter provided in an embodiment of the present application;
[0068] Figure 5 This is a schematic diagram of the effect of a grating projection process provided by an embodiment of the present application;
[0069] Figure 6 This is a flow chart of a grid optimization process provided by an embodiment of the present application;
[0070] Figure 7 This is a flow chart of a texture rendering processing method provided in an embodiment of the present application;
[0071] Figure 8 This is a schematic diagram of a scene for texture rendering optimization provided by an embodiment of the present application;
[0072] Figure 9 This is a structural diagram of a texture rendering processing device provided in an embodiment of the present application;
[0073] Figure 10 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0074] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0075] See Figure 1 , Figure 1 This is a structural diagram of a data processing system provided in an embodiment of the present application. Figure 1 As shown, the data processing system may include terminal devices (such as device 11a, device 12a, device 13a) and server 200a. It is understandable that Figure 1 The number of terminal devices and servers in the example is merely illustrative; any number of terminal devices and servers may be used depending on implementation requirements. Terminal devices (e.g., device 11a, device 12a, and device 13a) may communicate with servers via a network (i.e., a medium providing a communication link via a wired or wireless communication link or fiber optic cable, etc.) to transmit data.
[0076] It is understandable that a client may be running on a terminal device (such as device 12a), and the client may be a program that provides local services to users (also called business objects, operation objects). For example, the client may be a game client or a user client for cloud games. Server 200a may be a server corresponding to the client, and the server 200a may run a program for providing resources, service data and other services to the client. For example, the server 200a may be a game server for providing game services. It is understandable that the client running on the terminal device may also be called an application client, a business client, and so on. For example, the client running on the terminal device may be a client for providing game services, and then the user can play games on the terminal device, such as manipulating virtual objects in the game to move, release skills, and so on.
[0077] It is understood that terminal devices (such as device 12a) may include, but are not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, smart speakers, smart home appliances, etc., and are not limited here. The server 200a can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms, and are not limited here.
[0078] It is understandable that the embodiments of the present application can be applied to a computer device, which can be the above-mentioned Figure 1 Servers in the Figure 1 A data processing device that processes virtual objects in the game provided by the data processing system in the game. The data processing device can be a server or a terminal device, wherein the terminal device can include but is not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, smart speakers, smart home appliances, etc., without limitation here. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms, without limitation here.
[0079] See Figure 2 , Figure 2 This is a scenario diagram of a data processing method provided in an embodiment of the present application. Figure 2 As shown, the object image 1 can be obtained in the business space (such as Figure 223a in the figure), the object image 1 can be rendered in the business space based on the object mesh 21a and the camera pose 22a of the virtual camera. The image size of the object image 1 can be H×W. The object mesh can include multiple facets, such as F facets.
[0080] Furthermore, when the texture rendering quality of the object image 1 does not meet the rendering quality condition, rendering optimization is performed. Specifically, when the texture rendering quality of the object image 1 does not meet the rendering quality condition, raster projection processing can be performed based on the object mesh in the model space, thereby obtaining F raster projection images 25a corresponding to the F facets. For example, the F raster projection images can include raster projection image 251a. The image size of each raster projection image 25a can be consistent with the image size of the object image 1, such as H×W. Each raster projection image can include the projected area of the facet, and the pixel values of the projected area and the non-projected area of the facet are different.
[0081] Furthermore, a reference mask image (such as Figure 2 24a in the figure). The reference mask image can be a channel image of the alpha channel in the model texture image determined in the model space based on the object mesh and the camera pose 22a. It can be understood that the image size of the reference mask image can also be consistent with the image size of the object image 1, such as H×W. The pixel value of each pixel in the reference mask image can be used to characterize transparency. If the pixel value indicates transparency, then when texture rendering is performed, it is not colored based on the texture map of the virtual object; if the pixel value indicates opacity, then when texture rendering is performed, it is colored based on the texture map of the virtual object. In the present application, a pixel value of 0 can be used to represent transparency and a pixel value of 1 can be used to represent opacity; or, 0 can be used to represent opacity and 1 can be used to represent transparency, which is not limited here.
[0082] Furthermore, a joint intersection process can be performed based on the reference mask image and the F grating projection images to obtain a joint intersection value 26a. Joint intersection value 26a can include the joint intersection value between each grating projection image 25a and the reference mask image. The joint intersection value can be used to represent the degree of overlap between the reference mask image and the grating projection image. Furthermore, mesh optimization processing can be performed based on joint intersection value 26a to obtain an object-optimized mesh 27a. For example, patches with a joint intersection value less than a certain threshold can be pruned.
[0083] Furthermore, the virtual object is rendered in the model space based on the object optimization mesh and camera pose, so that the object image 2 (such as Figure 228a in the figure). It should be understood that the texture rendering quality of object image 2 is superior to that of texture image 1, thereby optimizing the texture rendering quality of the image rendered by the virtual object. Furthermore, if the optimized mesh is applied to a business space (such as a game space), the virtual objects displayed in the business space can be made more realistic and have better texture rendering effects.
[0084] In an embodiment of the present application, it is possible to determine from the business space that the texture quality of the virtual object does not meet the rendering quality conditions of the business texture image, and then the texture rendering of the virtual object can be optimized. Specifically, a joint cross calculation can be performed based on the reference mask image and the grating projection images of F facets in the object grid, so that the joint cross value of the grating projection image corresponding to each facet and the reference mask image can be determined, thereby characterizing the overlap between the grating projection image corresponding to each facet and the reference mask image, and then the object grid is optimized based on the joint cross value, so as to render based on the optimized object grid and obtain the optimized image of the virtual object (i.e., the first object image). In this way, the object grid can be optimized based on the reference mask image of the virtual object under certain posture parameters, without the need to obtain a large amount of sample data for model training, which greatly reduces the time required for texture rendering optimization, thereby improving the efficiency of optimizing the texture rendering effect of the virtual object. In addition, when performing mesh optimization, the present application obtains reference mask images and grating projection images under fixed posture parameters, which helps to avoid camera drift, texture ghosting, etc. during texture rendering optimization, thereby improving the optimization effect of texture rendering optimization.
[0085] It is understandable that in some scenarios, such as in many games such as mixed reality on computer devices, many 3D objects are faced with rendering failures or problems of not being realistic enough when they are rendered. A method proposed in an embodiment of the present application optimizes the topology of any mesh by a mesh pruning strategy (also known as facet pruning) that relies on a reference mask image and the pose parameter information of the camera, thereby performing rendering optimization. In an embodiment of the present application, a renderer (such as a differentiable renderer) can be used to render the texture as a mask map. Its pixel intensity reflects the probability of being covered by the texture map of the virtual object during the rendering process. Based on the available 2D mask (i.e., the reference mask image), it is possible to quickly find all incorrectly rendered textures under a given viewpoint, i.e., the texture on the facet whose joint intersection value does not meet a certain threshold can be found. The method of the present application is independent of the network that generates the 3D mesh (i.e., the object mesh), and the present application is also applied to some three-dimensional reconstruction scenarios, and can be easily inserted into any self-supervised image synthesis or naturally generated 3D reconstruction pipeline to obtain a complex mesh with non-spherical topology.
[0086] It is understandable that the embodiments of the present application can be applied to game scenarios, that is, the business space in the embodiments of the present application can be a virtual game space. The game can be a traditional game or a cloud game. Accordingly, the client running on the terminal device can be an application client for a traditional game or an application client for a cloud game. Among them, the biggest difference between cloud games and traditional games is the location of game processing and rendering. Traditional games require the game software to be installed on the user's terminal device, and the game processing and rendering tasks are completed locally by the terminal device; while cloud games hand over all game processing and rendering tasks to the cloud server, and transmit the game screen and sound to the terminal device via the Internet.
[0087] It is understood that the embodiments of the present application can also be applied to virtual social scenarios, where objects can appear as virtual images. The virtual image here can be a virtual image pre-configured according to the object's needs, for example, a combination of corresponding image resources (such as virtual wearable items, makeup, hairstyle, etc.) selected from an image resource library, or a virtual image reconstructed based on the object's real image to fit the object, such as a virtual image rendered by a rendering engine on an application client based on collected real object data (such as the object's face shape, hairstyle, clothing, etc.). The virtual social scene refers to a 3D (short for Three Dimensions) virtual space based on the future Internet, which exhibits convergence and physical persistence characteristics through virtual augmentation of physical reality, and has link perception and sharing features, or an interactive, immersive, and collaborative world. Just as the physical universe is a series of spatially interconnected worlds, the virtual social scene can also be regarded as a collection of many worlds.
[0088] It is understood that the embodiments of the present application can be applied to the field of artificial intelligence technology. For example, the texture rendering quality of a rendered object image can be judged using a neural network model pre-trained based on artificial intelligence technology. Artificial intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to achieve optimal results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a manner similar to human intelligence. Artificial intelligence is the study of the design principles and implementation methods of various intelligent machines, giving them the capabilities of perception, reasoning, and decision-making. Artificial intelligence technology is an interdisciplinary subject covering a wide range of fields, including both hardware-level and software-level technologies. Basic artificial intelligence technologies generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, pre-trained model technology, operation / interaction systems, mechatronics, etc. Among them, pre-trained models, also known as large models or basic models, can be widely applied to downstream tasks in various major areas of artificial intelligence after fine-tuning. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0089] It is understood that the above scenarios are merely examples and do not limit the application scenarios of the technical solutions provided in the embodiments of this application. The technical solutions of this application can also be applied to other scenarios. For example, those skilled in the art will appreciate that with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application will also be applicable to similar technical problems.
[0090] Further, see Figure 3 , Figure 3 1 is a flow chart of a texture rendering processing method provided in an embodiment of the present application. The method can be executed by the above-mentioned computer device, for example, the computer device can be a server. The method can include at least the following steps S101 to S106.
[0091] S101. Obtain a first object image of a virtual object in a business space; the first object image refers to a business texture image whose texture rendering quality does not meet a rendering quality condition, and the business texture image is obtained by performing a first rendering process on the virtual object based on posture parameters of a virtual camera in the business space and an object mesh of the virtual object, where the object mesh includes F facets used to constitute the virtual object, where F is a positive integer.
[0092] Among them, virtual objects may refer to objects that appear in some application scenarios, such as a virtual environment that can be provided by a game application. For example, the virtual object may be a virtual character that can be controlled by a user in a game application, or it may be a non-player character (NPC) in a game application, etc., which is not limited here. The virtual environment may be a scene displayed (or provided) when the client of an application (such as a game application) is running on a terminal. The virtual environment refers to a scene created for virtual objects to carry out activities (such as game competitions), such as a virtual house, a virtual island, a virtual map, etc. The virtual environment may be a simulation environment of the real world, or a semi-simulated and semi-fictitious environment, or a purely fictitious environment, which is not limited here. In an embodiment of the present application, the virtual environment may be a three-dimensional virtual environment, and the virtual object may be displayed in three dimensions. The virtual object is a three-dimensional model created based on some 3D modeling technology. Each virtual object has its own shape and volume in the three-dimensional virtual environment, and occupies a part of the space in the three-dimensional virtual environment.
[0093] It is understandable that the business space may be a virtual space for executing a business (such as a game or a metaverse business). For example, the business space may be a virtual space for running a game.
[0094] The first object image refers to a service texture image whose texture rendering quality does not meet the rendering quality condition, for example, the first object image may be the above-mentioned Figure 2 The business texture image is obtained by performing a first rendering process on the virtual object based on the pose parameters of the virtual camera in the business space and the object mesh of the virtual object. In other words, the business texture image may be an image rendered on the virtual object in the business space. The first rendering process may be a rendering process performed on the virtual object in the business space.
[0095] The virtual camera may be a camera used to capture images of virtual objects in a virtual space. It should be understood that the virtual camera's posture parameters may be used to describe the relative position of the virtual camera relative to the virtual object. For example, the posture parameters may include information such as the azimuth, elevation, and distance of the virtual camera relative to the virtual object. The method for determining the virtual camera's posture parameters may be described below.
[0096] Specifically, an object coordinate system created based on the virtual object is obtained; the object coordinate system takes the center position of the virtual object as the origin; based on the position of the virtual camera in the object coordinate system and the origin of the object coordinate system, the azimuth information, elevation information and distance information of the virtual camera relative to the virtual object are determined; based on the azimuth information, elevation information and distance information, the posture parameters of the virtual camera are determined.
[0097] The object coordinate system may be a coordinate system created based on a virtual object. In the object coordinate system, the origin of the coordinate system may be the center position of the virtual object. The center position may be a preset position used to characterize the virtual object, for example, the center position may be the center of gravity of the virtual object. The object coordinate system may include three coordinate axes, such as the x, y, and z axes. Furthermore, a coordinate axis may be determined vertically through the origin, and two mutually perpendicular coordinate axes may be determined horizontally through the origin.
[0098] It is understandable that the virtual camera can have a corresponding spatial position in the object coordinate system, and then the azimuth information, elevation information, and distance information can be determined based on the origin of the object coordinate system and the position of the virtual camera in the object coordinate system. Among them, the azimuth information can be used to indicate the angle between the projection of the line connecting the virtual camera and the origin in the horizontal direction and the reference direction. Specifically, the reference coordinate axis is determined from the coordinate axis parallel to the horizontal plane, and the reference direction is determined based on the positive axis direction or the negative axis direction of the reference coordinate axis. The azimuth information is determined based on the reference direction and the angle between the projection of the line connecting the position of the virtual camera and the origin on the horizontal plane. Among them, the elevation information can be used to indicate the angle between the line connecting the virtual camera and the origin and the projection of the line connecting the virtual camera and the origin on the horizontal plane. The distance information can be used to indicate the distance from the position of the virtual camera to the origin.
[0099] For example, see Figure 4 , Figure 4 This is a schematic diagram of the effect of a posture parameter provided by an embodiment of the present application. Figure 4 As shown, in the business space, the image of the virtual object 400a can be obtained by the virtual camera 410a. Wherein, an object coordinate system can be established based on the virtual object 400a, such as can be referred to Figure 4 As shown in the x, y, and z axes in , the origin of the object coordinate system (i.e., point a) can be determined based on the center position of the virtual object 400a. Among them, the position of the virtual camera 410a is represented by the position of point a, point c is the projection of the position of the virtual camera (i.e., point b) on the horizontal plane, and the straight line ac represents the projection of the line connecting the position of the virtual camera and the origin on the horizontal plane. It can be understood that the distance information can be the length of the line between the center position of the virtual object 400a (i.e., the position of point a) (i.e., the origin of the object coordinate system) and the virtual camera 410a (i.e., the position of point b), that is, the distance information is the distance between the straight lines ab, i.e., the distance 43a. Among them, taking the positive axis of the x-axis as the reference direction, the azimuth information can be shown as reference azimuth 41a, and the azimuth 41a can be the angle between the straight line ac and the positive axis of the x-axis. The elevation information in the attitude parameters of the virtual camera can be found in Figure 4As shown in the elevation angle 42a in FIG. 4 , the elevation angle 42a may be the angle between the straight line ab and the straight line ac.
[0100] Among them, the object mesh can be used to define the topological structure of the virtual object, that is, to define the shape and outline of the virtual object. The object mesh, also known as a 3D mesh, is a basic unit in computer graphics. In computer graphics, a mesh is a collection of vertices and patches (also called faces) that constitute a 3D (short for 3Dimensions, which means three-dimensional in Chinese) object. These meshes used to constitute virtual objects are usually composed of triangles, quadrilaterals or other simple polygons. Among them, the most commonly used may be triangular meshes. For example, in this application, the object mesh can be expressed as M'=(V', F'), where V' represents the set of vertices of the virtual object, and F' represents the set of patches of the virtual object. In other words, the object mesh can be composed of multiple vertices and patches. The number of patches in the object mesh is recorded here as F, that is, the object mesh includes F patches used to constitute the virtual object, and F is a positive integer.
[0101] Among them, texture rendering quality can be used to describe the rendering effect of image texture. It is understandable that texture rendering quality can be measured by whether there are texture ghosting, blurring, black spots and the like in the image, or by the clarity and realism of the rendered image, etc., which are not limited here. Among them, the rendering quality condition can be that there are no texture ghosting, blurring, black spots and the like in the image, or that the clarity reaches a certain threshold, the realism reaches a certain threshold, etc., which are not limited here. It should be understood that the texture rendering quality can be judged by some deep neural networks, which can be a neural network model obtained by training based on a large amount of sample data, and then the texture rendering quality of the texture image can be determined based on the deep neural network.
[0102] S102 , performing grating projection processing on the F facets based on the posture parameters to obtain F grating projection images corresponding to the F facets; one facet corresponds to one grating projection image.
[0103] Among them, the raster projection processing can be used to indicate the process of mapping the facets in the object mesh to the pixel points in the two-dimensional image. In other words, the raster projection processing is to break up the facets in the virtual space (such as triangular facets) into pixel points and draw them into the prepared two-dimensional picture (also called a two-dimensional image). The raster projection image can be the image obtained when the facet is projected onto the two-dimensional image. Then, the pixel value of the pixel point in the raster projection image can be used to characterize the probability that the pixel point belongs to the projection area of the facet. It should be understood that a facet can correspond to a raster projection image. In other words, each facet of the F faces can be subjected to raster projection processing separately to obtain the corresponding raster projection image. It can be understood that the raster projection processing can be processed by a rasterizer. For example, the rasterizer can be a PyTorch3D (a rasterizer) rasterizer.
[0104] It is understood that when performing raster projection processing, the projection of a facet onto a two-dimensional image is associated with the pose parameters of the virtual camera. For the same facet, the resulting raster projection images projected onto the two-dimensional image can be different when the virtual camera's pose parameters are different. In other words, the raster projection images determined for the same facet from different viewpoints can be different. Here, raster projection processing can be performed based on the pose parameters of the virtual camera used when determining the first object image, resulting in raster projection images corresponding to each of the F facets. For example, when determining the first object image, the pose parameter of the virtual camera is θ. Raster projection processing can then be performed on the F facets based on the pose parameter θ. In other words, the F facets are projected onto the two-dimensional image based on the virtual camera with the pose parameter θ, resulting in F raster projection images corresponding to the F facets. This allows the virtual camera's pose parameters to be kept constant when optimizing rendering effects, compared to those used when the texture rendering effect in the business space was poor. This helps avoid camera drift and improves texture rendering effects.
[0105] Specifically, the F grating projection images include a grating projection image j, where j is a positive integer less than or equal to F; the surface patch corresponding to the grating projection image j is a target surface patch; then, performing grating projection processing on the F surface patches based on the posture parameters to obtain F grating projection images corresponding to the F surface patches may include the following steps: acquiring an initial image; the image size of the initial image is consistent with the image size of the first object image; performing grating projection processing on the target surface patch based on the posture parameters, and determining a projection area of the target surface patch in the initial image; the projection area includes a first pixel point, and the first pixel point has a corresponding mapping position on the target surface patch; determining a second pixel value of the first pixel point based on a distance between the first pixel point and the mapping position of the first pixel point on the target surface patch; determining a pixel point in the initial image other than the first pixel point as a second pixel point, and determining a second pixel value of the second pixel point based on a preset pixel value; determining a grating projection image of the grating projection image j based on the initial image including the second pixel value of the first pixel point and the second pixel value of the second pixel point, and determining the F grating projection images corresponding to the F surface patches based on the grating projection image of the grating projection image j.
[0106] The target patch is the patch corresponding to the grating projection image j. The initial image may be the two-dimensional image onto which the patch is projected during the grating projection process. The image size of the initial image is consistent with the image size of the first object image. For example, the image size of the initial image and the image size of the first object image are both H×W.
[0107] It should be understood that the projection area can be the area projected onto when the target surface is projected onto the initial image. For example, if the target surface is a triangle, the triangular area corresponding to the triangular surface can be determined in the initial avatar, and the projected triangular area can be the projection area in the initial image. It is understood that the shape of the projection area can be consistent with the shape of the target surface, or it can be different from the shape of the target surface due to the camera posture. The specific shape is determined according to the actual projection situation and is not limited here.
[0108] The first pixel point may be a pixel point included in the projection area. The number of first pixel points in the projection area corresponding to a patch is determined based on actual conditions, and may include one or more pixels, which is not limited here. The first pixel point has a corresponding mapping position on the target patch. The mapping position may be the position where the projection on the patch is the first pixel point during projection. In other words, when performing raster projection processing, the mapping position on the patch is projected to the first pixel point.
[0109] The second pixel point may be a pixel point in the initial image other than the first pixel point, i.e., a pixel point in an area outside the projection area of the initial image. It is understood that the preset pixel value may be a preset value used to determine the pixel value of the second pixel point. For example, the preset pixel value may be 0, and the pixel value of the second pixel point thus determined is 0.
[0110] It can be understood that the second pixel value can be the pixel value of the pixel point in the determined grating projection image. Based on the above description, it can be known that the pixel value of each pixel point in the initial image (i.e., the second pixel value) can be determined, and then the initial image with the pixel value of each pixel point determined can be determined as the grating projection image of grating projection image j. Similarly, F grating projection images corresponding to F surface patches can be obtained, that is, the grating projection image corresponding to each surface patch can be obtained.
[0111] It is understandable that the method for determining the pixel value of each pixel in the grating projection image can refer to the following formula 1.
[0112]
[0113] Among them, D j [pi] represents the pixel value of pixel position pi in the raster projection image j. j represents the patch corresponding to the grating projection image j, and pi represents any pixel position in the initial image. d(f j ,pi) represents the pixel position pi in the initial image and the patch f j The distance between pixel position pi and patch f is j The distance between can be represented by the distance between the pixel position pi and the mapping position of the pixel position pi on the target patch; if the pixel position pi is not a pixel point in the projection area (i.e., the second pixel point), then the distance between the pixel position pi and the patch f j The distance between them can be expressed as a preset value, which is not limited here. σ is a hyperparameter used to control the clarity of the grating projection image. σ and d() can be defined in the soft rasterizer used for grating projection processing. It can be understood that D j The dimension of [pi] is |F|×H×W, where |F| is the total number of patches, that is, the value of j ranges from 1 to F, and H×W represents the dimension of the grating projection image corresponding to each patch.
[0114] For example, see Figure 5 , Figure 5 This is a schematic diagram of the effect of a grating projection process provided by an embodiment of the present application. Figure 5As shown, when capturing an image through a virtual camera 51a, a patch in the object mesh can be projected onto a grating projection image, such as projecting patch 52a onto a grating projection image 53a. The posture parameters of the virtual camera 51a are consistent with the posture parameters of the virtual camera when acquiring the first object image. In the grating projection image 53a, the grating projection area is 531a, which can include a projection area 531a, and the projection area 531a can include multiple pixels. It should be understood that when performing grating projection processing, the positions to which the vertices in the patch 52a are projected in the grating projection image can be determined, and then the projection area 531a can be determined based on the positions to which the vertices are projected.
[0115] Optionally, in an embodiment of the present application, the F facets included in the above-mentioned object mesh may be the F facets in the object mesh that are closest to the virtual camera. In other words, the number of the F facets is less than or equal to the total number of facets in the object mesh. The F grating projection images that can be determined may be the grating projection images corresponding to the F facets that are closest to the virtual camera. It is understandable that when performing grating projection processing, due to angle issues, some facets may be blocked by other facets, and the facets cannot obtain corresponding projection areas on the grating projection image. These facets are the facets other than the F facets closest to the virtual camera. In other words, the F facets determined may be the facets that display projection areas in the grating projection image when performing grating projection.
[0116] Then, it can be understood that the method for determining the pixel value of each pixel point in the F grating projection images can refer to the following formula 2.
[0117]
[0118] Where P[k,pi] represents the pixel value of pixel position pi of the grating projection image k. i k represents the patch corresponding to the grating projection image k, and pi represents any pixel position in the initial image. d(f i k ,pi) represents the pixel position pi in the initial image and the patch f i k The distance between pixel position pi and patch f is i k The distance between can be represented by the distance between the pixel position pi and the mapping position of the pixel position pi on the target patch; if the pixel position pi is not a pixel point in the projection area (i.e., the second pixel point), then the distance between the pixel position pi and the patch f i kThe distance between them can be expressed as a preset value, which is not limited here. d() can be defined in the soft rasterizer used for raster projection processing.
[0119] S103 , obtaining a reference mask image of the virtual object; the reference mask image is determined based on a model texture image of the virtual object under the posture parameters obtained in the model space; the image sizes of the reference mask image and the business texture image are consistent.
[0120] The reference mask image of the virtual object may be an image used to represent the transparency of pixels in the model texture image. The model texture image may be an image rendered in model space, that is, a texture image of the virtual object at the pose parameters captured in model space. The virtual object at the pose parameters refers to the virtual object at the pose parameters when the virtual camera captures the image.
[0121] It is understandable that the image size of the reference mask image is consistent with the image size of the business texture image. It is understandable that the image size of the reference mask image is consistent with the image size of the model texture image, and therefore, the image size of the model texture image is also consistent with the image size of the business texture image. The image size can be used to describe the number of rows and columns of pixel positions included in the image, that is, the number of pixels included in the image. Among them, the pixel position can be used to describe the position of the pixel point in the image, and the position can be represented by the row and column where the pixel point is located. For example, the image size of the business texture image is H×W, and H and W are both positive integers, then the image size of the reference mask image is also H×W, that is, the pixel positions of the business texture image and the reference mask image contain H rows and W columns, and can include H×W pixels.
[0122] In the reference mask image of the virtual object, the pixel value of each pixel is used to represent the transparency of the pixel. In other words, the pixel value of each pixel (also known as pixel intensity) reflects the probability of being covered by the texture map of the virtual object during the image rendering process. It is understood that in the reference mask image, the pixel value of each pixel can be 0 or 1 to indicate transparency or opacity. For example, 0 indicates transparency, that is, the probability of the pixel being covered by the texture map of the virtual object is 0, and 1 indicates opacity, that is, the probability of the pixel being covered by the texture map of the virtual object is 1.
[0123] Specifically, obtaining a reference mask image of a virtual object may include the following steps: obtaining a model texture image of the virtual object under posture parameters in a model space; the model texture image includes a channel image under a target channel; pixel values in the channel image of the target channel are used to characterize the transparency of the model texture image; and determining a reference mask image of the virtual object based on the channel image under the target channel.
[0124] The model texture image may be an image of a virtual object under pose parameters obtained in the model space. It is understood that the model texture image may include multiple channels, such as an R color channel, a G color channel, and a B color channel, that is, the model texture image is an RGB image, or the model texture image may include an R color channel, a G color channel, a B color channel, and an alpha channel (also known as an alpha channel), that is, the model texture image is an RGBα image. The alpha channel (i.e., the alpha channel, also known as the alpha channel) can be used to describe the transparency of the model texture image.
[0125] It is understandable that the alpha channel among the multiple channels of the model texture image can be determined as the target channel. Optionally, any channel among the multiple channels of the model texture image can also be determined as the target channel. Then, a reference mask image of the virtual object is determined based on the channel image under the target channel. Wherein, when determining the reference mask image based on the channel image under the alpha channel, the pixel value in the channel image under the alpha channel can be mapped to 0 (i.e., as referred to as the first numerical value) or 1 (i.e., as referred to as the second numerical value), thereby obtaining a reference mask image. For example, the pixel value of each pixel in the alpha channel ranges from 0 to 255, with a pixel value of 0 representing complete transparency and a pixel value of 255 representing complete opacity. Then, a value close to 0 (i.e., a value less than or equal to half of the maximum value of the value range, such as 0-127) can be mapped to 0, and a value close to 255 (i.e., a value greater than half of the maximum value of the value range, such as 127-255) can be mapped to 1, thereby obtaining a reference mask image. Optionally, when any color channel of the model texture image (such as the R color channel, the G color channel, or the B color channel) is determined as the target channel, the pixel value of the channel image under the color channel can also be mapped to 0 or 1 to obtain a reference mask image. The relevant description of determining the reference mask image based on the image of the alpha channel is referred to and will not be repeated here.
[0126] S104 , performing joint cross processing on the reference mask image and the F grating projection images to obtain joint cross values of the F grating projection images; a joint cross value is used to represent the degree of overlap between a grating projection image and the reference mask image.
[0127] The joint intersection processing may be a process for calculating a joint intersection value between the grating projection image and the reference mask image. The joint intersection value may be used to represent the degree of overlap between the grating projection image and the reference mask image. It is understood that each grating projection image may have a corresponding joint intersection value.
[0128] It is understood that both the reference mask image and the F raster projection images include pixels at H×W pixel locations, where H and W are both positive integers. The F raster projection images may include raster projection image j, which can be any one of the F raster projection images, and j is a positive integer less than or equal to F. It is understood that when calculating the joint intersection value between the reference mask image and any raster projection image, the reference mask image and the raster projection image can be aligned, thereby determining the joint intersection value based on the comparison between the pixel values at the same pixel location in the raster projection image and the reference mask image. It is understood that the pixel values in the reference mask image are used to represent transparency (i.e., the probability that the pixel is covered by the texture map of the virtual object), while the pixel values in the raster projection image are used to represent the probability that the pixel is a projection area. Therefore, determining the joint intersection value between the reference mask image and the raster projection image is equivalent to determining the degree of overlap between the area covered by the texture map of the virtual object (i.e., the opaque area) in the reference mask image and the projection area of the patch in the raster projection image. Here, the determination of the joint cross-value of the grating projection image j is taken as an example for explanation.
[0129] It is understood that when determining the joint intersection value of the grating projection image j, a pixel position i can be determined from the H×W pixel positions, where i is a positive integer less than or equal to H×W, and the pixel position i is any pixel position among the H×W pixel positions; then, based on the first pixel value corresponding to the pixel position i in the reference mask image and the second pixel value corresponding to the pixel position i in the grating projection image j, a pixel comparison result corresponding to the pixel position i is determined, and then the joint intersection value of the grating projection image j is determined based on the pixel comparison result corresponding to the pixel position i. It is understood that when determining the joint intersection value of the grating projection image j based on the pixel comparison result corresponding to the pixel position i, the method for determining the pixel comparison result corresponding to the pixel position i can be referred to to determine the pixel comparison result corresponding to each pixel position in the reference mask image and the grating projection image j, and then the joint intersection value of the grating projection image j is determined based on the pixel comparison result corresponding to each pixel position.
[0130] The first pixel value may be the pixel value of a pixel in the reference mask image. In other words, the pixel value of the pixel included in the reference mask image is the first pixel value. The second pixel value may be the pixel value of a pixel in any of the F grating projection images. In other words, the pixel value of the pixel included in any of the F grating projection images is the second pixel value. It should be understood that the magnitude of the first pixel value can be used to represent the transparency of the pixel in the model texture image, that is, the probability of being covered by the texture map of the virtual object during the image rendering process; and the magnitude of the second pixel value can be used to represent the probability that the pixel belongs to the projection area of the patch.
[0131] The pixel comparison result can be used to indicate a comparison result between a first pixel value and a second pixel value at the same pixel position (e.g., pixel position i). The pixel comparison result can include a first comparison result and a second comparison result, wherein the first comparison result indicates the smallest pixel value between the first pixel value and the second pixel value at the same pixel position (e.g., pixel position i), and the second comparison result indicates the largest pixel value between the first pixel value and the second pixel value at the same pixel position (e.g., pixel position i). It is understood that when determining the joint intersection value of the grating projection image j based on the pixel comparison result corresponding to pixel position i, the joint intersection value of the grating projection image j can be determined based on the sum of the first comparison result corresponding to each pixel position and the sum of the second comparison result corresponding to each pixel position.
[0132] Specifically, the reference mask image and the F grating projection images each include pixel points at H×W pixel positions, where H and W are both positive integers; the pixel value of the pixel point included in the reference mask image is a first pixel value; the pixel value of the pixel point included in any of the F grating projection images is a second pixel value; the F grating projection images include a grating projection image j, where j is a positive integer less than or equal to F; then, performing joint cross processing on the reference mask image and the F grating projection images to obtain a joint cross value of the F grating projection images may include the following steps: determining a pixel position i from the H×W pixel positions; i is a positive integer less than or equal to H×W A positive integer; determining the minimum value of the first pixel value corresponding to pixel position i in the reference mask image and the second pixel value corresponding to pixel position i in the grating projection image j as the first comparison result corresponding to the pixel position i; determining the maximum value of the first pixel value corresponding to pixel position i in the reference mask image and the second pixel value corresponding to pixel position i in the grating projection image j as the second comparison result corresponding to the pixel position i; determining the joint cross value of the grating projection image j based on the first comparison result corresponding to the pixel position i and the second comparison result corresponding to the pixel position i, and obtaining the joint cross value of the F grating projection images based on the joint cross value of the grating projection image j.
[0133] As can be seen from the above description, grating projection image j is any one of the F grating projection images. Pixel position i can be any one of the H×W pixel positions. It is understood that, as can be seen from the above description, the first comparison result and the second comparison result corresponding to a pixel position (e.g., pixel position i) can be collectively referred to as the pixel comparison result corresponding to that pixel position.
[0134] It should be understood that the first comparison result and the second comparison result corresponding to each of the H×W pixel positions can be determined by referring to the processing method for determining the first comparison result corresponding to pixel position i and the second comparison result corresponding to pixel position i. Therefore, determining the joint cross-value of the grating projection image j based on the first comparison result corresponding to pixel position i and the second comparison result corresponding to pixel position i can include: determining a first cross-value based on the sum of the first comparison results corresponding to each of the H×W pixel positions; determining a second cross-value based on the sum of the second comparison results corresponding to each pixel position; and determining the joint cross-value of the grating projection image j based on the first cross-value and the second cross-value. The first cross-value can be a factor used to determine the joint cross-value, which is the sum of the first comparison results corresponding to each pixel position; and the second cross-value can be another factor used to determine the joint cross-value, which is the sum of the second comparison results corresponding to each pixel position. The first cross-value and the second cross-value can then be combined to obtain the joint cross-value of the grating projection image j, such as by dividing the first cross-value by the second cross-value to determine the joint cross-value of the grating projection image j.
[0135] Specifically, determining the joint intersection value of the grating projection image j based on the first comparison result corresponding to the pixel position i and the second comparison result corresponding to the pixel position i can include the following steps: determining a pixel position m different from the pixel position i from the H×W pixel positions; m is a positive integer less than or equal to H×W; m is different from i; obtaining the first comparison result corresponding to the pixel position m and the second comparison result corresponding to the pixel position m; determining the first intersection value corresponding to the grating projection image j based on the first comparison result corresponding to the pixel position m and the first comparison result corresponding to the pixel position i; determining the second intersection value corresponding to the grating projection image j based on the second comparison result corresponding to the pixel position m and the second comparison result corresponding to the pixel position i; and determining the joint intersection value of the grating projection image j based on the first intersection value and the second intersection value.
[0136] Wherein, pixel position m is a pixel position determined to be different from pixel position i from among the H×W pixel positions, and m is a positive integer less than or equal to H×W; m is different from i. It is understood that the H×W pixel positions may include not only pixel position m and pixel position i, but also other pixel positions. Here, two pixel positions from the H×W pixel positions (i.e., pixel position m and pixel position i) are used as examples to illustrate the process of determining the joint intersection value of the grating projection image j.
[0137] It can be understood that the process of determining the first comparison result corresponding to pixel position m and the second comparison result corresponding to pixel position m can refer to the above-mentioned description of determining the first comparison result corresponding to pixel position i and the second comparison result corresponding to pixel position i, and will not be repeated here.
[0138] The description of the first crossover value and the second crossover value can refer to the above description and will not be repeated here. Taking pixel position m and pixel position i as examples, the first crossover value can be determined based on the sum of the first comparison result corresponding to pixel position m and the first comparison result corresponding to pixel position i, and the second crossover value can be determined based on the sum of the second comparison result corresponding to pixel position m and the second comparison result corresponding to pixel position i.
[0139] It can be understood that the joint cross value of each of the F grating projection images can be determined by referring to the processing method for determining the joint cross value of the grating projection image j, that is, the joint cross value of the F grating projection images can be obtained based on the joint cross value of the grating projection image j.
[0140] For example, a method for determining a joint intersection value of a grating projection image may be referred to the following formulas 3 and 4.
[0141] γ j =∑ pi∈α min(D j [pi],α[pi])Formula 3
[0142] Γ j =∑ pi∈α max(D j [pi],α[pi])Formula 4
[0143] Among them, γ in formula 3 j Represents the first crossover value corresponding to the grating projection image j, Γ in Formula 4 j represents the second intersection value corresponding to the grating projection image j. Wherein, pi represents any pixel position in the grating projection image and the reference mask image; D j[pi] represents the pixel value of the pixel position pi in the grating projection image j; α represents the reference mask image, pi∈α means that the reference mask image α includes the pixel position pi, and α[pi] represents the pixel value of the pixel position pi in the reference mask image. min(D j [pi],α[pi]) represents the minimum value of the pixel values of the grating projection image j and the reference mask image α at the pixel position pi, that is, the first comparison result corresponding to the pixel position pi, and then the sum of the first comparison results corresponding to each pixel position can be used to determine the first intersection value γ j . max(D in Formula 4 j [pi],α[pi]) represents the maximum value of the pixel values of the grating projection image j and the reference mask image α at the pixel position pi, that is, the second comparison result corresponding to the pixel position pi, and then the sum of the second comparison results corresponding to each pixel position can be used to determine the second intersection value Γ j . Further, based on γ j / Γ j The joint intersection value of the grating projection image j is determined.
[0144] It can be understood that in the above description, the reference mask image can be a black and white mask image (i.e., an image composed of pixels with pixel values of 0 or 1), and the pixel value at each pixel position is used to represent the probability of being covered by the texture map of the virtual object during the image rendering process. Optionally, the reference mask image can also be expressed as multiple reference mask sub-images, such as F reference mask sub-images, and the image size of each reference mask sub-image is consistent with the image size of the above-mentioned business texture image, such as H×W. Each reference mask sub-image corresponds to a facet, and in the reference mask sub-image, the pixel value at each pixel position can represent the probability of being covered by the texture map of a facet corresponding to the object mesh of the virtual object during the image rendering process. Therefore, a complete reference mask image can be determined based on the union of the reference mask sub-images corresponding to the F faces.
[0145] Specifically, the reference mask image includes F reference mask sub-images; one reference mask sub-image corresponds to one patch; the F reference mask sub-images and the F grating projection images each include pixel points at H×W pixel positions, where H and W are both positive integers; the F grating projection images include a grating projection image j, where j is a positive integer less than or equal to F; then, performing a joint cross-processing on the reference mask image and the F grating projection images to obtain a joint cross-value of the F grating projection images may include the following steps: determining the patch corresponding to the grating projection image j as the target patch, and performing a cross-processing on the F reference mask sub-images and the F grating projection images. A reference mask sub-image corresponding to the target patch in the code sub-image is determined as the target reference mask sub-image; a pixel position i is determined from H×W pixel positions; i is a positive integer less than or equal to H×W; a pixel comparison result corresponding to pixel position i is determined based on a first pixel value corresponding to pixel position i in the target reference mask sub-image and a second pixel value corresponding to pixel position i in the grating projection image j; a joint intersection value of the grating projection image j is determined based on the pixel comparison result corresponding to the pixel position i, and a joint intersection value of F grating projection images is obtained based on the joint intersection value of the grating projection image j.
[0146] Based on the above description, it can be understood that the reference mask sub-image can be a sub-image used to constitute a reference mask image. It is understood that the number of reference mask sub-images is consistent with the number of patches contained in the object mesh, and one reference mask sub-image corresponds to one patch. That is, one reference mask sub-image is used to represent the transparency of the pixel corresponding to a patch when it is mapped to the model texture image. It is understood that the process of determining the joint intersection value of the grating projection images is described here using the grating projection image j included in the F grating projection images as an example.
[0147] The target patch may be the patch corresponding to the grating projection image j, and the target reference mask sub-image may be the reference mask sub-image corresponding to the target patch in the F reference mask sub-images. The pixel comparison result corresponding to pixel position i may be the result of a magnitude comparison between the first pixel value corresponding to pixel position i in the target reference mask sub-image and the second pixel value corresponding to pixel position i in the grating projection image j. It should be understood that, as described above, the pixel comparison result may include a first comparison result and a second comparison result, which is not described in detail here. Furthermore, the pixel comparison result corresponding to each pixel position in the target reference mask sub-image and the grating projection image j may be determined by referring to the method for determining the pixel comparison result corresponding to pixel position i, thereby determining the joint intersection value of the grating projection image j based on the pixel comparison results corresponding to each pixel position in the grating projection image j. The specific determination process may refer to the above description of determining the joint intersection value of the grating projection image j based on the pixel comparison results corresponding to each pixel position in the reference mask image and the grating projection image j, which is not described in detail here.
[0148] S105 , performing mesh optimization processing on the object mesh based on the joint intersection values of the F grating projection images to obtain an object optimized mesh of the virtual object.
[0149] The mesh optimization process can be a process for optimizing the object mesh. It is understood that the goal of performing mesh optimization on the object mesh is to refine the object mesh so that when raster projection is performed based on the optimized object mesh, the overlap with the reference mask image is higher. It is understood that the mesh optimization process can be performed by the aforementioned rasterizer.
[0150] The object optimization mesh may be a mesh obtained by optimizing the object mesh of the virtual object. It is understood that the number of facets included in the object optimization mesh may be the same as or different from the number of facets included in the object mesh, and this is not limited here.
[0151] Specifically, based on the joint intersection values of F grating projection images, the object mesh is optimized to obtain the object optimized mesh of the virtual object, which may include the following steps: determining, from the F grating projection images, the grating projection images whose joint intersection values are less than or equal to the joint intersection threshold, and determining the grating projection images whose joint intersection values are less than or equal to the joint intersection threshold as the grating projection images to be pruned; searching for the facets corresponding to the grating projection images to be pruned among the F facets in the object mesh, and determining the found facets as the facets to be pruned; and performing a pruning process on the facets to be pruned in the object mesh to obtain the object optimized mesh of the virtual object.
[0152] The joint intersection threshold can be the minimum joint intersection value required for patch pruning. For example, if the joint intersection threshold is 95%, and the joint intersection value of grating projection image j is 94%, that is, the joint intersection value of grating projection image j is less than or equal to the joint intersection threshold, the patch corresponding to grating projection image j can be pruned.
[0153] The grating projection image to be pruned may be a grating projection image whose joint intersection value is less than or equal to the joint intersection threshold, that is, a grating projection image whose corresponding facet needs to be pruned. The facet to be pruned may be a facet to be pruned, that is, a facet corresponding to the grating projection image to be pruned. It is understandable that each facet among the F facets may have a corresponding facet index identifier, and the grating projection image corresponding to a facet is associated with the facet index identifier of the corresponding facet. Then, searching for the facet corresponding to the grating projection image to be pruned among the F facets in the object mesh may include: determining, from the F facets, the facet corresponding to the facet index identifier associated with the grating projection image to be pruned. The facet index identifier may be used to uniquely identify a facet among the F facets.
[0154] The trimming process may be a process of refining the face to be trimmed. Optionally, the trimming process may be a process of deleting the face to be trimmed, so that when the image is subsequently rendered to obtain a two-dimensional image, the face to be trimmed is no longer shaded.
[0155] Optionally, the surface to be pruned is trimmed to obtain a plurality of sub-surfaces by segmenting the surface to be pruned, and the sub-surface to be pruned is determined from the plurality of sub-surfaces, and the sub-surface to be pruned is deleted. The sub-surface may be a surface obtained by cutting the surface to be pruned, and the sub-surface to be pruned may be a sub-surface that needs to be deleted from the surface to be pruned. The number of sub-surfaces obtained by segmentation can be determined according to actual needs, such as 2, 3, etc., which is not limited here. It can be understood that when multiple sub-surfaces are obtained by segmentation, it is equivalent to segmenting the surface to be pruned into sub-surfaces that overlap with the opaque area in the reference mask image when projected onto the grating projection image, and sub-surfaces that do not overlap with the opaque area in the reference mask image when projected onto the grating projection image, and then the non-overlapping sub-surfaces can be determined as the sub-surface to be pruned, so that the pruned sub-surface is deleted.
[0156] It is understandable that when the surface to be trimmed is segmented to obtain multiple sub-surfaces, a segmentation line can be determined in the grating projection image to be trimmed based on the pixel points on the boundary of the area where the first pixel point in the grating projection image to be trimmed is located (also called the first boundary pixel point) and the pixel points on the boundary of the area where the opaque pixel points in the reference mask image are located (also called the second boundary pixel point), and based on the projection relationship between the grating projection image to be trimmed and the surface to be trimmed, a corresponding mapping segmentation line of the segmentation line is determined in the surface to be trimmed based on the projection relationship, and the surface to be trimmed is segmented based on the mapping segmentation line to obtain multiple sub-surfaces. Among them, the first pixel point can be a pixel point in the projection area. The opaque pixel point can be a pixel point whose pixel value in the reference mask image represents opacity, such as a pixel point with a pixel value of 0. Wherein, based on the first boundary pixel point in the grating projection image to be pruned and the second boundary pixel point in the reference mask image, a dividing line is determined, which can be as follows: in the grating projection image to be pruned, a pixel point on the boundary of the area where the first pixel point is located (i.e., the first boundary pixel point) and a boundary pixel point overlapping with a pixel point on the boundary of the area where the opaque pixel point is located (i.e., the second boundary pixel point) are determined, and a dividing line is determined based on the overlapping boundary pixel points. It is understandable that the dividing line can be a straight line in the grating projection image used to divide the projection area (i.e., the area where the first pixel point is located) and the opaque area (i.e., the area where the opaque pixel point is located). The mapped dividing line can be a straight line mapped by the dividing line in the facet to be pruned, and the mapped dividing line can be used to divide the facet to be pruned into multiple sub-facets. Furthermore, when determining the sub-patch to be pruned from the plurality of sub-patch segments, the first pixel in the grating projection image to be pruned that overlaps with an opaque pixel, excluding the first pixel on the dividing line, can be determined as the overlapping pixel. Based on the projection relationship, the spatial position corresponding to the overlapping pixel is determined in the grating projection image to be pruned, and the sub-patch at this spatial position is determined as the sub-patch to be pruned. In other words, the sub-patch at the spatial position corresponding to the overlapping pixel is the sub-patch that overlaps with the opaque area in the reference mask image when projected onto the grating projection image, while the remaining sub-patch is the sub-patch that does not overlap with the opaque area in the reference mask image when projected onto the grating projection image. Thus, when pruning the target sub-patch, the portion that does not overlap with the opaque area when projected is pruned, while the portion that overlaps with the opaque area when projected is retained, thereby increasing the degree of overlap between the projection of the patch in the optimized object mesh and the reference mask image.
[0157] For example, see Figure 6 , Figure 6 This is a flow chart of a grid optimization process provided by an embodiment of the present application. Figure 6As shown, when a reference mask image 61a and F grating projection images are obtained, a joint cross-processing can be performed on each of the F grating projection images and the reference mask image 61a. The reference mask image 61a may include an area covered by the texture map of the virtual object (i.e., an opaque area), such as the area 611a in the reference mask image 61a. The F grating projection images may include grating projection images 621a, grating projection image 622a, grating projection image 623a, ..., grating projection image 624a, and the like. Each grating projection image may include a projection area of a corresponding patch, such as the projection area 621b in the grating projection image 621a. Furthermore, a joint cross-processing can be performed based on the reference mask image 61a and the grating projection image 621a to obtain a joint cross-value 1. The specific calculation process can refer to the above-mentioned related description and will not be repeated here. Similarly, a joint cross-processing can be performed based on the reference mask image 61a and the grating projection image 622a to obtain a joint cross-value 2, a joint cross-processing can be performed based on the reference mask image 61a and the grating projection image 623a to obtain a joint cross-value 3, and a joint cross-processing can be performed based on the reference mask image 61a and the grating projection image 624a to obtain a joint cross-value 4. Furthermore, threshold judgments can be performed on the joint cross-value 1, the joint cross-value 2, ..., and the joint cross-value 4, respectively (such as Figure 6 63a in FIG), that is, determining whether the joint intersection value is less than the joint intersection threshold. Further, the object mesh can be trimmed (as shown in FIG. Figure 6 64a in FIG), and obtain the object optimized mesh (as shown in FIG. Figure 6 As shown in 65a in FIG, patches corresponding to grating projection images having a joint intersection value less than a joint intersection threshold value may be deleted.
[0158] Optionally, before performing mesh optimization on the object mesh, a threshold value judgment can be performed based on the sum of the joint intersection values of the F grating projection images. Only when the sum of the joint intersection values reaches a certain threshold value can mesh optimization be performed on the object mesh based on the joint intersection values of the F grating projection images to obtain the object optimized mesh of the virtual object. In this way, mesh optimization can be performed only when the overall condition of the object mesh meets the conditions for mesh optimization, avoiding mesh optimization for poor rendering quality caused by occasional offset of individual facets, avoiding useless rendering optimization processes, improving the accuracy of rendering optimization detection, and reducing the waste of computing resources.
[0159] S106 , performing a second rendering process on the virtual object based on the object optimization mesh and posture parameters to obtain a second object image of the virtual object; the texture rendering quality of the second object image is better than the texture rendering quality of the first object image.
[0160] The second rendering process may be a process of rendering the virtual object in the model space. The second object image may be an image obtained by performing the second rendering process on the virtual object based on the object optimization mesh and posture parameters. In other words, the second object image is an image obtained after texture rendering optimization, for example, the above-mentioned Figure 2 It can be understood that, when performing the second rendering process, the texture map of the virtual object can be covered on the patch based on the shader, thereby obtaining the second object image.
[0161] It is understandable that, because the second object image is rendered based on the optimized mesh, the texture rendering quality of the second object image may be better than the texture rendering quality of the first object image. Specifically, performing a second rendering process on the virtual object based on the object-optimized mesh and posture parameters to obtain the second object image of the virtual object may include: performing a second rendering process on the virtual object based on the object-optimized mesh and posture parameters to obtain a mesh-optimized texture image of the virtual object; and when the texture rendering quality of the mesh-optimized texture image is better than the texture rendering quality of the first object image, determining the mesh-optimized texture image as the second object image.
[0162] In an embodiment of the present application, it is possible to determine from the business space that the texture quality of the virtual object does not meet the rendering quality conditions of the business texture image, and then the texture rendering of the virtual object can be optimized. Specifically, a joint cross calculation can be performed based on the reference mask image and the grating projection images of F facets in the object grid, so that the joint cross value of the grating projection image corresponding to each facet and the reference mask image can be determined, thereby characterizing the overlap between the grating projection image corresponding to each facet and the reference mask image, and then the object grid is optimized based on the joint cross value, so as to render based on the optimized object grid and obtain the optimized image of the virtual object (i.e., the first object image). In this way, the object grid can be optimized based on the reference mask image of the virtual object under certain posture parameters, without the need to obtain a large amount of sample data for model training, which greatly reduces the time required for texture rendering optimization, thereby improving the efficiency of optimizing the texture rendering effect of the virtual object.
[0163] See Figure 7 , Figure 7 1 is a flow chart of a texture rendering processing method provided in an embodiment of the present application. The method can be executed by the above-mentioned computer device, for example, the computer device can be a server. The method can include at least the following steps S201-S210.
[0164] S201. Obtain a first object image of a virtual object in a business space; the first object image refers to a business texture image whose texture rendering quality does not meet a rendering quality condition, and the business texture image is obtained by performing a first rendering process on the virtual object based on posture parameters of a virtual camera in the business space and an object mesh of the virtual object, where the object mesh includes F facets used to constitute the virtual object, where F is a positive integer.
[0165] S202 , performing grating projection processing on the F face patches based on the posture parameters to obtain F grating projection images corresponding to the F face patches; one face patch corresponds to one grating projection image.
[0166] S203 , obtaining a reference mask image of the virtual object; the reference mask image is determined based on a model texture image of the virtual object under the posture parameters obtained in the model space; the image sizes of the reference mask image and the business texture image are consistent.
[0167] S204 , performing joint cross processing on the reference mask image and the F grating projection images to obtain joint cross values of the F grating projection images; a joint cross value is used to represent the degree of overlap between a grating projection image and the reference mask image.
[0168] S205 , performing mesh optimization processing on the object mesh based on the joint intersection values of the F grating projection images to obtain an object optimized mesh of the virtual object.
[0169] The processing of steps S201-S205 may refer to the relevant description of steps S101-S105 above, and will not be repeated here.
[0170] S206 , performing a second rendering process on the virtual object based on the object optimization mesh and posture parameters to obtain a second object image of the virtual object; the texture rendering quality of the second object image is better than the texture rendering quality of the first object image.
[0171] It can be understood that when rendering the above-mentioned business texture image, rendering processing can be performed based on the posture parameters, object mesh, and texture map of the virtual object, that is, the texture map of the virtual object is overlaid on the object mesh for coloring, so that a business texture image with texture and color can be obtained. When the rendering effect of the business texture image is not good, the business texture image is used as the above-mentioned first object image, and the virtual object is re-optimized and rendered.
[0172] Specifically, based on the posture parameters of the virtual camera in the business space, the object mesh of the virtual object and the texture map of the virtual object, the first rendering processing is performed on the virtual object to obtain a first business texture image; the texture map refers to the map resource configured when the virtual object is created in the model space; when the texture rendering quality of the first business texture image does not meet the rendering quality conditions, the first business texture image is determined as the first object image.
[0173] A texture map is a map resource that is configured when creating a virtual object in model space. It is understood that in an object mesh, each face can be associated with a corresponding texture map, and each texture map can be overlaid onto the corresponding face during the rendering process.
[0174] The rendering quality conditions can be found in the above description and are not elaborated here. Furthermore, when the rendering quality conditions do not meet the rendering quality conditions, the first service texture image can be determined as the first object image. Conversely, when the rendering quality conditions meet the rendering quality conditions, rendering optimization of the virtual object is not required, and the original object mesh can continue to be used for rendering in the service space.
[0175] Furthermore, performing a second rendering process on the virtual object based on the object optimization grid and posture parameters to obtain a second object image of the virtual object can include the following steps: performing texture optimization processing on the texture map based on the object optimization grid of the virtual object to obtain a texture optimization map of the virtual object; performing a second rendering process on the virtual object based on the object optimization grid, the texture optimization map and the posture parameters to obtain a second object image of the virtual object.
[0176] It is understandable that texture optimization processing can be a process for optimizing texture maps. It is understandable that each face has a corresponding texture mapping relationship with the texture map, and then the texture optimization processing based on the object optimization mesh can be based on the trimmed face. For example, when face n is deleted from the object mesh, the texture map corresponding to face n can be deleted, so that when subsequent rendering is performed, face n is no longer colored based on the texture map of face n; for another example, when face n is divided into multiple sub-faces and sub-face n1 is deleted, the texture portion corresponding to sub-face n1 can be deleted from the texture map corresponding to face n, so that when subsequent rendering is performed, sub-face n1 in face n is no longer colored based on the texture map of sub-face n1, and only the retained sub-faces are colored. In this way, based on the object optimization mesh, texture optimization map and posture parameters, a second rendering process can be performed on the virtual object to obtain a second object image of the virtual object.
[0177] It can be understood that after trimming the patches in the object mesh that do not meet the joint intersection threshold, an optimized mask image can be determined based on the raster projection image after patch trimming. For example, the optimized mask image can be determined by the following formula 5.
[0178]
[0179] Where α r [pi] represents the optimized mask image. F represents the total number of patches, j represents the j-th patch, D j [pi] represents the raster projection image. Where F p represents the number of trimmed patches, that is, Fp = {F p ∈F|γ p / Γ p <t}, t represents the joint intersection threshold.
[0180] It can be understood that if it is necessary to determine the mask image based on the raster projection image without patch trimming, the unoptimized mask image can be determined by the following formula 6.
[0181]
[0182] Where represents the unoptimized mask image, that is, the mask image without patch trimming. F represents the total number of patches, j represents the j-th patch, D j [pi] represents the raster projection image. Furthermore, the effect can be compared between the mask image of the object mesh without patch trimming and the mask image of the object mesh that has been trimmed, so that subsequent rendering processing can be performed based on the determined mask image to obtain the corresponding object image.
[0183] S207. In the model space, based on the object mesh and pose parameters, perform a second rendering process on the virtual object, record the first rendering consumption duration and the first rendering consumption resources consumed by performing the second rendering process on the virtual object based on the object mesh and pose parameters, and determine the first rendering consumption duration and the first rendering consumption resources as the first rendering consumption information.
[0184] As mentioned above, the second rendering process can be a rendering process in the model space. It should be understood that the image obtained by performing the second rendering process on the virtual object based on the object mesh and posture parameters is an image without texture rendering optimization. The virtual object is rendered here based on the unoptimized object mesh in order to record the time and resources consumed when no optimization is performed, so as to facilitate the subsequent comparison of the time and resources consumed by texture rendering optimization and no texture rendering optimization to determine whether the results of texture rendering optimization need to be adopted in the business space.
[0185] The first rendering consumption duration may be the length of time consumed for performing the second rendering process on the virtual object based on the object mesh and the posture parameters, and the first rendering consumption resources may be the computing resources occupied by performing the second rendering process on the virtual object based on the object mesh and the posture parameters. For example, the first rendering consumption resources may be the CPU occupancy rate of the process used to perform the second rendering process on the virtual object based on the object mesh and the posture parameters. The first rendering consumption information may include the first rendering consumption duration and the first rendering consumption resources.
[0186] S208. When performing a second rendering process on the virtual object based on the object-optimized mesh and posture parameters to obtain a second object image, record the second rendering consumption resources and the second rendering consumption time consumed by performing the second rendering process on the virtual object based on the object-optimized mesh and posture parameters, and determine the second rendering consumption resources and the second rendering consumption time as second rendering consumption information.
[0187] The second rendering consumption time may be the length of time consumed by performing the second rendering process on the virtual object based on the object-optimized mesh and posture parameters, and the second rendering consumption resources may be the computing resources occupied by performing the second rendering process on the virtual object based on the object-optimized mesh and posture parameters. The second rendering consumption information may include the second rendering consumption time and the second rendering consumption resources.
[0188] S209 : Determine a rendering optimization detection result based on the first rendering consumption information, the second rendering consumption information, the texture rendering quality of the first object image, and the texture rendering quality of the second object image.
[0189] The rendering optimization detection result may be a result used to determine whether to update the object mesh based on the object optimization mesh. The rendering optimization detection result may be an indicator result determined based on the first rendering consumption information, the second rendering consumption information, the texture rendering quality of the first object image, and the texture rendering quality of the second object image.
[0190] It is understandable that the texture rendering quality can be measured by multiple quality indicators, such as the above-mentioned quality indicators such as whether there are texture ghosting, blurring, black spots, etc., clarity, realism, etc., which are not limited here. Then, the number of quality indicators (called optimization indicators) in the texture rendering quality of the first object image that are better than the texture rendering quality of the second object image (called the number of optimization indicators) can be determined to determine the rendering optimization detection result based on the number of optimization indicators. For example, if the texture ghosting degree of the second object image is reduced compared to the first object image, the quality indicator of texture ghosting is determined as the optimization indicator; for example, if the clarity of the second object image is increased compared to the first object image, the quality indicator of clarity is determined as the optimization indicator, and then the number of optimization indicators can be counted to obtain the number of optimization indicators. In addition, the growth time difference of the rendering consumption time in the first rendering consumption information compared to the rendering consumption time in the second rendering consumption information can be obtained. If the first rendering consumption time is greater than the second rendering consumption time, the growth time difference is a positive value. If the first rendering consumption time is greater than the second rendering consumption time, the growth time difference is a negative value. In addition, the growth resource quantity of the rendering consumption resources in the first rendering consumption information compared to the rendering consumption resources in the second rendering consumption information can be obtained. If the first rendering consumption resources are greater than the second rendering consumption resources, the growth resource quantity is a positive value. If the first rendering consumption resources are greater than the second rendering consumption resources, the growth resource quantity is a negative value. It can be understood that information in multiple dimensions can also be determined based on other calculation methods, such as weighted summation based on the optimization degree of different optimization indicators to obtain information of a detection dimension, which is not limited here. Furthermore, the rendering optimization detection result can be determined based on information of multiple dimensions such as the number of optimization indicators, growth time difference, and growth resource quantity difference.
[0191] S210 . When the rendering optimization detection result satisfies the optimization condition associated with the virtual object, the object mesh is updated based on the object optimization mesh; the updated object mesh is used to render a business texture image of the virtual object in the business space.
[0192] The optimization condition can be a condition used to determine whether to update the object mesh based on the object-optimized mesh. For example, the optimization condition can include simultaneously satisfying one or more of the following: the number of optimization indicators reaches a certain threshold, the growth time difference is less than a certain threshold, the number of resources is less than a certain threshold, etc. It is understood that the optimization condition can also include conditions based on information from other detection dimensions, which are not limited here. The optimization condition can be understood as the improvement in the rendering texture quality of the second object, and the degree of improvement in rendering texture quality can be greater than the loss caused by rendering optimization. In this case, it can be determined that the optimization condition is met, and the optimized mesh can be applied to the business space for rendering. It is understood that in some cases, due to the pruning of the object mesh's facets, the number of facets required for rasterization and shading is reduced during rendering. Therefore, rendering based on the object-optimized mesh can reduce the rendering time and computing resources consumed compared to rendering based on the unoptimized mesh. This can help reduce rendering time while improving rendering quality, further improving rendering efficiency.
[0193] It should be understood that updating the object mesh based on the object optimization mesh means that when a virtual object is subsequently rendered in the business space, the business texture image is rendered based on the object optimization mesh. This allows rendering in business spaces (such as game spaces) using the texture-optimized object mesh, resulting in more realistic virtual objects with finer textures.
[0194] See Figure 8 , Figure 8 This is a schematic diagram of a texture rendering optimization scene provided by an embodiment of the present application. Figure 8 As shown, a single frame image can be obtained from the game, and then the single frame image in the game can be debugged (such as Figure 8 When it is detected that the texture rendering effect of a single frame image in the game is not good (that is, the texture rendering quality does not meet the rendering quality conditions), the object mesh and texture map (such as Figure 8 S82a in ), and then perform texture rendering optimization (such as Figure 8 S83a in the figure), wherein the process of texture rendering optimization can refer to the relevant description of the above steps S102-S105, which will not be repeated here. Further, the result of texture rendering optimization can be re-debugged (such as Figure 8 S84a in the figure) can be used to perform rendering based on the object optimization mesh and posture parameters to obtain an object image after texture rendering optimization. In addition, rendering performance records can be made during the debugging process (e.g. Figure 8In S85a), for example, the above-mentioned rendering time and rendering resources can be recorded. In addition, when debugging a single frame image in the game (i.e., rendering processing can be performed based on unoptimized object meshes and posture parameters), rendering performance records can be made during the debugging process (e.g., Figure 8 Further, it can be determined whether to adopt the optimized result (such as Figure 8 S87a), that is, whether the object mesh required for rendering the virtual object in the business space needs to be replaced with the optimized mesh can be considered based on the rendering time, rendering resource consumption, and rendering texture quality.
[0195] In an embodiment of the present application, it is possible to determine from the business space that the texture quality of the virtual object does not meet the rendering quality conditions of the business texture image, and then the texture rendering of the virtual object can be optimized. Specifically, a joint cross calculation can be performed based on the reference mask image and the grating projection images of F facets in the object grid, so that the joint cross value of the grating projection image corresponding to each facet and the reference mask image can be determined, thereby characterizing the overlap between the grating projection image corresponding to each facet and the reference mask image, and then the object grid is optimized based on the joint cross value, so as to render based on the optimized object grid and obtain the optimized image of the virtual object (i.e., the first object image). In this way, the object grid can be optimized based on the reference mask image of the virtual object under certain posture parameters, without the need to obtain a large amount of sample data for model training, greatly reducing the time required for texture rendering optimization, thereby improving the efficiency of optimizing the texture rendering effect of the virtual object. Further, the optimized object grid can be applied to the subsequent rendering process of the virtual object in the business space, thereby improving the rendering effect of the virtual object rendered in the business space.
[0196] See Figure 9 , Figure 9 This is a structural diagram of a texture rendering processing device provided by an embodiment of the present application. Figure 9 As shown, the texture rendering processing device 1 can be a computer program (including program code) running on a computer device (for example, the server 200a mentioned above), for example, the texture rendering processing device 1 is an application software; it can be understood that the texture rendering processing device 1 can be used to execute the corresponding steps in the texture rendering processing method provided in the embodiment of the present application. Figure 9 As shown, the texture rendering processing device 1 may include: a first image acquisition module 11, a grating projection module 12, a mask image acquisition module 13, a joint cross processing module 14, a grid optimization module 15, and an optimized rendering module 16;
[0197] A first image acquisition module 11 is configured to acquire a first object image of the virtual object in the business space; the first object image is a business texture image whose texture rendering quality does not meet the rendering quality condition, the business texture image being obtained by performing a first rendering process on the virtual object based on the posture parameters of the virtual camera in the business space and the object mesh of the virtual object, where the object mesh includes F facets constituting the virtual object, where F is a positive integer;
[0198] The grating projection module 12 is used to perform grating projection processing on the F facets based on the posture parameters to obtain F grating projection images corresponding to the F facets; one facet corresponds to one grating projection image; the mask image acquisition module 13 is used to obtain a reference mask image of the virtual object; the reference mask image is determined based on the model texture image of the virtual object at the posture parameters obtained in the model space; the image size of the reference mask image and the business texture image are consistent;
[0199] A joint cross processing module 14 is configured to perform a joint cross processing on the reference mask image and the F grating projection images to obtain a joint cross value of the F grating projection images; a joint cross value is used to represent the degree of overlap between a grating projection image and the reference mask image;
[0200] A mesh optimization module 15 is configured to perform mesh optimization processing on the object mesh based on the joint intersection value of the F grating projection images to obtain an object optimized mesh of the virtual object;
[0201] The optimization rendering module 16 is used to perform a second rendering process on the virtual object based on the object optimization grid and posture parameters to obtain a second object image of the virtual object; the texture rendering quality of the second object image is better than the texture rendering quality of the first object image.
[0202] The mesh optimization module 15 includes: a threshold judgment unit 151, a patch determination unit 152, and a patch trimming unit 153;
[0203] A threshold determination unit 151 is configured to determine, from the F grating projection images, a grating projection image whose joint intersection value is less than or equal to a joint intersection threshold, and determine the grating projection image whose joint intersection value is less than or equal to the joint intersection threshold as a grating projection image to be pruned;
[0204] A patch determining unit 152 is configured to search for a patch corresponding to the grating projection image to be pruned among the F patches in the object mesh, and determine the found patch as the patch to be pruned;
[0205] The facet pruning unit 153 is configured to prune the facets to be pruned in the object mesh to obtain an optimized object mesh of the virtual object.
[0206] The processing of the threshold determination unit 151, the patch determination unit 152, and the patch trimming unit 153 can refer to the above Figure 3 The relevant descriptions in the embodiments are not repeated here.
[0207] The reference mask image and the F grating projection images each include pixels at H×W pixel positions, where H and W are both positive integers; the pixel values of the pixels included in the reference mask image are first pixel values; the pixel values of the pixels included in any of the F grating projection images are second pixel values; the F grating projection images include a grating projection image j, where j is a positive integer less than or equal to F; the joint cross processing module 14 includes: a pixel position determining unit 141, a first comparing unit 142, a second comparing unit 143, and a cross value determining unit 144;
[0208] The pixel position determining unit 141 is configured to determine a pixel position i from the H×W pixel positions; i is a positive integer less than or equal to H×W;
[0209] A first comparison unit 142 is configured to determine the minimum value between a first pixel value corresponding to pixel position i in the reference mask image and a second pixel value corresponding to pixel position i in the grating projection image j as a first comparison result corresponding to pixel position i;
[0210] The second comparison unit 143 is configured to determine the maximum value between the first pixel value corresponding to the pixel position i in the reference mask image and the second pixel value corresponding to the pixel position i in the grating projection image j as a second comparison result corresponding to the pixel position i;
[0211] The cross value determination unit 144 is used to determine the joint cross value of the grating projection image j based on the first comparison result corresponding to the pixel position i and the second comparison result corresponding to the pixel position i, and obtain the joint cross value of F grating projection images based on the joint cross value of the grating projection image j.
[0212] The cross value determination unit 144 is specifically configured to:
[0213] Determine a pixel position m different from the pixel position i from the H×W pixel positions; m is a positive integer less than or equal to H×W; m is different from i;
[0214] Obtain a first comparison result corresponding to pixel position m and a second comparison result corresponding to pixel position m;
[0215] Determining a first intersection value corresponding to the grating projection image j based on a first comparison result corresponding to the pixel position m and a first comparison result corresponding to the pixel position i;
[0216] Determining a second intersection value corresponding to the grating projection image j based on the second comparison result corresponding to the pixel position m and the second comparison result corresponding to the pixel position i;
[0217] Based on the first intersection value and the second intersection value, a joint intersection value of the grating projection image j is determined.
[0218] The processing of the pixel position determination unit 141, the first comparison unit 142, the second comparison unit 143, and the cross value determination unit 144 can refer to the above Figure 3 The relevant descriptions in the embodiments are not repeated here.
[0219] The reference mask image includes F reference mask sub-images; one reference mask sub-image corresponds to one patch; the F reference mask sub-images and the F grating projection images each include pixel points at H×W pixel positions, where H and W are both positive integers; the F grating projection images include grating projection image j, where j is a positive integer less than or equal to F;
[0220] The joint cross processing module 14 further includes: a sub-image determination unit 145 and a pixel comparison unit 146;
[0221] The sub-image determining unit 145 is configured to determine the patch corresponding to the grating projection image j as the target patch, and determine the reference mask sub-image corresponding to the target patch from the F reference mask sub-images as the target reference mask sub-image;
[0222] The pixel position determining unit 141 is configured to determine a pixel position i from the H×W pixel positions; i is a positive integer less than or equal to H×W;
[0223] a pixel comparison unit 146 for determining a pixel comparison result corresponding to pixel position i based on a first pixel value corresponding to pixel position i in the target reference mask sub-image and a second pixel value corresponding to pixel position i in the grating projection image j;
[0224] The cross value determining unit 144 is configured to determine a joint cross value of the grating projection image j based on the pixel comparison result corresponding to the pixel position i, and obtain joint cross values of F grating projection images based on the joint cross value of the grating projection image j.
[0225] Among them, the F grating projection images include grating projection image j, j is a positive integer less than or equal to F; the surface patch corresponding to the grating projection image j is the target surface patch;
[0226] The grating projection module 12 includes: an initial image acquisition unit 121, a projection unit 122, a pixel determination unit 123, and a projection image determination unit 124;
[0227] An initial image acquisition unit 121 is configured to acquire an initial image; the image size of the initial image is consistent with the image size of the first object image;
[0228] The projection unit 122 is configured to perform raster projection processing on the target surface based on the posture parameters, and determine a projection area of the target surface in the initial image; the projection area includes a first pixel point, and the first pixel point has a corresponding mapping position on the target surface;
[0229] a pixel determining unit 123, configured to determine a second pixel value of the first pixel based on a distance between the first pixel and a mapping position of the first pixel on the target patch;
[0230] The pixel determining unit 123 is further configured to determine a pixel other than the first pixel in the initial image as a second pixel, and determine a second pixel value of the second pixel based on a preset pixel value;
[0231] The projection image determination unit 124 is used to determine the grating projection image of the grating projection image j based on the initial image including the second pixel value of the first pixel point and the second pixel value of the second pixel point, and determine the F grating projection images corresponding to the F facets based on the grating projection image of the grating projection image j.
[0232] The mask image acquisition module 13 includes: a channel acquisition unit 131 and a mask image determination unit 132;
[0233] The channel acquisition unit 131 is used to acquire a model texture image of the virtual object under the posture parameters in the model space; the model texture image includes a channel image under the target channel; the pixel value in the channel image of the target channel is used to represent the transparency of the model texture image;
[0234] The mask image determining unit 132 is configured to determine a reference mask image of the virtual object based on the channel image under the target channel.
[0235] The texture rendering device 1 further includes: a business texture image acquisition module 17 and a quality judgment module 18;
[0236] A business texture image acquisition module 17 is configured to perform a first rendering process on the virtual object based on the posture parameters of the virtual camera in the business space, the object mesh of the virtual object, and the texture map of the virtual object to obtain a first business texture image; the texture map refers to a map resource configured when creating the virtual object in the model space;
[0237] The quality judgment module 18 is configured to determine the first service texture image as the first object image when the texture rendering quality of the first service texture image does not meet the rendering quality condition.
[0238] The optimization rendering module 16 includes: a texture optimization unit 161 and a rendering unit 162;
[0239] A texture optimization unit 161 is configured to perform texture optimization processing on the texture map based on the object optimization grid of the virtual object to obtain a texture optimization map of the virtual object;
[0240] The rendering unit 162 is configured to perform a second rendering process on the virtual object based on the object optimization mesh, the texture optimization map, and the posture parameters to obtain a second object image of the virtual object.
[0241] The texture rendering device 1 further includes: a first rendering consumption recording module 19, a second rendering consumption recording module 20, a rendering comparison module 21, and an updating module 22;
[0242] A first rendering consumption recording module 19 is configured to perform a second rendering process on the virtual object based on the object mesh and the posture parameters in the model space, record a first rendering consumption time and first rendering consumption resources consumed by performing the second rendering process on the virtual object based on the object mesh and the posture parameters, and determine the first rendering consumption time and the first rendering consumption resources as first rendering consumption information;
[0243] The second rendering consumption recording module 20 records the second rendering consumption resources and the second rendering consumption duration consumed by performing the second rendering process on the virtual object based on the object optimized mesh and posture parameters when obtaining the second object image, and determines the second rendering consumption resources and the second rendering consumption duration as second rendering consumption information;
[0244] A rendering comparison module 21 is configured to determine a rendering optimization detection result based on the first rendering consumption information, the second rendering consumption information, the texture rendering quality of the first object image, and the texture rendering quality of the second object image;
[0245] The updating module 22 is used to update the object mesh based on the object optimization mesh when the rendering optimization detection result meets the optimization condition associated with the virtual object; the updated object mesh is used to render the business texture image of the virtual object in the business space.
[0246] The processing of the first rendering consumption recording module 19, the second rendering consumption recording module 20, the rendering comparison module 21, and the updating module 22 can refer to the above Figure 7 The relevant description of the embodiments is not repeated here.
[0247] The texture rendering device 1 further includes: an object coordinate system determination module 23 and a posture parameter determination module 24;
[0248] The object coordinate system determining module 23 is used to obtain an object coordinate system created based on the virtual object; the object coordinate system takes the center position of the virtual object as the origin;
[0249] The posture parameter determination module 24 is used to determine the azimuth information, elevation information and distance information of the virtual camera relative to the virtual object based on the position of the virtual camera in the object coordinate system and the origin of the object coordinate system; the posture parameter determination module 24 is used to determine the posture parameters of the virtual camera based on the azimuth information, elevation information and distance information.
[0250] See Figure 10 , Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 10 As shown, the computer device 1000 may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, the above-mentioned computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As Figure 10 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application.
[0251] In such Figure 10 In the illustrated computer device 1000, the network interface 1004 provides network communication functionality; the user interface 1003 primarily provides an interface for user input; and the processor 1001 can be used to invoke a device control application stored in the memory 1005 to execute the texture rendering processing method described in any of the corresponding embodiments above, which will not be repeated here. Furthermore, the beneficial effects of employing the same method will not be repeated here.
[0252] In addition, it should be pointed out here that: the embodiment of the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program executed by the texture rendering processing device 1 mentioned above, and the computer program includes program instructions. When the processor executes the program instructions, it can execute the description of the texture rendering processing method in the above embodiment. Therefore, it will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application.
[0253] The above-mentioned computer-readable storage medium can be the texture rendering processing device provided by any of the aforementioned embodiments or the internal storage unit of the above-mentioned computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. Furthermore, the computer-readable storage medium can also include both the internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been output or is to be output.
[0254] In addition, it should be noted that the embodiments of the present application also provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the method provided by any of the corresponding embodiments above. In addition, the description of the beneficial effects of using the same method will not be repeated. For technical details not disclosed in the computer program product or computer program embodiments involved in this application, please refer to the description of the method embodiments of this application.
[0255] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0256] The terms "first", "second", etc. in the description, claims, and drawings of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprising" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or device comprising a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.
[0257] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0258] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A texture rendering processing method, characterized in that: The method comprises: Obtaining a first object image of the virtual object in the business space; the first object image is a business texture image whose texture rendering quality does not meet a rendering quality condition, the business texture image being obtained by performing a first rendering process on the virtual object based on posture parameters of a virtual camera in the business space and an object mesh of the virtual object, the object mesh including F facets constituting the virtual object, where F is a positive integer; Performing grating projection processing on the F facets based on the posture parameters to obtain F grating projection images corresponding to the F facets; one facet corresponds to one grating projection image; Acquiring a reference mask image of the virtual object; the reference mask image is determined based on a model texture image of the virtual object under the pose parameters acquired in a model space; the image sizes of the reference mask image and the business texture image are consistent; performing a joint cross processing on the reference mask image and the F grating projection images to obtain a joint cross value of the F grating projection images; a joint cross value is used to represent the degree of overlap between a grating projection image and the reference mask image; performing a mesh optimization process on the object mesh based on the joint intersection values of the F grating projection images to obtain an object optimized mesh of the virtual object; Based on the object optimization grid and the posture parameters, a second rendering process is performed on the virtual object to obtain a second object image of the virtual object; the texture rendering quality of the second object image is better than the texture rendering quality of the first object image.
2. The method according to claim 1, characterized in that The performing mesh optimization processing on the object mesh based on the joint intersection value of the F grating projection images to obtain the object optimized mesh of the virtual object includes: Determine, from the F grating projection images, a grating projection image whose joint intersection value is less than or equal to a joint intersection threshold, and determine the grating projection image whose joint intersection value is less than or equal to the joint intersection threshold as the grating projection image to be pruned; Searching for a patch corresponding to the to-be-pruned grating projection image among the F patches in the object grid, and determining the found patch as the to-be-pruned patch; The to-be-pruned facets in the object mesh are pruned to obtain an object optimized mesh of the virtual object.
3. The method according to claim 1, characterized in that The reference mask image and the F grating projection images each include pixels at H×W pixel positions, where H and W are both positive integers; the pixel values of the pixels included in the reference mask image are first pixel values; the pixel values of the pixels included in any of the F grating projection images are second pixel values; the F grating projection images include a grating projection image j, where j is a positive integer less than or equal to F; The performing joint cross processing on the reference mask image and the F grating projection images to obtain a joint cross value of the F grating projection images includes: Determine a pixel position i from the H×W pixel positions; i is a positive integer less than or equal to H×W; Determine the minimum value between the first pixel value corresponding to the pixel position i in the reference mask image and the second pixel value corresponding to the pixel position i in the grating projection image j as the first comparison result corresponding to the pixel position i; Determine the maximum value of a first pixel value corresponding to the pixel position i in the reference mask image and a second pixel value corresponding to the pixel position i in the grating projection image j as a second comparison result corresponding to the pixel position i; Based on the first comparison result corresponding to the pixel position i and the second comparison result corresponding to the pixel position i, the joint cross value of the grating projection image j is determined, and based on the joint cross value of the grating projection image j, the joint cross value of the F grating projection images is obtained.
4. The method according to claim 3, characterized in that The determining of the joint intersection value of the grating projection image j based on the first comparison result corresponding to the pixel position i and the second comparison result corresponding to the pixel position i includes: Determine a pixel position m different from the pixel position i from the H×W pixel positions; m is a positive integer less than or equal to H×W; m is different from i; Obtaining a first comparison result corresponding to the pixel position m and a second comparison result corresponding to the pixel position m; determining a first intersection value corresponding to the grating projection image j based on a first comparison result corresponding to the pixel position m and a first comparison result corresponding to the pixel position i; determining a second intersection value corresponding to the grating projection image j based on the second comparison result corresponding to the pixel position m and the second comparison result corresponding to the pixel position i; Based on the first intersection value and the second intersection value, a joint intersection value of the grating projection image j is determined.
5. The method according to claim 1, wherein The reference mask image includes F reference mask sub-images; one reference mask sub-image corresponds to one patch; the F reference mask sub-images and the F grating projection images each include pixel points at H×W pixel positions, where H and W are both positive integers; the F grating projection images include a grating projection image j, where j is a positive integer less than or equal to F; The performing joint cross processing on the reference mask image and the F grating projection images to obtain a joint cross value of the F grating projection images includes: Determine the patch corresponding to the grating projection image j as the target patch, and determine the reference mask sub-image corresponding to the target patch from the F reference mask sub-images as the target reference mask sub-image; Determine a pixel position i from the H×W pixel positions; i is a positive integer less than or equal to H×W; determining a pixel comparison result corresponding to the pixel position i based on a first pixel value corresponding to the pixel position i in the target reference mask sub-image and a second pixel value corresponding to the pixel position i in the grating projection image j; The joint cross-value of the grating projection image j is determined based on the pixel comparison result corresponding to the pixel position i, and the joint cross-value of the F grating projection images is obtained based on the joint cross-value of the grating projection image j.
6. The method according to claim 1, characterized in that The F grating projection images include a grating projection image j, where j is a positive integer less than or equal to F; the patch corresponding to the grating projection image j is the target patch; The performing grating projection processing on the F facets based on the posture parameters to obtain F grating projection images corresponding to the F facets includes: Acquire an initial image; the image size of the initial image is consistent with the image size of the first object image; Performing raster projection processing on the target surface based on the posture parameters, and determining a projection area of the target surface in the initial image; the projection area includes a first pixel point, and the first pixel point has a corresponding mapping position on the target surface patch; determining a second pixel value of the first pixel based on a distance between the first pixel and a mapping position of the first pixel on the target patch; Determining a pixel point other than the first pixel point in the initial image as a second pixel point, and determining a second pixel value of the second pixel point based on a preset pixel value; Based on an initial image including the second pixel value of the first pixel point and the second pixel value of the second pixel point, a grating projection image of the grating projection image j is determined, and based on the grating projection image of the grating projection image j, F grating projection images corresponding to the F facets are determined.
7. The method according to claim 1, characterized in that The acquiring of the reference mask image of the virtual object comprises: Acquiring a model texture image of the virtual object under the posture parameters in the model space; the model texture image includes a channel image under a target channel; pixel values in the channel image of the target channel are used to represent the transparency of the model texture image; A reference mask image of the virtual object is determined based on the channel image under the target channel.
8. The method according to claim 1, characterized in that The method further comprises: Performing a first rendering process on the virtual object based on the posture parameters of the virtual camera in the business space, the object mesh of the virtual object, and the texture map of the virtual object to obtain a first business texture image; the texture map refers to a map resource configured when the virtual object is created in the model space; When the texture rendering quality of the first service texture image does not meet the rendering quality condition, the first service texture image is determined as the first object image.
9. The method according to claim 8, characterized in that The performing a second rendering process on the virtual object based on the object optimization mesh and the posture parameters to obtain a second object image of the virtual object includes: performing texture optimization processing on the texture map based on the object optimization grid of the virtual object to obtain a texture optimization map of the virtual object; Based on the object optimization mesh, the texture optimization map and the posture parameters, a second rendering process is performed on the virtual object to obtain a second object image of the virtual object.
10. The method according to claim 1, characterized in that The method further comprises: In the model space, performing the second rendering process on the virtual object based on the object mesh and the posture parameters, recording a first rendering consumption time and a first rendering consumption resource consumed by performing the second rendering process on the virtual object based on the object mesh and the posture parameters, and determining the first rendering consumption time and the first rendering consumption resource as first rendering consumption information; When performing a second rendering process on the virtual object based on the object optimization grid and the posture parameters to obtain the second object image, recording second rendering consumption resources and second rendering consumption duration consumed by performing the second rendering process on the virtual object based on the object optimization grid and the posture parameters, and determining the second rendering consumption resources and second rendering consumption duration as second rendering consumption information; determining a rendering optimization detection result based on the first rendering consumption information, the second rendering consumption information, a texture rendering quality of the first object image, and a texture rendering quality of the second object image; When the rendering optimization detection result meets the optimization condition associated with the virtual object, the object mesh is updated based on the object optimization mesh; the updated object mesh is used to render the business texture image of the virtual object in the business space.
11. The method according to claim 1, wherein The method further comprises: Acquire an object coordinate system created based on the virtual object; the object coordinate system takes the center position of the virtual object as an origin; determining azimuth information, elevation information, and distance information of the virtual camera relative to the virtual object based on the position of the virtual camera in the object coordinate system and the origin of the object coordinate system; The posture parameters of the virtual camera are determined based on the azimuth information, the elevation information, and the distance information.
12. A texture rendering processing device, characterized in that: The device comprises: A first image acquisition module is configured to acquire a first object image of the virtual object in a business space; the first object image is a business texture image whose texture rendering quality does not meet a rendering quality condition, the business texture image being obtained by performing a first rendering process on the virtual object based on posture parameters of a virtual camera in the business space and an object mesh of the virtual object, the object mesh including F facets constituting the virtual object, where F is a positive integer; a grating projection module, configured to perform grating projection processing on the F facets based on the posture parameters to obtain F grating projection images corresponding to the F facets; one facet corresponds to one grating projection image; a mask image acquisition module, configured to acquire a reference mask image of the virtual object; the reference mask image is determined based on a model texture image of the virtual object under the pose parameters acquired in a model space; the image size of the reference mask image and the business texture image are consistent; a joint cross processing module, configured to perform a joint cross processing on the reference mask image and the F grating projection images to obtain a joint cross value of the F grating projection images; a joint cross value is used to represent the degree of overlap between a grating projection image and the reference mask image; a mesh optimization module, configured to perform mesh optimization processing on the object mesh based on the joint intersection value of the F grating projection images to obtain an object optimized mesh of the virtual object; An optimization rendering module is used to perform a second rendering process on the virtual object based on the object optimization grid and the posture parameters to obtain a second object image of the virtual object; the texture rendering quality of the second object image is better than the texture rendering quality of the first object image.
13. A computer device, characterized in that: including memory and processor; The memory is connected to the processor, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 11.
15. A computer program product, characterized in that The method comprises a computer program / instruction, which implements the method according to any one of claims 1 to 11 when the computer program / instruction is executed by a processor.