Deformation processing of model elements, image rendering method, device, equipment and medium

By extracting the vertex data of the model element and generating a tremor transformation function, the tremor of the existing technology of small and medium -sized objects in the breeze shows the problem of unreal, achieved a more real breeze tremor effect, and improved the authenticity of the game screen.

CN112132937BActive Publication Date: 2025-01-28SHANGHAI MIHOYO TIANMING TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011001962.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-22
Publication Date
2025-01-28
Estimated Expiration
2040-09-22

AI Technical Summary

Technical Problem

The prior art is difficult to effectively simulate the trembling display of small objects in the breeze, resulting in a lack of realism in the game screen.

Method used

By extracting the vertex data of the model element, the tremor -based variable function of the central point information is generated, and the vertex coordinates are adjusted according to the current time to achieve the tremor of the model element.

Benefits of technology

The real breeze tremor effect of the model element is achieved, and the authenticity and interaction of the game screen are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112132937B_ABST
    Figure CN112132937B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a deformation processing and picture rendering method, device, equipment and medium of a model element. The deformation processing method of a model element comprises: extracting vertex data of the model element, the vertex data comprises: vertex coordinates of each vertex and information of the center point of the model element; generating a trembling deformation function of each vertex according to the information of the center point, the trembling deformation function being a time function; adjusting the vertex coordinates of each vertex according to the current time and the trembling deformation function of each vertex, and obtaining the vertex deformation coordinates of each vertex. The technical solution of the embodiment of the present invention provides a deformation processing method for simulating the trembling of a model element in a breeze, which optimizes the display effect of the model element, and further improves the authenticity of the displayed picture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to image processing technology, in particular to game image engine technology, and specifically to a deformation processing of model elements, a picture rendering method, a device, a equipment and a medium. Background Art

[0002] In the big world of the game, it is usually necessary to lay a large number of small objects in a scene or a large area within the scene to add details, supplement the picture and reflect the characteristics of the area. For example, laying a large number of flowers or small vegetation on the lawn.

[0003] In order to achieve a perfect integration of the laid small objects and the scene, and to avoid the small objects being displayed too rigidly in the screen, it is usually required that the small objects in the game screen can be displayed vibrating to simulate the display effect of a breeze blowing, thereby creating a realistic animation scene. However, the prior art does not form an effective vibrating processing technology for small objects. Summary of the invention

[0004] The embodiment of the present invention provides a deformation processing and picture rendering method, device, equipment and medium of a model element, so as to provide a deformation processing mode for simulating the vibration display of a model element in a breeze, and optimize the display effect of the model element.

[0005] In a first aspect, an embodiment of the present invention provides a deformation processing method for a model element, comprising:

[0006] Extracting vertex data of a model element, wherein the vertex data includes: vertex coordinates of each vertex and information of a center point of the model element;

[0007] Generate a vibration deformation function of each vertex according to the information of the center point, wherein the vibration deformation function is a time function;

[0008] According to the current time and the tremor deformation function of each vertex, the vertex coordinates of each vertex are adjusted to obtain the vertex deformation coordinates of each vertex.

[0009] In a second aspect, an embodiment of the present invention further provides a picture rendering method, comprising:

[0010] Whenever a trembling display condition of a target picture is detected, a current time is acquired, and at least one target model element to be trembling is acquired in the target picture;

[0011] Using the deformation processing method of the model element as described in any embodiment of the present invention, the vertex deformation coordinates of each vertex in each target model element are obtained;

[0012] Each target model element is rendered and displayed according to the vertex deformation coordinates of each vertex in each target model element.

[0013] In a third aspect, an embodiment of the present invention further provides a deformation processing device for a model element, comprising:

[0014] A vertex data extraction module, used to extract vertex data of a model element, wherein the vertex data includes: vertex coordinates of each vertex and information of a center point of the model element;

[0015] A tremor deformation function generating module, used for generating a tremor deformation function of each vertex according to the information of the center point, wherein the tremor deformation function is a time function;

[0016] The vertex coordinate adjustment module is used to adjust the vertex coordinates of each vertex according to the current time and the tremor deformation function of each vertex to obtain the vertex deformation coordinates of each vertex.

[0017] In a fourth aspect, an embodiment of the present invention further provides a picture rendering device, comprising:

[0018] A target model element acquisition module, used for acquiring the current time and acquiring at least one target model element to be processed by the dithering in the target picture whenever a dithering display condition of the target picture is detected;

[0019] A vertex deformation coordinate generation module, used to obtain the vertex deformation coordinates of each vertex in each target model element by using the deformation processing method of the model element as described in any embodiment of the present invention;

[0020] The rendering and display module is used to render and display each target model element according to the vertex deformation coordinates of each vertex in each target model element.

[0021] In a fifth aspect, an embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements a deformation processing method for a model element as described in any one of the embodiments of the present invention, or implements a screen rendering method as described in any one of the embodiments of the present invention.

