Vertex adjustment method and device, electronic equipment and readable storage medium

By adjusting the vertex position in the game model and using normals, time and UV noise to generate dynamic shield effects, the poor user experience caused by traditional static shield effects is solved, and a more dynamic shield performance is achieved.

CN119565131AInactive Publication Date: 2025-03-07BEIJING PIXEL SOFTWARE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411636579.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-03-07
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The shield effect in traditional game models is static and cannot be changed dynamically, resulting in poor user experience.

Method used

By determining the normal vector of the model space to be processed and converting it into view space normals, time-based noise, UV-based noise, and normal-based noise are generated, vertex offsets are calculated and vertex positions are adjusted to achieve the dynamic effect of the shield.

Benefits of technology

It realizes the dynamic performance of the shield, overcomes the limitations of traditional static models being unable to present dynamic effects, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119565131A_ABST
    Figure CN119565131A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a vertex adjustment method and device, electronic equipment and a readable storage medium, and relates to the field of data processing, and the method comprises the steps: determining the normal vector of a to-be-processed model space, converting the normal vector into a view space normal, determining the UV coordinates of the vertexes of a grid in the to-be-processed model space and the vertex normal, and determining the UV coordinates of the vertexes of the grid in the to-be-processed model space; generating time-based noise, UV-based noise and normal-based noise on the basis of the current time parameter, the vertex UV coordinate and the vertex normal, determining vertex offset of the to-be-processed model space on the basis of the view space normal, the time-based noise, the UV-based noise and the normal-based noise, and adjusting the vertex position of the to-be-processed model space on the basis of the vertex offset. Therefore, the vertex of the to-be-processed model space is adjusted, dynamic performance of the shield is achieved, and the limitation that a traditional static model cannot present the dynamic effect is overcome.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a vertex adjustment method, device, electronic device and readable storage medium. Background Art

[0002] Shield effects are often needed in games to express the character's striking actions. The shield effects expressed by traditional models are fixed and cannot change, resulting in a poor user experience. Summary of the invention

[0003] The purpose of the present invention is to provide a vertex adjustment method, device, electronic device and readable storage medium, which can change the vertex position of the model space to be processed in real time, thereby achieving a dynamic shield effect and improving the user experience.

[0004] In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0005] In a first aspect, an embodiment of the present application provides a vertex adjustment method, the method comprising:

[0006] Determine a normal vector of the model space to be processed, and convert the normal vector into a view space normal;

[0007] Determine vertex UV coordinates and vertex normals of the mesh in the model space to be processed;

[0008] Generate time-based noise, UV-based noise and normal-based noise based on current time parameters, vertex UV coordinates and vertex normals;

[0009] Determine the vertex offset of the model space to be processed based on the view space normal, the time base noise, the UV base noise and the normal base noise;

[0010] The vertex positions of the model space to be processed are adjusted based on the vertex offsets.

[0011] In an optional implementation, the step of determining a normal vector of the model space to be processed and converting the normal vector into a view space normal includes:

[0012] Determine the normal vector and view projection matrix of the model space to be processed;

[0013] The product of the normal vector and the view projection matrix is ​​calculated as the view space normal.

[0014] In an optional implementation, the step of generating time-based noise, UV-based noise and normal-based noise based on the current time parameter, vertex UV coordinates and vertex normals comprises:

[0015] Generate time-based noise and UV-based noise based on current time parameters and vertex UV coordinates;

[0016] Normal-based noise is generated based on the current time parameters and the vertex normals.

[0017] In an optional implementation, the step of determining the vertex offset of the model space to be processed based on the view space normal, time-based noise, UV-based noise and normal-based noise comprises:

[0018] Calculating a first product of the time-based noise and the UV-based noise;

[0019] determining a first sinusoidal function value of the first product;

[0020] Acquire a first target sine function value within a preset range from the first sine function value;

[0021] A first vertex offset in a model space to be processed is determined based on a first target sine function value and a view space normal.

[0022] In an optional implementation, the first vertex offset is calculated using the following formula:

[0023] offet1=normalviev.xy*norLen1*offsetScale;

[0024] Among them, offset1 is the first vertex offset, normalviev.xy is the view space normal, norLen1 is the first target sine function value, and offsetScale is the first scaling factor.

