Simulation rendering method and device of biological structure, equipment and storage medium

By generating and mixing the heavy texture maps and distance field data of biological structures, the problem of rough dynamic effects of biological structures in the existing technology is solved, and vivid, universal and high-quality biological structure simulation rendering is achieved, improving the quality and production of game art efficiency.

CN119206019APending Publication Date: 2024-12-27NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411442105.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

When simulating the dynamic effects of biological structures, the effects of the prior art are relatively rough, lack the reduction and simulation of biological structures, and have high requirements for texture coordinates, and are not universal.

Method used

By generating several heavy texture maps of biological structures, a dynamic sweep effect is generated based on texture coordinates, and the distance field data is obtained, and the dynamic simulation rendering effect of biological structures on the surface of any mesh is achieved.

Benefits of technology

It realizes dynamic simulation and rendering of biological structures with vivid effects and strong versatility, improving the quality of game art and production efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119206019A_ABST
    Figure CN119206019A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a simulation rendering method and device of a biological structure, equipment and a storage medium. The method comprises the following steps: generating a plurality of re-texture maps of the biological structure; generating a light sweeping dynamic effect based on the texture coordinates of the multiple texture maps; obtaining distance field data of the plurality of re-texture maps; and performing hybrid calculation on the distance field data of the multiple texture maps and the light sweeping dynamic effect to obtain a dynamic simulation rendering effect of the biological structure acting on the surface of any grid body. On the basis of a technology of mixing a plurality of multi-texture coordinate projection and a distance field, the method acts on the surface of any grid body to realize vivid and highly universal simulation performance of a biological structure with dynamic requirements, so that the game art quality and the game making efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of game rendering technology, and in particular to a method for simulating and rendering a biological structure, a device for simulating and rendering a biological structure, a corresponding electronic device, and a corresponding computer-readable storage medium. Background Art

[0002] In the game production process, there is a need for the appearance design of mimicry of creatures.

[0003] In order to simulate the dynamic performance of biological structures, in related technologies, by using the principle of texture coordinate sampling noise, the texture bias technology is applied for hybrid calculation to simulate the dynamic effect similar to breathing flicker. However, the dynamic effect of the biological structure achieved by the above method is relatively rough, lacks the restoration and simulation of the biological structure, and has high requirements for texture coordinates and is not universal. Summary of the invention

[0004] In view of the above problems, embodiments of the present invention are proposed to provide a method for simulating and rendering a biological structure, a device for simulating and rendering a biological structure, a corresponding electronic device, and a corresponding computer-readable storage medium that overcome the above problems or at least partially solve the above problems.

[0005] An embodiment of the present invention discloses a method for simulating and rendering a biological structure, the method comprising:

[0006] generating a plurality of retexture maps of the biological structure;

[0007] Generating a sweeping light dynamic effect based on the texture coordinates of the plurality of retexture maps;

[0008] Obtaining distance field data of the plurality of retexture maps;

[0009] The distance field data of the plurality of retexture maps and the dynamic light sweeping effect are mixed and calculated to obtain a dynamic simulation rendering effect of the biological structure acting on the surface of any mesh body.

[0010] The embodiment of the present invention further discloses a biological structure simulation rendering device, the device comprising:

[0011] A texture map generation module, used to generate a plurality of texture maps of the biological structure;

[0012] A light sweeping dynamic effect generation module, used for generating a light sweeping dynamic effect based on the texture coordinates of the plurality of heavy texture maps;

[0013] A distance field data acquisition module, used to acquire distance field data of the plurality of retexture maps;

[0014] The hybrid calculation module is used to perform hybrid calculation on the distance field data of the plurality of heavy texture maps and the dynamic effect of the light sweeping to obtain a dynamic simulation rendering effect of the biological structure acting on the surface of any mesh body.

[0015] An embodiment of the present invention further discloses an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, any one of the biological structure simulation rendering methods is implemented.

[0016] The embodiment of the present invention further discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, any one of the biological structure simulation rendering methods is implemented.

[0017] The embodiments of the present invention include the following advantages:

[0018] In the embodiment of the present invention, by generating a plurality of retexture maps of biological structures, based on the texture coordinates of the plurality of retexture maps, a sweeping dynamic effect is generated, and then by obtaining the distance field data of the plurality of retexture maps, the distance field data of the plurality of retexture maps and the sweeping dynamic effect are mixed and calculated to obtain the dynamic simulation rendering effect of the biological structure acting on the surface of any mesh body. Based on the technology of projecting a plurality of retexture coordinates and mixing the distance field, acting on the surface of any mesh body, a vivid and versatile simulation of biological structures with dynamic requirements is achieved, which can improve the quality of game art and the efficiency of game production. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a flowchart of steps of an embodiment of a method for simulating and rendering a biological structure of the present invention;

[0020] Figure 2 is a flowchart of another embodiment of a method for simulating and rendering a biological structure of the present invention;

[0021] Figure 3 is a schematic diagram of generating a first texture map provided by an embodiment of the present invention;

[0022] Figure 4 is a schematic diagram of generating a second texture map provided by an embodiment of the present invention;

[0023] Figure 5 is a schematic diagram of generating a third texture map provided by an embodiment of the present invention;

[0024] Figure 6 is a schematic diagram of generating a fourth texture map provided by an embodiment of the present invention;

