Search

CN-121982186-A - Model rendering method and device and electronic equipment

CN121982186ACN 121982186 ACN121982186 ACN 121982186ACN-121982186-A

Abstract

The invention provides a model rendering method, a model rendering device and electronic equipment, wherein a target area in a target model is determined, the target model is located in a designated virtual space, a surface patch model is arranged in the designated virtual space, position parameters of the surface patch model in the designated virtual space are determined based on the target area, the surface patch model is rendered based on the position parameters and crack effect texture parameters generated in advance to control the surface patch model to display crack effects on the surface of the target model, and the crack effect texture parameters are generated based on stress distribution parameters and crack elements. The method can generate the crack effect in the target area in the target model through the surface patch model and the crack effect texture parameters, the generation position of the crack effect can be adjusted according to the requirement, related staff is not required to be modified manually, the labor cost is reduced, the crack texture parameters are generated based on the stress distribution parameters and the crack elements, the logic and the result layering sense are provided, the formed crack effect is more vivid, and the visual experience of a user is improved.

Inventors

  • REN LIYUE
  • ZHANG DIELUN

Assignees

  • 网易(杭州)网络有限公司

Dates

Publication Date
20260505
Application Date
20251229

Claims (17)

  1. 1. A method of model rendering, the method comprising: the method comprises the steps of determining a target area in a target model, wherein the target model is positioned in a specified virtual space, and the specified virtual space is provided with a patch model; determining a position parameter of the patch model in the specified virtual space based on the target area; Rendering the surface patch model based on the position parameter and the pre-generated crack effect texture parameter to control the surface patch model to display the crack effect on the surface of the target model, wherein the crack effect texture parameter is generated based on the stress distribution parameter and the crack element.
  2. 2. The method of claim 1, wherein the crack effect texture parameter is generated by: Obtaining a basic texture map and gradient parameters, wherein the basic texture map comprises stress distribution parameters; Performing directional warping processing on the basic texture map based on the gradient parameters to obtain a processed basic texture map; and generating crack effect texture parameters based on the crack texture elements and the processed basic texture map.
  3. 3. The method of claim 2, wherein generating a crack effect texture parameter based on a crack texture element and the base texture map comprises: adding crack texture elements to the processed base texture map based on stress distribution parameters in the processed base texture map, and generating a target texture map; and generating a crack effect texture parameter based on the target texture map.
  4. 4. A method according to claim 3, wherein the step of adding crack texture elements to the processed base texture map based on stress distribution parameters in the processed base texture map, generating a target texture map, comprises: Adding a first crack texture element to the processed base texture map based on stress distribution parameters in the processed base texture map, generating a first texture map; Adding a second crack texture element to the processed base texture map based on the stress distribution parameter in the processed base texture map and the distribution parameter of the first crack texture element to generate a second texture map, wherein the size of the second crack texture element is smaller than that of the first crack texture element; and superposing the first texture mapping and the second texture mapping to generate a target texture mapping.
  5. 5. A method according to claim 3, wherein the crack effect texture parameters comprise target elevation maps; Generating crack effect texture parameters based on the target texture map, comprising: Adjusting display parameters of crack texture elements in the target texture map; Performing image processing on the edge area of the crack texture element in the adjusted target texture map to generate a preliminary height map, wherein the image processing comprises softening processing and/or irregular processing; and determining a target area in the preliminary altitude map, and superposing preset noise on the target area to generate the target altitude map.
  6. 6. The method of claim 3, wherein the crack effect texture parameter comprises a base color map; Generating crack effect texture parameters based on the target texture map, comprising: generating an energy emission map based on the target texture map; And generating a basic color map based on the energy emission map and a preset color map.
  7. 7. The method of claim 6, wherein the step of generating an energy emission map based on the target texture map comprises: Generating a target height map based on the target texture map; inverting the target height map, and mapping the processed target height map through a nonlinear curve to obtain a first mask map; and processing a preset gradual change image based on the first mask map to generate an energy emission map.
  8. 8. The method of claim 7, wherein generating a base color map based on the energy emission map and a preset color map comprises: performing superposition processing on a preset first color map and a second color map based on a second mask map to generate an initial color map, wherein the second mask map is generated based on stress distribution parameters in the target texture map; And superposing the initial color mapping and the energy emission mapping to generate a basic color mapping.
  9. 9. The method of claim 1, wherein the designated virtual space includes a virtual character therein; the virtual character moves on the surface of the target model; A step of determining a target region in a target model, comprising: a target region in the target model is determined based on the position of the virtual character in the specified virtual space.
  10. 10. The method of claim 1, wherein determining the location parameters of the patch model in the specified virtual space based on the target region comprises: Determining world position coordinates and depth parameters of the target area; And updating the position parameters corresponding to each vertex of the surface patch model in a vertex shader based on the world position coordinates and the depth parameters of the target area.
  11. 11. The method of claim 10, wherein the step of determining world location coordinates and depth parameters of the target area comprises: Projecting a first vertex formed in the target area to a designated plane to obtain a projection point of the first vertex corresponding to the designated plane, wherein the normal direction of the designated plane is parallel to the preset vertical direction of the designated virtual space; Determining world position coordinates of a first vertex in the target area in a coordinate plane parallel to the specified plane in a world coordinate system based on a relative orientation of the projected point and the specified position of the specified plane and world position coordinates of the specified position; A height parameter of the first vertex is determined based on a distance between the first vertex and the projection point.
  12. 12. The method of claim 1, wherein the step of rendering the patch model based on the location parameter and a pre-generated crack effect texture parameter comprises: rendering the surface patch model based on the position parameter, a pre-generated crack effect texture parameter and a third mask map, wherein the third mask map is generated based on the distance between the vertex in the surface patch model and the edge of the surface patch model.
  13. 13. The method of claim 12, wherein the third mask map is generated by: calculating a distance between each vertex in each of the patch models and an edge of the patch model; Mapping the distance to a pixel value; and generating the third mask map based on the texture map coordinates corresponding to each vertex and the pixel value.
  14. 14. The method of claim 12, wherein the step of rendering the patch model based on the location parameter, a pre-generated crack effect texture parameter, and a third mask map, comprises: Determining transparency parameters for each vertex of the patch model based on the third mask map; and rendering the patch model based on the position parameter, the pre-generated crack effect texture parameter and the transparency parameter.
  15. 15. A model rendering apparatus, the apparatus comprising: the system comprises a target area determining module, a target area determining module and a target area determining module, wherein the target area determining module is used for determining a target area in a target model, the target model is positioned in a designated virtual space, and the designated virtual space is provided with a patch model; the position parameter determining module is used for determining the position parameter of the patch model in the appointed virtual space based on the target area; the rendering module is used for rendering the surface patch model based on the position parameter and the pre-generated crack effect texture parameter so that the surface patch model displays the crack effect on the surface of the target model, and the crack effect texture parameter is generated based on the stress distribution parameter and the crack element.
  16. 16. An electronic device comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the model rendering method of any one of claims 1-14.
  17. 17. A machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement the model rendering method of any one of claims 1-14.