[0025] In an optional implementation, the step of determining the vertex offset of the model space to be processed based on the view space normal, time-based noise, UV-based noise and normal-based noise comprises:

[0026] Determining a second sine function value of the vertex normal;

[0027] Calculate the second sine function value and the current time parameter to obtain a normal disturbance value;

[0028] A second vertex offset of the to-be-processed model space is determined based on the normal disturbance value and the view space normal.

[0029] In an optional implementation, the normal disturbance value is calculated by the following formula:

[0030] norLen2=sin(snoise(normal)*Time*NoiseScale)+0.8) / 2.0;

[0031] Among them, norLen2 is the normal disturbance value, snoise(normal) is the second sine function value, Time is the current time parameter, and NoiseScale is the second scaling factor.

[0032] In a second aspect, an embodiment of the present application provides a vertex adjustment device, the device comprising:

[0033] A determination module is used to determine the normal vector of the model space to be processed and convert the normal vector into a view space normal; determine the vertex UV coordinates and vertex normals of the mesh in the model space to be processed; generate time-based noise, UV-based noise and normal-based noise based on the current time parameter, the vertex UV coordinates and the second vertex normal; determine the vertex offset of the model space to be processed based on the view space normal, the time-based noise, the UV-based noise and the normal-based noise;

[0034] An adjustment module is used to adjust the vertex positions of the model space to be processed based on the vertex offsets.

[0035] In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the vertex adjustment method when executing the computer program.

[0036] In a fourth aspect, an embodiment of the present application provides a readable storage medium having a computer program stored thereon, which implements the steps of the vertex adjustment method when executed by a processor.

[0037] This application has the following beneficial effects:

[0038] The present application determines the normal vector of the model space to be processed and converts the normal vector into the view space normal, determines the vertex UV coordinates and vertex normals of the mesh in the model space to be processed, generates time-based noise, UV-based noise and normal-based noise based on the current time parameters, vertex UV coordinates and vertex normals, determines the vertex offset of the model space to be processed based on the view space normal, time-based noise, UV-based noise and normal-based noise, adjusts the vertex position of the model space to be processed based on the vertex offset, thereby adjusting the vertices of the model space to be processed, realizing the dynamic performance of the shield, thereby overcoming the limitation that traditional static models cannot present dynamic effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0040] Figure 1 A block diagram of an electronic device provided by an embodiment of the present invention;

[0041] Figure 2 One of the flowchart diagrams of a vertex adjustment method provided by an embodiment of the present invention;

[0042] Figure 3 A second flowchart of a vertex adjustment method provided by an embodiment of the present invention;

[0043] Figure 4 A third flowchart of a vertex adjustment method provided by an embodiment of the present invention;

[0044] Figure 5 A fourth flowchart of a vertex adjustment method provided by an embodiment of the present invention;

[0045] Figure 6 A structural block diagram of a vertex adjustment device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0047] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0049] In the description of the present invention, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear to indicate an orientation or position relationship, they are based on the orientation or position relationship shown in the accompanying drawings, or are the orientation or position relationship in which the product of the invention is usually placed when used. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0050] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.

[0051] In the description of this application, it should also be noted that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0052] After research, it was found that shield effects are often needed in games to present some of the character's striking actions. The current shield effect is a static effect, so the effect is poor.

[0053] The shield of the traditional model is a static effect when it is modeled and cannot achieve dynamic changes. The traditional shield effect often needs to be combined with animation to present a dynamic effect. Therefore, it is costly to display a dynamic shield effect based on a transmission model.

[0054] In view of the discovery of the above problems, the present embodiment provides a vertex adjustment method, device, electronic device and readable storage medium, which can determine the normal vector of the model space to be processed and convert the normal vector into the view space normal, determine the vertex UV coordinates and vertex normals of the mesh in the model space to be processed, generate time-based noise, UV-based noise and normal-based noise based on the current time parameters, vertex UV coordinates and vertex normals, determine the vertex offset of the model space to be processed based on the view space normal, time-based noise, UV-based noise and normal-based noise, adjust the vertex position of the model space to be processed based on the vertex offset, thereby adjusting the vertices of the model space to be processed, so as to achieve dynamic performance of the shield, thereby overcoming the limitation that traditional static models cannot present dynamic effects. The solution provided by the present embodiment is elaborated in detail below.