[0022] In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a deformation processing method for a model element as described in any one of the embodiments of the present invention, or implements a screen rendering method as described in any one of the embodiments of the present invention.

[0023] The technical solution of the embodiment of the present invention extracts vertex data of the model element; generates a trembling deformation function of each vertex according to the information of the center point; adjusts the vertex coordinates of each vertex according to the current time and the trembling deformation function of each vertex, and obtains the vertex deformation coordinates of each vertex. When the model element is subjected to trembling deformation processing, each vertex of the model element is controlled to perform trembling deformation processing around the center point of the model element, so that the new model element obtained after rendering is closer to the actual breeze trembling effect. The technical solution of the embodiment of the present invention provides a deformation processing method for simulating the trembling of the model element in the breeze, optimizes the display effect of the model element, and further improves the authenticity of the displayed picture. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1a It is a flow chart of the implementation of a deformation processing method of a model element in the first embodiment of the present invention;

[0025] Figure 1b is a schematic diagram of a vector relationship between a vertex and a center point applicable to an embodiment of the present invention;

[0026] Figure 1c is another schematic diagram of a vector relationship between a vertex and a center point applicable to an embodiment of the present invention;

[0027] Figure 2 It is a flow chart of the implementation of a deformation processing method of a model element in the second embodiment of the present invention;

[0028] Figure 3 This is a flowchart of an implementation method of a picture rendering method in Embodiment 3 of the present invention;

[0029] Figure 4 It is a structural diagram of a deformation processing device for a model element in a fourth embodiment of the present invention;

[0030] Figure 5 is a structural diagram of a picture rendering device in Embodiment 5 of the present invention;

[0031] Figure 6 It is a structural diagram of a computer device in Embodiment 6 of the present invention. DETAILED DESCRIPTION

[0032] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0033] It should also be noted that, for ease of description, only the part relevant to the present invention but not all content is shown in the accompanying drawings. It should be mentioned before discussing exemplary embodiments in more detail that some exemplary embodiments are described as processing or methods depicted as flow charts. Although the flow chart describes each operation (or step) as sequential processing, many operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. When its operation is completed, the processing can be terminated, but it can also have additional steps not included in the accompanying drawings. The processing can correspond to methods, functions, procedures, subroutines, subprograms, etc.

[0034] Embodiment 1

[0035] Figure 1a This is a flow chart of a deformation processing method for a model element provided in the first embodiment of the present invention. This embodiment is applicable to the case where a small object in a virtual scene is subjected to breeze vibration processing. The method can be executed by a deformation processing device for a model element. The device can be implemented by software and / or hardware and can generally be integrated in a terminal or a server (typically, a game server). The method of this embodiment specifically includes the following steps:

[0036] S110 . Extract vertex data of a model element, wherein the vertex data includes vertex coordinates of each vertex and information of a center point of the model element.

[0037] In this embodiment, the model element refers to a specific individual element among a large number of small objects laid out in the picture to be rendered and displayed. For example, the model element can be a flower in a sea of ​​flowers, a blade of grass in a clump of grass on a lawn, or a leaf on a tree.

[0038] In this embodiment, each model element has a preset number of vertices (generally multiple), wherein for each model element, vertex data corresponding to the model element needs to be pre-stored. The vertex data includes: vertex coordinates of each vertex and information of the center point of the model element.

[0039] Among them, after connecting the vertex coordinates of each vertex in sequence, the contour shape of the model element can be obtained.

[0040] Generally speaking, a model element may include one or more center points, which are generally located at the root of the model element close to the ground. After setting the center point, when the model element is deformed by breeze vibration, the root will not vibrate, so that the result of the vibration deformation processing is closer to the real situation.

[0041] The information of the center point is information used to indicate the position of the center point in the model element, for example, it may be the center point coordinates, or it may be a vector between the coordinates of each vertex and the corresponding center point coordinates.

[0042] In a specific example, it is assumed that a model of a tuft of grass includes multiple model elements. Each model element is a blade of grass. The model element includes five vertices (A, B, C, D, and E).

[0043] In an optional implementation of this embodiment, Figure 1b The diagram of the vertices of a blade of grass is shown in , where point F is taken as the only center point of the blade of grass in the model element, and vectors AF, BF, CF, DF and EF are the vectors from each vertex to the center point F.

[0044] In another optional implementation of this embodiment, Figure 1c In the example, a grass bag has three center points, namely D, E and F. The vectors from each vertex to the center point include AF, BD, CE, DD and EE. In other words, Figure 1c In , there is more than one center point, and each vertex can point to any of the center points. Figure 1b and Figure 1c In the figure, the solid lines with arrows represent the vectors from each vertex to the center point, and the dotted lines represent the overall outline of a blade of grass. Figure 1c The small and medium circles around D and E indicate that the vectors from D and E to the center point are both pointing to themselves.

