Virtual model processing method and device, electronic equipment and storage medium
By generating a flickering point mask map using random reference parameters based on UV information, the method addresses inefficiencies in creating flashing spot effects on virtual models, enhancing clarity and richness while simplifying production.
Patent Information
- Application Number
- CN202411412541.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2024-12-27
AI Technical Summary
Existing methods for creating flashing spot effects on virtual models in game design are inefficient due to cumbersome production steps and the high resource consumption of semi-transparent texture materials, leading to low clarity and richness in the effects.
A method involving constructing multiple random reference parameters based on UV information of a texture map to generate a flickering point mask map, followed by texture adjustment processing to achieve a flickering point effect, ensuring clarity and richness while simplifying the production process.
The method enhances the clarity and richness of the flickering point effect on virtual models and significantly improves production efficiency by reducing the complexity and resource consumption of the process.
Smart Images

Figure CN119185935A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of game technology, and in particular to a method, device, electronic device and storage medium for processing a virtual model. Background Art
[0002] In order to provide players with a better gaming experience, many terminal games are often built based on real scenes and items in real scenes. In actual game design projects, artists and planners often propose the production of game resources. Through the design of game resources, various virtual resources that simulate real-life scenes or items can be realized, such as virtual buildings, virtual clothing, and a variety of virtual accessories. Specifically, different material texture effects can be achieved on virtual clothing, such as a flashing point effect on virtual clothing, so as to provide players with a rich variety of virtual clothing to choose from in the game.
[0003] In the prior art, a bright spot map corresponding to the flashing spot effect is usually prepared for the virtual model to produce the flashing spot effect on the virtual model. However, the existing method of using bright spot maps to achieve the flashing spot effect cannot guarantee clarity and richness, and because the map needs to be prepared to achieve the flashing spot effect, the production steps required are cumbersome and the process is complicated and troublesome, resulting in low production efficiency for achieving the flashing spot effect on the virtual model. Summary of the invention
[0004] The embodiments of the present application provide a method, device, electronic device and storage medium for processing a virtual model. A plurality of random reference parameters are constructed based on UV information of a texture map of the virtual model, and a flickering point mask map with a plurality of random flickering points is generated based on the plurality of reference parameters. Texture adjustment processing is then performed on the virtual model based on the flickering point mask map to achieve a flickering point effect for the virtual model. The clarity and richness of the flickering point effect can be effectively guaranteed, and the steps for producing the flickering point effect can be effectively simplified. The programming of the flickering point effect can be realized, and the efficiency of producing the flickering point effect in the virtual model can be improved.
[0005] In a first aspect, an embodiment of the present application provides a method for processing a virtual model, comprising:
[0006] Obtaining a texture map of the virtual model to be processed;
[0007] Perform at least two random function calculations on UV information corresponding to each pixel in the texture map to obtain a plurality of reference parameters corresponding to each pixel;
[0008] Based on the UV information of each pixel point and the corresponding multiple reference parameters, a scintillation point mask area corresponding to each pixel point is generated to obtain a scintillation point mask image;
[0009] The texture adjustment process is performed on the virtual model to be processed based on the flickering point mask image to obtain a target virtual model with a flickering point effect.
[0010] In a second aspect, an embodiment of the present application provides a virtual model processing device, including:
[0011] An acquisition unit, used for acquiring a texture map of a virtual model to be processed;
[0012] A first processing unit is used to perform at least two random function calculation processes on UV information corresponding to each pixel point in the texture map to obtain a plurality of reference parameters corresponding to each pixel point;
[0013] A generating unit, configured to generate a scintillation point mask area corresponding to each pixel point based on UV information of each pixel point and a corresponding plurality of reference parameters, so as to obtain a scintillation point mask image;
[0014] The second processing unit is used to perform texture adjustment processing on the virtual model to be processed based on the scintillation point mask image to obtain a target virtual model with a scintillation point effect.
[0015] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory storing a plurality of instructions; a processor loads instructions from the memory to execute the steps of any virtual model processing method provided in the embodiment of the present application.
[0016] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a plurality of instructions suitable for loading by a processor to execute the steps of any virtual model processing method provided in the embodiment of the present application.
[0017] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the steps in any virtual model processing method provided in the embodiment of the present application.
[0018] By adopting the solution of the embodiment of the present application, multiple random reference parameters are constructed based on the UV information of the texture map of the virtual model, and then a flickering point mask map with multiple random flickering points is generated based on the multiple reference parameters, so that the texture of the virtual model is adjusted based on the flickering point mask map to achieve the flickering point effect for the virtual model. The clarity and richness of the flickering point effect can be effectively guaranteed, and the production steps of the flickering point effect can be effectively simplified, the programming of the flickering point effect can be realized, and the production efficiency of the flickering point effect in the virtual model can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 It is a scene schematic diagram of a virtual model processing system provided in an embodiment of the present application;
[0021] Figure 2 It is a flowchart of an embodiment of a method for processing a virtual model provided in an embodiment of the present application;
[0022] Figure 3 It is a node flow diagram of a method for processing a virtual model provided in an embodiment of the present application;
[0023] Figure 4 It is another node flow diagram of the virtual model processing method provided in the embodiment of the present application;
[0024] Figure 5 It is another node flow diagram of the virtual model processing method provided in the embodiment of the present application;
[0025] Figure 6 It is another node flow diagram of the virtual model processing method provided in the embodiment of the present application;
[0026] Figure 7 It is another node flow diagram of the virtual model processing method provided in the embodiment of the present application;
[0027] Figure 8 It is another node flow diagram of the virtual model processing method provided in the embodiment of the present application;
[0028] Fig. 9 It is another node flow diagram of the virtual model processing method provided in the embodiment of the present application;
[0029] Fig.10 It is another node flow diagram of the virtual model processing method provided in the embodiment of the present application;
[0030] Fig.11 It is another node flow diagram of the virtual model processing method provided in the embodiment of the present application;
[0031] Fig.12 It is another node flow diagram of the virtual model processing method provided in the embodiment of the present application;
[0032] Fig.13is a schematic diagram of the structure of a virtual model processing device provided in an embodiment of the present application;
[0033] Fig.14 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application. At the same time, in the description of the embodiments of the present application, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0035] In the prior art, a layer of semi-transparent texture material is usually added on top of an opaque virtual clothing material to create a wave effect on the virtual clothing. However, since the semi-transparent material is the material with the highest resource consumption during the rendering process, the resource consumption of the semi-transparent texture material is high, resulting in a large amount of resources required to realize the wave effect on the virtual clothing, thereby resulting in low efficiency in the production of virtual resources.
[0036] The present application embodiment provides a method, device, electronic device and computer-readable storage medium for processing a virtual model, which can obtain a texture map of a virtual model to be processed; then, perform at least two random function calculations on the UV information corresponding to each pixel in the texture map to obtain multiple reference parameters corresponding to each pixel; then, based on the UV information of each pixel and the corresponding multiple reference parameters, generate a flickering point mask area corresponding to each pixel to obtain a flickering point mask map; finally, perform texture adjustment processing on the virtual model to be processed based on the flickering point mask map to obtain a target virtual model with a flickering point effect. In the embodiment of the present application, by constructing multiple random reference parameters based on the UV information of the texture map of the virtual model, and then generating a flickering point mask map with multiple random flickering points based on the multiple reference parameters, the virtual model is texture adjusted based on the flickering point mask map to achieve a flickering point effect for the virtual model, which can effectively ensure the clarity and richness of the flickering point effect, and can also effectively simplify the production steps of the flickering point effect, realize the programming of the flickering point effect production, and improve the production efficiency of the flickering point effect in the virtual model.
[0037] The embodiments of the present application provide a method, device, electronic device, and computer-readable storage medium for processing a virtual model. Specifically, the present embodiment will be described from the perspective of a processing device for a virtual model, and the processing device for a virtual model can be specifically integrated in an electronic device, that is, the processing method for a virtual model in the embodiments of the present application can be executed by an electronic device, and optionally, the electronic device can include: a terminal device. The terminal device can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, a game console, or a personal computer (PC) and the like.
[0038] The virtual model processing method provided in the embodiment of the present application can be applied to a virtual model processing system. The virtual model processing system may include a player terminal device and a server, and the terminal may be a device including both receiving and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing two-way communication on a two-way communication link. The player terminal device and the server may perform two-way communication via a network.
[0039] Optionally, the server may be an independent server, or a server network or server cluster composed of servers, including but not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud server composed of multiple servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.
[0040] The processing method of the virtual model in one embodiment of the present disclosure can be run on a local terminal device or a server. When the processing method of the virtual model is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0041] For example, when the processing method of the virtual model is run on the terminal, the terminal device stores a game application and is used to present a virtual scene in the game screen. The terminal device is used to interact with the user through a graphical user interface, for example, the game application is downloaded and installed by the terminal device and run. The terminal device may provide the graphical user interface to the user in a variety of ways, for example, it may be rendered and displayed on the display screen of the terminal device, or the graphical user interface may be presented through holographic projection. For example, the terminal device may include a touch display screen and a processor, the touch display screen is used to present the graphical user interface and receive the operation instructions generated by the user acting on the graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, respond to the operation instructions, and control the display of the graphical user interface on the touch display screen.
[0042] For example, when the processing method of the virtual model runs on the server, it can be a cloud game. Cloud gaming refers to a gaming method based on cloud computing. In the operation mode of cloud gaming, the operating body of the game application and the game screen presentation body are separated, and the storage and operation of the processing method of the virtual model are completed on the cloud gaming server. The game screen presentation is completed on the client of the cloud gaming. The cloud gaming client is mainly used for receiving and sending game data and presenting the game screen. For example, the cloud gaming client can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, a personal digital assistant, etc., but the terminal device for processing game data is a cloud gaming server in the cloud. When playing the game, the user operates the cloud gaming client to send an operation instruction to the cloud gaming server. The cloud gaming server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the cloud gaming client through the network. Finally, the cloud gaming client decodes and outputs the game screen.
[0043] See also Figure 1 , Figure 1 A scene diagram of a processing system of a virtual model provided by an embodiment of the present application. The system may include at least one terminal, at least one server, at least one database, and a network. The terminal held by the user can be connected to the server of different games through the network. The terminal is any device with computing hardware that can support and execute software products corresponding to the game. In addition, when the system includes multiple terminals, multiple servers, and multiple networks, different terminals can be connected to each other through different networks and different servers. The network can be a wireless network or a wired network, such as a wireless network such as a wireless local area network (WLAN), a local area network (LAN), a cellular network, a 2G network, a 3G network, a 4G network, a 5G network, etc. In addition, different terminals can also use their own Bluetooth network or hotspot network to connect to other terminals or to servers, etc. For example, multiple users can be online through different terminals and connected and synchronized with each other through appropriate networks to support multi-player games. In addition, the system may include multiple databases, multiple databases are coupled to different servers, and information related to the game environment can be continuously stored in the database when different users are online for multi-player games.
[0044] The embodiment of the present application provides a method for processing a virtual model, which can be executed by a terminal or a server. The embodiment of the present application takes the method for processing a virtual model executed by a terminal as an example for explanation. Among them, the terminal may include a touch display screen and a processor (of course, the terminal may also use peripherals such as a mouse and a keyboard as input devices, and only the touch display screen is used as an example for explanation here), and the touch display screen is used to present a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. When the user operates the graphical user interface through the touch display screen, the graphical user interface can control the local content of the terminal by responding to the received operation instructions, and can also control the content of the opposite server by responding to the received operation instructions. For example, the operation instructions generated by the user acting on the graphical user interface include instructions for starting a game application, and the processor is configured to start the game application after receiving the instructions for starting the game application provided by the user. In addition, the processor is configured to render and draw a graphical user interface associated with the game on the touch display screen. The touch display screen is a multi-touch sensitive screen that can sense touch or sliding operations performed simultaneously by multiple points on the screen. The user uses a finger to perform a touch operation on the graphical user interface, and when the graphical user interface detects the touch operation, different virtual objects in the graphical user interface of the game are controlled to perform actions corresponding to the touch operation.
[0045] It should be noted that Figure 1 The scenario diagram of the virtual model processing system shown is merely an example. The virtual model processing system and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. A person of ordinary skill in the art can appreciate that with the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.
[0046] The following is a detailed description in conjunction with the accompanying drawings. In this embodiment, the execution subject is a terminal device as an example. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments. Although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that shown in the accompanying drawings.
[0047] Please also read Figures 2 to 12 , Figure 2 A flowchart of a method for processing a virtual model provided in an embodiment of the present application is provided. Fig.12A method for processing a virtual model provided in an embodiment of the present application uses a node flow of multiple modules in the Unreal Engine, the modules including a grayscale grid generation module, a flickering point mask map generation module, a flickering point brightness control module, a flickering point density control module, a hue map sampling module, a highlight area calculation module, and a flickering point color control module. The specific flow of the method for processing the virtual model can be as follows: Steps 101 to 104:
[0048] Step 101: Obtain a texture map of a virtual model to be processed.
[0049] Specifically, the UV information of the virtual model is usually recorded in the texture map corresponding to the virtual model. Among them, the texture map is a two-dimensional image that contains the color, texture, lighting and other information of the model surface of the virtual model. In the texture map, the UV coordinates are used to map the vertices of the model to the corresponding positions on the texture image, thereby determining the color and texture information of each vertex. The UV coordinates record the position of each vertex on the surface of the model on the texture image. Through these UV coordinates, the color and texture information on the texture map can be correctly applied to the surface of the model during the rendering process.
[0050] Step 102: Perform at least two random function calculations on UV information corresponding to each pixel in the texture map to obtain a plurality of reference parameters corresponding to each pixel.
[0051] In order to obtain a more random and natural flickering point, the random function calculation process in the embodiment of the present application refers to using a pre-built amplified random function to operate on the UV information to obtain the corresponding function result as a reference parameter. Specifically, the random function in the present application is usually expressed as a function of a random variable, and the amplified random function used refers to amplifying or expanding a random function to increase its amplitude or range of variation. The amplified random function can be achieved by performing a linear transformation or a nonlinear transformation on the random variable.
[0052] In a specific implementation, the step of "performing at least two random function calculations on the UV information corresponding to each pixel in the texture map to obtain multiple reference parameters corresponding to each pixel" includes:
[0053] Based on a plurality of preset random functions, random function calculation processing is performed on UV information corresponding to each pixel point in the texture map to obtain a plurality of grayscale grids corresponding to each pixel point, wherein one grayscale grid is associated with one grayscale information.
[0054] For details, please refer to Figure 3 and Figure 4, you can use the node process in Unreal Engine (UE) to build three random grayscale grids with different results based on the UV information in the texture map. Figure 3 It is a grayscale grid generation module, which includes multiple processing nodes. Specifically, the flash point size can be set to 100 or 500, and the specific value is set according to the needs of the production personnel. Each UV information and flash point parameter can be input into the first multiply function node, the floor function node, the second multiply function node (0.00333), and the BreakOutFloat2Components node in sequence to obtain a first result, and then the first result is input into the first branch (the first add function node and the third multiply function node (0.6)) to obtain a second result, and the first result is input into the second branch (the fourth multiply function node and the fifth multiply function node (0.4)) to obtain a third result, and then the second result and the third result are input into the second add function node to obtain a fourth result. Then, the fourth result is respectively input into the first function branch (sixth multiply function node (2611), third add function node (5.381), seventh multiply function node (63.78), frac node), second function branch (eighth multiply function node (2700), fourth add function node (5.068), ninth multiply function node (40.92), frac node), and third function branch (tenth multiply function node (1243), fifth add function node (6.008), eleventh multiply function node (235.4), frac node) to obtain Random A (i.e., Figure 4 The first random result in ), through the second function branch to get Random B (i.e. Figure 4 Then, Random A and Random B are input into the sixth add function node to obtain the fifth result, the fifth result and the sixth result obtained through the third function branch are input into the seventh add function node, and the result obtained by the seventh add function node is passed through the twelfth multiply function node (36.54) and the frac node to obtain Random C (i.e. Figure 4 ), thereby obtaining Random A, Random B, and Random C as the three grayscale grids corresponding to the pixel points.
[0055] Step 103: Based on the UV information of each pixel and a corresponding plurality of reference parameters, a scintillation point mask area corresponding to each pixel is generated to obtain a scintillation point mask image.
[0056] Specifically, after obtaining multiple grayscale grids of each pixel point, the UV value Frac after Tilling can be obtained to form a UV grid of the same size as the random grayscale grid, and then RandomA and RandomB are merged into a two-dimensional vector as the center of the flashing point, and RandomC is slightly processed as the radius of the circle of the flashing point. At the same time, a size limit is set on the center offset value to prevent the circle from crossing the boundary.
[0057] Specifically, since the circles of the flashing points are calculated in each UV grid, once the center is too biased or the radius is too large, it will exceed the grid. The purpose of the embodiment of the present application is to obtain a complete circle as the flashing point. Once it crosses the boundary, a straight edge will appear. Therefore, it is necessary to set the center offset parameter for limitation. Specifically, the grayscale value of one of the random grayscale grids can be used as the radius of the drawn circle, and the grayscale values of the other two random grayscale grids can be used as the offset of the center of the circle. It is known that half of the side length of the UV grid is the maximum value of the circle radius. By subtracting the radius of the circle from it, the distance between the edge of the circle and the edge of the UV grid can be obtained. This distance is used to limit the center offset as the center offset parameter.
[0058] Among them, the grayscale grid is a two-dimensional grid used to represent an image (i.e., a texture map), in which the value of each grid represents the grayscale level of the corresponding pixel. The UV grid is a two-dimensional grid used for texture mapping, in which the value of each grid represents a texture coordinate.
[0059] For example, see also Figure 5 and Figure 6 , a node process can be used in Unreal Engine (UE) to calculate the UV information of each pixel and the corresponding multiple reference parameters (such as the grayscale value corresponding to the grayscale grid). Figure 5It is a flickering point mask map generation module, and the flickering point mask map generation module includes multiple processing nodes. The flickering point mask area corresponding to each pixel point can be generated through the multiple processing nodes of the flickering point mask map generation module to obtain a flickering point mask map. In an embodiment of the present application, Random A (i.e., the first random result), Random B (i.e., the second random result) and Random C (i.e., the third random result) generated by the grayscale grid generation module can be input into the flickering point mask map generation module to obtain a flickering point mask map. Specifically, Random A and Random B can be input into the merge (Append) node to obtain a two-dimensional vector formed by the merger of RandomA and RandomB, and then the two-dimensional vector can be input into the first subtraction node (Subtract(, 0.5)) to obtain a first difference vector; at the same time, Random A can be input into the merge (Append) node to obtain a two-dimensional vector formed by the merger of RandomA and RandomB, and then the two-dimensional vector can be input into the first subtraction node (Subtract(, 0.5)) to obtain a first difference vector; at the same time, Random C is input into the Divide(,2) node, and the obtained quotient is input into the second Clamp node, the second Subtract(,0.5) node, and the Multiply(,-1) node in turn for processing to obtain the target product; then, the first difference vector and the target product are input into the first Clamp node and the Add node in turn to obtain the target sum value between the first difference vector, the target product and the preset value (0.5,0.5), where the Clamp node is used to limit the input value within a specified range; then, the target sum value is input into the SphereMask node to create a spherical mask effect, which can mix an input value with a spherical mask to generate a mask effect according to the position and radius of the sphere.
[0060] In one embodiment, the step of “generating a scintillation point mask area corresponding to each pixel point based on the UV information of each pixel point and a corresponding plurality of reference parameters to obtain a scintillation point mask image” includes:
[0061] Determine at least one shape parameter of a flickering point of a specified shape corresponding to each pixel point based on the grayscale information of a plurality of grayscale grids corresponding to each pixel point;
[0062] Based on the UV information of each pixel point and at least one corresponding shape parameter, a scintillation point mask area corresponding to each pixel point is generated to obtain a scintillation point mask image.
[0063] Specifically, the grayscale grid may include a first grayscale grid, a second grayscale grid and a third grayscale grid, and the grayscale information corresponding to each grayscale grid is different; the step of "determining at least one shape parameter of a flashing point of a specified shape corresponding to each pixel point based on the grayscale information of the plurality of grayscale grids corresponding to each pixel point" includes:
[0064] If the specified shape of the flashing point is a circle, the target circle center parameter is determined based on the first grayscale information of the first grayscale grid and the second grayscale information of the second grayscale grid, and the target radius parameter is determined based on the third grayscale information of the third grayscale grid.
[0065] Furthermore, the method further comprises:
[0066] Based on the target radius parameter of the pixel point and the corresponding UV information, a center offset parameter of the scintillation point is determined, wherein the center offset parameter is used to display the center position of the circular scintillation point.
[0067] Optionally, each grayscale grid stores a grayscale value, and a threshold can be set. If the grayscale is lower than a certain value, the value of this position is set to 0. Multiplying it with the flickering point mask will remove the circular flickering point at this location.
[0068] Step 104: Perform texture adjustment processing on the virtual model to be processed based on the flickering point mask image to obtain a target virtual model with a flickering point effect.
[0069] Specifically, the embodiment of the present application can connect the flickering point mask map to the self-luminous channel of the preset material of the virtual model to obtain a target virtual model with a flickering point effect. Specifically, it can be achieved through the following processing steps: First, it is necessary to create a preset material for the virtual model; then, the self-luminous channel setting is performed, specifically to find the self-luminous channel in the material, and this self-luminous channel is used to control the self-luminous effect of the surface of the object of the virtual model; then, the flickering point mask map is imported into the material, and the flickering point mask map is usually a black and white image, in which white represents flickering points and black represents non-flickering points. After that, the mask map intensity can also be adjusted. According to the timing needs of the production staff, the intensity or brightness of the flickering point mask map can be adjusted to control the brightness of the flickering point; finally, the flickering point mask map is connected to the self-luminous channel of the preset material, specifically by using the flickering point mask map as the texture map of the self-luminous channel. Further, the self-luminous parameters can also be adjusted, for example, the parameters of the self-luminous channel (such as brightness or color) can be adjusted as needed to obtain the desired effect. Based on the above steps, the effect of displaying the glittering points on the model surface of the virtual model can be achieved by connecting the glittering point mask map to the self-luminous channel of the preset material of the virtual model. When the virtual model is rendered, the glittering points will be presented in a self-luminous manner, thereby increasing the visual appeal and realism of the virtual model.
[0070] In one embodiment, the step of “performing texture adjustment processing on the virtual model to be processed based on the scintillation point mask image to obtain a target virtual model with a scintillation point effect” includes:
[0071] Adjusting the material map of the virtual model to be processed based on the flickering point mask map to obtain a target material map with flickering points;
[0072] The texture of the virtual model to be processed is adjusted based on the target material map to obtain a target virtual model with a flashing point effect.
[0073] For example, the flickering point mask map may be connected to the self-luminous channel of the material map of the virtual model to be processed, so as to obtain a target virtual model with a flickering point effect.
[0074] In summary, the embodiment of the present application provides a method for processing a virtual model, which can obtain a texture map of a virtual model to be processed; then, the UV information corresponding to each pixel in the texture map is subjected to at least two random function calculations to obtain a plurality of reference parameters corresponding to each pixel; then, based on the UV information of each pixel and the corresponding plurality of reference parameters, a flickering point mask area corresponding to each pixel is generated to obtain a flickering point mask map; finally, the virtual model to be processed is subjected to texture adjustment processing based on the flickering point mask map to obtain a target virtual model with a flickering point effect. In the embodiment of the present application, a plurality of random reference parameters are constructed based on the UV information of the texture map of the virtual model, and a flickering point mask map with a plurality of random flickering points is generated based on the plurality of reference parameters, so that the texture of the virtual model is adjusted based on the flickering point mask map to realize the flickering point effect for the virtual model, which can effectively ensure the clarity and richness of the flickering point effect, and can also effectively simplify the steps for making the flickering point effect, realize the programming of the flickering point effect, and improve the efficiency of making the flickering point effect in the virtual model.
[0075] Based on the above introduction, the following example will be given to further illustrate the virtual model processing method of the present application. The specific embodiment of the virtual model processing method is described as follows.
[0076] In a specific embodiment, the step of “generating a scintillation point mask area corresponding to each pixel point based on the UV information of each pixel point and a corresponding plurality of reference parameters to obtain a scintillation point mask image” further includes:
[0077] Acquire the highlight area and the non-highlight area of the virtual model to be processed;
[0078] generating a first density parameter based on the highlight area, and generating a second density parameter based on the non-highlight area;
[0079] Based on the first density parameter, the density of the flickering points in the area corresponding to the highlight area in the flickering point mask image is adjusted; and based on the second density parameter, the density of the flickering points in the area corresponding to the non-highlight area in the flickering point mask image is adjusted to obtain an adjusted flickering point mask image.
[0080] For example, see also Figure 7 and Figure 8 , you can use the node process in Unreal Engine (UE) to calculate the highlight area of the virtual model and control the density of the flickering points, and then set two density parameters to adjust the density of the flickering points in the highlight area and non-highlight area to retain or remove the flickering points and control the random distribution of the flickering points. The density value can be understood as a threshold value. The result obtained by subtracting the threshold value from the grayscale grid becomes 0 if it is lower than the threshold value. 0 means it is removed, and non-0 means it is retained.
[0081] in, Figure 7 The highlight area calculation module includes a plurality of processing nodes. The highlight area of the virtual model can be obtained through the plurality of processing nodes of the highlight area calculation module, thereby determining the highlight area and the non-highlight area of the virtual model. In an embodiment of the present application, the normal information (BaseNormal) of the model surface of the virtual model can be input into the transformation (TransformVector) node, and the vector of the normal information in the local coordinate system corresponding to the tangent space is converted into a vector in the coordinate system corresponding to the world scene space to obtain a first vector; then, the first vector is input into the reflection vector (Reflection Vector) node, and the direction vector of the reflected light is calculated based on the direction vector of the incident light and the surface normal (i.e., the first vector) to obtain a second vector; then, the second vector and the illumination vector of the illumination direction in the sky atmosphere system obtained by the illumination vector acquisition (SkyAtmosphereLightDirection) node are input into the vector operation (Dot) node, and the dot product between the second vector and the illumination vector is calculated to obtain a target dot product; finally, the target dot product is input into the restriction (Saturate) node and the Ref Mask node in turn to calculate the result of each pixel point, and the highlight area and non-highlight area of the virtual model are determined according to the result.
[0082] in, Figure 8It is a flicker point density control module, which includes multiple processing nodes. The multiple processing nodes of the flicker point density control module can retain the flicker points in the highlight area of the virtual model and remove the flicker points in the non-highlight area of the virtual model. In an embodiment of the present application, Random C (i.e., the third random result) and the flash point parameters corresponding to the flash point random distribution seed obtained through the sparkle texture (Sparkle Distrubute) node can be input into the multiplication (Multiply) node to obtain the target product; then, the target product is input into the value (Frac) node to obtain the decimal part of the target product to obtain the target value, so as to achieve the tiling or repetition effect of the texture; thereafter, the target value input and the preset non-highlight density parameter and highlight density parameter are input into the first limit (Saturate) node and the division (Divide) node in turn to obtain the target quotient value, and then the target quotient value is input into the second limit (Saturate) node to limit the input value between 0 and 1 to obtain the target value; then, the target value is input into the complement calculation (1-x) node to obtain the complement of the target value subtracted from 1; finally, the complement is input into the particle (sparkledistrbute) node to create a random sparkling effect at the position of each particle, so that the particles are scattered or sparkling in space.
[0083] Specifically, a first density parameter and a second density parameter can be set. The first density parameter is used to control the density of flickering points in the highlight area to make the flickering points in the highlight area more densely distributed. The second density parameter is used to control the density of flickering points in the non-highlight area. Since the non-highlight area may have no flickering points or be set with a small number of flickering points, the second density parameter is needed to control the distribution of flickering points in the non-highlight area.
[0084] In a specific embodiment, the step of “generating a scintillation point mask area corresponding to each pixel point based on the UV information of each pixel point and a corresponding plurality of reference parameters to obtain a scintillation point mask image” further includes:
[0085] Determine a target grayscale grid from the plurality of grayscale grids, and generate brightness control information based on target grayscale information of the target grayscale grid;
[0086] A target flicker point is determined from the flicker point mask map based on the brightness control information, and a current brightness of the target flicker point is adjusted according to the brightness control information to obtain an adjusted flicker point mask map.
[0087] For example, see Fig. 9, you can use the node process in Unreal Engine (UE) to control the brightness of the flashing points to enrich the randomness of the flashing points. Specifically, you can use RandomA (or RandomB or RandomC) as the value that interacts with the line of sight, and add an extra layer of density control of the highlight flashing points to highlight some flashing points corresponding to the flashing point mask. Specifically, you can multiply the camera direction vector with (1, 0, 0) to bring about the grayscale value that keeps changing as the viewing angle changes, and use this as a basis to simulate the flashing effect of the flashing points.
[0088] in, Fig. 9 It is a flicker point brightness control module, and the flicker point brightness control module includes multiple processing nodes. The flicker points that need to be highlighted can be highlighted through the multiple processing nodes of the flicker point brightness control module. In an embodiment of the present application, the obtained camera direction vector (CameraDirectionVector) and the preset parameters (x: 1.0, y: 0.0, z: 0.0) can be input into the vector operation (Dot) node to obtain the first dot product; then, the first dot product is input into the first multiplication (Multiply(, 2)) node to obtain the first product; then, the first product is input into the value (Frac) node to obtain the decimal part of the first product to obtain the first numerical value, and then the first numerical value and RandomA are input into the summation (Add) node to obtain the first sum value, and then the first sum value is input into the The second value is input into the Frac node to obtain the decimal part of the first sum to obtain the second value; then, the second value is input into the Subtract(,0.5) node to obtain the difference between the second value and 0.5, and the difference is input into the Abs node to calculate the absolute value of the difference; then, the absolute value is input into the second Multiply(,2) node to obtain the second product; the second product and the preset flash point density (0.8) are input into the SmoothStep node to control the smooth transition of color or intensity, thereby creating a gradient effect of color or intensity, so that it transitions smoothly within the range.
[0089] In a specific embodiment, the step of “generating a scintillation point mask area corresponding to each pixel point based on the UV information of each pixel point and a corresponding plurality of reference parameters to obtain a scintillation point mask image” further includes:
[0090] Acquire a preset hue diagram, wherein the preset hue diagram includes at least one type of color type information;
[0091] Based on the grayscale information of each pixel in the flickering point mask image, the preset hue image is randomly sampled to determine a color type for each flickering point in the flickering point mask image, thereby obtaining an adjusted flickering point mask image.
[0092] For example, see Fig.10 In order to conveniently control the color of the flash point, the embodiment of the present application can use the gray value to sample the hue map to obtain a colored flash point. Specifically, the node process can be used in the Unreal Engine (UE) to sample the hue map with the gray value to obtain the colored flash point. Among them, the hue map can include a variety of different colors. The gray value corresponding to each pixel in the flash point mask map is used to randomly sample a color from a plurality of colors to obtain flash points of different colors. Specifically, when the color range is 1, the full color domain can be sampled, and when it is 0, only the monochrome domain can be sampled. The color offset is when the color range is 0, by adjusting this value to control which color of the hue map the flash point selects.
[0093] in, Fig.10 It is the hue map sampling module. Fig.11 It is a flicker point color control module. The hue map sampling module and the flicker point color control module include multiple processing nodes, and the hue map can be sampled through the multiple processing nodes of the hue map sampling module and the flicker point color control module. In the embodiment of the present application, the color range parameter can be set to 1, so that the full color range can be sampled, and the color offset parameter can be set to 0, and the color of the hue map selected by the flicker point can be controlled by adjusting the value of the color offset parameter; then Random C, the color range parameter, and the color offset parameter are summed to obtain a first sum value, and then the first sum value is input into the flicker point color map node, and the hue map is sampled to obtain a color flicker point.
[0094] Furthermore, the method further comprises:
[0095] The texture adjustment process is performed on the virtual model to be processed based on the adjusted scintillation point mask image to obtain a target virtual model with the adjusted scintillation point effect.
[0096] Optionally, the step of “performing at least two random function calculations on the UV information corresponding to each pixel point in the texture map to obtain a plurality of reference parameters corresponding to each pixel point” further includes:
[0097] Obtaining a target shape of a scintillation point of a scintillation point mask image to be generated;
[0098] Based on the number of shape parameters required for the target shape, the number of reference parameters that need to be generated for each pixel point is determined to determine the number of times the random function calculation process is performed.
[0099] For example, if the target shape of the flashing point is a circle, three grayscale grids with different random results are required to determine shape parameters such as the center and radius of the circle based on the three grayscale grids; if the target shape of the flashing point is a square, four grayscale grids with different random results are required to determine shape parameters such as the center point, X value, Y value and offset parameter of the square based on the four grayscale grids.
[0100] The embodiment of the present application uses UV as the initial value, constructs three random amplification functions, and finally fits them together to form a function result that is approximately true random, and the obtained function result is used as a grayscale random UV subdivision grid. Then, a circular Mask of the distance field of the UV subdivision grid is constructed, and two random results are specifically extracted and pieced together into a two-dimensional vector, which is processed into a random offset value of the UV subdivision grid. The radius of the circular Mask is used to limit the offset value so that it remains within the range of the respective subdivision grid. Then, a random grayscale grid is constructed again, and the Clip value is set for random elimination to reduce the density of flash points and make the distribution more random. Furthermore, the hue map is sampled with grayscale values to obtain colored flash points, and the overall effect is constructed to set design parameters.
[0101] In summary, the embodiment of the present application provides a method for processing a virtual model, which can obtain a texture map of a virtual model to be processed; then, the UV information corresponding to each pixel in the texture map is subjected to at least two random function calculations to obtain a plurality of reference parameters corresponding to each pixel; then, based on the UV information of each pixel and the corresponding plurality of reference parameters, a flickering point mask area corresponding to each pixel is generated to obtain a flickering point mask map; finally, the virtual model to be processed is subjected to texture adjustment processing based on the flickering point mask map to obtain a target virtual model with a flickering point effect. In the embodiment of the present application, a plurality of random reference parameters are constructed based on the UV information of the texture map of the virtual model, and a flickering point mask map with a plurality of random flickering points is generated based on the plurality of reference parameters, so that the texture of the virtual model is adjusted based on the flickering point mask map to realize the flickering point effect for the virtual model, which can effectively ensure the clarity and richness of the flickering point effect, and can also effectively simplify the steps for making the flickering point effect, realize the programming of the flickering point effect, and improve the efficiency of making the flickering point effect in the virtual model.
[0102] This embodiment also provides a virtual model processing device, which can be integrated into a terminal device. Fig.13 As shown, the processing device of the virtual model may include:
[0103] An acquisition unit 201 is used to acquire a texture map of a virtual model to be processed;
[0104] The first processing unit 202 is used to perform at least two random function calculation processes on UV information corresponding to each pixel point in the texture map to obtain multiple reference parameters corresponding to each pixel point;
[0105] A generating unit 203 is used to generate a scintillation point mask area corresponding to each pixel point based on the UV information of each pixel point and a corresponding plurality of reference parameters to obtain a scintillation point mask image;
[0106] The second processing unit 204 is configured to perform texture adjustment processing on the virtual model to be processed based on the scintillation point mask image to obtain a target virtual model with a scintillation point effect.
[0107] In some embodiments, the processing device of the virtual model includes a processing subunit, which is used to:
[0108] Based on a plurality of preset random functions, random function calculation processing is performed on UV information corresponding to each pixel point in the texture map to obtain a plurality of grayscale grids corresponding to each pixel point, wherein one grayscale grid is associated with one grayscale information.
[0109] In some embodiments, the processing device of the virtual model includes a processing subunit, which is used to:
[0110] Determine at least one shape parameter of a flickering point of a specified shape corresponding to each pixel point based on the grayscale information of a plurality of grayscale grids corresponding to each pixel point;
[0111] Based on the UV information of each pixel point and at least one corresponding shape parameter, a scintillation point mask area corresponding to each pixel point is generated to obtain a scintillation point mask image.
[0112] In some embodiments, the processing device of the virtual model includes a processing subunit, which is used to:
[0113] If the specified shape of the flashing point is a circle, the target circle center parameter is determined based on the first grayscale information of the first grayscale grid and the second grayscale information of the second grayscale grid, and the target radius parameter is determined based on the third grayscale information of the third grayscale grid.
[0114] In some embodiments, the processing device of the virtual model includes a processing subunit, which is used to:
[0115] Based on the target radius parameter of the pixel point and the corresponding UV information, a center offset parameter of the scintillation point is determined, wherein the center offset parameter is used to display the center position of the circular scintillation point.
[0116] In some embodiments, the processing device of the virtual model includes a processing subunit, which is used to:
[0117] Adjusting the material map of the virtual model to be processed based on the flickering point mask map to obtain a target material map with flickering points;
[0118] The texture of the virtual model to be processed is adjusted based on the target material map to obtain a target virtual model with a flashing point effect.
[0119] In some embodiments, the processing device of the virtual model includes a processing subunit, which is used to:
[0120] Acquire the highlight area and the non-highlight area of the virtual model to be processed;
[0121] generating a first density parameter based on the highlight area, and generating a second density parameter based on the non-highlight area;
[0122] Based on the first density parameter, the density of the flickering points in the area corresponding to the highlight area in the flickering point mask image is adjusted; and based on the second density parameter, the density of the flickering points in the area corresponding to the non-highlight area in the flickering point mask image is adjusted to obtain an adjusted flickering point mask image.
[0123] In some embodiments, the processing device of the virtual model includes a processing subunit, which is used to:
[0124] Determine a target grayscale grid from the plurality of grayscale grids, and generate brightness control information based on target grayscale information of the target grayscale grid;
[0125] A target flicker point is determined from the flicker point mask map based on the brightness control information, and a current brightness of the target flicker point is adjusted according to the brightness control information to obtain an adjusted flicker point mask map.
[0126] In some embodiments, the processing device of the virtual model includes a processing subunit, which is used to:
[0127] Acquire a preset hue diagram, wherein the preset hue diagram includes at least one type of color type information;
[0128] Based on the grayscale information of each pixel in the flickering point mask image, the preset hue image is randomly sampled to determine a color type for each flickering point in the flickering point mask image, thereby obtaining an adjusted flickering point mask image.
[0129] In some embodiments, the processing device of the virtual model includes a processing subunit, which is used to:
[0130] The texture adjustment process is performed on the virtual model to be processed based on the adjusted scintillation point mask image to obtain a target virtual model with the adjusted scintillation point effect.
[0131] In some embodiments, the processing device of the virtual model includes a processing subunit, which is used to:
[0132] Obtaining a target shape of a scintillation point of a scintillation point mask image to be generated;
[0133] Based on the number of shape parameters required for the target shape, the number of reference parameters that need to be generated for each pixel point is determined to determine the number of times the random function calculation process is performed.
[0134] The embodiment of the present application discloses a processing device for a virtual model, wherein the texture map of the virtual model to be processed is obtained by an acquisition unit 201; the first processing unit 202 performs at least two random function calculations on the UV information corresponding to each pixel in the texture map to obtain multiple reference parameters corresponding to each pixel; the generation unit 203 generates a scintillation point mask area corresponding to each pixel based on the UV information of each pixel and the corresponding multiple reference parameters to obtain a scintillation point mask map; the second processing unit 204 performs texture adjustment processing on the virtual model to be processed based on the scintillation point mask map to obtain a target virtual model with a scintillation point effect. In the embodiment of the present application, multiple random reference parameters are constructed based on the UV information of the texture map of the virtual model, and then a scintillation point mask map with multiple random scintillation points is generated based on the multiple reference parameters, so that the texture adjustment processing is performed on the virtual model based on the scintillation point mask map to realize the scintillation point effect for the virtual model, which can effectively ensure the clarity and richness of the scintillation point effect, and can also effectively simplify the production steps of the scintillation point effect, realize the programming of the scintillation point effect production, and improve the production efficiency of the scintillation point effect in the virtual model.
[0135] Accordingly, an embodiment of the present application further provides an electronic device, which may be a terminal, and the terminal may be a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA) and other terminal devices. Alternatively, the electronic device may be a server.
[0136] like Fig.14 As shown, Fig.14A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 300 includes a processor 301 having one or more processing cores, a memory 302 having one or more computer-readable storage media, and a computer program stored in the memory 302 and executable on the processor. The processor 301 is electrically connected to the memory 302. Those skilled in the art will appreciate that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or arrange components differently.
[0137] The processor 301 is the control center of the electronic device 300. It uses various interfaces and lines to connect various parts of the entire electronic device 300, and executes various functions and processes data of the electronic device 300 by running or loading software programs and / or units stored in the memory 302, and calling data stored in the memory 302, so as to monitor the electronic device 300 as a whole. The processor 301 can be a central processing unit CPU, a graphics processing unit GPU, a network processor (Network Processor, NP), etc., and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application.
[0138] In the embodiment of the present application, the processor 301 in the electronic device 300 will load instructions corresponding to the processes of one or more application programs into the memory 302 according to the following steps, and the processor 301 will run the application programs stored in the memory 302 to implement various functions, such as:
[0139] Obtaining a texture map of the virtual model to be processed;
[0140] Perform at least two random function calculations on UV information corresponding to each pixel in the texture map to obtain a plurality of reference parameters corresponding to each pixel;
[0141] Based on the UV information of each pixel point and the corresponding multiple reference parameters, a scintillation point mask area corresponding to each pixel point is generated to obtain a scintillation point mask image;
[0142] The texture adjustment process is performed on the virtual model to be processed based on the flickering point mask image to obtain a target virtual model with a flickering point effect.
[0143] The electronic device provided in the embodiment of the present application can obtain the texture map of the virtual model to be processed; then, the UV information corresponding to each pixel in the texture map is subjected to at least two random function calculations to obtain multiple reference parameters corresponding to each pixel; then, based on the UV information of each pixel and the corresponding multiple reference parameters, a flickering point mask area corresponding to each pixel is generated to obtain a flickering point mask map; finally, the virtual model to be processed is texture adjusted based on the flickering point mask map to obtain a target virtual model with a flickering point effect. In the embodiment of the present application, multiple random reference parameters are constructed based on the UV information of the texture map of the virtual model, and then a flickering point mask map with multiple random flickering points is generated based on the multiple reference parameters, so that the virtual model is texture adjusted based on the flickering point mask map to realize the flickering point effect for the virtual model, which can effectively ensure the clarity and richness of the flickering point effect, and can also effectively simplify the production steps of the flickering point effect, realize the programming of the flickering point effect production, and improve the production efficiency of the flickering point effect in the virtual model.
[0144] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0145] Optional, such as Fig.14 As shown, the electronic device 300 further includes: a touch screen 303, a radio frequency circuit 304, an audio circuit 305, an input unit 306, and a power supply 307. The processor 301 is electrically connected to the touch screen 303, the radio frequency circuit 304, the audio circuit 305, the input unit 306, and the power supply 307, respectively. Those skilled in the art can understand that Fig.14 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0146] The touch display screen 303 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 303 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, and these graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel can be used to collect the user's touch operation on or near it (such as the user uses any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 301, and can receive the command sent by the processor 301 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 301 to determine the type of touch event, and then the processor 301 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 303 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 303 can also be used as a part of the input unit 306 to realize the input function.
[0147] The radio frequency circuit 304 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other electronic devices through wireless communication, and to send and receive signals with the network device or other electronic devices.
[0148] The audio circuit 305 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 305 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 305 and converted into audio data, and then the audio data is output to the processor 301 for processing, and then sent to another electronic device through the radio frequency circuit 304, or the audio data is output to the memory 302 for further processing. The audio circuit 305 may also include an earplug jack to provide communication between an external headset and the electronic device.
[0149] The input unit 306 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0150] The power supply 307 is used to supply power to various components of the electronic device 300. Optionally, the power supply 307 can be logically connected to the processor 301 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 307 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0151] although Fig.14 Not shown, the electronic device 300 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.
[0152] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0153] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0154] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored, and the computer program can be loaded by a processor to execute any virtual model processing method provided in the embodiment of the present application. The computer program can execute the following steps of the virtual model processing method:
[0155] Obtaining a texture map of the virtual model to be processed;
[0156] Perform at least two random function calculations on UV information corresponding to each pixel in the texture map to obtain a plurality of reference parameters corresponding to each pixel;
[0157] Based on the UV information of each pixel point and the corresponding multiple reference parameters, a scintillation point mask area corresponding to each pixel point is generated to obtain a scintillation point mask image;
[0158] The texture adjustment process is performed on the virtual model to be processed based on the flickering point mask image to obtain a target virtual model with a flickering point effect.
[0159] Due to the computer program stored in the storage medium, the texture map of the virtual model to be processed can be obtained; then, the UV information corresponding to each pixel in the texture map is subjected to at least two random function calculations to obtain multiple reference parameters corresponding to each pixel; then, based on the UV information of each pixel and the corresponding multiple reference parameters, a flickering point mask area corresponding to each pixel is generated to obtain a flickering point mask map; finally, the virtual model to be processed is texture adjusted based on the flickering point mask map to obtain a target virtual model with a flickering point effect. In an embodiment of the present application, multiple random reference parameters are constructed based on the UV information of the texture map of the virtual model, and a flickering point mask map with multiple random flickering points is generated based on the multiple reference parameters, so that the virtual model is texture adjusted based on the flickering point mask map to achieve the flickering point effect for the virtual model, which can effectively ensure the clarity and richness of the flickering point effect, and can also effectively simplify the production steps of the flickering point effect, realize the programming of the flickering point effect production, and improve the production efficiency of the flickering point effect in the virtual model.
[0160] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0161] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0162] Since the computer program stored in the computer-readable storage medium can execute any virtual model processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any virtual model processing method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0163] According to one aspect of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the methods provided in various optional implementations of the above embodiments.
[0164] In the above-mentioned virtual model processing device, computer-readable storage medium, electronic device, and computer program product embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process and beneficial effects of the above-mentioned virtual model processing device, computer-readable storage medium, computer program product, electronic device and its corresponding units can refer to the description of the virtual model processing method in the above embodiment, and will not be repeated here.
[0165] The above is a detailed introduction to a virtual model processing method, device, electronic device, computer-readable storage medium and computer program product provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for processing a virtual model, characterized in that: include: Obtaining a texture map of the virtual model to be processed; Perform at least two random function calculations on UV information corresponding to each pixel in the texture map to obtain a plurality of reference parameters corresponding to each pixel; Based on the UV information of each pixel point and the corresponding multiple reference parameters, a scintillation point mask area corresponding to each pixel point is generated to obtain a scintillation point mask image; The texture adjustment process is performed on the virtual model to be processed based on the flickering point mask image to obtain a target virtual model with a flickering point effect.
2. The method according to claim 1, characterized in that The UV information corresponding to each pixel point in the texture map is subjected to at least two random function calculation processes to obtain a plurality of reference parameters corresponding to each pixel point, including: Based on a plurality of preset random functions, random function calculation processing is performed on UV information corresponding to each pixel point in the texture map to obtain a plurality of grayscale grids corresponding to each pixel point, wherein one grayscale grid is associated with one grayscale information.
3. The method according to claim 2, characterized in that The method of generating a scintillation point mask area corresponding to each pixel point based on the UV information of each pixel point and a corresponding plurality of reference parameters to obtain a scintillation point mask image includes: Determine at least one shape parameter of a flickering point of a specified shape corresponding to each pixel point based on the grayscale information of a plurality of grayscale grids corresponding to each pixel point; Based on the UV information of each pixel point and at least one corresponding shape parameter, a scintillation point mask area corresponding to each pixel point is generated to obtain a scintillation point mask image.
4. The method according to claim 3, characterized in that The grayscale grids include a first grayscale grid, a second grayscale grid and a third grayscale grid, and each grayscale grid corresponds to different grayscale information; The step of determining at least one shape parameter of a flickering point of a specified shape corresponding to each pixel point based on the grayscale information of the plurality of grayscale grids corresponding to each pixel point comprises: If the specified shape of the flashing point is a circle, the target circle center parameter is determined based on the first grayscale information of the first grayscale grid and the second grayscale information of the second grayscale grid, and the target radius parameter is determined based on the third grayscale information of the third grayscale grid.
5. The method according to claim 4, characterized in that The method further comprises: Based on the target radius parameter of the pixel point and the corresponding UV information, a center offset parameter of the scintillation point is determined, wherein the center offset parameter is used to display the center position of the circular scintillation point.
6. The method according to claim 1, characterized in that The step of performing texture adjustment processing on the virtual model to be processed based on the scintillation point mask image to obtain a target virtual model with a scintillation point effect includes: Adjusting the material map of the virtual model to be processed based on the flickering point mask map to obtain a target material map with flickering points; The texture of the virtual model to be processed is adjusted based on the target material map to obtain a target virtual model with a flashing point effect.
7. The method according to claim 1, characterized in that After generating a scintillation point mask area corresponding to each pixel point based on the UV information of each pixel point and a corresponding plurality of reference parameters to obtain a scintillation point mask image, the method further includes: Acquire the highlight area and the non-highlight area of the virtual model to be processed; generating a first density parameter based on the highlight area, and generating a second density parameter based on the non-highlight area; Based on the first density parameter, the density of the flickering points in the area corresponding to the highlight area in the flickering point mask image is adjusted; and based on the second density parameter, the density of the flickering points in the area corresponding to the non-highlight area in the flickering point mask image is adjusted to obtain an adjusted flickering point mask image.
8. The method according to claim 2, characterized in that: After generating a scintillation point mask area corresponding to each pixel point based on the UV information of each pixel point and the corresponding multiple reference parameters to obtain a scintillation point mask image, the method further includes: Determine a target grayscale grid from the plurality of grayscale grids, and generate brightness control information based on target grayscale information of the target grayscale grid; A target flicker point is determined from the flicker point mask map based on the brightness control information, and a current brightness of the target flicker point is adjusted according to the brightness control information to obtain an adjusted flicker point mask map.
9. The method according to claim 2, characterized in that: After generating a scintillation point mask area corresponding to each pixel point based on the UV information of each pixel point and a corresponding plurality of reference parameters to obtain a scintillation point mask image, the method further includes: Acquire a preset hue diagram, wherein the preset hue diagram includes at least one type of color type information; Based on the grayscale information of each pixel in the flickering point mask image, the preset hue image is randomly sampled to determine a color type for each flickering point in the flickering point mask image, thereby obtaining an adjusted flickering point mask image.
10. The method according to any one of claims 7 to 9, characterized in that: The method further comprises: The texture adjustment process is performed on the virtual model to be processed based on the adjusted scintillation point mask image to obtain a target virtual model with the adjusted scintillation point effect.
11. The method according to claim 2, characterized in that Before performing at least two random function calculation processes on UV information corresponding to each pixel point in the texture map to obtain a plurality of reference parameters corresponding to each pixel point, the method further includes: Obtaining a target shape of a scintillation point of a scintillation point mask image to be generated; Based on the number of shape parameters required for the target shape, the number of reference parameters that need to be generated for each pixel point is determined to determine the number of times the random function calculation process is performed.
12. A virtual model processing device, characterized in that: include: An acquisition unit, used for acquiring a texture map of a virtual model to be processed; A first processing unit is used to perform at least two random function calculation processes on UV information corresponding to each pixel point in the texture map to obtain multiple reference parameters corresponding to each pixel point; A generating unit, configured to generate a scintillation point mask area corresponding to each pixel point based on UV information of each pixel point and a corresponding plurality of reference parameters, so as to obtain a scintillation point mask image; The second processing unit is used to perform texture adjustment processing on the virtual model to be processed based on the scintillation point mask image to obtain a target virtual model with a scintillation point effect.
13. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the virtual model processing 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 plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps of the virtual model processing method according to any one of claims 1 to 11.