[0055] This embodiment provides an electronic device that can adjust vertices. In a possible implementation, the electronic device can be a user terminal, for example, the electronic device can be, but is not limited to, a server, a smart phone, a personal computer (PC), a tablet computer, a personal digital assistant (PDA), a mobile Internet device (MID), and an image acquisition device.

[0056] The electronic device 100 is installed and runs an application that supports virtual scenes. The application can be any one of a first-person shooting game (FPS), a third-person shooting game, a multiplayer online tactical competitive game (MOBA), a two-dimensional (2D) game application, a three-dimensional (3D) game application, a virtual reality application, a three-dimensional map program, a simulation program, or a multiplayer fighting survival game. The application can also be a stand-alone application, such as a stand-alone 3D game program.

[0057] Please refer to Figure 1 , Figure 1 1 is a schematic diagram of the structure of the electronic device 100 provided in the embodiment of the present application. The electronic device 100 may also include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0058] The electronic device 100 includes a vertex adjustment device 110 , a memory 120 and a processor 130 .

[0059] The electronic device may also include at least one network interface and a user interface. The various components in the electronic device 100 are coupled together via a bus system. It is understood that the bus system is used to achieve connection and communication between these components. In addition to the data bus, the bus system also includes a power bus, a control bus, and a status signal bus.

[0060] The components of the memory 120 and the processor 130 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The vertex adjustment device 110 includes at least one software function module that can be stored in the memory 120 in the form of software or firmware or solidified in the operating system (OS) of the electronic device 100. The processor 130 is used to execute the executable modules stored in the memory 120, such as the software function modules and computer programs included in the vertex adjustment device 110.

[0061] Wherein, the memory 120 can be, but not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable read-only memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc. The memory can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drive, optical disk drive, etc. The memory 120 optionally includes one or more storage devices that are physically far away from the processor. The memory 120 described in the embodiment of the present application is intended to include any suitable type of memory.

[0062] The memory 120 is used to store programs, and the processor 130 executes the programs after receiving execution instructions.

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

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

[0065] Please refer to Figure 2 , Figure 2 For application Figure 1 A flowchart of a vertex adjustment method of an electronic device 100 is provided, and the method including each step is described in detail below.

[0066] S201: Determine a normal vector of a model space to be processed, and convert the normal vector into a view space normal.

[0067] S202: Determine vertex UV coordinates and vertex normals of the mesh in the model space to be processed.

[0068] UV coordinates are a two-dimensional coordinate system used to describe texture mapping information on the surface of a model. Each vertex has a corresponding UV coordinate that is used to determine the position of the vertex in the texture image. The range of UV coordinates is usually from (0,0) to (1,1), with the upper left corner being (0,0) and the lower right corner being (1,1). UV coordinates are used to sample the texture and map it onto the surface of the model, thereby achieving texture mapping and rendering.

[0069] S203: Generate time-based noise, UV-based noise, and normal-based noise based on current time parameters, vertex UV coordinates, and vertex normals.

[0070] S204: Determine the vertex offset of the model space to be processed based on the view space normal, time-based noise, UV-based noise, and normal-based noise.

[0071] S205: Adjusting the vertex positions of the model space to be processed based on the vertex offsets.

[0072] It should be noted that the model space to be processed can be a virtual object in a virtual scene. A virtual scene is a virtual scene displayed (or provided) when an application is running on a terminal. The virtual scene can be a simulation environment of the real world, a semi-simulation and semi-fictitious virtual environment, or a purely fictitious virtual environment. The virtual scene can be any one of a two-dimensional virtual scene, a 2.5-dimensional virtual scene, or a three-dimensional virtual scene. The embodiment of the present application does not limit the dimension of the virtual scene.

[0073] For example, when the virtual scene is a three-dimensional virtual space, the three-dimensional virtual space can be an open space. The virtual scene can be used to simulate the real environment in reality. For example, the virtual scene can include the sky, land, ocean, etc., and the land can include environmental elements such as deserts and cities. Of course, the virtual scene can also include virtual items, such as buildings, vehicles, and weapons and other props used by virtual objects in the virtual scene to arm themselves or fight with other virtual objects. The virtual scene can also be used to simulate the real environment under different weather conditions, such as sunny days, rainy days, foggy days, or night weather. Users can control virtual objects to move in the virtual scene.