[0025] Figure 7 is a schematic diagram of generating a noise texture provided by an embodiment of the present invention;

[0026] Figure 8 is an example diagram of a bias texture provided by an embodiment of the present invention;

[0027] Fig. 9 is a schematic diagram of a dynamic light scanning effect provided by an embodiment of the present invention;

[0028] Fig.10 It is a schematic diagram of the hybrid computing effect provided by an embodiment of the present invention;

[0029] Fig.11 is a schematic diagram of a simulated rendering effect provided by an embodiment of the present invention;

[0030] Fig.12 It is a structural block diagram of an embodiment of a biological structure simulation rendering device of the present invention. DETAILED DESCRIPTION

[0031] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0032] The embodiment of the present invention is based on a technology of mixing several heavy texture coordinate projections and distance fields, and acts on the surface of any mesh body to achieve a vivid and versatile simulation of biological structures with dynamic requirements, which can improve the quality of game art and the efficiency of game production.

[0033] Reference Figure 1 , shows a flowchart of a method for simulating and rendering a biological structure according to an embodiment of the present invention, which may specifically include the following steps:

[0034] Step 101, generating a plurality of heavy texture maps of the biological structure;

[0035] The embodiments of the present invention may involve dynamic simulation rendering of biological structures with dynamic requirements. The biological structures with dynamic requirements may include but are not limited to scales and hard shells, which are not limited by the embodiments of the present invention.

[0036] In order to realize dynamic simulation rendering of biological structures with dynamic requirements, firstly, a plurality of heavy texture maps of the biological structure may be acquired so as to realize dynamic simulation processing based on a plurality of heavy texture coordinate projection technologies.

[0037] Several retexture maps can refer to applying multiple textures to the same model, and each texture map can be used to achieve different effects.

[0038] Optionally, the multiple retexture maps involved in the embodiment of the present invention may include one or more of the following texture maps, such as a first texture map for simulating the surface structure of a biological structure, a second texture map for simulating the surface pattern texture of a biological structure, a third texture map for indicating a phase difference during dynamic simulation rendering, and a fourth texture map for indicating a streamer mask during dynamic simulation rendering. It should be noted that the multiple retexture maps may also include other effect maps, such as color maps, normal maps, highlight maps, etc., which are not limited in the embodiment of the present invention.

[0039] Taking the dynamic effect of dragon scales, that is, the biological structure to be dynamically simulated and rendered is dragon scales as an example, among the several heavy texture maps produced, the first texture map can be used to simulate the surface structure of dragon scales, the second texture map can be used to simulate the totem expression of the dragon scale surface, the third texture map can be used to calculate the phase difference when the dragon scales are dynamically expressed, and the fourth texture map can be used to calculate the streamer mask when the dragon scales are dynamically expressed.

[0040] Step 102, generating a sweeping light dynamic effect based on the texture coordinates of a plurality of heavy texture maps;

[0041] The dynamic simulation processing based on the multiple retexture coordinate projection technology can be expressed as the texture coordinates based on the multiple retexture maps to generate the sweeping dynamic effect.

[0042] Optionally, it can be expressed as sampling a preset noise texture based on a number of heavy texture coordinates to obtain a biased noise texture. At this time, the biased effect can be mixed with the preset sweeping light effect, that is, a sweeping light dynamic effect is generated by mixing the biased noise texture with the preset sweeping light effect.

[0043] Step 103, obtaining distance field data of a plurality of heavy texture maps;

[0044] Step 104 , the distance field data of a plurality of retexture maps and the dynamic effects of light sweeping are mixed and calculated to obtain a dynamic simulation rendering effect of a biological structure acting on the surface of an arbitrary mesh body.

[0045] The generated sweeping light dynamic effect refers to a dynamic lighting effect, which is usually used to simulate the scanning or flow effect of light. In order to generate a more realistic and dynamic rendering effect, the distance field blending technology can be used to obtain a dynamic simulation rendering effect with vivid effects and strong versatility.

[0046] Among them, distance field data can be mainly used as a data structure to represent the distance from a point in space to a specific object. It is usually used for high-precision geometric representation and can accurately describe the shape and details of the model.

[0047] In some embodiments of the present invention, the distance field data of several retexture maps and the dynamic effects of light sweeping can be combined with the high-precision geometric representation provided by the distance field data to generate high-quality rendering effects to meet the needs of different application scenarios.

[0048] In practical applications, the distance field data can be drawn when the texture asset is produced, and the blending calculation can be implemented in the material shader part, that is, the material shader can obtain the distance field data determined when drawing several heavy texture maps of the biological structure, and is used to blend the distance field data with the sweeping dynamic effect.

[0049] Optionally, the implementation process of steps 102 to 104 above can be implemented in the material shader part. After obtaining the material shader that can implement the process of steps 102 to 104 above, the aforementioned material shader can be assigned to any mesh body to project it on the surface of any mesh body by using a number of heavy texture coordinates, so as to achieve the dynamic simulation rendering effect of the corresponding biological structure acting on the surface of any mesh body.