Description

Model rendering method and device and electronic equipment Technical Field The present invention relates to the field of rendering technologies, and in particular, to a model rendering method, device and electronic equipment. Background In the three-dimensional game and movie production process, the construction of special effect scenes such as ground cracks, magma, energy cracks and the like is a common requirement. In the related art, a related worker is generally required to manually engrave a high-precision model and draw a related map, so as to generate a display effect corresponding to the special effect scene. The method has long manufacturing period, inconvenient modification and adjustment and high labor cost. Cracks can also be simulated in some mapping software by combining the underlying noise nodes with the nodes for pixel value adjustment. However, the crack morphology generated by the method often lacks natural logic and structural hierarchy, and the crack-related effects are usually superimposed simply by a mask, and lack of inherent correlation of depth, so that the visual effect is poor and the user experience is affected. Disclosure of Invention Accordingly, the invention aims to provide a model rendering method, a model rendering device and electronic equipment, so as to reduce labor cost, improve crack effect and improve visual experience of users. In a first aspect, an embodiment of the present invention provides a model rendering method, where the method includes determining a target area in a target model, the target model being located in a specified virtual space, the specified virtual space being provided with a patch model, determining a position parameter of the patch model in the specified virtual space based on the target area, rendering the patch model based on the position parameter and a crack effect texture parameter generated in advance to control the patch model to display a crack effect on a surface of the target model, and the crack effect texture parameter being generated based on a stress distribution parameter and a crack element. In a second aspect, an embodiment of the invention provides a model rendering device, which comprises a target area determining module, a position parameter determining module, a rendering module and a crack effect texture parameter generating module, wherein the target area determining module is used for determining a target area in a target model, the target model is located in a designated virtual space, the designated virtual space is provided with a patch model, the position parameter determining module is used for determining position parameters of the patch model in the designated virtual space based on the target area, the rendering module is used for rendering the patch model based on the position parameters and the pre-generated crack effect texture parameters so as to control the patch model to display a crack effect on the surface of the target model, and the crack effect texture parameters are generated based on the stress distribution parameters and crack elements. In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, where the memory stores machine executable instructions executable by the processor, and the processor executes the machine executable instructions to implement the model rendering method described above. In a fourth aspect, embodiments of the present invention provide a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement the model rendering method described above. The embodiment of the invention has the following beneficial effects: The model rendering method, device and electronic equipment determine a target area in a target model, the target model is located in a designated virtual space, a surface patch model is arranged in the designated virtual space, position parameters of the surface patch model in the designated virtual space are determined based on the target area, the surface patch model is rendered based on the position parameters and crack effect texture parameters generated in advance to control the surface patch model to display crack effects on the surface of the target model, and the crack effect texture parameters are generated based on stress distribution parameters and crack elements. The method can generate the crack effect in the target area in the target model through the surface patch model and the crack effect texture parameters, the generation position of the crack effect can be adjusted according to the requirement, related staff is not required to be modified manually, the labor cost is reduced, the crack texture parameters are generated based on the stress distribution parameters and the crack elements, the logic and the result layering sense are provided, the formed crack effect is more vivid, and the visual expe