[0074] Virtual objects are images of various people and objects that can interact in a virtual scene, or movable objects in a virtual scene. The movable objects can be virtual characters, virtual animals, cartoon characters, etc., such as characters displayed in a virtual scene. The virtual object can be a virtual image in the virtual scene that represents the user. A virtual scene can include multiple virtual objects, each of which has its own shape and volume in the virtual scene and occupies a part of the space in the virtual scene.

[0075] The virtual object may be a user character controlled by operations on the client, or an artificial intelligence (AI) set in a virtual scene battle through training, or a non-user character (NPC) set in a virtual scene interaction. Optionally, the virtual object may be a virtual character that performs adversarial interaction in the virtual scene. Optionally, the number of virtual objects participating in the interaction in the virtual scene may be pre-set or dynamically determined according to the number of clients joining the interaction.

[0076] The normal vector in the model space to be processed is a vector defined in the object's own coordinate system, which describes the perpendicular direction of the tangent plane at each point on the model surface. Normal vectors are crucial for lighting calculations because they determine how the surface interacts with the incident light, which in turn affects the color and brightness of the rendering.

[0077] The model space normal vectors to be processed are defined relative to the origin and coordinate axes of the model itself, without any transformation. This means that if the model is rotated or moved, the model space normal vectors remain unchanged and only represent the inherent geometric direction of the model. The model space normal vectors can usually be directly derived from the 3D modeling software, or calculated through geometric algorithms such as plane equations, cross products of polygonal faces, etc. Before performing lighting calculations, the model space normal vectors often need to be converted to other spaces (such as world space, view space) in order to correctly match the light source position and the observer's perspective. But in the original model data, they remain in model space expression. Regardless of the space, the normal vector needs to be kept as a unit vector, that is, the length is 1, in order to ensure the accuracy of the lighting calculation.

[0078] The view space normal refers to the normal vector in the model space to be processed converted to the view space coordinate system. It enables the lighting calculation to be centered on the observer's perspective, thereby improving efficiency and effect.

[0079] The specific implementation method of converting the normal vector into the view space normal may be: determining the normal vector of the model space to be processed and the view projection matrix, and calculating the product of the normal vector and the view projection matrix as the view space normal.

[0080] The view-projection matrix combines the functions of the view matrix and the projection matrix to transform the 3D scene from the model space to the 2D pixel coordinates visible on the screen. The transformation process is divided into two steps: 1. View transformation: The view matrix transforms the world space into the observation space (also called view space), which is achieved by simulating a coordinate system fixed to the position and orientation of the camera. This means that all calculations are performed relative to the camera. 2. Projection transformation: The projection matrix further transforms the view space into the clipping space, which determines the visible range, perspective effect, or orthographic projection size of the final image. In the clipping space, vertices within a specific range (usually between -1 and 1) are mapped to the screen, while vertices outside the range are clipped. In summary, the view-projection matrix implements a complete transformation from 3D space to 2D screen coordinates.

[0081] The view space normal is finally normalized so that its final vector length is 1, ensuring that the view space normal is still a unit vector.

[0082] Divide the model space to be processed into square grids (2D) or cubic grids (3D), that is, grids, and determine the vertex UV coordinates corresponding to each grid and the vertex normals of each grid.

[0083] Generates time-based noise, UV-based noise, and normal-based noise based on the current time parameters, vertex UV coordinates, and vertex normals.

[0084] Time-based noise is a random signal or disturbance that changes over time. It is often used in computer graphics, audio processing, physical simulation and other fields to increase dynamic realism or simulate uncertainty in natural phenomena. The characteristic of this type of noise is that its value changes over time, providing a dynamic change effect, which is different from a static noise pattern. UV-based noise refers to the noise pattern generated or applied according to the sampling points on the UV coordinates of the model surface in texture mapping. This noise is different from traditional noise based on spatial coordinates or time changes. Its changes depend on texture coordinates, so that the noise pattern can be attached to the surface of the 3D model along with the texture. Normal-based noise involves applying noise perturbations to the surface normals of a 3D model to achieve more natural or complex surface details and lighting effects. Normal-based noise affects the geometric appearance and lighting interaction of the model space to be processed.