[0050] In the embodiment of the present invention, by generating a plurality of retexture maps of biological structures, based on the texture coordinates of the plurality of retexture maps, a sweeping dynamic effect is generated, and then by obtaining the distance field data of the plurality of retexture maps, the distance field data of the plurality of retexture maps and the sweeping dynamic effect are mixed and calculated to obtain the dynamic simulation rendering effect of the biological structure acting on the surface of any mesh body. Based on the technology of projecting a plurality of retexture coordinates and mixing the distance field, acting on the surface of any mesh body, a vivid and versatile simulation of biological structures with dynamic requirements is achieved, which can improve the quality of game art and the efficiency of game production.

[0051] Reference Figure 2 , shows a flowchart of another biological structure simulation rendering method embodiment of the present invention, which may specifically include the following steps:

[0052] Step 201, generating a plurality of heavy texture maps of the biological structure;

[0053] Embodiments of the present invention may involve dynamic simulation rendering of biological structures with dynamic requirements. The biological structures with dynamic requirements may include but are not limited to scale-like and hard-shell-like biological structures.

[0054] In order to realize dynamic simulation rendering of biological structures with dynamic requirements, firstly, a plurality of heavy texture maps of the biological structure may be acquired so as to realize dynamic simulation processing based on a plurality of heavy texture coordinate projection technologies.

[0055] Several retexture maps may refer to applying multiple textures on the same model, and each texture map may be used to achieve different effects. Optionally, the several retexture maps involved in the embodiment of the present invention may include one or more of the following, such as a first texture map for simulating the surface structure of a biological structure, a second texture map for simulating the surface pattern texture of a biological structure, a third texture map for indicating a phase difference during dynamic simulation rendering, and a fourth texture map for indicating a streamer mask during dynamic simulation rendering.

[0056] The generation process of the first texture map can be expressed as generating a surface structure texture of a biological structure, and then the aforementioned generated surface structure texture array can be distributed to a preset map, and a preset distance field is superimposed on the surface structure texture located on the preset map to obtain the first texture map.

[0057] For example, taking dragon scale as an example, the surface structure texture of the dragon scale can be a dragon scale texture. When making the first part of the dragon scale texture, the surface details of the dragon scale and the erosion part distance field mixed data can be calculated to simulate the surface structure of the dragon scale.

[0058] Optionally, you can first draw a Figure 3 The dragon scale texture shown in (1) can then be used using array algorithms, such as Figure 3 As shown in (2), the dragon scales are spread over the entire preset texture; by superimposing Figure 3 The preset distance field shown in (3) and (4) may be a distance field that decays from the middle to both sides, and may be superimposed as shown in Figure 3 The Perlin noise attenuated toward both sides in the middle shown in (5) and (6) is used to simulate the structure and erosion of the dragon scale based on the superposition of the aforementioned preset distance field and the Perlin noise, thereby obtaining the first texture map of the dragon scale texture.

[0059] Among them, the distance field is a field that records distance information. The distance field that decays from the middle to both sides can be expressed as Figure 3 As shown in (4), the grayscale of the middle part is 1, indicating that the distance is 1, and the grayscale of the two sides of the scale is 0, indicating that the distance is 0, that is, what is recorded is the distance field between the two ends of the scale and the middle; the erosion part refers to the uneven texture presentation caused by erosion of the scales through noise simulation, which can be specifically as follows Figure 3 As shown in (6).

[0060] The generation process of the second texture map can be expressed as generating a surface pattern texture of the biological structure, and then randomly distributing the aforementioned generated surface pattern texture to a preset map to obtain the second texture map.

[0061] For example, taking dragon scales as an example, the surface pattern texture of the dragon scales can be a totem expression on the dragon scale surface, such as auspicious cloud texture, etc. When making the second part of the dragon scale texture, the auspicious cloud texture can be randomly distributed by a discrete random scattering algorithm to simulate the totem expression on the dragon scale surface.

[0062] Optionally, you can first draw a Figure 4 The auspicious cloud texture shown in (1) can then be tiled with the auspicious cloud texture over the entire preset map using a random scattering algorithm, resulting in Figure 4 The second texture map shown in (2).

[0063] The generation process of the third texture map can be expressed as performing an inverse operation on the surface structural texture of the biological structure to obtain a shape island texture for the surface structural texture, and then distributing the aforementioned generated shape island texture array to a preset map, and performing discrete grayscale distribution on the shape island texture located on the preset map to obtain the third texture map.

[0064] Shape island texture refers to an isolated, irregular shape area in two-dimensional or three-dimensional space.

[0065] For example, taking dragon scales as an example, when making the third part of the dragon scale texture, the shape islands in the dragon scale texture can be discretely distributed in grayscale through a flood fill algorithm to calculate the phase difference when the dragon scale dynamic effect is expressed.

[0066] Optionally, the drawing can be obtained as Figure 3 The dragon scale texture shown in (1) is inverted to obtain a texture map of a tiled full-shaped island texture. As an example, in order to quickly obtain a texture map of a tiled full-shaped island texture, you can directly convert Figure 3 The texture map of the dragon scale texture shown in (2) is inverted to obtain Figure 5 The texture map of the tiled full-shape island texture shown in (1) is another example. Figure 3 The dragon scale texture shown in (1) is inverted, and then the array algorithm is used to tile the inverted dragon scale texture over the entire preset map, resulting in the following Figure 5 The texture map of the tiled full-shape island texture shown in (1).