[0045] The above vertex data can be stored in UV data, vertex color data, instantiated arrays, tangents, normals or bitangent data locations, etc., and this embodiment does not limit this. A vertex may contain multiple sets of UV data, and the center point data can be stored in a specified set of UV data, that is, UVn, where n represents the nth set of UV. Vertex color data includes four channels: R, G, B and A (brightness). An instantiated array is an array indexed by a vertex ID or other int type variable related to a vertex.

[0046] S120 , generating a vibration deformation function of each vertex according to the information of the central point, wherein the vibration deformation function is a time function.

[0047] In this embodiment, in order to simulate the model element trembling in the breeze, a trembling deformation function corresponding to each vertex can be constructed. The above trembling deformation function can be expressed as: at different times, a certain fixed point is used as the center, and the left and right vibrations are performed (that is, the trembling display effect). Based on the vertex coordinate deformation formed by the trembling deformation function, the animation effect of the model element trembling slightly with the breeze can be simulated at multiple continuous times.

[0048] In this embodiment, the advantage of generating the vibration deformation function of each vertex based on the information of the center point is that it can create an effect of slight left and right swinging around the center point when the model element undergoes vibration deformation, instead of moving around randomly, thereby ensuring the authenticity of the model element shaking with the breeze.

[0049] Generally speaking, the sine function or cosine function is a function used to simulate simple harmonic vibration, and the simple harmonic vibration is very close to the vibration of the model element in the embodiment of the present invention under the breeze. Therefore, a standard sine or cosine function can be constructed in advance, and the amplitude, frequency and phase of the sine or cosine function can be set according to the preset parameters. Furthermore, the coordinates of the center point corresponding to each vertex can be determined according to the information of the center point, and then the coordinates of each center point are used as the oscillation center, and the vibration deformation function of each vertex is set to achieve that each vertex can oscillate with the matching center point as the center at different times.

[0050] Of course, it is understandable that those skilled in the art can also construct other types of trembling deformation functions, as long as the trembling deformation function used can enable each vertex in the model element to use the corresponding center point as the trembling center and tremble left and right around the center point. This embodiment does not limit the specific form of the trembling deformation function.

[0051] S130 , adjusting the vertex coordinates of each vertex according to the current time and the tremor deformation function of each vertex to obtain the vertex deformation coordinates of each vertex.

[0052] In this embodiment, the jitter deformation function is a function of time. By substituting the values ​​at different times into the jitter deformation function, the deformation offsets (XZ values) of different vertex coordinates can be obtained. The calculated deformation offsets of the vertex coordinates are superimposed with the corresponding vertex coordinates to obtain the vertex deformation coordinates of each vertex.

[0053] The technical solution of the embodiment of the present invention extracts vertex data of the model element; generates a trembling deformation function of each vertex according to the information of the center point; adjusts the vertex coordinates of each vertex according to the current time and the trembling deformation function of each vertex, and obtains the vertex deformation coordinates of each vertex. When the model element is subjected to trembling deformation processing, each vertex of the model element is controlled to perform trembling deformation processing around the center point of the model element, so that the new model element obtained after rendering is closer to the actual breeze trembling effect. The technical solution of the embodiment of the present invention provides a deformation processing method for simulating the trembling of the model element in the breeze, optimizes the display effect of the model element, and further improves the authenticity of the displayed picture.

[0054] On the basis of the above embodiments, the vertex data may further include: a softness factor of each vertex, the softness factor being associated with the position of the vertex in the model element;

[0055] Correspondingly, generating the trembling deformation function of each vertex according to the information of the center point may include:

[0056] A vibration deformation function of each vertex is generated according to the information of the central point and the softness factor of each vertex.

[0057] In this embodiment, different softness factors can be further stored for different vertices. Based on the softness factors, different parts of a single model element can have different vibration amplitudes. Typically, in a scene where a blade of grass vibrates in a real breeze, the tip of the grass vibrates the most, and the amplitude of the vibration decreases as it goes down. Grass roots generally do not vibrate. In order to simulate the above real scene in the game screen, the inventor creatively adds a softness factor (also called a wind-affected factor) corresponding to each vertex in the vertex data.

[0058] The value range of the softness factor can be set to [0, 1], and it is stipulated that the larger the softness factor of a vertex is, the greater the deformation of the vertex when it vibrates with the breeze; the smaller the softness factor of a vertex is, the smaller the deformation of the vertex when it vibrates with the breeze. When the softness factor of a vertex is 0, the vertex will not produce any deformation after the breeze blows.

[0059] In a specific example, Figure 1b As shown, the softness factor of vertex A can be set to 0.9, the softness factors of vertices B and C can be set to 0.5, and the softness factors of vertices D and E can be set to 0. At this time, even if only one center point F is set, due to the introduction of the softness factor, in the scene of simulating breeze blowing, the vertices D and E at the root of the grass will not vibrate at all.

