Search

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

CN121999113ACN 121999113 ACN121999113 ACN 121999113ACN-121999113-A

Abstract

The model rendering method comprises the steps of obtaining geometric information and basic color information of a three-dimensional model, wherein the geometric information comprises coordinates of a luminous center of the three-dimensional model under a local coordinate system, conducting coordinate conversion on the coordinates of the luminous center under the local coordinate system to obtain a luminous center position under a world coordinate system, calculating a spatial distance from a current rendering pixel point to the luminous center based on a preset camera position and the luminous center position, determining a luminous intensity adjusting coefficient according to a brightness value of the basic color information, generating a luminous shade based on the spatial distance and the luminous intensity adjusting coefficient, and conducting mixing processing on the luminous shade and the basic color information to obtain a rendering color of the three-dimensional model. By considering the double factors of the space distance and the color characteristics, the intelligent dynamic adjustment of the luminous effect is realized, so that the visual expressive force of three-dimensional model rendering is remarkably improved.

Inventors

  • CHEN ZHIYU

Assignees

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

Dates

Publication Date
20260508
Application Date
20251224

Claims (13)

  1. 1. A model rendering method, comprising: Obtaining geometric information and basic color information of a three-dimensional model, wherein the geometric information comprises coordinates of a luminous center of the three-dimensional model under a local coordinate system; coordinate conversion is carried out on the coordinates of the luminous center under the local coordinate system, so that the luminous center position under the world coordinate system is obtained; Calculating the spatial distance from the current rendering pixel point to the light emitting center based on the preset camera position and the light emitting center position; determining a luminous intensity adjusting coefficient according to the brightness value of the basic color information; Generating a lighting mask based on the spatial distance and the lighting intensity adjustment factor; and mixing the luminous shade and the basic color information to obtain the rendering color of the three-dimensional model.
  2. 2. The model rendering method of claim 1, wherein the calculating a spatial distance of a current rendering pixel to the luminescence center based on a preset camera position and the luminescence center position comprises: acquiring a camera observation direction vector; Based on a preset camera position, the luminous center position and the camera observation direction vector, a vertical plane intersection point from the camera observation direction to the luminous center is obtained through vector projection operation; And calculating the spatial distance from the current rendering pixel point to the intersection point of the vertical planes.
  3. 3. The model rendering method of claim 1, wherein the determining a luminous intensity adjustment coefficient according to the brightness value of the base color information comprises: Calculating a brightness value of the basic color information using a weighted average formula; judging the color type according to the brightness value; And based on the color type, performing nonlinear transformation on the original distance value by using a preset function, and generating the luminous intensity adjusting coefficient.
  4. 4. The model rendering method of claim 3, wherein the brightness value of the basic color information is calculated using a weighted average formula, specifically, brightness value=r×first weight+g×second weight+b×third weight, wherein R, G, B is red, green, and blue color components, respectively.
  5. 5. A model rendering method according to claim 3, wherein the preset function includes a three-segment fitted curve function, the original distance value is non-linearly transformed using the preset function, the luminous intensity adjustment coefficient is generated, and further comprising: Performing nonlinear transformation by adopting a three-section fitting curve function; And performing smooth interpolation processing and intensity limiting processing on the transformation result to generate the luminous intensity adjusting coefficient.
  6. 6. The model rendering method of claim 1, wherein the generating a lighting mask based on the spatial distance and the lighting intensity adjustment coefficient comprises: Generating a main lighting shade by adopting a preset smooth interpolation function based on the space distance; generating an auxiliary luminous shade according to the luminous intensity adjusting coefficient; and carrying out weighted mixing processing on the main light-emitting shade and the auxiliary light-emitting shade to generate the light-emitting shade.
  7. 7. The model rendering method of claim 6, wherein the weighted blending of the primary and secondary lighting masks generates the lighting mask, further comprising: Calculating an included angle between a normal vector of the surface and the illumination direction; And adjusting the weighted mixing process based on the included angle.
  8. 8. The model rendering method of claim 1, further comprising: Receiving a time input; After the luminance value according to the base color information is determined, the luminance intensity adjustment coefficient is periodically modulated based on the time input.
  9. 9. The model rendering method of claim 1, wherein the acquiring geometric information and basic color information of the three-dimensional model comprises: Loading a three-dimensional model file; and analyzing the three-dimensional model file, and extracting vertex positions, texture coordinates and color mapping information.
  10. 10. The model rendering method according to claim 1, wherein the mixing the illuminant mask and the base color information to obtain the rendering color of the three-dimensional model includes: calculating a transparency value of the light emitting shade; performing color mixing operation on the basic color information based on the transparency value; and obtaining the mixed color value as the rendering color of the three-dimensional model.
  11. 11. A model rendering apparatus, characterized by comprising: The system comprises an acquisition module, a color acquisition module and a color acquisition module, wherein the acquisition module is used for acquiring geometric information and basic color information of a three-dimensional model, and the geometric information comprises coordinates of a luminous center of the three-dimensional model under a local coordinate system; the obtaining module is used for carrying out coordinate conversion on the coordinates of the luminous center under a local coordinate system to obtain the luminous center position under a world coordinate system; the calculation module is used for calculating the space distance from the current rendering pixel point to the luminous center based on the preset camera position and the luminous center position; The determining module is used for determining a luminous intensity adjusting coefficient according to the brightness value of the basic color information; The generation module is used for generating a luminous shade based on the space distance and the luminous intensity adjustment coefficient; and the rendering module is used for carrying out mixing processing on the luminous shade and the basic color information to obtain the rendering color of the three-dimensional model.
  12. 12. A computer readable storage medium, characterized in that a computer program is stored, which, when being executed by a processor, implements the method of any one of claims 1 to 10.
  13. 13. An electronic device, comprising: a memory storing a computer program; a processor executing the computer program to implement the method of any one of claims 1 to 10.