[0067] In getting Figure 5 After the texture map of the tiled shape island texture shown in (1) is filled, the flood filling algorithm can be used to perform discrete grayscale distribution on the shape island texture to obtain the following Figure 5 The third texture map shown in (2) can be used to indicate the phase difference during dynamic simulation rendering.

[0068] The generation process of the fourth texture map can be expressed as performing an expansion operation on the surface structure texture of the biological structure to obtain the expanded surface structure texture, and then performing a difference calculation on the expanded surface structure texture and the surface structure texture before the expansion to obtain the surface stroke texture, and then distributing the aforementioned generated surface stroke texture array to a preset map to obtain the fourth texture map.

[0069] For example, taking dragon scales as an example, when making the fourth part of the dragon scale texture, the dragon scale texture stroke area can be obtained by dilation and difference calculation of the dragon scale texture, which is used to calculate the streamer mask when the dragon scale is dynamically expressed.

[0070] Optionally, first, you can use the art asset production tool to Figure 3 The dragon scale texture shown in (1) is expanded, and then the difference between it and the dragon scale before expansion is calculated, as shown in Figure 6 (1) shows a surface stroke texture, that is, a surface structure texture with a stroke area; at the same time, a spherical attenuation can be added to the surface stroke texture, such as Figure 6 As shown in (2), the final structure used to express the stroke is obtained. At this time, the array algorithm can be used to convert Figure 6 The stroke texture shown in (2) is tiled over the entire preset map, resulting in Figure 6 The fourth texture map shown in (3).

[0071] Step 202, obtaining a plurality of retexture coordinates of a plurality of retexture maps;

[0072] The embodiment of the present invention realizes dynamic simulation processing based on several heavy texture coordinate projection technologies. At this time, several heavy texture coordinates of several heavy texture maps can be obtained, so as to construct several heavy texture coordinate projection algorithms based on the obtained several heavy texture coordinates, so as to facilitate subsequent projection rendering processing.

[0073] The multiple texture coordinates may refer to texture coordinates in three directions, namely, texture coordinates in the x, y and z directions.

[0074] Optionally, the relative coordinates of the world space and the point (0,0,0) in three directions of the three-sided xy plane, yz plane, and xz plane can be calculated first, and the calculated relative coordinates can be range-scaled to obtain texture coordinates in three directions for subsequent texture sampling implementation.

[0075] For example, the pseudo code may be as follows:

[0076] (Relative coordinates = relativePos, world coordinates = posWorld, local space to world space matrix = LocalToWorldMat)

[0077] / / relativePos can refer to relative coordinates, which can represent the offset of the position in the world coordinate system relative to a local space origin; posWorld can refer to the position in the world coordinate system; LocalToWorldMat can refer to the transformation matrix from local space to world space; uvx, uvy, uvz can refer to the generated texture coordinates (UV coordinates), which are used for texture mapping in different directions; Tilling can refer to the tiling parameters of the texture, which can be mainly used to control the number of texture repetitions;

[0078] relativePos=posWorld-Transfrom(LocalToWorldMat,float3(0,0,0));

[0079] / / Transfrom transforms the origin of the local space (i.e. the coordinates of the local space (0,0,0)) into the world coordinate system, and calculates the offset of the position posWorld in the world coordinate system relative to the origin of the local space through posWorld-Transfrom to obtain the relative coordinate relativePos;

[0080] uvx=float2(relativePos.y,relativePos.z*-1)*Tilling;

[0081] / / Use the Y component of the relative coordinate as the U component of the texture coordinate and the negative value of the Z component of the relative coordinate as the V component of the texture coordinate, and multiply the texture coordinate by the tiling parameter Tilling to control the number of repetitions of the texture to obtain the texture mapping in the X direction;

[0082] uvy=float2(relativePos.y,relativePos.z)*Tilling;

[0083] / / Use the Y component of the relative coordinate as the U component of the texture coordinate and the Z component of the relative coordinate as the V component of the texture coordinate, and multiply the texture coordinate by the tiling parameter Tilling to control the number of repetitions of the texture to obtain the texture mapping in the Y direction;

[0084] uvz=float2(relativePos.y,relativePos.x)*Tilling;

[0085] / / Use the Y component of the relative coordinate as the U component of the texture coordinate and the X component of the relative coordinate as the V component of the texture coordinate, and multiply the texture coordinate by the tiling parameter Tilling to control the number of repetitions of the texture to obtain the texture mapping in the Z direction.

[0086] The main purpose of the above pseudo code is to convert the position in the world coordinate system into relative coordinates and generate texture coordinates (UV coordinates) based on the relative coordinates. The generated texture coordinates can be used for texture mapping in different directions, and the number of texture repetitions can be controlled by the tiling parameter Tilling to achieve complex rendering effects.

[0087] In some embodiments of the present invention, the texture coordinates in the above three directions can constitute a plurality of heavy texture coordinates. The construction of a plurality of heavy texture coordinate projection algorithms depends on the texture coordinates in the above three directions. The use of a plurality of heavy texture coordinate projection algorithms can make the texture sampled normally in all directions, and can also realize a multi-directional dynamic bias effect in combination with a time function.

[0088] Step 203, sampling a preset noise texture based on a number of heavy texture coordinates to obtain a biased noise texture;

