Virtual object special effects processing method, device and computer equipment
By comparing the vertex pixel coordinates and ablation dynamic thresholds of the virtual object model, combining dynamic control parameters and noise processing, the ideal ablation special effect of the virtual object in the dissolution direction is achieved, solving the problem of unsatisfactory ablation effect in the existing technology, and improving the gaming experience.
Patent Information
- Application Number
- CN202211390772.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-07
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2042-11-07
AI Technical Summary
The prior art has poor results when realizing the ablation effect of virtual objects, which affects the experience of gamers.
By obtaining the first coordinate values of each vertex pixel of the virtual object model, comparing it with the ablation dynamic threshold value on the corresponding coordinate axis, obtaining the ablation edge value, and combining dynamic control parameters and edge noise, the special effect processing parameters are obtained, and special effect rendering is performed through the chip shader to realize the ablation special effect of the virtual object in the dissolution direction.
It realizes more ideal and rich ablation effects of virtual objects in the dissolution direction, improving the experience of gamers.
Smart Images

Figure CN115797528B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing applications, and in particular to a method, device and computer equipment for special effects processing of virtual objects. Background Art
[0002] In animation applications such as games, the Shader graphical programming tool in the Unity engine is usually used to render virtual objects in the application scene to achieve the ablation effect of virtual objects in scenes such as game character death and map burning caused by application operations. For example, after a game monster dies, it starts to disappear from a certain position until it spreads to the whole body, achieving an ablation effect similar to a burning phenomenon, etc., thereby meeting the game operation effect display requirements and enhancing the player's immersion and fun in playing the game.
[0003] Currently, in order to achieve the ablation effect of virtual objects, Unity Shader starts by controlling the specific edges of the three-dimensional model of the virtual object, controlling its transparency from dark to light to zero, to achieve the effect of the virtual object disappearing. However, the ablation effect achieved by this special effects processing method is not ideal, which affects the game player experience. Summary of the invention
[0004] In order to solve the above technical problems, the embodiments of the present application provide the following technical solutions:
[0005] On the one hand, the present application proposes a special effects processing method for a virtual object, the method comprising:
[0006] Obtaining an ablation special effect processing request for a virtual object model; the ablation special effect processing request includes at least one dissolving direction for the virtual object model;
[0007] In response to the ablation special effect processing request, obtaining a first coordinate value of each vertex pixel of the virtual object model; the first coordinate value refers to a coordinate value on a coordinate axis consistent with the dissolving direction;
[0008] According to the comparison result between the first coordinate value and the ablation dynamic threshold on the corresponding coordinate axis, the ablation edge value of the corresponding vertex pixel is obtained; the magnitude of the ablation edge value can represent the ablation degree of the corresponding pixel point on the object map, and the ablation dynamic threshold can change with the increase of ablation time;
[0009] The ablation edge value, the first dynamic control parameter and the edge noise of the virtual object model are processed to obtain a first special effect processing parameter corresponding to the dissolving direction; the first dynamic control parameter is used to control the ablation degree of the corresponding vertex pixel in the dissolving direction;
[0010] The first special effect processing parameter, the preset ablation threshold, the special effect background map and the vertex data output by the vertex shader are rendered with special effects through a fragment shader, so that the virtual object displays an ablation effect in the dissolving direction; the special effect background map is obtained by object mapping the virtual object model.
[0011] Optionally, obtaining the ablation edge value of the corresponding vertex pixel according to the comparison result between the first coordinate value and the ablation dynamic threshold on the corresponding coordinate axis includes:
[0012] Starting from the first vertex pixel in the dissolving direction, comparing the first coordinate value of each vertex pixel with the ablation dynamic threshold, to obtain the ablation edge value of the vertex pixel corresponding to the current ablation moment;
[0013] According to the preset rules, the ablation dynamic threshold corresponding to the next ablation moment is obtained;
[0014] The first coordinate value of each vertex pixel is compared with the ablation dynamic threshold corresponding to the next ablation moment to obtain the ablation edge value of the vertex pixel corresponding to the next ablation moment, until the ablation of the last vertex pixel in the dissolving direction is completed.
[0015] Optionally, obtaining the ablation dynamic threshold corresponding to the next ablation moment according to a preset rule includes:
[0016] Obtain a first maximum coordinate value and a first minimum coordinate value of each vertex pixel of the object map of the virtual object model in the dissolving direction;
[0017] By interpolation, the ablation dynamic threshold corresponding to the ablation moment is sequentially obtained within the range from the first maximum coordinate value to the first minimum coordinate value.
[0018] Optionally, the processing of the ablation edge value, the first dynamic control parameter, and the edge noise of the virtual object model to obtain a first special effect processing parameter corresponding to the dissolution direction includes:
[0019] obtaining a first dynamic control parameter for the virtual object model in the dissolving direction;
[0020] Acquire random noise, perform pixel chromaticity shift processing on the random noise, and obtain edge noise of an object map for a virtual object model;
[0021] Adding the first dynamic control parameter and the edge noise to obtain an edge control parameter;
[0022] The edge control parameter and the ablation edge value are processed according to a step function, and the processing result is reversely processed to obtain a first special effect processing parameter corresponding to the dissolving direction.
[0023] Optionally, the process of acquiring the vertex data output by the vertex shader includes:
[0024] Obtaining disturbance noise of vertex coordinates of each vertex pixel of the virtual object model;
[0025] Using the disturbance noise to perform disturbance processing on the coordinate values of the vertex coordinates to obtain disturbed vertex coordinates;
[0026] According to the ablation control parameter, linear interpolation is performed between the original vertex coordinates and the interference vertex coordinates to obtain the target vertex coordinates; the ablation control parameter is obtained at least according to the first dynamic control parameter;
[0027] The target vertex coordinates are processed by a vertex shader to obtain vertex data that can represent the target display position in the target space.
[0028] Optionally, obtaining an ablation control parameter at least according to the first dynamic control parameter includes:
[0029] The first dynamic control parameter and the preset edge color gradient control parameter are fused to obtain an edge control parameter;
[0030] A smooth step operation is performed on the edge control parameter, the first dynamic control parameter and the first coordinate value to obtain an ablation control parameter in the dissolution direction.
[0031] On the other hand, the present application also proposes a special effects processing device for a virtual object, the device comprising:
[0032] An ablation special effect processing request obtaining module, used to obtain an ablation special effect processing request for a virtual object model; the ablation special effect processing request includes at least one dissolving direction for the virtual object model;
[0033] A first coordinate value obtaining module is used to respond to the ablation special effect processing request and obtain a first coordinate value of each vertex pixel of the virtual object model; the first coordinate value refers to a coordinate value on a coordinate axis consistent with the dissolving direction;
[0034] an ablation edge value obtaining module, configured to obtain an ablation edge value of a corresponding vertex pixel according to a comparison result between the first coordinate value and an ablation dynamic threshold on a corresponding coordinate axis; the magnitude of the ablation edge value can represent the ablation degree of the corresponding pixel point on the object map, and the ablation dynamic threshold can change with the increase of ablation time;
[0035] A first special effect processing parameter obtaining module is used to process the ablation edge value, the first dynamic control parameter and the edge noise of the virtual object model to obtain a first special effect processing parameter corresponding to the dissolution direction; the first dynamic control parameter is used to control the ablation degree of the corresponding vertex pixel in the dissolution direction;
[0036] A special effects rendering module is used to perform special effects rendering on the first special effects processing parameter, a preset ablation threshold, a special effects background map and vertex data output by a vertex shader through a fragment shader, so that the virtual object displays an ablation special effect in the dissolution direction; the special effects background map is obtained by object mapping the virtual object model.
[0037] Optionally, the ablation edge value obtaining module includes:
[0038] A first comparison unit is used to compare the first coordinate value of each vertex pixel with the ablation dynamic threshold starting from the first vertex pixel in the dissolving direction to obtain the ablation edge value of the vertex pixel corresponding to the current ablation moment;
[0039] An ablation dynamic threshold obtaining unit, used to obtain the ablation dynamic threshold corresponding to the next ablation moment according to a preset rule;
[0040] The second comparison unit is used to compare the first coordinate value of each vertex pixel with the ablation dynamic threshold corresponding to the next ablation moment to obtain the ablation edge value of the vertex pixel corresponding to the next ablation moment until the ablation of the last vertex pixel in the dissolving direction is completed.
[0041] Optionally, the ablation dynamic threshold obtaining unit includes:
[0042] A coordinate value acquisition unit, used for acquiring a first maximum coordinate value and a first minimum coordinate value of each vertex pixel of the object map of the virtual object model in the dissolving direction;
[0043] The interpolation obtaining unit is used to sequentially obtain the ablation dynamic threshold corresponding to the ablation moment in the range from the first maximum coordinate value to the first minimum coordinate value by interpolation.
[0044] On the other hand, the present application also proposes a computer device, the computer device comprising:
[0045] Communication module;
[0046] A memory, used to store a program of the special effect processing method of the virtual object as described above;
[0047] The processor is used to load and execute the program stored in the memory to implement the steps of the special effect processing method of the virtual object as described above.
[0048] On the other hand, the present application further proposes a computer-readable storage medium on which a computer program is stored, characterized in that the computer program is loaded and executed by a processor to implement the special effects processing method of the virtual object as described above.
[0049] It can be seen that based on the above technical solution, after the present application obtains an ablation special effect processing request including at least one dissolving direction of the virtual object model, the first coordinate value of each vertex pixel of the virtual object model on the coordinate axis consistent with the dissolving direction can be obtained, and the ablation dynamic threshold corresponding to each ablation moment is compared with the first coordinate value of the vertex pixel to determine the ablation edge value of the vertex pixel. After that, the ablation edge value, the first dynamic control parameter and the edge noise for the virtual object model are processed to obtain the first special effect processing parameter in the corresponding dissolving direction, so as to perform special effect rendering on the first special effect processing parameter, the preset ablation threshold, the special effect background image and the vertex data output by the vertex shader through the fragment shader, so that the virtual object displays the ablation special effect in the dissolving direction, enriching the ablation special effect display effect of different virtual objects. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0051] Figure 1 A schematic diagram of the hardware structure of an optional example of a computer device applicable to the special effects processing method for virtual objects proposed in this application;
[0052] Figure 2 A schematic diagram of the hardware structure of another optional example of a computer device applicable to the special effects processing method for virtual objects proposed in this application;
[0053] Figure 3 A flowchart diagram of an optional example of a special effect processing method for a virtual object proposed in this application;
[0054] Figure 4 A schematic diagram of the Unity Shader Graph creation process for the special effects processing method for virtual objects proposed in this application;
[0055] Figure 5A schematic diagram of a dynamic acquisition process of the ablation edge value of each pixel in the special effects processing method for virtual objects proposed in this application;
[0056] Figure 6 A schematic diagram of a dynamic control parameter acquisition process in a special effect processing method for a virtual object proposed in the present application;
[0057] Figure 7 A schematic diagram of a method for obtaining edge noise in a special effects processing method for a virtual object proposed in the present application;
[0058] Figure 8 A schematic diagram of a method for obtaining special effect processing parameters in the special effect processing method for virtual objects proposed in this application;
[0059] Fig. 9 A schematic diagram of a method for obtaining edge gradient color in a special effects processing method for virtual objects proposed in this application;
[0060] Fig.10 A schematic diagram of a special effects background image and a special effects rendering process applicable to the special effects processing method for virtual objects proposed in this application;
[0061] Fig.11 A flowchart diagram of another optional example of the special effects processing method for virtual objects proposed in this application;
[0062] Fig.12 A flowchart diagram of another optional example of the special effects processing method for virtual objects proposed in this application;
[0063] Fig.13 A schematic diagram of a vertex perturbation process in a special effects processing method for a virtual object proposed in this application;
[0064] Fig.14 A schematic diagram of a vertex data acquisition method applicable to the special effects processing method for virtual objects proposed in this application;
[0065] Fig.15 This is a schematic structural diagram of an optional example of a special effects processing device for a virtual object proposed in this application. DETAILED DESCRIPTION
[0066] Regarding the description in the background technology section, in the rendering of scenes such as the death of game characters and the burning of maps, it is hoped that the three-dimensional model of the corresponding virtual object will disappear through corrosion and ablation, while allowing particles to appear and dissipate in the form of a model, turning into an effect of ash particles dissipating. This allows the virtual object to slowly disappear in the form of dissolution starting from either end edge of a complete state; and in the process of summoning game characters, scene environment changes, etc., it is possible to start from either end edge of the desired virtual object, and slowly emerge as an entity from zero in the form of particles until the entire model is displayed.
[0067] Among them, in the process of ablation display and hiding, the effect achieved by the transparency control method of Unity Shader cannot reflect the ablation process, which affects the special effect display effect of the virtual object. Therefore, this application proposes to reflect the ablation effect in the form of particles from either edge. In this regard, this application proposes to use Alpha Clip to cut the three-dimensional model of the virtual object, make a layer of random noise at the cut to control Alpha Clip, and use random noise to disturb the edge of the ablation area from either end, so as to mix a color, that is, the transition color between the ablation area and the non-ablation area, so that the ablated virtual object model fragments are scattered as ashes, that is, the ablation effect is reflected in the form of particles from any edge, and in the ablation process, the color of the particles can also be superimposed with gradient colors, which can better meet the different special effect display effects, enrich the special effect display method, and improve the player's immersion.
[0068] In the above-mentioned virtual object rendering process, the model construction and special effects realization process of different virtual objects can be based on but not limited to the graphics processing technology included in artificial intelligence (AI), machine learning (ML) / deep learning technology, image recognition and processing in computer vision technology (CV), three-dimensional object reconstruction, three-dimensional technology, etc. This application does not elaborate on the three-dimensional model construction and rendering realization process of virtual objects. According to application requirements, the rendering efficiency and reliability can be improved in combination with appropriate artificial intelligence technology.
[0069] 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, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0070] Reference Figure 1, is a hardware structure diagram of an optional example of a computer device applicable to the special effects processing method of virtual objects proposed in this application. Combined with the above analysis, the computer device can be a server and / or an electronic device. The server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server supporting cloud computing services. The server can be directly or indirectly connected to electronic devices such as smart phones, tablet computers, laptops, desktop computers, netbooks, etc. through wired or wireless communication to meet the data interaction requirements between the electronic devices and the server. The specific communication connection method can be determined according to the situation.
[0071] like Figure 1 As shown, the computer device proposed in the embodiment of the present application may include but is not limited to: a communication module 11, a memory 12 and a processor 13, wherein:
[0072] The number of each of the communication module 11, the memory 12 and the processor 13 can be at least one, and the communication module 11, the memory 12 and the processor 13 can all be connected to a communication bus to achieve data communication between each other. The specific communication process may depend on the situation.
[0073] The communication module 11 may include a GSM module, a GPRS module, a WIFI module, and / or communication modules for implementing other wireless communication networks or wired communication networks, etc. It may also include communication modules such as USB interface, serial / parallel port, etc. to realize data transmission between the internal components of the computer device. The present application does not limit the type and number of communication modules contained in the computer device, which can be determined according to the data communication requirements in the application scenario. This embodiment will not be described in detail one by one.
[0074] The memory 12 can be used to store a program for implementing the special effects processing method for virtual objects proposed in the present application, and the processor 13 can be used to load and execute the program stored in the memory 12 to implement the various steps of the special effects processing method for virtual objects proposed in the embodiment of the present application. The specific implementation process can refer to but is not limited to the description of the corresponding part of the method embodiment below, and will not be described in detail here.
[0075] In the embodiment of the present application, the memory 12 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device or other volatile solid-state storage device. The processor 13 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, etc.
[0076] It should be understood that Figure 1 The structure of the computer device shown does not constitute a limitation on the computer device in the embodiment of the present application. In practical applications, the computer device may include Figure 1 For example, if the computer device is an electronic device as listed above, the electronic device may be configured with an application engine that supports the normal operation of the application, such as a game engine. In addition, from the perspective of hardware structure, refer to Figure 2 As shown, the electronic device may also include a display, various input devices, various output devices, an antenna, a power module, a sensor module, etc., which are not listed one by one in this application.
[0077] The following will describe in detail the special effects processing method for virtual objects proposed in the present application from the perspective of a computer device, but is not limited to the implementation methods described in the following embodiments, and for the operations performed by the computer device according to the embodiments of the present application as illustrated in the flowchart in the present application, it can be understood that the previous or subsequent operations are not necessarily performed precisely in order. On the contrary, each step can be processed in reverse order or simultaneously. At the same time, other operations can also be added to these processes, or one or more operations can be removed from these processes. The embodiments of the present application below are not described in detail one by one, but all belong to the protection scope of the technical solution of the present application.
[0078] Reference Figure 3 , is a flowchart of an optional example of a special effect processing method for a virtual object proposed in the present application, the method is applicable to a computer device as described above, such as Figure 3 As shown, the method may include but is not limited to the following steps:
[0079] Step S31, obtaining an ablation special effect processing request for a virtual object model; the ablation special effect processing request includes at least one dissolving direction for the virtual object model;
[0080] In the actual application of this application, the Shader graphical programming tool (i.e., ShaderGraph) in the Unity engine can be used to implement the processing of virtual object model data. In this way, when a virtual object model needs to be processed by ablation special effects, since there is no need to consider the lighting effect, a Unity Shader Graph can be created, such as Figure 4 The following is a schematic diagram of the Unity ShaderGraph creation process. After starting the Shader Graph Editor, you can right-click the Project window in the output editing interface to output the project submenu. After that, you can follow the path Create / Shader / UniversalRender Pipeline / Unlit Shader Graph to trigger the objects in the corresponding menu panel to create an Unlit Shader Graph, but it is not limited to Figure 4 The creation implementation shown.
[0081] Afterwards, the embodiment of the present application can double-click the created Unlit Shader Graph file to open the ShaderGraph editor. Afterwards, the programming function of the Shader Graph editor can be used to complete the special effects processing method of the virtual object proposed in the present application, and obtain the virtual object model data with the processed ablation special effect, which is stored in the created Unlit Shader Graph file. In this way, when the player performs a corresponding operation on the virtual object, the Unlit Shader Graph file can be executed to control the virtual object to present the preset ablation special effect.
[0082] Based on the above analysis, in the editing interface of the Shader Graph editor, you can select the virtual object model that needs special effects processing this time, the type of special effects that need to be displayed (this application takes the ablation special effect of gradual dissolution in the form of particles as an example to illustrate), the dissolution direction of the virtual object to display the ablation special effects process and other model data, click the confirmation button to obtain the ablation special effects processing request for the selected virtual object model. This application does not limit the content of the ablation special effects processing request and the method of obtaining it, which can be determined according to the actual situation.
[0083] Among them, the above-mentioned dissolution direction may include but is not limited to: a straight line direction formed from any direction to the corresponding direction (i.e., the straight line direction obtained by increasing 180°) from top to bottom, from bottom to top, from left to right, from right to left, etc., or it can be a curve direction of a preset curve or a custom curve (which can be determined based on the selected virtual object model structure, etc.). The present application does not impose any restrictions on the ablation path formed by the dissolution direction and its acquisition method, which can be determined according to the circumstances.
[0084] It should be understood that the above-mentioned dissolving direction refers to the process in which the selected virtual object displays the ablation special effect, starting from the edge of a certain direction or multiple directions of the virtual object, and gradually dissolving in the form of particles in a certain direction until the virtual object disappears. It can be seen that the dissolving directions selected for different virtual object models are different, and the special effects display effect of gradually dissolving in the form of particles starting from the corresponding edges will also be different. The ablation special effect that the virtual object model needs to display can be flexibly selected by one or more dissolving directions, thereby realizing the directional dissolution of the virtual object model. It can be seen that, compared with the processing method of ablating each virtual object from a fixed edge, the directional ablation processing method proposed in the present application realizes the personalized display of ablation special effects of different virtual objects and improves the display effect of ablation special effects of different virtual objects.
[0085] Step S32, in response to the ablation special effect processing request, obtaining a first coordinate value of each vertex pixel of the virtual object model;
[0086] In practical applications, a virtual object model usually includes a set of triangular faces, each of which is composed of three vertices. Each vertex usually includes vertex data such as vertex position and normal / tangent texture coordinates, so that the vertex data can be processed later and combined with other model data to render the virtual object.
[0087] Therefore, according to the method described above, in the scenario where the ablation effect of the virtual object model in the dissolving direction needs to be obtained, the virtual object model is cut to determine the vertex coordinates at the cut, such as Figure 5 As shown, the virtual object model can be processed by the Position node to obtain the vertex coordinates of each vertex pixel. The vertex coordinates are usually (x, y, z) three-dimensional coordinates in the world coordinate system, and can also include normals, colors and texture coordinates as needed. This application does not limit the coordinate attributes contained in the vertex coordinates, which can be determined according to the circumstances.
[0088] Afterwards, for the selected dissolving direction of the virtual object model, the first coordinate value of the corresponding component can be extracted from each vertex coordinate. Taking the dissolving direction from top to bottom as an example, the vertex coordinates of each vertex pixel obtained can be input into the Split node to separate the components in the vertex coordinates, such as R, G, B and A components. In this embodiment, the G component in RGB, that is, the y coordinate of the vertex coordinate, can be extracted; if the selected dissolving direction is ablation from left to right, according to this component extraction method, the R component, that is, the x coordinate of the vertex coordinate, etc. can be extracted. It can be seen that the dissolving direction pre-selected in the present application is different. The present application can extract the coordinate value on the coordinate axis consistent with the dissolving direction from the multi-dimensional vertex coordinates of each vertex pixel as the first coordinate value to implement subsequent processing.
[0089] It should be noted that this application does not elaborate on the implementation process of the Position node and the Split node in the Shader Graph editor processing the input data.
[0090] Step S33, obtaining an ablation edge value of a corresponding pixel according to a comparison result between the first coordinate value and an ablation dynamic threshold on a corresponding coordinate axis;
[0091] In the embodiment of the present application, the ablation dynamic threshold Start of the vertex pixel on different coordinate axes, i.e., in different dissolution directions, may be different. The initial value is often relatively large and can decrease with the increase of ablation time. The present application does not impose any restrictions on the ablation dynamic threshold corresponding to different dissolution directions at different ablation times.
[0092] Based on this, in order to make the dissolution of the virtual object model directional, the dissolution direction from top to bottom is still used as an example for explanation, and its corresponding ablation dynamic threshold is recorded as StartY. Figure 5 As shown, the first coordinate value of each extracted vertex pixel can be compared with the ablation dynamic threshold. If the first coordinate value is larger than the ablation dynamic threshold, the ablation edge value of the corresponding vertex pixel is larger. Since the size of the ablation edge value (i.e., Edge value) can characterize the ablation degree of the vertex pixel during the ablation process, the larger the ablation edge value, the greater the ablation degree of the corresponding vertex pixel.
[0093] Among them, since the value of the ablation dynamic threshold will decrease with the increase of the ablation time T, before the ablation special effect is displayed, that is, when T=0, since StartY is often relatively large, the first coordinate value of each vertex pixel in the virtual object model is usually less than the StartY of the current ablation moment, so that the ablation edge Edge value of each vertex pixel is zero, then the object map of the virtual object model is not dissolved; as the ablation time T increases from 0, the value of StartY can be decreased according to the preset rule (which can be executed by the Subtract node), and the number of vertex pixels whose first coordinate value is greater than the StartY of the corresponding ablation moment from top to bottom of the object map gradually increases. At the same time, the ablation edge Edge value of the vertex pixels from top to bottom will gradually increase (relative to the ablation edge Edge value of the vertex pixel itself at the previous ablation moment), and the ablation edge Edge value of the top vertex pixel is the largest, and its ablation degree is the largest, thereby realizing the gradual dissolution of the object map of the virtual object model from top to bottom, that is, realizing directional dissolution.
[0094] The process of obtaining the Edge value of the vertex pixel in other dissolution directions is similar to the process of obtaining the Edge value of the vertex pixel from top to bottom described above, and this application does not provide detailed examples one by one. It should be noted that this application does not limit the method for obtaining the dynamic threshold of the ablation of the vertex pixel in the ablation process of different dissolution directions. Figure 5 As shown, for the object map of the virtual object model, the first maximum coordinate value (such as Figure 5 Max(1) input coordinate value) and the first minimum coordinate value (such as Figure 5 Then, during the ablation process, starting from the first maximum coordinate value, the StartY corresponding to the ablation moment can be obtained by decreasing the value.
[0095] Step S34, processing the ablation edge value, the first dynamic control parameter and the edge noise of the virtual object model to obtain a first special effect processing parameter corresponding to the dissolving direction;
[0096] In order to dynamically control the degree of ablation of virtual objects, the ablation effects obtained by preview processing usually require setting corresponding dynamic control parameters. For ablation effects presented in different dissolving directions, the values of the set dynamic control parameters may be different, which can be obtained based on the coordinate values on the coordinate axis corresponding to the vertex pixels. This application does not limit the method for obtaining dynamic control parameters. The embodiment of this application still takes the ablation effect of dissolving from top to bottom as an example for explanation, and the corresponding dynamic control parameter is the first dynamic control parameter. The dynamic control parameters corresponding to other dissolving directions may be the second dynamic control parameter or the third dynamic control parameter, etc. This application does not give detailed examples of the acquisition process.
[0097] Based on this, refer to Figure 6 The schematic diagram of the dynamic control parameter acquisition process shown in the figure can create a dissolve node disolve, which is a float node with a value between 0 and 1. 0 can represent no ablation and 1 can represent complete ablation. It can be seen that the value of the disolve node (i.e., the ablation parameter) can represent the degree of ablation and can be converted into the attributes of the corresponding vertex coordinates. The control type can select the slider Slider and output the dissolution parameter (such as Figure 6 The Remap node output parameter is input to the edge of the Smoothstep node (Edge(1)) and the first coordinate value of each vertex pixel (such as the y component of the vertex coordinate) for smoothing steps (such as Figure 6 The Smoothstep node shown in the figure) is processed to obtain the first dynamic control parameter of the corresponding vertex pixel. The specific calculation process is not described in detail in this application.
[0098] Optionally, after obtaining the dynamic control parameters, the edge color gradient of the virtual object model can also be controlled by summing the gradient with the dissolution parameter (e.g. Figure 6 The Add node operation shown in the figure) will obtain the corresponding gradient control parameter (which can be input into Figure 6 The edge Edge (2) end of the Smoothstep node in the middle performs a smooth step with the above-mentioned dynamic control parameters and the first coordinate value to obtain the ablation control parameter of the first coordinate value of the corresponding vertex pixel, which is used to realize subsequent color mixing and vertex perturbation processing.
[0099] For the edge disturbance of the virtual object model, a noise signal can be used to achieve it. For this purpose, the present application can create a noise node to obtain the edge noise for the virtual object model. Figure 7As shown, a Simple Noise node is created, and the V component in UV is offset by the timer Time to achieve disturbance of the edge of the virtual object model. According to actual needs, the multiplication operation Multiply node can be used to weaken the noise signal, etc., to obtain the edge noise of the virtual object model. This application does not elaborate on the method for obtaining the edge noise.
[0100] According to but not limited to the method described above, after obtaining the ablation edge value, the first dynamic control parameter, and multiple model data such as the edge noise of the virtual object model, AlphaClip control can be implemented accordingly, so that the edge particles of the virtual object model are random, in preparation for the subsequent ash scattering effect in the dissolution direction. Figure 8 As shown, the present application can add the edge noise to the first dynamic control parameter (ie, the slider control parameter) (eg Figure 8 The output parameter is input to the In(1) terminal of the Step node, and the ablation edge value of each vertex pixel is input to the Edge(1) terminal of the Step node to perform a Step step. The granular boundary is obtained in the dissolving direction, and the step processing result is reversed ( Figure 8 In the circular diagram in the figure, black indicates transparency and white indicates opaqueness), and the first special effect processing parameter in the dissolving direction is obtained as the AlphaClip input parameter, that is, the Alpha ClipThreshold(1) end of the input fragment. After that, the relationship between this parameter and Alpha (which can be recorded as the preset ablation threshold, usually 0.5) can be used to determine whether the color of the corresponding vertex pixel is discarded and whether the vertex pixel position is hollow.
[0101] Step S35, performing special effect rendering on the first special effect processing parameter, the preset ablation threshold, the special effect background image, and the vertex data output by the vertex shader through the fragment shader, so that the virtual object displays the ablation special effect in the dissolving direction.
[0102] In the embodiment of the present application, the special effect background image can be obtained by processing the object map of the virtual object model, and the specific processing implementation method is not limited. Optionally, since the control parameter for controlling the edge color gradient gradient is combined in the above-mentioned first dynamic control parameter acquisition process, that is, the first dynamic control parameter represents the edge gradient effect, in this way, in the process of obtaining the special effect background image, such as Fig. 9 As shown, the background color of the object map for the virtual object model, such as the color selected by the Color node, can be selected, mixed with the first dynamic control parameter, and then multiplied (such as the multiplication operation of the Multiply node) to obtain an edge gradient color.
[0103] Afterwards, if Fig.10 As shown, the edge gradient color and the object map of the virtual object model can be processed, such as sampling the object map, mixing the sampled image with the edge gradient color to obtain a special effect background image, that is, the edge color of the object map of the virtual object model is gradually changed to enrich the special effect. It should be noted that when the edge color gradient is not required, the edge gradient color acquisition step does not need to be performed in the above process of obtaining the special effect background image. Similarly, in the process of obtaining the above first dynamic control parameter, the control parameter of the edge gradient gradient can also be combined differently. In this way, the first dynamic control parameter that controls the degree of edge ablation can be directly mixed with the sampled image of the object map to obtain the desired special effect background image, that is, the base color Base Color of the fragment shader.
[0104] Among them, Fig.10 As shown, according to the method described above, the obtained first special effect processing parameter, the preset ablation threshold and the special effect background image can be input into the fragment shader (such as Fig.10 The fragment node shown in the figure is combined with the vertex data output by the vertex shader, such as the spatial coordinates of the vertex pixels output on the screen. This application does not describe in detail the method for obtaining the vertex data. The fragment shader renders according to the various data obtained, determines the final color of each vertex pixel in the virtual object model, and makes the virtual object display the ablation effect in the form of particles in the selected dissolution direction. This application does not describe in detail the working principles of the fragment shader and vertex shader.
[0105] In summary, in the embodiments of the present application, when the virtual object is required to display ablation effects in the form of particles, the dissolution direction for displaying the ablation effects can be flexibly selected, and the ablation edge value of each vertex pixel of the virtual object model is obtained in combination with the selected dissolution direction. Thereafter, the first dynamic control parameter for controlling the ablation degree of each vertex pixel in the dissolution direction and the edge noise for realizing edge disturbance are combined to obtain the first special effects processing parameter in the corresponding dissolution direction. In this way, the fragment shader performs special effects rendering on the first special effects processing parameter, the preset ablation threshold, the special effects background map and the vertex data, so that the object map of the virtual object model can be gradually dissolved from the edge in the form of particles according to the dissolution direction, thereby enriching the dissolution special effects display effect of the virtual object.
[0106] Reference Fig.11, which is a flowchart of another optional example of the special effects processing method for virtual objects proposed in this application. This method can be an optional detailed implementation of the special effects processing method for virtual objects proposed above. This embodiment can be a detailed description of the acquisition process of the ablation edge value proposed above. For other execution steps of using the ablation edge value to implement the special effects processing of virtual objects, please refer to the description of the corresponding part of the context, which will not be described in detail in this embodiment. Based on this, refer to Figure 5 The schematic diagram of the process of obtaining the ablation edge value of each vertex pixel is shown in FIG. Fig.11 As shown, the process of obtaining the ablation edge value may include:
[0107] Step S111, starting from the first vertex pixel in the dissolving direction of the selected virtual object model, the first coordinate value of each vertex pixel is compared with the ablation dynamic threshold to obtain the ablation edge value of the corresponding pixel point at the current ablation moment;
[0108] Regarding the process of obtaining the first coordinate value of each vertex pixel, you can refer to the processing process of the Position node and the Split node described above, and you can obtain the coordinates of the coordinate axis in the vertex coordinates of each vertex pixel that are consistent with the selected dissolution direction, such as the coordinate value on the y-axis is recorded as the first coordinate value, or the coordinate value on the x-axis is the second coordinate value, etc. The subsequent processing process of different coordinate components and the ablation special effects processing process in different dissolution directions are similar. This application does not give detailed examples one by one, and still takes the extraction of the first coordinate value as an example for explanation.
[0109] According to the above method, after obtaining the world coordinate position of each vertex pixel, the Edge value can be calculated in ShaderGraph according to the method proposed in this application. Figure 5 As shown, at different ablation moments, the first coordinate value of each vertex pixel of the virtual object model can be compared with the corresponding ablation dynamic threshold to obtain an ablation edge value that can characterize the ablation degree of the vertex pixel at the corresponding ablation moment. The implementation process is not described in detail.
[0110] Step S112, obtaining the ablation dynamic threshold corresponding to the next ablation moment according to a preset rule;
[0111] As the ablation time increases, the ablation dynamic threshold will slowly decrease according to the preset rules. Since the object map of the virtual object model is determined, the coordinate values of each vertex pixel in a certain ablation direction are determined. In this way, in the process of continuously decreasing the ablation dynamic threshold, the number of vertex pixels whose first coordinate values are greater than the ablation dynamic threshold increases, and the difference between the first coordinate value of such vertex pixels and the ablation dynamic threshold also increases, and the ablation degree of the corresponding vertex pixel increases until its color attribute becomes transparent.
[0112] Optionally, the implementation process of step S112 may include but is not limited to: obtaining the first maximum coordinate value and the first minimum coordinate value of each vertex pixel of the object map of the virtual object model in the dissolution direction; obtaining the ablation dynamic threshold corresponding to the ablation moment in sequence from the first maximum coordinate value to the first minimum coordinate value through interpolation, that is, as the ablation time increases, starting from the first maximum coordinate value, the value can be gradually reduced through interpolation to obtain the ablation dynamic threshold at the current ablation moment that is less than the ablation dynamic threshold at the previous ablation moment.
[0113] Exemplarily, the dissolving direction from top to bottom is used as an example for explanation. Assuming that the object map of the virtual object model is a square image with a height of 4, the top pixel position MaxY (i.e., the first maximum coordinate value) of the object map = the center position of the image (transform.position.Y) + half of the image height (i.e., 2). Similarly, the end pixel position MinY (i.e., the first minimum coordinate value) of the object map = the center position of the image (transform.position.Y) - half of the image height (i.e., 2). It should be understood that for object maps of other shapes, the maximum and minimum coordinate values in the selected dissolving direction can be calculated according to the corresponding mathematical operation method, and the calculation process is not described in detail one by one in this application.
[0114] Based on this, in the dissolving process from top to bottom within 1 second, the ablation time T can be increased from 0 to 1 second, and the dynamic ablation threshold StartY value can be slowly reduced from MaxY to MinY using the lerp interpolation function, which is equivalent to moving the StartY value from the top position of the object map to the minimum square position. Every time the StartY value moves down a little, that is, every time the StartY value decreases a little, the vertex pixels above the StartY value will slowly become transparent until they all become transparent (i.e. disappear) after moving to the bottom. During this movement process, the higher the vertex pixel position, the higher its transparency, until the transparency reaches 100%, that is, the corresponding vertex pixel disappears.
[0115] Similarly, if the selected dissolution direction is gradual ablation from bottom to top, the process of obtaining the StartY value is similar. The difference is that when the StartY value moves from the bottom of the object map to the top, the StartY value will start from MinY and increase to MaxY. According to the above comparison method, the ablation edge value of each pixel point is dynamically adjusted; when the selected dissolution direction is ablation in the left and right directions, in this scenario, the rightmost pixel position MaxX of the object map (that is, the first maximum coordinate value) can be obtained = the center position of the image (transform.position.X) + half the width of the image (that is, 2); the leftmost pixel position MinX of the object map (that is, the first minimum coordinate value) = the center position of the image (transform.position.X) - half the width of the image (that is, 2). Afterwards, in the ablation process from right to left or from left to right, the StartX at the corresponding moment can be dynamically obtained by interpolation from the currently determined coordinate value variation range. The implementation process is not described in detail in this application.
[0116] It can be seen that when the dissolving direction is from top to bottom or from right to left, during the ablation process of the map object of the virtual object model, the dynamically obtained StartY or StartX will gradually decrease according to the interpolation method; conversely, if the dissolving direction is from bottom to top or from left to right, during the ablation process of the map object of the virtual object model, the dynamically obtained StartY or StartX will gradually decrease. This application does not limit the implementation process of step S112.
[0117] Step S113, comparing the first coordinate value of each vertex pixel with the ablation dynamic threshold corresponding to the next ablation moment, to obtain the ablation edge value of the vertex pixel corresponding to the next ablation moment, until the ablation of the last vertex pixel in the dissolving direction is completed.
[0118] As analyzed above, in order to obtain the ablation effect of the object map of the virtual object model in the selected dissolution direction, that is, to make the ablation of the object map directional, the ablation dynamic threshold corresponding to each ablation moment can be compared with the coordinate value of the corresponding coordinate axis of the vertex pixel to determine the ablation edge value of the vertex pixel. Since the ablation dynamic threshold will change with the increase of ablation time, and the change is related to the dissolution direction, according to this processing method, it can be ensured that the ablation edge value of each vertex pixel of the object map in the dissolution direction gradually increases, and at the same ablation moment, the closer the vertex pixel is to the starting edge position of the dissolution direction, the greater the ablation edge value, which represents the greater degree of dissolution of the vertex pixel at this position, and the earlier it is dissolved and disappears.
[0119] Reference Fig.12, which is a flowchart of another optional example of the special effect processing method for virtual objects proposed in this application, and the method can be described in another optional detailed implementation of the special effect processing method for virtual objects proposed above, such as Fig.12 As shown, the method may include:
[0120] Step S121, obtaining an ablation special effect processing request for the virtual object model; the ablation special effect processing request includes at least one dissolving direction for the virtual object model;
[0121] Step S122, in response to the ablation special effect processing request, obtaining vertex coordinates of each vertex pixel of the virtual object model, and determining a first coordinate value on a coordinate axis consistent with the dissolving direction;
[0122] Step S123, obtaining an ablation edge value of a corresponding pixel according to a comparison result between the first coordinate value and an ablation dynamic threshold on a corresponding coordinate axis;
[0123] Regarding the implementation process of step S121 to step S123, reference may be made to the description of the corresponding part of the above embodiment, including but not limited to Figure 5 The vertex coordinates and the coordinate values on different coordinate axes are separately obtained, and the ablation edge of each vertex pixel is dynamically updated accordingly, so as to obtain the ablation effect with the selected dissolving direction.
[0124] Step S124, obtaining a first dynamic control parameter for the virtual object model in the dissolving direction;
[0125] Step S125, fusing the first dynamic control parameter and the preset edge color gradient control parameter to obtain an edge control parameter;
[0126] Step S126, performing a smoothing step operation on the edge control parameter, the first dynamic control parameter and the first coordinate value to obtain an ablation control parameter in the dissolution direction;
[0127] See above Figure 6 In the processing method shown, in order to dynamically control the degree of ablation, the corresponding first dynamic control parameter can be configured, and then the preset control parameter of the edge color gradient can be configured, and the processing result can be used as the input of the Smoothstep node to achieve the color gradient effect of the edge of the ablation direction of the virtual object model. The implementation process can refer to the description of the corresponding part of the above embodiment, and this embodiment will not be repeated. Among them, the ablation control parameter output by the Smoothstep node can be used as the input parameter of the subsequent color mixing and vertex perturbation processing.
[0128] Step S127, obtaining random noise, performing pixel chromaticity shift processing on the random noise, and obtaining edge noise of an object map for the virtual object model;
[0129] This application proposes to use noise (this application refers to a noise image) to disturb the edge of the object map. For this, Figure 7 As shown, a Simple Noise node is created, and the UV offset is controlled by a timer to obtain the required edge noise. The specific processing implementation process can refer to the description of the corresponding part of the above embodiment, which will not be repeated in this embodiment.
[0130] Step S128, adding the first dynamic control parameter and the edge noise to obtain an edge control parameter;
[0131] Step S129, processing the edge control parameter and the ablation edge value according to the step function, and performing reverse processing on the processing result to obtain the first special effect processing parameter in the corresponding dissolving direction;
[0132] For the implementation process of step S128 and step S129, please refer to Figure 8 The description of the corresponding parts thereof will not be described in detail in this embodiment.
[0133] Step S1210, obtaining disturbance noise of vertex coordinates of each vertex pixel of the virtual object model;
[0134] This application can make a coordinate perturbation effect on the vertices of the area to be ablated in the virtual object model, and construct a coordinate perturbation noise, referring to Fig.13 The vertex coordinate perturbation processing method shown in the figure can use SimpleNoise to perturb the x and y axis coordinate values of the vertex coordinates, and use Gradient Noise to perturb the y axis (taking the ablation direction from the up and down direction as an example, if the ablation direction is the left and right direction, it can be the x axis here) coordinate value, but it is not limited to Fig.13 The vertex coordinate perturbation processing method shown.
[0135] Step S1211, using disturbance noise to perform disturbance processing on the coordinate values of the vertex coordinates to obtain disturbed vertex coordinates;
[0136] Step S1212, performing linear interpolation between the original vertex coordinates and the interference vertex coordinates according to the ablation control parameters to obtain the target vertex coordinates;
[0137] Step S1213, processing the target vertex coordinates through a vertex shader to obtain vertex data that can represent the target display position in the target space;
[0138] Combined with the vertex coordinate acquisition method described in the Position node above, after obtaining the coordinates of each vertex of the virtual object model, such as Fig.14 As shown, the interference noise can be added to the vertex coordinates according to the method described above to obtain the corresponding interference vertex coordinates. After that, linear interpolation can be performed through the slider control (such as the ablation control parameters obtained above) to obtain the target vertex coordinates, which are input to the Position end of the vertex shader Vertex. The target vertex coordinates are transformed in combination with the target space configuration parameters to obtain their display position on the screen, that is, the global space coordinates of the vertex are obtained, which are recorded as vertex data. The working principle of the vertex shader is not described in detail in this application.
[0139] Among them, in the implementation process of the above-mentioned step S1212, in the Lerp function, A is the disturbed vertex coordinate position, B is the undisturbed vertex coordinate position, (T is a time parameter controlled by a progress bar), and the interpolation function expresses the interpolation calculation between A and B to obtain a value between A and B. After real-time calculation, the obtained value can vary between A and B, and finally reflects the effect that all vertices are in an unordered form, and the transparency changes from opaque to completely transparent.
[0140] Step S1214, performing special effect rendering on the first special effect processing parameter, the preset ablation threshold, the special effect background image, and the vertex data output by the vertex shader through the fragment shader, so that the virtual object displays the ablation special effect in the dissolving direction.
[0141] In summary, in the embodiments of the present application, after the fragment shader blows up the input parameters, the final color of each pixel of the object map of the virtual object model can be determined, so that the virtual object displays the ablation effect in the form of particles in the selected dissolution direction, enriching the display effect of the ablation characteristics of different virtual objects and improving the user experience.
[0142] Reference Fig.15 , is a schematic structural diagram of an optional example of a special effect processing device for a virtual object proposed in the present application, and the device may include:
[0143] The ablation special effect processing request obtaining module 151 is used to obtain an ablation special effect processing request for a virtual object model; the ablation special effect processing request includes at least one dissolving direction for the virtual object model;
[0144] A first coordinate value obtaining module 152 is used to respond to the ablation special effect processing request and obtain a first coordinate value of each vertex pixel of the virtual object model; the first coordinate value refers to a coordinate value on a coordinate axis consistent with the dissolving direction;
[0145] an ablation edge value obtaining module 153, configured to obtain an ablation edge value of a corresponding vertex pixel according to a comparison result between the first coordinate value and an ablation dynamic threshold on a corresponding coordinate axis; the magnitude of the ablation edge value can represent the ablation degree of the corresponding pixel point on the object map, and the ablation dynamic threshold can change with the increase of ablation time;
[0146] A first special effect processing parameter obtaining module 154 is used to process the ablation edge value, the first dynamic control parameter and the edge noise of the virtual object model to obtain a first special effect processing parameter corresponding to the dissolving direction; the first dynamic control parameter is used to control the ablation degree of the corresponding vertex pixel in the dissolving direction;
[0147] The special effects rendering module 155 is used to perform special effects rendering on the first special effects processing parameters, the preset ablation threshold, the special effects background map and the vertex data output by the vertex shader through a fragment shader, so that the virtual object displays the ablation special effect in the dissolution direction; the special effects background map is obtained by object mapping of the virtual object model.
[0148] Optionally, the ablation edge value obtaining module 153 may include:
[0149] A first comparison unit is used to compare the first coordinate value of each vertex pixel with the ablation dynamic threshold starting from the first vertex pixel in the dissolving direction to obtain the ablation edge value of the vertex pixel corresponding to the current ablation moment;
[0150] An ablation dynamic threshold obtaining unit, used to obtain the ablation dynamic threshold corresponding to the next ablation moment according to a preset rule;
[0151] The second comparison unit is used to compare the first coordinate value of each vertex pixel with the ablation dynamic threshold corresponding to the next ablation moment to obtain the ablation edge value of the vertex pixel corresponding to the next ablation moment until the ablation of the last vertex pixel in the dissolving direction is completed.
[0152] Optionally, the ablation dynamic threshold obtaining unit may include:
[0153] A coordinate value acquisition unit, used for acquiring a first maximum coordinate value and a first minimum coordinate value of each vertex pixel of the object map of the virtual object model in the dissolving direction;
[0154] The interpolation obtaining unit is used to sequentially obtain the ablation dynamic threshold corresponding to the ablation moment in the range from the first maximum coordinate value to the first minimum coordinate value by interpolation.
[0155] In some embodiments, based on the above, the first special effect processing parameter obtaining module 154 may include:
[0156] A first dynamic control parameter obtaining unit, configured to obtain a first dynamic control parameter for the virtual object model in the dissolving direction;
[0157] An edge noise obtaining unit, used for obtaining random noise, performing pixel chromaticity shift processing on the random noise, and obtaining edge noise of an object map for a virtual object model;
[0158] an edge control parameter obtaining unit, configured to add the first dynamic control parameter and the edge noise to obtain an edge control parameter;
[0159] The special effect processing parameter obtaining unit is used to process the edge control parameter and the ablation edge value according to a step function, and perform reverse processing on the processing result to obtain the first special effect processing parameter corresponding to the dissolving direction.
[0160] Optionally, in order to obtain vertex data output by a vertex shader, the apparatus may further include:
[0161] A disturbance noise obtaining module, used to obtain disturbance noise of vertex coordinates of each vertex pixel of the virtual object model;
[0162] An interference vertex coordinate obtaining module is used to perform a disturbance process on the coordinate values of the vertex coordinates using the disturbance noise to obtain the interference vertex coordinates;
[0163] A target vertex coordinate obtaining module, used for performing linear interpolation between the original vertex coordinates and the interfering vertex coordinates according to an ablation control parameter to obtain the target vertex coordinates; the ablation control parameter is obtained at least according to the first dynamic control parameter;
[0164] The vertex data obtaining module is used to process the target vertex coordinates through a vertex shader to obtain vertex data that can represent the target display position in the target space.
[0165] Optionally, the above device may further include: an ablation control parameter acquisition module, configured to obtain an ablation control parameter at least according to the first dynamic control parameter. In some embodiments, the ablation control parameter acquisition module may include:
[0166] An edge control parameter obtaining unit, used for fusing the first dynamic control parameter with a preset edge color gradient control parameter to obtain an edge control parameter;
[0167] The ablation control parameter obtaining unit is used to perform a smooth step operation on the edge control parameter, the first dynamic control parameter and the first coordinate value to obtain the ablation control parameter in the dissolution direction.
[0168] It should be noted that the various modules, units, etc. in the above-mentioned device embodiments can be stored in the memory as program modules, and the processor executes the above-mentioned program modules stored in the memory to implement the corresponding functions. For the functions implemented by each program module and its combination, as well as the technical effects achieved, please refer to the description of the corresponding parts of the above-mentioned method embodiments, which will not be repeated in this embodiment.
[0169] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. The computer program is loaded and executed by a processor to implement the various steps of the special effects processing method of the virtual object mentioned above. The specific implementation process can refer to the description of the corresponding part of the above embodiment, and this embodiment will not repeat it.
[0170] The present application also proposes a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in various optional implementations of the special effect processing method of the virtual object or the special effect processing device of the virtual object. The specific implementation process can refer to the description of the corresponding embodiment above, and will not be repeated.
[0171] Finally, it should be noted that the various embodiments in this specification are described in a progressive or parallel manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the devices and computer equipment disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part.
[0172] Professionals may further 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 the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design preconditions of the technical solution. Professional and technical personnel may 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.
[0173] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the core idea or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A special effects processing method for a virtual object, characterized in that: The method comprises: Obtaining an ablation special effect processing request for a virtual object model; the ablation special effect processing request includes at least one dissolving direction for the virtual object model; In response to the ablation special effect processing request, obtaining a first coordinate value of each vertex pixel of the virtual object model; the first coordinate value refers to a coordinate value on a coordinate axis consistent with the dissolving direction; According to the comparison result between the first coordinate value and the ablation dynamic threshold on the corresponding coordinate axis, the ablation edge value of the corresponding vertex pixel is obtained; the magnitude of the ablation edge value can represent the ablation degree of the corresponding pixel point on the object map, and the ablation dynamic threshold can change with the increase of ablation time, and the change is related to the dissolution direction; The ablation edge value, the first dynamic control parameter and the edge noise of the virtual object model are processed to obtain a first special effect processing parameter corresponding to the dissolving direction; the first dynamic control parameter is used to control the ablation degree of the corresponding vertex pixel in the dissolving direction; The first special effect processing parameter, the preset ablation threshold, the special effect background map and the vertex data output by the vertex shader are rendered with special effects through a fragment shader, so that the virtual object displays an ablation effect in the dissolving direction; the special effect background map is obtained by object mapping the virtual object model.
2. The method according to claim 1, characterized in that The step of obtaining the ablation edge value of the corresponding vertex pixel according to the comparison result between the first coordinate value and the ablation dynamic threshold on the corresponding coordinate axis includes: Starting from the first vertex pixel in the dissolving direction, comparing the first coordinate value of each vertex pixel with the ablation dynamic threshold, to obtain the ablation edge value of the vertex pixel corresponding to the current ablation moment; According to the preset rules, the ablation dynamic threshold corresponding to the next ablation moment is obtained; The first coordinate value of each vertex pixel is compared with the ablation dynamic threshold corresponding to the next ablation moment to obtain the ablation edge value of the vertex pixel corresponding to the next ablation moment, until the ablation of the last vertex pixel in the dissolving direction is completed.
3. The method according to claim 2, characterized in that The step of obtaining the ablation dynamic threshold corresponding to the next ablation moment according to the preset rule includes: Obtain a first maximum coordinate value and a first minimum coordinate value of each vertex pixel of the object map of the virtual object model in the dissolving direction; By interpolation, the ablation dynamic threshold corresponding to the ablation moment is sequentially obtained within the range from the first maximum coordinate value to the first minimum coordinate value.
4. The method according to any one of claims 1 to 3, characterized in that: The processing of the ablation edge value, the first dynamic control parameter and the edge noise of the virtual object model to obtain the first special effect processing parameter corresponding to the dissolving direction includes: obtaining a first dynamic control parameter for the virtual object model in the dissolving direction; Acquire random noise, perform pixel chromaticity shift processing on the random noise, and obtain edge noise of an object map for a virtual object model; Adding the first dynamic control parameter and the edge noise to obtain an edge control parameter; The edge control parameter and the ablation edge value are processed according to a step function, and the processing result is reversely processed to obtain a first special effect processing parameter corresponding to the dissolving direction.
5. The method according to claim 4, characterized in that The process of obtaining the vertex data output by the vertex shader includes: Obtaining disturbance noise of vertex coordinates of each vertex pixel of the virtual object model; Using the disturbance noise to perform disturbance processing on the coordinate values of the vertex coordinates to obtain disturbed vertex coordinates; According to the ablation control parameter, linear interpolation is performed between the original vertex coordinates and the interference vertex coordinates to obtain the target vertex coordinates; the ablation control parameter is obtained at least according to the first dynamic control parameter; The target vertex coordinates are processed by a vertex shader to obtain vertex data that can represent the target display position in the target space.
6. The method according to claim 5, characterized in that The obtaining of the ablation control parameter at least according to the first dynamic control parameter comprises: The first dynamic control parameter and the preset edge color gradient control parameter are fused to obtain an edge control parameter; A smooth step operation is performed on the edge control parameter, the first dynamic control parameter and the first coordinate value to obtain an ablation control parameter in the dissolution direction.
7. A special effects processing device for a virtual object, characterized in that: The device comprises: An ablation special effect processing request obtaining module, used to obtain an ablation special effect processing request for a virtual object model; the ablation special effect processing request includes at least one dissolving direction for the virtual object model; A first coordinate value obtaining module is used to respond to the ablation special effect processing request and obtain a first coordinate value of each vertex pixel of the virtual object model; the first coordinate value refers to a coordinate value on a coordinate axis consistent with the dissolving direction; an ablation edge value obtaining module, for obtaining an ablation edge value of a corresponding vertex pixel according to a comparison result between the first coordinate value and an ablation dynamic threshold on a corresponding coordinate axis; the magnitude of the ablation edge value can characterize the ablation degree of the corresponding pixel point on the object map, the ablation dynamic threshold can change with the increase of ablation time, and the change is related to the dissolution direction; A first special effect processing parameter obtaining module is used to process the ablation edge value, the first dynamic control parameter and the edge noise of the virtual object model to obtain a first special effect processing parameter corresponding to the dissolution direction; the first dynamic control parameter is used to control the ablation degree of the corresponding vertex pixel in the dissolution direction; A special effects rendering module is used to perform special effects rendering on the first special effects processing parameter, a preset ablation threshold, a special effects background map and vertex data output by a vertex shader through a fragment shader, so that the virtual object displays an ablation special effect in the dissolution direction; the special effects background map is obtained by object mapping the virtual object model.
8. The device according to claim 7, characterized in that The ablation edge value obtaining module comprises: A first comparison unit is used to compare the first coordinate value of each vertex pixel with the ablation dynamic threshold starting from the first vertex pixel in the dissolving direction to obtain the ablation edge value of the vertex pixel corresponding to the current ablation moment; An ablation dynamic threshold obtaining unit, used to obtain the ablation dynamic threshold corresponding to the next ablation moment according to a preset rule; The second comparison unit is used to compare the first coordinate value of each vertex pixel with the ablation dynamic threshold corresponding to the next ablation moment to obtain the ablation edge value of the vertex pixel corresponding to the next ablation moment until the ablation of the last vertex pixel in the dissolving direction is completed.
9. The device according to claim 8, characterized in that The ablation dynamic threshold obtaining unit comprises: A coordinate value acquisition unit, used for acquiring a first maximum coordinate value and a first minimum coordinate value of each vertex pixel of the object map of the virtual object model in the dissolving direction; The interpolation obtaining unit is used to sequentially obtain the ablation dynamic threshold corresponding to the ablation moment in the range from the first maximum coordinate value to the first minimum coordinate value by interpolation.
10. A computer device, characterized in that: The computer device comprises: Communication module; A memory, used to store a program of the special effect processing method for a virtual object according to any one of claims 1 to 6; A processor is used to load and execute the program stored in the memory to implement each step of the special effect processing method of a virtual object as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for decal on virtual model, equipment and medium
CN112884874A
Ablation operation prompting method, electronic device, and computer-readable storage medium
WO2022141688A1