[0085] Finally, based on the view space normal, time base noise, UV base noise and normal base noise obtained above, the vertex offset of the model space to be processed is determined, and the vertex position of the model space to be processed is adjusted based on the vertex offset. Thus, the position of the vertex in the model space to be processed is changed in real time, so as to realize the dynamic performance of the shield, that is, to change the presentation mode of the shield of the virtual object in the virtual scene.

[0086] There are many ways to generate time-based noise, UV-based noise and normal-based noise based on the current time parameters, vertex UV coordinates and vertex normals. In one implementation, Figure 3 As shown, the following steps are included:

[0087] S301: Generate time-based noise and UV-based noise based on current time parameters and vertex UV coordinates.

[0088] S302: Generate normal-based noise based on the current time parameter and the vertex normal.

[0089] Use the snoise function to generate time-based noise and UV-based noise based on the current time parameters and vertex UV coordinates.

[0090] Generates normal-based noise using the current time parameters and vertex normals as input to the snoise function. The noise value of the normal-based noise will produce different noise as the normal changes.

[0091] There are many ways to determine the vertex offset of the model space to be processed based on the view space normal, time base noise, UV base noise and normal base noise. In one implementation, Figure 4 As shown, the following steps are included:

[0092] S401: Calculate a first product of the time-based noise and the UV-based noise.

[0093] S402: Determine a first sinusoidal function value of the first product.

[0094] S403: Obtain a first target sine function value within a preset range from the first sine function values.

[0095] S404: Determine a first vertex offset in the model space to be processed based on the first target sine function value and the view space normal.

[0096] The time-based noise obtained in the present invention produces changes on the entire object, while the UV-based noise produces different noise values ​​at different positions on the surface of the object. The time-based noise and the UV-based noise are combined to adjust the vertex positions of the model space to be processed.

[0097] The first sine function value of the first product of the time-based noise and the UV-based noise is determined, and the first sine function value is limited according to a preset range, so as to realize the control of the combination of the time-based noise and the UV-based noise.

[0098] It should be noted that the preset range can be set according to actual conditions, and the embodiment of the present invention does not impose specific restrictions on this. The setting of the preset range achieves the effect of zooming in or out of the subsequent vertex offset along the sine wave.

[0099] The first vertex offset can be calculated using the following formula:

[0100] offset1=normalviev.xy*norLen1*offsetScale;

[0101] Among them, offset1 is the first vertex offset, normalviev.xy is the view space normal, norLen1 is the first target sine function value, and offsetScale is the first scaling factor.

[0102] It should be noted that the first scaling factor can be set according to actual conditions, and the embodiment of the present invention does not impose any specific limitation on this. Specifically, the first scaling factor can be obtained from a general register.

[0103] There are many ways to determine the vertex offset of the model space to be processed based on the view space normal, time base noise, UV base noise and normal base noise. In one implementation, Figure 5 As shown, the following steps are included:

[0104] S501: Determine a second sine function value of the vertex normal.

[0105] S502: Calculate the second sine function value and the current time parameter to obtain a normal disturbance value.

[0106] S503: Determine a second vertex offset of the to-be-processed model space based on the normal disturbance value and the view space normal.

[0107] The normal perturbation value is calculated by the following formula:

[0108] norLen2=sin(snoise(normal)*Time*NoiseScale)+0.8) / 2.0;

[0109] Among them, norLen2 is the normal disturbance value, snoise(normal) is the second sine function value, Time is the current time parameter, and NoiseScale is the second scaling factor.

[0110] The normal perturbation value realizes the dynamic perturbation of the length and direction of the normal, simulating the deformation effect of the shield under the action of external force.

[0111] The second vertex offset is calculated using the following formula:

[0112] offset2=normalviev.xy*norLen2*offsetScale;

[0113] Among them, offset2 is the second vertex offset, normalviev.xy is the view space normal, norLen2 is the normal perturbation value, and offsetScale is the first scaling factor.

[0114] When the vertex position of the processed model space is finally adjusted, it can be adjusted based on the first vertex offset or the second vertex offset. Finally, the first vertex offset or the second vertex offset is applied to the output vertex clip coordinates, thereby achieving a dynamic expansion effect on the shield surface.