[0089] The bias effect can be achieved by sampling a preset noise texture based on a number of texture coordinates; the dynamic bias effect can be achieved by combining the noise data obtained by the aforementioned sampling with a time function for subsequent dynamic effect calculations.

[0090] Specifically, the preset noise texture may be sampled based on a number of heavy texture coordinates to obtain noise data, and then the noise data is fused and calculated with a preset time function to obtain the biased noise texture.

[0091] The preset noise texture used for sampling may be a high-frequency continuous noise used to simulate the performance of streamer light.

[0092] For example, in an art asset production tool, you can use Figure 7 The Perlin noise shown in (1) and the similar caustics such as Figure 7 The noise shown in (2) is mixed and calculated to obtain Figure 7 The high-frequency texture noise shown in (3) can be specifically realized by performing a 0.5 linear interpolation mixed calculation on the Perlin noise and the caustic noise, and this is not limited in the embodiment of the present invention.

[0093] Samples a preset noise texture based on a number of heavy texture coordinates, optionally, such as Figure 8 As shown, for the texture coordinates in the x, y and z directions, several texture coordinate projection algorithms can be used to sample the noise texture shown in Figure (7) 3 to obtain multi-directional noise data; then the multi-directional noise data can be combined with the preset time function to obtain Figure 8The multi-directional texture bias effect shown in (1), (2), and (3) can be specifically expressed as superimposing the time function with the x, y, and z axis values ​​of the texture bias to achieve a dynamic texture bias effect in multiple directions.

[0094] Step 204, performing mixed calculation on the biased noise texture and the preset sweeping light effect to generate a sweeping light dynamic effect;

[0095] In some embodiments of the present invention, the preset light sweeping effect and the bias effect obtained by the above calculation may be mixed and calculated to obtain a light sweeping effect with noise disturbance, that is, a light sweeping dynamic effect.

[0096] Specifically, the preset illumination effect and the preset time function can be fused and calculated by the algorithm to obtain the preset sweeping light effect. At this time, the preset sweeping light effect can be a multi-layer sweeping light effect. Then, the multi-layer sweeping light effect and the biased noise texture can be fused and calculated by the algorithm to obtain the following: Fig. 9 The dynamic effect of scanning light shown in (1) to (3).

[0097] For example, the pseudo code may be as follows:

[0098] (Only one plane's scanning calculation logic is shown, the other three planes are the same. The first layer scanning initial version = scan1, the second layer scanning initial version = scan2, the first layer scanning final version = finalScan1, the second layer scanning final version = finalScan2, starting point 1 = startTermX, starting point 2 = startTermY, starting point 3 = startTermZ, starting point 4 = startTermW, xy plane noise = noiseX)

[0099] / / scan1 can refer to the first layer of scanning, which is mainly used to indicate the preliminary calculation result of the first layer of scanning effect; scan2 can refer to the second layer of scanning, which is mainly used to indicate the preliminary calculation result of the second layer of scanning effect; finalScan1 can refer to the final version of the first layer of scanning, which is mainly used to indicate the final calculation result of the first layer of scanning effect; finalScan2 can refer to the final version of the second layer of scanning, which is mainly used to indicate the final calculation result of the second layer of scanning effect; startTermX, startTermY, startTermZ, startTermW can refer to the starting point of the scanning, which is mainly used to control the position of the scanning; time can refer to the time variable, which is mainly used to control the movement of the scanning; uvx can refer to the generated texture coordinates (UV coordinates), which is mainly used to calculate the scanning effect; noiseX can refer to the noise on the xy plane, which is mainly used to increase the randomness and complexity of the scanning effect;

[0100] scan1=saturate(1.25-distance(uvx.x,lerp(startTermX,startTermY,frac(time*0.2))));

[0101] / / distance can calculate the distance from the texture coordinate uvx.x to the starting point of the light sweep, lerp(startTermX, startTermY, frac(time*0.2)). Among them, lerp can interpolate between startTermX and startTermY according to time and the interpolation function lerp to generate the starting point of the light sweep; frac can multiply the time by 0.2 and take the decimal part to control the movement of the light sweep; 1.25-distance(...) can subtract 1.25 from the distance value to get the preliminary calculation result of the light sweep effect; saturate(...) can limit the calculation result to the range of [0,1] to avoid exceeding the range;

[0102] scan2=saturate(1.25-distance(uvx.x,lerp(startTermZ,startTermW,frac(time*0.2))));

[0103] / / distance can calculate the distance from the texture coordinate uvx.x to the starting point of the light sweep, lerp(startTermZ, startTermW, frac(time*0.2)), where lerp can interpolate between startTermZ and startTermW according to the time and the interpolation function lerp to generate the starting point of the light sweep; frac can multiply the time by 0.2 and take the decimal part to control the movement of the light sweep; 1.25-distance(...) can subtract 1.25 from the distance value to get the preliminary calculation result of the light sweep effect; saturate(...) can limit the calculation result to the range of [0,1] to avoid exceeding the range;

[0104] finalScan1=smoothstep(-0.5,1,scan1)+smoothstep(-0.5,1,scan2);

[0105] / / smoothstep(-0.5,1,scan1) means using the smoothstep function to smooth scan1 so that it transitions smoothly within the range of [-0.5,1]; smoothstep(-0.5,1,scan2) means using the smoothstep function to smooth scan2 so that it transitions smoothly within the range of [-0.5,1]; finalScan1 means adding the two smoothing results to get the final version of the first layer of scanning;

[0106] finalScan2=smoothstep(0,1,scan1-0.5)*smoothstep(0,1,noiseX)+smoothstep(0,1,scan2-0.5)*smoothstep(0,1,noixeX);

[0107] / / smoothstep(0,1,scan1-0.5) means using the smoothstep function to smooth scan1-0.5 so that it transitions smoothly within the range of [0,1]; smoothstep(0,1,noiseX) means using the smoothstep function to smooth noiseX so that it transitions smoothly within the range of [0,1]; smoothstep(0,1,scan2-0.5) means using the smoothstep function to smooth scan2-0.5 so that it transitions smoothly within the range of [0,1]; finalScan2 means multiplying the two smoothed results to get the final version of the second layer of scanning.

[0108] The above pseudo code shows the logic of calculating the sweeping light effect on a plane. It mainly generates a dynamic sweeping light effect by calculating the distance from the texture coordinate to the starting point of the sweeping light, and combines the time variable and noise. Finally, the final sweeping light effect is obtained through smoothing and addition / multiplication operations. The sweeping light effect can usually be used to simulate the scanning or flow effect of light to increase the dynamics and vividness of the rendering.

[0109] Step 205 , the distance field data of a plurality of retexture maps and the dynamic effects of light sweeping are mixed and calculated to obtain a dynamic simulation rendering effect of a biological structure acting on the surface of an arbitrary mesh body.

[0110] The generated sweeping light dynamic effect refers to a dynamic lighting effect, which is usually used to simulate the scanning or flow effect of light. In order to generate a more realistic and dynamic rendering effect, the distance field blending technology can be used to obtain a dynamic simulation rendering effect with vivid effects and strong versatility.

[0111] Among them, distance field data can be mainly used as a data structure to represent the distance from a point in space to a specific object. It is usually used for high-precision geometric representation and can accurately describe the shape and details of the model.

[0112] In some embodiments of the present invention, the distance field data of several retexture maps and the dynamic effects of light sweeping can be combined with the high-precision geometric representation provided by the distance field data to generate high-quality rendering effects to meet the needs of different application scenarios.

[0113] Specifically, the dynamic light sweeping effect can be rendered into several heavy texture maps, and then based on the distance field data, multiple rendering areas can be discretized from the several heavy texture maps for rendering the dynamic light sweeping effect, and various rendering areas can be superimposed on the preset lighting model to obtain the dynamic simulation rendering effect of the biological structure acting on the surface of any mesh.

[0114] For example, taking dragon scales as an example, the four parts of the dragon scale texture can be sampled through several retexture coordinate mapping algorithms, and combined with the calculated sweeping light dynamic effect, to achieve the rendering of the sweeping light dynamic effect to several retexture maps. For example, several retexture coordinate mapping algorithms can be used to sample four parts of the dragon scale texture, and then the sampled dragon scale texture and the sweeping light effect can be combined through the algorithm to obtain the following: Fig.10 The rendering effects shown in (1) to (4) above.

[0115] After combining the four parts of the sweeping light dynamic effect and the dragon scale effect, a variety of rendering areas can be discretized from several heavy texture maps for rendering the sweeping light dynamic effect. Specifically, the distance field blending algorithm can be used to discretize shallow areas, depth areas, highlight areas, streamer areas, stroke areas, etc., which can be superimposed on the lighting model to achieve the dynamic effect of the dragon scale simulated structure.

[0116] In practical applications, after obtaining multiple rendering areas discretized, they can be mixed with corresponding colors. Specifically, multiple range areas are obtained by stripping and extracting multiple grayscales of the distance field, and the areas are divided into depth areas, highlight areas, streamer areas, and stroke areas according to the texture parts where the areas are located, and the areas are mixed with the corresponding colors of each part. It should be noted that the colors of each part can be customized by the user, and this is not limited by the embodiment of the present invention.

[0117] As an example, suppose the discretized shallow region can be Fig.11 As shown in (1), the highlight area can be Fig.11As shown in (2), at this time, the distance field provided by the dragon scale texture, that is, the surface details of the dragon scale and the distance field of the eroded part are mixed, and the value range of several heavy texture maps is scaled to obtain the highlight area and the shallow area; after the two areas are interpolated based on a certain custom color, the dragon scale base color of the above two areas can be obtained, for example, Fig.11 The superficial area after staining shown in (3) and Fig.11 The highlight area after dyeing shown in (4).

[0118] As another example, Fig.11 The superficial area after staining shown in (3) and Fig.11 The dyed highlight area shown in (4) is combined with the dynamic light sweeping effect to obtain Fig.11 The dragon scale light effect shown in (5).

[0119] Optionally, you can combine the dragon scale totem expression with the totem color to get Fig.11 The effect shown in (6) is achieved to complete the dragon scales with totems; moreover, the phase difference graphic island texture can be applied to the color intensity of each scale to make each scale have a light and dark contrast relationship, so as to achieve the enhanced expression of the dragon scale structure; and the dragon scale stroke texture combined with the color can be applied to the above result, so as to obtain the following: Fig.11 The effect shown in (7) completes the calculation of the dragon scale dynamic effect.

[0120] The combination mentioned in the embodiment of the present invention may specifically refer to adding the corresponding color values ​​given by the user to the calculated regions through multiplication, and the embodiment of the present invention does not impose any limitation on this.

[0121] It should be noted that the implementation process of the above steps 202 to 205 can be implemented in the material shader part. After obtaining the material shader that can implement the above steps 202 to 205, the aforementioned material shader can be assigned to any mesh body to project it on the surface of any mesh body by using a number of heavy texture coordinates, so as to achieve the dynamic simulation rendering effect of the corresponding biological structure acting on the surface of any mesh body.

[0122] In the embodiment of the present invention, a technology based on the mixing of several heavy texture coordinate projections and distance fields is applied to the surface of any mesh body to achieve a vivid and versatile simulation of biological structures with dynamic requirements, which can improve the quality of game art and the efficiency of game production.

[0123] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0124] Reference Fig.12 , shows a structural block diagram of an embodiment of a biological structure simulation rendering device of the present invention, which may specifically include the following modules:

[0125] A texture map generation module 1201, used to generate a plurality of texture maps of the biological structure;

[0126] A sweeping light dynamic effect generation module 1202, used to generate a sweeping light dynamic effect based on the texture coordinates of the plurality of retexture maps;

[0127] A distance field data acquisition module 1203 is used to acquire distance field data of the plurality of retexture maps;

[0128] The hybrid calculation module 1204 is used to perform hybrid calculation on the distance field data of the plurality of heavy texture maps and the scanning dynamic effect to obtain a dynamic simulation rendering effect of the biological structure acting on the surface of any mesh body.

[0129] In some embodiments of the present invention, the plurality of heavy texture maps include one or more of the following: a first texture map, a second texture map, a third texture map, and a fourth texture map;

[0130] Among them, the first texture map is used to simulate the surface structure of the biological structure; the second texture map is used to simulate the surface pattern texture of the biological structure; the third texture map is used to indicate the phase difference during dynamic simulation rendering; and the fourth texture map is used to indicate the streamer mask during dynamic simulation rendering.

[0131] In some embodiments of the present invention, the texture map generation module 1201 may include the following submodules:

[0132] The first texture map generation submodule is used to generate the surface structure texture of the biological structure; distribute the surface structure texture array to a preset map, superimpose a preset distance field on the surface structure texture located on the preset map, and generate the first texture map.

[0133] In some embodiments of the present invention, the texture map generation module 1201 may include the following submodules:

[0134] The second texture map generation submodule is used to generate a surface pattern texture of the biological structure; and randomly distribute the surface pattern texture to a preset map to generate the second texture map.

[0135] In some embodiments of the present invention, the texture map generation module 1201 may include the following submodules:

[0136] The third texture map generation submodule is used to perform an inverse operation on the surface structure texture of the biological structure to obtain a shape island texture for the surface structure texture; distribute the shape island texture array to a preset map, and perform discrete grayscale distribution on the shape island texture located on the preset map to generate the third texture map.

[0137] In some embodiments of the present invention, the texture map generation module 1201 may include the following submodules:

[0138] The fourth texture map generation submodule is used to perform an expansion operation on the surface structure texture of the biological structure to obtain the expanded surface structure texture; perform a difference calculation on the expanded surface structure texture and the surface structure texture before expansion to obtain a surface stroke texture; and distribute the surface stroke texture array to a preset map to generate the fourth texture map.

[0139] In some embodiments of the present invention, the light sweeping dynamic effect generation module 1202 may include the following submodules:

[0140] The sweeping light dynamic effect generation submodule is used to obtain a number of heavy texture coordinates of the said number of heavy texture maps; based on the said number of heavy texture coordinates, a preset noise texture is sampled to obtain a biased noise texture; and the biased noise texture is mixed and calculated with a preset sweeping light effect to generate a sweeping light dynamic effect.

[0141] In some embodiments of the present invention, the sweeping light dynamic effect generation submodule may include the following units:

[0142] The texture biasing unit is used to sample the preset noise texture based on the plurality of heavy texture coordinates to obtain noise data; and fuse the noise data with a preset time function to obtain a biased noise texture.

[0143] In some embodiments of the present invention, the light sweeping dynamic effect generation module 1202 may further include the following submodules:

[0144] The preset scanning effect generation submodule is used to fuse the preset lighting effect with the preset time function to obtain the preset scanning light effect.

[0145] In some embodiments of the present invention, the hybrid computing module 1204 may include the following submodules:

[0146] A hybrid calculation submodule is used to render the sweeping light dynamic effect to the plurality of retexture maps; based on the distance field data, a plurality of rendering areas are discretized from the plurality of retexture maps for rendering the sweeping light dynamic effect, and various rendering areas are superimposed on a preset lighting model to obtain a dynamic simulation rendering effect of the biological structure acting on the surface of any mesh body.