Description

Model rendering method and device and electronic equipment Technical Field The invention relates to the technical field of games, in particular to a model rendering method and device, a storage medium and electronic equipment. Background With the rapid development of Three-Dimensional (3D) graphics rendering technology, the requirements for reality and visual expressive force of Three-Dimensional model rendering effects are increasingly increasing in the fields of game development, movie production, virtual reality and the like. In the traditional three-dimensional model rendering process, the processing of the luminous effect often adopts a simple uniform luminous or fixed parameter-based illumination model, and the processing mode has obvious technical defects. Firstly, the traditional luminous rendering method lacks effective consideration of space distance factors, and cannot dynamically adjust luminous intensity according to the space relation between an observation visual angle and a luminous object, so that the rendered luminous effect is not natural and real enough under different visual angles, and layering sense and stereoscopic sense are lacking. Secondly, the existing luminous rendering technology fails to fully utilize the color characteristics of the model, ignores the influence of different color materials on luminous effects, and ensures that the final rendering result has larger difference with the actual appearance of luminous objects in the physical world. These technical problems seriously affect the visual quality of the three-dimensional scene and the immersive experience of the user, so that development of a three-dimensional model rendering method capable of intelligently adjusting the luminous effect according to the spatial distance and the color characteristics is needed. It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art. Disclosure of Invention The present disclosure is directed to a model rendering method and apparatus, a storage medium, and an electronic device that, at least to some extent, overcome one or more of the problems due to the limitations and disadvantages of the related art. According to one aspect of the present disclosure, there is provided a model rendering method, the method further comprising: Obtaining geometric information and basic color information of a three-dimensional model, wherein the geometric information comprises coordinates of a luminous center of the three-dimensional model under a local coordinate system; coordinate conversion is carried out on the coordinates of the luminous center under the local coordinate system, so that the luminous center position under the world coordinate system is obtained; Calculating the spatial distance from the current rendering pixel point to the light emitting center based on the preset camera position and the light emitting center position; determining a luminous intensity adjusting coefficient according to the brightness value of the basic color information; Generating a lighting mask based on the spatial distance and the lighting intensity adjustment factor; and mixing the luminous shade and the basic color information to obtain the rendering color of the three-dimensional model. In accordance with another aspect of the present disclosure, A model rendering apparatus, the apparatus comprising: The system comprises an acquisition module, a color acquisition module and a color acquisition module, wherein the acquisition module is used for acquiring geometric information and basic color information of a three-dimensional model, and the geometric information comprises coordinates of a luminous center of the three-dimensional model under a local coordinate system; the obtaining module is used for carrying out coordinate conversion on the coordinates of the luminous center under a local coordinate system to obtain the luminous center position under a world coordinate system; the calculation module is used for calculating the space distance from the current rendering pixel point to the luminous center based on the preset camera position and the luminous center position; The determining module is used for determining a luminous intensity adjusting coefficient according to the brightness value of the basic color information; The generation module is used for generating a luminous shade based on the space distance and the luminous intensity adjustment coefficient; and the rendering module is used for carrying out mixing processing on the luminous shade and the basic color information to obtain the rendering color of the three-dimensional model. According to another aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, whe