[0060] The advantage of this setting is that when each model element in the picture to be rendered vibrates in the breeze, the vibration (or deformation) amplitude of different positions of the model element is different, thereby making the effect of the model element vibrating with the breeze closer to the real situation.

[0061] In an optional implementation of the present embodiment, when generating the vibration deformation function of each vertex based on the information of the center point and the softness factor of each vertex, since it is necessary to ensure that the vibration amplitudes of vertices in different positions are different, the softness factor of the vertex can be used to set the vibration amplitude of the vibration deformation function.

[0062] For example, for a standard sine or cosine function, the softness factor of each vertex can be used as the amplitude of the standard sine or cosine function, or the softness factor can be used to correct the amplitude of the standard sine or cosine function to ensure that the calculated vertex deformation coordinates of each vertex match the characteristics of the calculated softness factor.

[0063] In the above optional implementation of this embodiment, the vertex data may further include: individual feature data, and the individual feature data is used to distinguish the model element from other model elements of the same type.

[0064] Correspondingly, generating the trembling deformation function of each vertex according to the information of the center point may include:

[0065] A tremor deformation function of each vertex is generated according to the information of the center point and the individual feature data.

[0066] The individual feature data may be a random value generated randomly, or a value calculated according to certain rules, or a value set according to the characteristics of the object. The same or different individual feature data may be set for each vertex of the same model element.

[0067] In an optional implementation of the present embodiment, by setting different individual feature data for different model elements, it can be achieved that when the picture to be rendered includes multiple model elements of the same type (for example, a cluster of grass composed of multiple grasses), the vibrating deformation of each model element is not exactly the same, so as to avoid the rather stiff display effect that each grass in the picture vibrates in a certain direction with the same displacement when vibrating and deforming. The vibrating effect of each model element can have slight differences, thereby making the picture more natural and without repetition.

[0068] In the above optional implementation of the present embodiment, when generating the jitter deformation function of each vertex according to the information of the center point and the individual feature data, since it is necessary to ensure that the jitter amplitudes of vertices in different positions will have slight differences, the individual feature data can be used to set the frequency or phase of the jitter deformation function. For example, for a standard sine or cosine function, the individual feature data can be used as the phase of the standard sine or cosine function, or the individual feature data can be used to correct the phase of the standard sine or cosine function to ensure that the calculated vertex deformation coordinates of each vertex of different model elements will have certain slight differences, so that the final rendered picture is more realistic than the actual situation in the scene.

[0069] In an optional implementation of this embodiment, the vertex data may also include: the softness factor and individual characteristic data of each vertex;

[0070] Correspondingly, generating the trembling deformation function of each vertex according to the information of the center point may include:

[0071] A vibration deformation function of each vertex is generated according to the information of the central point, the softness factor of each vertex and the individual characteristic data.

[0072] In the above optional implementation of the present embodiment, the softness factor of each vertex and the individual characteristic data are added to calculate the vertex deformation coordinates of each vertex when the model element vibrates, which ensures that each model element in the picture to be rendered has different vibration amplitudes at different positions when simulating breeze vibration, and also ensures that the vertex deformation coordinates of each vertex of different model elements will have certain slight differences, further improving the vibration display effect of the model element, making each model element in the picture to be rendered closer to the real breeze vibration effect, and improving the authenticity and interactivity of the picture.

[0073] Embodiment 2

[0074] Figure 2 It is a flow chart of a deformation processing method of a model element in the second embodiment of the present invention. This embodiment is refined on the basis of the above embodiment. In this embodiment, a jitter deformation function of each vertex is generated according to the information of the center point, the softness factor of each vertex and the individual feature data. Specifically, a standard jitter function is obtained, and the standard jitter function includes: multiple parameters to be filled in; the information of the center point, the softness factor of each vertex and the individual feature data are filled into the standard jitter function to obtain the jitter deformation function of each vertex.

[0075] At the same time, the vertex coordinates of each vertex are adjusted according to the current time and the jitter deformation function of each vertex to obtain the vertex deformation coordinates of each vertex, which is specifically: according to the current time and the jitter deformation function of each vertex, the deformation offset of each vertex is calculated; according to the vertex coordinates of each vertex and the deformation offset corresponding to each vertex, the vertex deformation coordinates of each vertex are obtained.

[0076] Accordingly, the method of the embodiment of the present invention includes:

[0077] S210: Extract vertex data of model elements.

[0078] The vertex data includes: vertex coordinates of each vertex, information of the center point of the model element, a softness factor of each vertex and the individual feature data.

[0079] S220: Acquire a standard dither function, where the standard dither function includes: a plurality of parameters to be filled.

[0080] Optionally, the standard dither function may be a sine function. For example, a standard dither function of the form: sin(t)=A0+A*sin(ωt+θ) may be constructed.

[0081] Among them, t is the independent variable in the standard dither function, ω is the preset dither frequency value, A0, A and θ are parameters to be filled in, and after obtaining the vertex data of each vertex, they can be filled in the standard dither function as parameters.