[0147] In an embodiment of the present invention, the biological structure simulation rendering device provided by the embodiment of the present invention generates a plurality of heavy texture maps of the biological structure, generates a sweeping dynamic effect based on the texture coordinates of the plurality of heavy texture maps, and then obtains the distance field data of the plurality of heavy texture maps, and performs mixed calculation on the distance field data of the plurality of heavy texture maps and the sweeping dynamic effect, thereby obtaining a dynamic simulation rendering effect of the biological structure acting on the surface of any mesh body. Based on the technology of projecting a plurality of heavy texture coordinates and mixing the distance field, the biological structure can be vividly and universally simulated on the surface of any mesh body to achieve a realistic expression of the biological structure with dynamic requirements, which can improve the quality of game art and the efficiency of game production.

[0148] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0149] An embodiment of the present invention further provides an electronic device, including:

[0150] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, each process of the above-mentioned biological structure simulation rendering method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0151] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the above-mentioned biological structure simulation rendering method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0152] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0153] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0154] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0155] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0156] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable terminal device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0157] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0158] Finally, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0159] It should also 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 terminal 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 terminal 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 terminal device including the elements.

[0160] The above describes in detail a method for simulating and rendering a biological structure, a device for simulating and rendering a biological structure, a corresponding electronic device, and a corresponding computer-readable storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A method for simulating and rendering a biological structure, characterized in that: The method comprises: generating a plurality of retexture maps of the biological structure; Generating a sweeping light dynamic effect based on the texture coordinates of the plurality of retexture maps; Obtaining distance field data of the plurality of retexture maps; The distance field data of the plurality of retexture maps and the dynamic light sweeping effect are mixed and calculated to obtain a dynamic simulation rendering effect of the biological structure acting on the surface of any mesh body.

2. The method according to claim 1, characterized in that The plurality of heavy texture maps include one or more of the following: a first texture map, a second texture map, a third texture map, and a fourth texture map; Among them, the first texture map is used to simulate the surface structure of the biological structure; the second texture map is used to simulate the surface pattern texture of the biological structure; the third texture map is used to indicate the phase difference during dynamic simulation rendering; and the fourth texture map is used to indicate the streamer mask during dynamic simulation rendering.

3. The method according to claim 2, characterized in that The generating of a plurality of retexture maps of the biological structure comprises: generating a surface structural texture of the biological structure; The surface structure texture array is distributed to a preset map, and a preset distance field is superimposed on the surface structure texture located on the preset map to generate the first texture map.

4. The method according to claim 2, characterized in that The generating of a plurality of retexture maps of the biological structure comprises: generating a surface pattern texture of the biological structure; The surface pattern texture is randomly distributed to a preset map to generate the second texture map.

5. The method according to claim 2, characterized in that: The generating of a plurality of retexture maps of the biological structure comprises: Performing an inversion operation on the surface structure texture of the biological structure to obtain a shape island texture for the surface structure texture; The shape island texture array is distributed to a preset map, and discrete grayscale distribution is performed on the shape island texture located on the preset map to generate the third texture map.

6. The method according to claim 2, characterized in that The generating of a plurality of retexture maps of the biological structure comprises: Performing an expansion operation on the surface structure texture of the biological structure to obtain an expanded surface structure texture; Performing difference calculation on the surface structure texture after expansion and the surface structure texture before expansion to obtain a surface stroke texture; The surface stroke texture array is distributed to a preset map to generate the fourth texture map.

7. The method according to claim 1 or 2, characterized in that: The step of generating a sweeping light dynamic effect based on the texture coordinates of the plurality of heavy texture maps comprises: Obtaining a number of retexture coordinates of the number of retexture maps; Sampling a preset noise texture based on the plurality of heavy texture coordinates to obtain a biased noise texture; The biased noise texture is mixed with a preset light sweeping effect to generate a light sweeping dynamic effect.

8. The method according to claim 7, characterized in that The sampling of the preset noise texture based on the plurality of heavy texture coordinates to obtain the biased noise texture includes: Sampling a preset noise texture based on the plurality of heavy texture coordinates to obtain noise data; The noise data is fused with a preset time function to obtain a biased noise texture.

9. The method according to claim 7, characterized in that: The method further comprises: The preset lighting effect is combined with the preset time function to obtain the preset sweeping light effect.

10. The method according to claim 2, characterized in that The mixing and calculating the distance field data of the plurality of retexture maps and the sweeping light dynamic effect to obtain the dynamic simulation rendering effect of the biological structure acting on the surface of any mesh body includes: Rendering the sweeping light dynamic effect to the plurality of heavy texture maps; Based on the distance field data, a plurality of rendering areas are discretized from a plurality of heavy texture maps for rendering the dynamic light sweeping effect, and the various rendering areas are superimposed on a preset lighting model to obtain a dynamic simulation rendering effect of the biological structure acting on the surface of any mesh body.

11. A biological structure simulation rendering device, characterized in that: The device comprises: A texture map generation module, used to generate a plurality of texture maps of the biological structure; A light sweeping dynamic effect generation module, used for generating a light sweeping dynamic effect based on the texture coordinates of the plurality of heavy texture maps; A distance field data acquisition module, used to acquire distance field data of the plurality of retexture maps; The hybrid calculation module is used to perform hybrid calculation on the distance field data of the plurality of heavy texture maps and the dynamic effect of the light sweeping to obtain a dynamic simulation rendering effect of the biological structure acting on the surface of any mesh body.

12. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the method for simulating and rendering a biological structure according to any one of claims 1 to 10 is implemented.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for simulating and rendering a biological structure according to any one of claims 1 to 10 is implemented.