[0115] Please refer to Figure 6 The present application embodiment also provides a method for applying Figure 1 The vertex adjustment device 110 of the electronic device 100 includes:

[0116] The determination module 111 is used to determine the normal vector of the model space to be processed, and convert the normal vector into the view space normal; determine the vertex UV coordinates and vertex normals of the mesh in the model space to be processed; generate time-based noise, UV-based noise and normal-based noise based on the current time parameter, vertex UV coordinates and vertex normals; determine the vertex offset of the model space to be processed based on the view space normal, time-based noise, UV-based noise and normal-based noise;

[0117] The adjustment module 112 is used to adjust the vertex positions of the model space to be processed based on the vertex offsets.

[0118] The present application also provides an electronic device 100, which includes a processor 130 and a memory 120. The memory 120 stores computer executable instructions, and when the computer executable instructions are executed by the processor 130, the vertex adjustment method is implemented.

[0119] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by the processor 130, the vertex adjustment method is implemented.

[0120] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0121] In addition, each functional module in each embodiment of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk.

[0122] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0123] The above are only various implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A vertex adjustment method, characterized in that: The method comprises: Determine a normal vector of the model space to be processed, and convert the normal vector into a view space normal; Determine vertex UV coordinates and vertex normals of the mesh in the model space to be processed; Generate time-based noise, UV-based noise and normal-based noise based on current time parameters, vertex UV coordinates and vertex normals; Determine the vertex offset of the model space to be processed based on the view space normal, the time base noise, the UV base noise and the normal base noise; The vertex positions of the model space to be processed are adjusted based on the vertex offsets.

2. The method according to claim 1, characterized in that The step of determining a normal vector of a model space to be processed and converting the normal vector into a view space normal comprises: Determine the normal vector and view projection matrix of the model space to be processed; The product of the normal vector and the view projection matrix is ​​calculated as the view space normal.

3. The method according to claim 1, characterized in that: The step of generating time-based noise, UV-based noise and normal-based noise based on the current time parameter, vertex UV coordinates and vertex normals comprises: Generate time-based noise and UV-based noise based on current time parameters and vertex UV coordinates; Normal-based noise is generated based on the current time parameters and the vertex normals.

4. The method according to claim 1, characterized in that: The step of determining the vertex offset of the model space to be processed based on the view space normal, time base noise, UV base noise and normal base noise comprises: Calculating a first product of the time-based noise and the UV-based noise; determining a first sinusoidal function value of the first product; Acquire a first target sine function value within a preset range from the first sine function value; A first vertex offset in a model space to be processed is determined based on a first target sine function value and a view space normal.

5. The method according to claim 4, characterized in that The first vertex offset is calculated by the following formula: offset1=normalviev.xy*norLen1*offsetScale; Among them, offset1 is the first vertex offset, normalviev.xy is the view space normal, norLen1 is the first target sine function value, and offsetScale is the first scaling factor.

6. The method according to claim 1, characterized in that The step of determining the vertex offset of the model space to be processed based on the view space normal, time base noise, UV base noise and normal base noise comprises: Determining a second sine function value of the vertex normal; Calculate the second sine function value and the current time parameter to obtain a normal disturbance value; A second vertex offset of the to-be-processed model space is determined based on the normal disturbance value and the view space normal.

7. The method according to claim 6, characterized in that The normal disturbance value is calculated by the following formula: norLen2=sin(snoise(normal)*Time*NoiseScale)+0.8) / 2.0; Among them, norLen2 is the normal disturbance value, snoise(normal) is the second sine function value, Time is the current time parameter, and NoiseScale is the second scaling factor.

8. A vertex adjustment device, characterized in that: The device comprises: A determination module, used to determine the normal vector of the model space to be processed, and convert the normal vector into a view space normal; determine the vertex UV coordinates and vertex normals of the mesh in the model space to be processed; generate time-based noise, UV-based noise and normal-based noise based on current time parameters, vertex UV coordinates and vertex normals; determine the vertex offset of the model space to be processed based on the view space normal, time-based noise, UV-based noise and normal-based noise; An adjustment module is used to adjust the vertex positions of the model space to be processed based on the vertex offsets.

9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the method according to any one of claims 1 to 7 when executing the computer program.

10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.