[0082] Of course, the above only shows an optional form of a standard dither function. In fact, those skilled in the art may preset the standard dither function and the various parameters to be filled in the standard dither function according to actual conditions, and this embodiment does not limit this.

[0083] S230, filling the information of the center point, the softness factor of each vertex and the individual characteristic data into the standard tremor function to obtain the tremor deformation function of each vertex.

[0084] Based on the information of the center point of each vertex, the center point coordinates corresponding to each vertex can be obtained (the center point coordinates corresponding to different vertices can be the same or different). After obtaining the above-mentioned standard jitter function, the center point coordinates corresponding to each vertex, the softness factor of each vertex, and the above-mentioned individual feature data (the individual feature data corresponding to different vertices can be the same or different) can be filled in the standard jitter function to obtain the jitter deformation function of each vertex.

[0085] Continuing with the previous example, the coordinates of the center point can be filled in the position of the parameter A0 to be filled in the standard jitter function, the softness factor can be filled in the position of the parameter A to be filled, and the individual feature data can be filled in the position of the parameter θ to be filled, so as to obtain the jitter deformation function of each vertex.

[0086] S240: Calculate the deformation offset of each vertex according to the current time and the vibration deformation function of each vertex.

[0087] Optionally, you can use the formula: Substitute the current time and calculate the deformation offset Δx and Δz of each vertex.

[0088] Among them, X0 and Z0 are the coordinates of the center point, S is the softness factor of the vertex, and Rand is the individual characteristic data.

[0089] S250 , obtaining vertex deformation coordinates of each vertex according to the vertex coordinates of each vertex and the deformation offsets respectively corresponding to each vertex.

[0090] After the deformation offset of each vertex is obtained, the deformation offset and the corresponding vertex coordinates may be superimposed to obtain the vertex deformation coordinates of each vertex.

[0091] In a specific example, the formula: Calculate the vertex deformation coordinates of each vertex.

[0092] Among them, (X, Z) is the vertex coordinates of each vertex, (X T , Z T ) is the vertex deformation coordinate of each vertex.

[0093] The technical solution of the embodiment of the present invention extracts vertex data of the model element; generates a trembling deformation function of each vertex according to the information of the center point; adjusts the vertex coordinates of each vertex according to the current time and the trembling deformation function of each vertex, and obtains the vertex deformation coordinates of each vertex. When the model element is subjected to trembling deformation processing, each vertex of the model element is controlled to perform trembling deformation processing around the center point of the model element, so that the new model element obtained after rendering is closer to the actual breeze trembling effect. The technical solution of the embodiment of the present invention provides a deformation processing method for simulating the trembling of the model element in the breeze, optimizes the display effect of the model element, and further improves the authenticity of the displayed picture.

[0094] Embodiment 3

[0095] Figure 3This is a flowchart of a screen rendering method provided in Embodiment 3 of the present invention. This embodiment is applicable to the case where a screen including a model element after trembling processing is rendered and displayed. The method can be executed by a screen rendering device, which can be implemented by software and / or hardware and can generally be integrated in a terminal or a game server. The method of this embodiment specifically includes the following steps:

[0096] S310 . Whenever a trembling display condition of a target picture is detected, obtain the current time, and obtain at least one target model element to be trembling processed in the target picture.

[0097] In this embodiment, in order to realize the rendering display of the picture, it is necessary to first use the object laying tool to lay out various objects on the canvas in the picture production environment (such as a game engine, digital content production software, etc.) to form a picture.

[0098] The object laying tool can be a brush tool, similar to a stamp in the shape of the object to be laid, and the stamp will be placed where the object is laid. Specifically, when the mouse is in the picture making environment and the object laying tool is activated, the picture maker can select the model of the object to be laid, then the mouse can be displayed in the shape of the selected model on the picture making interface, and when the picture maker drags the mouse and clicks or performs other forms of selection operations at a certain position in the target picture, the selected model is laid at that position. For example, a large amount of grass is laid on a lawn to eventually form a lawn. Usually, for the sake of picture making efficiency, the grass is laid in units of a tuft of grass model during the laying process, and a tuft of grass is composed of a certain number of grass roots.

[0099] When the picture is completed or previewed during the production process, it can be rendered and displayed. This process requires calling the shader, which reads the display parameters of each model element in each laid object model, and renders the picture according to the read display parameters, finally forming and displaying the rendered picture.

[0100] In this embodiment, if the current picture to be rendered needs to show the display effect of each model element after the breeze blows, the picture is determined to be a target picture that meets the shaking display conditions. At this time, there is no need to actually simulate the wind force, wind direction and other information of the breeze. Only the model elements that need to shake slightly with the breeze need to be subjected to shaking deformation processing.

[0101] As mentioned above, the objects laid out in each picture to be rendered and displayed are known, and not all objects need to be vibrated and deformed. For example, when a picture includes trees, grass, stones and houses, it is obvious that the leaves in the trees and each blade of grass in the grass need to be vibrated and deformed, while the stones and houses do not need to be vibrated and deformed.

[0102] Accordingly, at least one target model element in the target picture that needs to be subjected to a trembling deformation process may be determined first.

[0103] S320: Using the deformation processing method of the model element as described in any embodiment of the present invention, obtain the vertex deformation coordinates of each vertex in each target model element.

[0104] After acquiring each target model element in the target image, the deformation processing method of the model element described in any embodiment of the present invention can be used to obtain new vertex deformation coordinates of each target model element after the trembling deformation processing according to the vertex data of each target model element and the current time.

[0105] S330 , rendering and displaying each of the target model elements according to the vertex deformation coordinates of each vertex in each of the target model elements.

[0106] Finally, the shader renders the target image according to the new vertex deformation coordinates of each target model element, and finally displays the rendering result on the screen.

[0107] The technical solution of the embodiment of the present invention obtains the current time whenever the shaking display condition of the target picture is detected, and obtains at least one target model element to be shaken in the target picture, adopts the deformation processing method of the model element, and obtains the vertex deformation coordinates of each vertex in each target model element; according to the vertex deformation coordinates of each vertex in each target model element, the technical solution of rendering and displaying each target model element can control the vertices of the model element to perform shaking deformation processing around the center point of the model element when the model element is subjected to shaking deformation processing, so that the new model element obtained after rendering is closer to the actual breeze shaking effect. The technical solution of the embodiment of the present invention provides a deformation processing method for simulating the shaking of model elements in the breeze, optimizes the display effect of the model elements, and further improves the authenticity of the displayed picture.

[0108] Embodiment 4

[0109] Figure 4 4 is a structural diagram of a deformation processing device for a model element provided in the fourth embodiment of the present invention. The deformation processing device for a model element comprises: a vertex data extraction module 410, a trembling deformation function generation module 420 and a vertex coordinate adjustment module 430, wherein:

[0110] The vertex data extraction module 410 is used to extract the vertex data of the model element, wherein the vertex data includes: the vertex coordinates of each vertex and the information of the center point of the model element;

[0111] A tremor deformation function generating module 420, used to generate a tremor deformation function of each vertex according to the information of the center point, wherein the tremor deformation function is a time function;

[0112] The vertex coordinate adjustment module 430 is used to adjust the vertex coordinates of each vertex according to the current time and the tremor deformation function of each vertex to obtain the vertex deformation coordinates of each vertex.

[0113] The technical solution of the embodiment of the present invention extracts vertex data of the model element; generates a trembling deformation function of each vertex according to the information of the center point; adjusts the vertex coordinates of each vertex according to the current time and the trembling deformation function of each vertex, and obtains the vertex deformation coordinates of each vertex. When the model element is subjected to trembling deformation processing, each vertex of the model element is controlled to perform trembling deformation processing around the center point of the model element, so that the new model element obtained after rendering is closer to the actual breeze trembling effect. The technical solution of the embodiment of the present invention provides a deformation processing method for simulating the trembling of the model element in the breeze, optimizes the display effect of the model element, and further improves the authenticity of the displayed picture.

[0114] On the basis of the above embodiments, the vertex data may further include: a softness factor of each vertex, the softness factor being associated with the position of the vertex in the model element;

[0115] Accordingly, the vibration deformation function generating module 420 can be specifically used for:

[0116] A vibration deformation function of each vertex is generated according to the information of the central point and the softness factor of each vertex.

[0117] On the basis of the above embodiments, the vertex data may further include: individual feature data, the individual feature data is used to distinguish the model element from other model elements of the same type;

[0118] Accordingly, the vibration deformation function generating module 420 can be specifically used for:

[0119] A tremor deformation function of each vertex is generated according to the information of the center point and the individual feature data.

[0120] On the basis of the above embodiments, the vertex data may further include: the softness factor and individual characteristic data of each vertex;

[0121] Accordingly, the vibration deformation function generating module 420 can be specifically used for:

[0122] A vibration deformation function of each vertex is generated according to the information of the central point, the softness factor of each vertex and the individual characteristic data.

[0123] Based on the above embodiments, the vibration deformation function generating module 420 can be specifically used for:

[0124] Obtaining a standard tremor function, wherein the standard tremor function includes: a plurality of parameters to be filled;

[0125] The information of the center point, the softness factor of each vertex and the individual characteristic data are filled into the standard tremor function to obtain the tremor deformation function of each vertex.

[0126] Based on the above embodiments, the standard vibration function may be a sine function.

[0127] Based on the above embodiments, the vertex coordinate adjustment module 430 can be specifically used for:

[0128] Calculate the deformation offset of each vertex according to the current time and the tremor deformation function of each vertex;

[0129] The vertex deformation coordinates of each vertex are obtained according to the vertex coordinates of each vertex and the deformation offsets respectively corresponding to each vertex.

[0130] The deformation processing device for model elements provided in the embodiment of the present invention can execute the deformation processing method for model elements provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0131] Embodiment 5

[0132] Figure 5 : is a structural diagram of a picture rendering device provided by Embodiment 5 of the present invention. The picture rendering device comprises: a target model element acquisition module 510, a vertex deformation coordinate generation module 520 and a rendering display module 530, wherein:

[0133] The target model element acquisition module 510 is used to acquire the current time and acquire at least one target model element to be processed by the dithering in the target picture whenever the dithering display condition of the target picture is detected;

[0134] A vertex deformation coordinate generating module 520, configured to obtain the vertex deformation coordinates of each vertex in each target model element by using the deformation processing method of the model element as described in any embodiment of the present invention;

[0135] The rendering and display module 530 is used to render and display each target model element according to the vertex deformation coordinates of each vertex in each target model element.

[0136] The technical solution of the embodiment of the present invention obtains the current time whenever the shaking display condition of the target picture is detected, and obtains at least one target model element to be shaken in the target picture, adopts the deformation processing method of the model element, and obtains the vertex deformation coordinates of each vertex in each target model element; according to the vertex deformation coordinates of each vertex in each target model element, the technical solution of rendering and displaying each target model element can control the vertices of the model element to perform shaking deformation processing around the center point of the model element when the model element is subjected to shaking deformation processing, so that the new model element obtained after rendering is closer to the actual breeze shaking effect. The technical solution of the embodiment of the present invention provides a deformation processing method for simulating the shaking of model elements in the breeze, optimizes the display effect of the model elements, and further improves the authenticity of the displayed picture.

[0137] The image rendering device provided in the embodiment of the present invention can execute the image rendering method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0138] Embodiment 6

[0139] Figure 6 It is a schematic diagram of the structure of the computer device in the sixth embodiment of the present invention. Figure 6 A block diagram of an exemplary computer device 412 suitable for use in implementing embodiments of the present invention is shown. Figure 6 The computer device 412 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0140] like Figure 6 As shown, the computer device 412 is in the form of a general-purpose computing device. The components of the computer device 412 may include, but are not limited to: one or more processors or processing units 416, a system memory 428, and a bus 418 that connects different system components (including the system memory 428 and the processing unit 416).

[0141] Bus 418 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0142] The computer device 412 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 412, including volatile and non-volatile media, removable and non-removable media.

[0143] System memory 428 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 430 and / or cache memory 432. Computer device 412 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 434 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6 not shown, usually called a "hard drive"). Although Figure 6 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical medium) may be provided. In these cases, each drive may be connected to bus 418 via one or more data medium interfaces. Memory 428 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of various embodiments of the present invention.

[0144] A program / utility 440 having a set (at least one) of program modules 442 may be stored, for example, in memory 428, such program modules 442 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 442 generally perform the functions and / or methods of the embodiments described herein.

[0145] The computer device 412 may also communicate with one or more external devices 414 (e.g., keyboard, pointing device, display 424, etc.), one or more devices that enable a user to interact with the computer device 412, and / or any device that enables the computer device 412 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed via input / output (I / O) interface 422. Furthermore, the computer device 412 may also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network, such as the Internet) via network adapter 420. As shown, the network adapter 420 communicates with other modules of the computer device 412 via bus 418. It should be understood that although Figure 6Not shown, other hardware and / or software modules may be used in conjunction with computer device 412, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0146] The processing unit 416 executes various functional applications and data processing by running the programs stored in the system memory 428, for example, implementing a deformation processing method of a model element provided in an embodiment of the present invention, including:

[0147] Extracting vertex data of a model element, wherein the vertex data includes: vertex coordinates of each vertex and information of a center point of the model element;

[0148] Generate a vibration deformation function of each vertex according to the information of the center point, wherein the vibration deformation function is a time function;

[0149] According to the current time and the tremor deformation function of each vertex, the vertex coordinates of each vertex are adjusted to obtain the vertex deformation coordinates of each vertex.

[0150] Alternatively, a picture rendering method provided by an embodiment of the present invention is implemented, including:

[0151] Whenever a trembling display condition of a target picture is detected, a current time is acquired, and at least one target model element to be trembling is acquired in the target picture;

[0152] Using the deformation processing method of the model element as described in any one of the embodiments of the present invention, the vertex deformation coordinates of each vertex in each target model element are obtained;

[0153] Each target model element is rendered and displayed according to the vertex deformation coordinates of each vertex in each target model element.

[0154] Embodiment 7

[0155] Embodiment 7 of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, a deformation processing method of a model element provided in the embodiment of the present invention is implemented, including:

[0156] Extract vertex data of the model element, the vertex data including: vertex coordinates of each vertex and information of the center point of the model element; generate a tremor deformation function of each vertex according to the information of the center point, the tremor deformation function being a time function; adjust the vertex coordinates of each vertex according to the current time and the tremor deformation function of each vertex to obtain the vertex deformation coordinates of each vertex.

[0157] Alternatively, when the program is executed by a processor, a screen rendering method provided by an embodiment of the present invention is implemented, including:

[0158] Whenever a shaking display condition of a target screen is detected, the current time is obtained, and at least one target model element to be shaken is obtained in the target screen; the deformation processing method of the model element as described in any one of the embodiments of the present invention is adopted to obtain the vertex deformation coordinates of each vertex in each target model element; and each target model element is rendered and displayed according to the vertex deformation coordinates of each vertex in each target model element.

[0159] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.

[0160] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0161] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0162] Computer program code for performing the operation of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0163] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A deformation processing method for a model element, characterized in that: include: Extracting vertex data of a model element, wherein the vertex data includes: vertex coordinates of each vertex and information of a center point of the model element; Generate a vibration deformation function of each vertex according to the information of the center point, wherein the vibration deformation function is a time function; According to the current time and the trembling deformation function of each vertex, the vertex coordinates of each vertex are adjusted to obtain the vertex deformation coordinates of each vertex; The vertex data also includes: the softness factor and individual characteristic data of each vertex; Generating a tremor deformation function of each vertex according to the information of the center point includes: Obtaining a standard tremor function, wherein the standard tremor function includes: a plurality of parameters to be filled; Fill the information of the center point, the softness factor of each vertex and the individual feature data into the standard tremor function to obtain the tremor deformation function of each vertex; wherein the tremor deformation function is expressed as left and right vibration with a certain fixed point as the center at different times, thereby forming the deformation of the coordinates of each vertex; the individual feature data is a random value generated randomly, or a value calculated and generated according to a certain rule, or a value set according to the characteristics of the object, and the same or different individual feature data are set for each vertex of the same model element; According to the current time and the trembling deformation function of each vertex, the vertex coordinates of each vertex are adjusted to obtain the vertex deformation coordinates of each vertex, including: Calculate the deformation offset of each vertex according to the current time and the tremor deformation function of each vertex; The vertex deformation coordinates of each vertex are obtained according to the vertex coordinates of each vertex and the deformation offsets respectively corresponding to each vertex.

2. The method according to claim 1, characterized in that: The standard dither function is a sine function.

3. A picture rendering method, characterized in that: include: Whenever a trembling display condition of a target picture is detected, a current time is acquired, and at least one target model element to be trembling is acquired in the target picture; Using the method described in any one of claims 1 to 2, obtaining the vertex deformation coordinates of each vertex in each target model element; Each target model element is rendered and displayed according to the vertex deformation coordinates of each vertex in each target model element.

4. A deformation processing device for a model element, characterized in that: include: A vertex data extraction module, used to extract vertex data of a model element, wherein the vertex data includes: vertex coordinates of each vertex and information of a center point of the model element; A tremor deformation function generating module, used for generating a tremor deformation function of each vertex according to the information of the center point, wherein the tremor deformation function is a time function; A vertex coordinate adjustment module, used to adjust the vertex coordinates of each vertex according to the current time and the tremor deformation function of each vertex to obtain the vertex deformation coordinates of each vertex; The vertex data also includes: the softness factor and individual characteristic data of each vertex; The tremor deformation function generation module is specifically used to obtain a standard tremor function, which includes: a plurality of parameters to be filled; the information of the center point, the softness factor of each vertex and the individual feature data are filled into the standard tremor function to obtain the tremor deformation function of each vertex; wherein the tremor deformation function is expressed as left and right vibrations with a certain fixed point as the center at different times, thereby forming the deformation of the coordinates of each vertex; the individual feature data is a random value generated randomly, or a value calculated and generated according to a certain rule, or a value set according to the characteristics of the object, and the same or different individual feature data are set for each vertex of the same model element; Wherein, the vertex coordinate adjustment module is specifically used for: Calculate the deformation offset of each vertex according to the current time and the tremor deformation function of each vertex; The vertex deformation coordinates of each vertex are obtained according to the vertex coordinates of each vertex and the deformation offsets respectively corresponding to each vertex.

5. A picture rendering device, characterized in that: include: A target model element acquisition module, used for acquiring the current time and acquiring at least one target model element to be processed by the dithering in the target picture whenever a dithering display condition of the target picture is detected; A vertex deformation coordinate generation module, used to obtain the vertex deformation coordinates of each vertex in each target model element by using the method described in any one of claims 1-2; The rendering and display module is used to render and display each target model element according to the vertex deformation coordinates of each vertex in each target model element.

6. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, it implements the deformation processing method of the model element as described in any one of claims 1-2, or implements the picture rendering method as described in claim 3.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, it implements the deformation processing method of the model element as described in any one of claims 1-2, or implements the picture rendering method as described in claim 3.

Citation Information

Patent Citations

  • Potted plant growth process display method and device, storage medium and equipment

    CN109559366A