Model snow effect rendering method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202311726560.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-14
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2043-12-14
AI Technical Summary
[0003]目前,游戏中没有下雪天气下模型覆雪的效果表现,特别是头发模型覆雪效果的渲染,相关技术中需要人工,根据单个头发资源依次迭代美术资产
[0018] As can be seen from the above, the rendering method, apparatus, electronic device, and storage medium for snow-covered model effects provided in this application first obtain the target noise map and the inherent rendering parameters of the target model to be rendered; and then obtain the preset snow-falling rendering parameters corresponding to the inherent rendering parameters; then, interpolate the inherent rendering parameters and the preset snow-falling rendering parameters according to the target noise map to obtain the snow-covered rendering parameters of the target model; finally, render the target model according to the snow-covered rendering parameters, thereby achieving automated rendering of the snow-covered model effect through the target noise map, improving the efficiency and quality of snow-covered model rendering.
Smart Images

Figure CN117695631B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of model rendering technology, and in particular to a rendering method, apparatus, electronic device and storage medium for a model with a snow-covered effect. Background Technology
[0002] This section is intended to provide background or context for the embodiments of this application as set forth in the claims. The description herein is not intended to be a prior art simply because it is included in this section.
[0003] Currently, the game lacks snow effects for models, especially rendering snow on hair models. This requires manual work, iterating through individual hair assets. This results in a massive workload for art production, and the manual process is difficult to control, leading to inconsistent final results and unreliable rendering quality for snow-covered hair. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a rendering method, apparatus, electronic device and storage medium for a snow-covered model, so as to solve or partially solve the problems in the background art.
[0005] To achieve the above objectives, this application provides a method for rendering a snow-covered effect on a model, comprising:
[0006] Obtain the target noise map and the inherent rendering parameters of the target model to be rendered;
[0007] Obtain the preset snowfall rendering parameters corresponding to the inherent rendering parameters;
[0008] Based on the target noise map, interpolation calculations are performed on the inherent rendering parameters and the preset snowfall rendering parameters to obtain the snow-covered rendering parameters of the target model;
[0009] The target model is rendered based on the snow-covered rendering parameters.
[0010] Based on the same inventive concept, an exemplary embodiment of this application also provides a rendering apparatus for a snow-covered model, comprising:
[0011] The first acquisition module acquires the target noise map and the inherent rendering parameters of the target model to be rendered;
[0012] The second acquisition module acquires preset snowfall rendering parameters corresponding to the inherent rendering parameters;
[0013] The interpolation module performs interpolation calculations on the inherent rendering parameters and the preset snowfall rendering parameters based on the target noise map to obtain the snowfall rendering parameters of the target model.
[0014] The rendering module renders the target model based on the snow-covered rendering parameters.
[0015] Based on the same inventive concept, an exemplary embodiment of this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor executes the program to implement the rendering method for the snow-covered model effect as described above.
[0016] Based on the same inventive concept, an exemplary embodiment of this application also provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the rendering method for the snow-covered model effect as described above.
[0017] Based on the same inventive concept, an exemplary embodiment of this application also provides a computer program product, the computer program product including a computer program, which is executed by one or more processors to cause the processors to perform the game sound adjustment method as described above.
[0018] As can be seen from the above, the rendering method, apparatus, electronic device, and storage medium for snow-covered model effects provided in this application first obtain the target noise map and the inherent rendering parameters of the target model to be rendered; and then obtain the preset snow-falling rendering parameters corresponding to the inherent rendering parameters; then, interpolate the inherent rendering parameters and the preset snow-falling rendering parameters according to the target noise map to obtain the snow-covered rendering parameters of the target model; finally, render the target model according to the snow-covered rendering parameters, thereby achieving automated rendering of the snow-covered model effect through the target noise map, improving the efficiency and quality of snow-covered model rendering. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram illustrating one application scenario of an embodiment of this application;
[0021] Figure 2 This is a flowchart illustrating a method for rendering a snow-covered effect on a model according to an embodiment of this application.
[0022] Figure 3 This is a schematic diagram of a noise map according to an embodiment of this application;
[0023] Figure 4 This is a schematic diagram of another noise map according to an embodiment of this application;
[0024] Figure 5 This is a schematic diagram comparing the effects of snow cover and no snow cover on a model according to an embodiment of this application;
[0025] Figure 6 This is a schematic diagram comparing the snow-covering effect of the first model in the embodiments of this application;
[0026] Figure 7 This is a schematic diagram comparing the snow-covering effect of the second model in an embodiment of this application;
[0027] Figure 8 This is a schematic diagram comparing the snow-covering effect of the third model in this application embodiment;
[0028] Figure 9 This is a schematic diagram comparing the snow-covered effect of a first material region and a second material region according to an embodiment of this application;
[0029] Figure 10 This is a schematic diagram illustrating the effect of weather on snow cover according to an embodiment of this application;
[0030] Figure 11 This is a schematic diagram of the structure of a rendering device for a snow-covered model according to an embodiment of this application;
[0031] Figure 12 This is a schematic diagram of the structure of a specific electronic device according to an embodiment of this application. Detailed Implementation
[0032] The principles and spirit of this application will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are provided merely to enable those skilled in the art to better understand and implement this application, and are not intended to limit the scope of this application in any way. Rather, these embodiments are provided to make this application more thorough and complete, and to fully convey the scope of this application to those skilled in the art.
[0033] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this disclosure should have the ordinary meaning understood by one of ordinary skill in the art to which this disclosure pertains. The terms "first," "second," and similar terms used in the embodiments of this disclosure do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the element or object listed following the word and its equivalents, without excluding other elements or objects. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly. Furthermore, in the description of this application, unless otherwise stated, the term "multiple" refers to two or more. The term "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.
[0034] According to an embodiment of this application, a rendering method, system, electronic device, and storage medium for a snow-covered model effect are proposed.
[0035] In this article, it is important to understand that any number of elements in the accompanying figures is for illustrative purposes and not for limitation, and any naming is for distinction only and has no limiting meaning.
[0036] The principles and spirit of this application will be explained in detail below with reference to several representative embodiments. Invention Overview
[0038] Currently, there are no technologies that can effectively render snow-covered models, especially for hair models. This typically requires manual iteration of individual hair assets. For example, a game might have over 300 hair assets, each requiring three staff members to work on for a full day. Creating over 300 hair assets is an enormous workload, significantly increasing production costs. This results in a large workload and high costs for art production. Furthermore, the manual process is difficult to control, leading to inconsistent final results and unreliable rendering quality for snow-covered hair.
[0039] Furthermore, as the graphics processing capabilities of mobile devices improve, users' expectations for graphics rendering effects are also increasing. However, current technologies cannot achieve high-quality rendering of snow-covered hair on mobile devices, nor can they be compatible with different types of hair materials or handle the influence of other objects on the hair on the snow coverage.
[0040] To address the aforementioned issues, this application provides a method for rendering a snow-covered effect on a model, specifically including:
[0041] First, the target noise map and the inherent rendering parameters of the target model to be rendered are obtained; then, the preset snowfall rendering parameters corresponding to the inherent rendering parameters are obtained; next, the inherent rendering parameters and the preset snowfall rendering parameters are interpolated based on the target noise map to obtain the snowfall rendering parameters of the target model; finally, the target model is rendered according to the snowfall rendering parameters, thereby achieving automated rendering of the model's snowfall effect through the target noise map, improving the efficiency and quality of model snowfall rendering, and reducing the cost of model snowfall rendering. Furthermore, the model snowfall effect rendering method of this application can use a shader algorithm, achieving high-quality hair snowfall effect performance on mobile devices based on the original materials. In addition, this application has high practicality and application value, and can effectively improve the quality of graphics rendering effects on mobile devices.
[0042] After introducing the basic principles of this application, the various non-limiting embodiments of this application will be described in detail below.
[0043] Application Scenarios Overview
[0044] In specific application scenarios, the snow-covered effect rendering method of this application can be applied to various systems involving snow-covered effect rendering of target models. Optionally, this system can be a game system or other systems. As an example, see [reference]. Figure 1This application scenario includes at least one server 102 and at least one terminal 101. Terminal devices include, but are not limited to, desktop computers, mobile phones, mobile computers, tablets, media players, smart wearable devices, personal digital assistants (PDAs), or other electronic devices capable of performing the aforementioned functions. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The server and terminal can communicate via a network to transmit data. The network can be a wired network or a wireless network; this application does not specifically limit its use.
[0045] The server can be a server that provides various services. Specifically, the server can be used to provide background services for applications running on the terminal. Optionally, in some implementations, the snow-covered effect rendering method for the model provided in this application embodiment can be executed by a terminal device or a server. When executed by a server, the server first obtains the target noise map and the inherent rendering parameters of the target model to be rendered, then obtains the preset snow-falling rendering parameters corresponding to the inherent rendering parameters, then performs interpolation calculations on the inherent rendering parameters and the preset snow-falling rendering parameters based on the target noise map to obtain the snow-covered rendering parameters of the target model, and finally renders the target model based on the snow-covered rendering parameters. Optionally, the server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software programs or software modules (e.g., software programs or software modules used to provide distributed services), or as a single software program or software module. This application embodiment does not specifically limit this.
[0046] Optionally, the aforementioned wireless or wired networks use standard communication technologies and / or protocols. The network is typically the Internet, but can be any network, including but not limited to local area networks (LANs), metropolitan area networks (MANs), wide area networks (WANs), mobile, wired or wireless networks, private networks, or any combination of virtual private networks. In some embodiments, technologies and / or formats including Hypertext Markup Language (HTML), Extensible Markup Language (XML), etc., are used to represent data exchanged over the network. Furthermore, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), and Internet Protocol Security (IPsec) can be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.
[0047] The following describes a method for rendering a snow-covered effect on a model according to an exemplary embodiment of this application, using specific application scenarios. It should be noted that the above application scenarios are shown only to facilitate understanding of the spirit and principles of this application, and the embodiments of this application are not limited in any way. Rather, the embodiments of this application can be applied to any applicable scenario.
[0048] It should be understood that, although Figure 2 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0049] Exemplary methods
[0050] refer to Figure 2 This application provides a method for rendering a snow-covered effect on a model. The execution entity of this method can be, but is not limited to, a server or a terminal device. The method includes the following steps:
[0051] S101, obtain the target noise map and the inherent rendering parameters of the target model to be rendered.
[0052] In practice, the target noise map is primarily used to determine the distribution of snow across the target model after it has been applied. Optionally, the target noise map can be a user-inputted noise map, or a randomly generated or selected noise map; there are no restrictions on this. (Reference) Figure 3 and Figure 4 Two different noise maps are provided, and users can choose the noise map they need as the target noise map. Optional, Figure 3 The noise distribution in the image is relatively concentrated, and the overall density is low. Therefore, Figure 3 It can be used to simulate the effect of snowflakes in real life. Figure 4 The noise distribution in the image is relatively dispersed and the density is relatively high. Therefore, Figure 4 It can be used to simulate the effect of snowflakes in real life.
[0053] To better simulate the effect of snow cover in reality, in some embodiments, the target noise map may include a snowflake noise map and a snowflake noise map, wherein the noise mesh density corresponding to the snowflake noise map is greater than that corresponding to the snowflake noise map. That is, the target noise map can consist of two maps: the one with the higher noise mesh density is called the snowflake noise map, used to mimic the snowflake effect; the one with the lower noise mesh density is called the snowflake noise map, used to mimic the snowflake effect. In this embodiment, using both types of target noise maps simultaneously can simulate the effect of snowflakes and snowflakes simultaneously covering the target model in reality.
[0054] In some embodiments, the target model is the model that needs to be rendered with a snow-covered effect. Optionally, the target model can be configured as needed; for example, the target model can be the hair model of a virtual character. The target model itself has some inherent rendering parameters used to render its appearance before it is covered with snow. These appearance parameters include the model's color, and / or roughness, and / or normals, and / or specular parameters, and / or metallicity, etc. These appearance parameters together define the original appearance of the target model.
[0055] In order to accurately render the snow-covered effect of the model, in some embodiments, the inherent rendering parameters include at least one of the following: inherent color, inherent normal, inherent roughness, inherent metallicity, and inherent specular parameters.
[0056] S102, Obtain the preset snowfall rendering parameters corresponding to the inherent rendering parameters.
[0057] In specific implementation, after obtaining the inherent rendering parameters of the target model, it is necessary to further obtain the preset snow rendering parameters corresponding to the inherent rendering parameters. In some embodiments, the preset snow rendering parameters include at least one of the following: preset snow color, preset snow normal, preset snow roughness, preset snow metallicity, and preset snow specular parameters, etc. Optionally, the preset snow rendering parameters can be set according to the inherent rendering parameters, so that the two correspond one-to-one. Optionally, the preset snow rendering parameters can be set in advance as needed. For example, the preset snow color can be set to white, the preset snow roughness can be set to 0.9 (roughness range is 0 to 1), the preset snow metallicity can be set to 0 (completely non-metallic), and the preset snow specular parameter can be set to 1, etc. These preset snow rendering parameters can initially determine the basic display form of the snow-covered areas on the target model. Optionally, the preset snow normal can be set to a fixed normal as needed, or a preset normal map can be set, and then the normal of each pixel can be collected through the preset normal map. There is no limitation on this.
[0058] S103, based on the target noise map, interpolate the inherent rendering parameters and the preset snow rendering parameters to obtain the snow-covered rendering parameters of the target model.
[0059] In practice, after obtaining the preset snowfall rendering parameters and the inherent rendering parameters of the target model, interpolation calculations can be performed on the inherent rendering parameters and the preset snowfall rendering parameters based on the target noise map to obtain the snow-covered rendering parameters of the target model. Optionally, during the interpolation calculation, the inherent rendering parameters and the preset snowfall rendering parameters can be used as the two endpoints to be interpolated, and then the interpolation weights can be determined through the target noise map.
[0060] In some embodiments, interpolation can be calculated using the following formula:
[0061] L = lerp(A, B, X);
[0062] Where L represents the interpolated snow rendering parameters, lerp represents the linear interpolation function, A represents the inherent rendering parameters, and B represents the preset snow rendering parameters.
[0063] It should be noted that when interpolating the inherent rendering parameters and the preset snow rendering parameters based on the target noise map, interpolation calculations need to be performed on each vertex of the target model. That is, each point corresponds to an inherent rendering parameter. Furthermore, the grayscale value of the pixel corresponding to that vertex can be collected from the target noise map and used as the interpolation weight for that vertex, ultimately obtaining the snow-covered rendering parameters for that vertex. For the noise map, the maximum grayscale value for white is 1, the minimum grayscale value for black is 0, and the grayscale values for other grays are between 0 and 1. Therefore, the white areas of the target noise map generally correspond to the final snow-covered areas of the target model.
[0064] To better mimic the snow-covered effect of real-world models, in some embodiments, interpolation calculations are performed on the inherent rendering parameters and the preset snowfall rendering parameters based on the target noise map. Specifically, this includes:
[0065] The grayscale value of the snowflake noise map is sampled to obtain the first grayscale information;
[0066] The snowflake noise map is sampled for grayscale values to obtain second grayscale information;
[0067] Multiply the first grayscale information by the second grayscale information to obtain the superimposed grayscale information;
[0068] Based on the superimposed grayscale information, interpolation calculations are performed on the inherent rendering parameters and the preset snowfall rendering parameters.
[0069] In practical implementation, considering that in reality, when objects are covered with snow on a snowy day, fine powdery snowflakes are usually superimposed under the surface snowflakes to reflect the effect of snow cover, this embodiment sets two types of target noise maps to simulate this effect: a snowflake noise map and a snowflake noise map. During interpolation calculations, the grayscale values of the two noise maps are first collected to obtain first grayscale information and second grayscale information. Then, the first grayscale information and the second grayscale information are multiplied to obtain superimposed grayscale information. Based on the superimposed grayscale information, interpolation calculations are performed on the inherent rendering parameters and the preset snowfall rendering parameters. (Reference) Figure 6 The left image shows the rendering effect obtained by interpolating the inherent rendering parameters and the preset snowfall rendering parameters using only the second grayscale information. The right image shows the rendering effect obtained by interpolating the inherent rendering parameters and the preset snowfall rendering parameters by superimposing grayscale information. It can be seen that the snow in the right image includes both snowflakes and snowflakes.
[0070] It's important to note that because the noise mesh density of the snowflake noise map is greater than that of the snowflake noise map, a white position in the snowflake noise map will likely also be white in the corresponding position in the snowflake noise map; conversely, a black position in the snowflake noise map will likely also be white in the corresponding position in the snowflake noise map. For the noise map, white corresponds to a grayscale value of 1, and black corresponds to a grayscale value of 0. Therefore, when the area with snowflakes (value 1) and the area with snowflakes (value 1) are multiplied, the result is 1, and both snowflakes and snowflakes can be displayed simultaneously. Conversely, when both are 0, the result is 0, and neither is displayed. When the area with snowflakes (value 1) and the area without snowflakes (value 0) are multiplied, the result is 0, meaning snowflakes are not displayed separately. When the area without snowflakes (value 0) and the area with snowflakes (value 1) are multiplied, the result is 0, but this is less common. Therefore, by multiplying the first grayscale information with the second grayscale information, the effect of superimposing fine, powdery snowflakes beneath the surface snowflakes can be achieved.
[0071] To facilitate adjustment of the snowflake coverage area, in some embodiments, grayscale value sampling is performed on the snowflake noise map to obtain first grayscale information, specifically including:
[0072] The grayscale value of the snowflake noise map is sampled to obtain the first initial grayscale information;
[0073] The preset snowflake range parameter is added to the first initial grayscale information to obtain the first grayscale information.
[0074] In practical implementation, considering that during the rendering process, it may be necessary to adjust the snowflake range based on the target noise map, for example, to increase the snowflake coverage. In this case, the preset snowflake range parameter can be set to a positive number, and the preset snowflake range parameter can be added to the first initial grayscale information to obtain the first grayscale information. To reduce the snowflake coverage, the preset snowflake range parameter can be set to a negative number, and the preset snowflake range parameter can be added to the first initial grayscale information to obtain the first grayscale information. Optionally, when the grayscale value of the target noise map is in the range of 0 to 1, the preset snowflake range parameter can generally be set between -1 and 1. When the grayscale value of the target noise map is in the range of 0 to 255, the preset snowflake range parameter can generally be set between -255 and 255 (a grayscale value of 0 represents black, and a grayscale value of 255 represents white), or the grayscale value of the target noise map can be normalized first, and then the preset snowflake range parameter can generally be set between -1 and 1.
[0075] To facilitate adjustment of the snowflake coverage area, in some embodiments, the snowflake noise map is sampled to obtain second grayscale information, specifically including:
[0076] The snowflake noise map is sampled to obtain the second initial grayscale information;
[0077] The preset snowflake range parameter is added to the second initial grayscale information to obtain the second grayscale information.
[0078] In practice, the process of adjusting the range of snowflake coverage is similar to that of adjusting the range of snowmelt coverage described above. Refer to the embodiment for adjusting the range of snowflake coverage described above; further details will not be repeated here. (Reference) Figure 7 The left image shows the rendering effect when the preset snowflake range parameter is 0, and the right image shows the rendering effect when the preset snowflake range parameter is 1. It can be seen that the snow-covered area in the right image is significantly larger than that in the left image.
[0079] To better reproduce the snow-covered effect of the target model in reality, in some embodiments, interpolation calculations are performed on the inherent rendering parameters and the preset snowfall rendering parameters based on the target noise map, specifically including:
[0080] Obtain the normal information of the target model;
[0081] Adjust the target noise map based on the normal information;
[0082] Interpolation calculations are performed on the inherent rendering parameters and the preset snowfall rendering parameters based on the adjusted target noise map.
[0083] In practical implementation, considering that in reality, after snowfall, snow is generally more likely to accumulate on the top surface of the target model, i.e., the surface perpendicular to the vertical direction, while surfaces parallel to the vertical direction, such as the sides of the target model, are generally less likely to accumulate snow, in order to better reproduce the snow cover of the target model in reality, the target noise map can be adjusted using normal information. Then, the adjusted target noise map is used to interpolate the inherent rendering parameters and the preset snowfall rendering parameters. (Reference) Figure 8 The left image shows the rendering effect when the target noise map is not adjusted using normal information, while the right image shows the rendering effect after the target noise map is adjusted using normal information. It can be seen that the snow cover on the side of the target model (hair model) is significantly reduced in the right image.
[0084] It should be noted that since the normals are perpendicular to all faces of the target model, the orientation of each face of the target model can be reflected through the normal information. Then, by adjusting the normals, the snow cover weight corresponding to faces with different orientations can be made different.
[0085] To quickly adjust the superimposed grayscale information based on normal information, in some embodiments, the target noise map is adjusted based on the normal information, specifically including:
[0086] The vertical component coordinates of the normal of the target model are determined based on the normal information;
[0087] The grayscale information of the target noise map is adjusted based on the vertical component coordinates; wherein the vertical component coordinates are proportional to the grayscale value of the grayscale information of the target noise map.
[0088] In practical implementation, to save computation, considering that normal information can be represented by three-dimensional coordinates, i.e., (x, y, z), where the longer the y-component (y) on the y-axis (the vertical coordinate axis), the more vertical the normal, and further, the more surface-like the surface corresponding to the normal. Therefore, to reduce computation, the vertical component coordinate (y) of the normal can be directly used to adjust the grayscale information of the target noise map. Optionally, when adjusting the grayscale information of the target noise map using the vertical component coordinate, the vertical component coordinate can be taken first, and then a relationship function between the vertical component coordinate and the grayscale value can be set. The grayscale information can then be adjusted using this relationship function, so that the grayscale value corresponding to the grayscale information increases as the vertical component coordinate increases. Optionally, the specific relationship function can be set as needed, for example, a linear function, an exponential function, etc. It should be noted that the grayscale information of the target noise map can be any one of the above-mentioned first grayscale information, the above-mentioned second grayscale information, and the above-mentioned superimposed grayscale information. The specific grayscale information used can be selected as needed.
[0089] In some embodiments, adjusting the grayscale information of the target noise map based on the vertical component coordinates specifically includes:
[0090] Obtain the preset snow cover range parameters of the target model;
[0091] Adjust the vertical component coordinates based on the preset snow cover range parameters;
[0092] The grayscale information of the target noise map is adjusted based on the adjusted vertical component coordinates.
[0093] In practice, considering that in some cases it may be necessary to further increase or decrease the snowflake coverage on the side of the model, the vertical component coordinates can be adjusted by first setting a snow coverage range parameter, and then adjusting the grayscale information of the target noise map according to the adjusted vertical component coordinates. Optionally, the adjustment can be achieved by directly adding or multiplying the preset snow coverage range parameter with the vertical component coordinates; the specific adjustment process is not limited. When it is necessary to increase the snowflake coverage on the side of the model, the preset snow coverage range parameter can be set to a positive number and added to the vertical component coordinates; or the preset snow coverage range parameter can be set to a number greater than 1 and multiplied by the vertical component coordinates. When it is necessary to decrease the snowflake coverage on the side of the model, the preset snow coverage range parameter can be set to a negative number and added to the vertical component coordinates; or the preset snow coverage range parameter can be set to a number less than 1 and multiplied by the vertical component coordinates.
[0094] In some embodiments, adjusting the target noise map based on the normal information specifically includes:
[0095] Based on the normal information, determine the angle between the direction of the normal of the target model and the preset vertical direction:
[0096] The grayscale information of the target noise map is adjusted based on the included angle; wherein the included angle is inversely proportional to the grayscale value of the grayscale information of the target noise map.
[0097] In specific implementations, in some embodiments, besides adjusting the grayscale information of the target noise map through the vertical component coordinates, the angle between the direction of the normal of the target model and a preset vertical direction can be determined first based on the normal information. Then, the grayscale information of the target noise map can be adjusted through this angle, making the angle inversely proportional to the grayscale value of the target noise map. That is, the more vertical the direction of the normal of the target model, the larger the grayscale value corresponding to the superimposed grayscale information. Optionally, the preset vertical direction is the direction parallel to the y-axis. In some embodiments, the direction perpendicular to the horizontal plane in the game scene can be defined as the preset vertical direction.
[0098] In some embodiments, adjusting the target noise map based on the included angle specifically includes:
[0099] Obtain the preset snow cover range parameters of the target model;
[0100] Adjust the included angle based on the preset snow cover range parameter;
[0101] The grayscale information of the target noise map is adjusted based on the adjusted included angle.
[0102] In practice, to facilitate adjusting the snowflake coverage area on the side of the model, the included angle can be adjusted first according to the preset snow coverage range parameter, and then the grayscale information of the target noise map can be adjusted according to the adjusted included angle. The specific process of adjusting the included angle can refer to the process of adjusting the vertical component coordinates in the above embodiment, which will not be elaborated here.
[0103] S104, Render the target model based on the snow-covered rendering parameters.
[0104] In practice, after obtaining the snow-covered rendering parameters of the target model, the target model can be rendered using these parameters to achieve automatic rendering of the snow-covered effect. (Reference) Figure 5 The left image shows the target model without snow effect rendering, while the right image shows the target model with snow effect rendering. It can be seen that the snow effect is significantly enhanced in the right image.
[0105] To better reproduce the snow-covered effect of the model in reality, in some embodiments, after rendering the target model based on the snow-covered rendering parameters, the method further includes:
[0106] Based on the second grayscale information, interpolation calculations are performed on the inherent rendering parameters and the preset snowfall rendering parameters to obtain the snowflake rendering parameters of the target model;
[0107] The target model is rendered based on the snowflake rendering parameters;
[0108] Determine the first and second material regions of the target model;
[0109] A first texture mask is added to the first material area; wherein, the first texture mask is used to display the rendering effect corresponding to the snowflake rendering parameters;
[0110] A second texture mask is added to the second material area; wherein, the second texture mask is used to display the rendering effect corresponding to the snow rendering parameters.
[0111] In practical implementation, considering that in reality, when the target model is a hair model, the hair strands are rarely covered with large areas of snow due to the high temperature, at most only covered with some snowflakes, this embodiment sets different masks for the first material area and the second material area respectively. The first texture mask displays the rendering effect corresponding to the snowflake rendering parameters, and the second texture mask displays the rendering effect corresponding to the snow-covering rendering parameters. Optionally, the first material area and the second material area can be divided according to the surface parameters of the model, such as roughness and smoothness. Optionally, in some embodiments, the first material area and the second material area can be divided according to the type of material of the model. (Reference) Figure 9 ,in, Figure 9 The first and second material regions in the model are divided according to the types of materials used in the model. Specifically... Figure 9 The material is divided into hair-like parts and non-hair-like parts (the glasses part). You can see... Figure 9 The first material area (hair strands) only has snowflake effects, while the second material area (glasses) has both snowflake and snowflake effects.
[0112] To better adapt to the weather in the game, in some embodiments, the target model is rendered based on the snow-covered rendering parameters, specifically including:
[0113] Obtain the snowfall amount corresponding to the target model:
[0114] Adjust the snow cover rendering parameters based on the amount of snowfall;
[0115] The target model is rendered based on the adjusted snow-covered rendering parameters.
[0116] In practical implementation, to ensure that the snow cover effect of the target model changes according to the weather, the snow cover rendering parameters can be adjusted based on the corresponding snowfall amount, and the target model can be rendered based on the adjusted snow cover rendering parameters. Optionally, the snow cover rendering parameters can be adjusted based on interpolation calculations, using the snow cover rendering parameters and the inherent rendering parameters as the two endpoints of the interpolation calculation. Thus, when the snowfall amount is 0, the adjusted snow cover rendering parameters become the inherent rendering parameters, maintaining the original display effect of the target model; when the snowfall amount is 1, the adjusted snow cover rendering parameters remain unchanged, thereby maximizing the snow cover effect of the target model. (Reference) Figure 10 In the left image, the snowfall amount is 0, and the target model still displays the original rendering effect. In the right image, the snowfall amount is not 0, so the target model has a snow-covered effect, and the snow-covered effect will increase with the increase of snowfall amount.
[0117] The snow-covered rendering method provided in this application first obtains the target noise map and the inherent rendering parameters of the target model to be rendered; then, it obtains the preset snow-falling rendering parameters corresponding to the inherent rendering parameters; then, it performs interpolation calculation on the inherent rendering parameters and the preset snow-falling rendering parameters based on the target noise map to obtain the snow-covered rendering parameters of the target model; finally, it renders the target model according to the snow-covered rendering parameters, thereby achieving automated rendering of the snow-covered effect of the model through the target noise map, improving the efficiency and quality of snow-covered rendering of the model, and reducing the cost of snow-covered rendering of the model. At the same time, the snow-covered rendering method of this application can use the shader algorithm to achieve high-quality hair snow-falling effect performance on mobile devices based on the original materials during snowy weather. Furthermore, the snow-covered rendering method of this application has high material versatility, can handle various types of hair, and can achieve layered snow-covered effects, including thin snow (snowflakes) and thick snow (snow flakes). It can also handle other objects on the hair, such as hats and hair accessories, further improving the realism of the rendering. It can also be combined with the in-game weather system to achieve dynamic snow-covered effects. Finally, the snow-covered rendering method of this application allows users to adjust the snow coverage, intensity, and style, enhancing the user experience.
[0118] It should be noted that the method in this embodiment can be executed by a single device, such as a computer or server. The method can also be applied in a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method in this embodiment, and the multiple devices will interact with each other to complete the method described.
[0119] It should be noted that the above description describes some embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0120] Exemplary device
[0121] Based on the same inventive concept, corresponding to any of the above embodiments, this application also provides a rendering device for a model covered in snow effect.
[0122] refer to Figure 11 The rendering device for the snow-covered effect of the model includes:
[0123] The first acquisition module 201 acquires the target noise map and the inherent rendering parameters of the target model to be rendered;
[0124] The second acquisition module 202 acquires preset snowfall rendering parameters corresponding to the inherent rendering parameters;
[0125] Interpolation module 203 performs interpolation calculations on the inherent rendering parameters and the preset snowfall rendering parameters based on the target noise map to obtain the snowfall rendering parameters of the target model;
[0126] The rendering module 204 renders the target model based on the snow-covered rendering parameters.
[0127] In some embodiments, the inherent rendering parameters include at least one of the following: inherent color, inherent normal, inherent roughness, inherent metallicity, and inherent specular parameter; the preset snow rendering parameters include at least one of the following: preset snow color, preset snow normal, preset snow roughness, preset snow metallicity, and preset snow specular parameter.
[0128] In some embodiments, the target noise map includes a snowflake noise map and a snowflake noise map, wherein the noise grid density corresponding to the snowflake noise map is greater than the noise grid density corresponding to the snowflake noise map; the interpolation module 203 includes:
[0129] The first sampling unit samples the grayscale value of the snowflake noise map to obtain the first grayscale information;
[0130] The second sampling unit samples the grayscale value of the snowflake noise map to obtain the second grayscale information;
[0131] The overlay unit multiplies the first grayscale information with the second grayscale information to obtain the overlay grayscale information;
[0132] The calculation unit performs interpolation calculations on the inherent rendering parameters and the preset snowfall rendering parameters based on the superimposed grayscale information.
[0133] In some embodiments, the first sampling unit is specifically used for:
[0134] The grayscale value of the snowflake noise map is sampled to obtain the first initial grayscale information;
[0135] The preset snowflake range parameter is added to the first initial grayscale information to obtain the first grayscale information.
[0136] In some embodiments, the second sampling unit is specifically used for:
[0137] The snowflake noise map is sampled to obtain the second initial grayscale information;
[0138] The preset snowflake range parameter is added to the second initial grayscale information to obtain the second grayscale information.
[0139] In some embodiments, the computing unit is specifically used for:
[0140] Obtain the normal information of the target model;
[0141] Adjust the target noise map based on the normal information;
[0142] Interpolation calculations are performed on the inherent rendering parameters and the preset snowfall rendering parameters based on the adjusted target noise map.
[0143] In some embodiments, the computing unit is specifically used for:
[0144] The vertical component coordinates of the normal of the target model are determined based on the normal information;
[0145] The grayscale information of the target noise map is adjusted based on the vertical component coordinates; wherein the vertical component coordinates are proportional to the grayscale value of the grayscale information of the target noise map.
[0146] In some embodiments, the computing unit is specifically used for:
[0147] Obtain the preset snow cover range parameters of the target model;
[0148] Adjust the vertical component coordinates based on the preset snow cover range parameters;
[0149] The grayscale information of the target noise map is adjusted based on the adjusted vertical component coordinates.
[0150] In some embodiments, the computing unit is specifically used for:
[0151] Based on the normal information, determine the angle between the direction of the normal of the target model and the preset vertical direction:
[0152] The grayscale information of the target noise map is adjusted based on the included angle; wherein the included angle is inversely proportional to the grayscale value of the grayscale information of the target noise map.
[0153] In some embodiments, the device further includes a masking module for:
[0154] Based on the second grayscale information, interpolation calculations are performed on the inherent rendering parameters and the preset snowfall rendering parameters to obtain the snowflake rendering parameters of the target model;
[0155] The target model is rendered based on the snowflake rendering parameters;
[0156] Determine the first and second material regions of the target model;
[0157] A first texture mask is added to the first material area; wherein, the first texture mask is used to display the rendering effect corresponding to the snowflake rendering parameters;
[0158] A second texture mask is added to the second material area; wherein, the second texture mask is used to display the rendering effect corresponding to the snow rendering parameters.
[0159] In some embodiments, the rendering module 204 is specifically used for:
[0160] Obtain the snowfall amount corresponding to the target model:
[0161] The snow cover weight of the target model is determined based on the amount of snowfall.
[0162] Adjust the snow cover rendering parameters based on the amount of snowfall;
[0163] The target model is rendered based on the adjusted snow-covered rendering parameters.
[0164] For ease of description, the above system is described by dividing it into various modules based on their functions. Of course, in implementing this application, the functions of each module can be implemented in one or more software and / or hardware.
[0165] The system described above is used to implement the rendering method for the snow-covered effect of the corresponding model in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0166] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the rendering method for the snow-covered model effect described in any of the above embodiments.
[0167] Figure 12 This embodiment illustrates a more specific hardware structure of an electronic device, which may include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, memory 1020, input / output interface 1030, and communication interface 1040 are interconnected internally via the bus 1050.
[0168] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0169] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.
[0170] The input / output interface 1030 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.
[0171] The communication interface 1040 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0172] Bus 1050 includes a pathway for transmitting information between various components of the device, such as processor 1010, memory 1020, input / output interface 1030, and communication interface 1040.
[0173] It should be noted that although the above-described device only shows the processor 1010, memory 1020, input / output interface 1030, communication interface 1040, and bus 1050, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.
[0174] The electronic device described above is used to implement the rendering method for the snow-covered effect of the corresponding model in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0175] The memory 1020 stores machine-readable instructions executable by the processor 1010. When the electronic device is running, the processor 1010 communicates with the memory 1020 via the bus 1050, causing the processor 1010 to execute the following instructions during operation: obtain a target noise map and the inherent rendering parameters of the target model to be rendered; obtain preset snow rendering parameters corresponding to the inherent rendering parameters; perform interpolation calculations on the inherent rendering parameters and the preset snow rendering parameters based on the target noise map to obtain the snow-covered rendering parameters of the target model; and render the target model based on the snow-covered rendering parameters.
[0176] In one possible implementation, the instructions executed by the processor 1010 include at least one of the following inherent rendering parameters: inherent color, inherent normal, inherent roughness, inherent metallicity, and inherent specular parameter; the preset snow rendering parameters include at least one of the following: preset snow color, preset snow normal, preset snow roughness, preset snow metallicity, and preset snow specular parameter.
[0177] In one possible implementation, the target noise map includes a snowflake noise map and a snowflake noise map, wherein the noise grid density corresponding to the snowflake noise map is greater than the noise grid density corresponding to the snowflake noise map; the instructions executed by the processor 1010 include interpolating the inherent rendering parameters and the preset snowfall rendering parameters based on the target noise map, specifically including:
[0178] The grayscale value of the snowflake noise map is sampled to obtain the first grayscale information;
[0179] The snowflake noise map is sampled for grayscale values to obtain second grayscale information;
[0180] Multiply the first grayscale information by the second grayscale information to obtain the superimposed grayscale information;
[0181] Based on the superimposed grayscale information, interpolation calculations are performed on the inherent rendering parameters and the preset snowfall rendering parameters.
[0182] In one possible implementation, the instructions executed by the processor 1010 include sampling the grayscale value of the snowflake noise map to obtain first grayscale information, specifically including:
[0183] The grayscale value of the snowflake noise map is sampled to obtain the first initial grayscale information;
[0184] The preset snowflake range parameter is added to the first initial grayscale information to obtain the first grayscale information.
[0185] In one possible implementation, the instructions executed by the processor 1010 sample the snowflake noise map to obtain second grayscale information, specifically including:
[0186] The snowflake noise map is sampled to obtain the second initial grayscale information;
[0187] The preset snowflake range parameter is added to the second initial grayscale information to obtain the second grayscale information.
[0188] In one possible implementation, the instructions executed by the processor 1010 include interpolating the inherent rendering parameters and the preset snowfall rendering parameters based on the target noise map, specifically including:
[0189] Obtain the normal information of the target model;
[0190] Adjust the target noise map based on the normal information;
[0191] Interpolation calculations are performed on the inherent rendering parameters and the preset snowfall rendering parameters based on the adjusted target noise map.
[0192] In one possible implementation, the instructions executed by the processor 1010, which adjust the target noise map based on the normal information, specifically include:
[0193] The vertical component coordinates of the normal of the target model are determined based on the normal information;
[0194] The grayscale information of the target noise map is adjusted based on the vertical component coordinates; wherein the vertical component coordinates are proportional to the grayscale value of the grayscale information of the target noise map.
[0195] In one possible implementation, the instructions executed by the processor 1010, which adjust the grayscale information of the target noise map based on the vertical component coordinates, specifically include:
[0196] Obtain the preset snow cover range parameters of the target model;
[0197] Adjust the vertical component coordinates based on the preset snow cover range parameters;
[0198] The grayscale information of the target noise map is adjusted based on the adjusted vertical component coordinates.
[0199] In one possible implementation, the instructions executed by the processor 1010, which adjust the target noise map based on the normal information, specifically include:
[0200] Based on the normal information, determine the angle between the direction of the normal of the target model and the preset vertical direction:
[0201] The grayscale information of the target noise map is adjusted based on the included angle; wherein the included angle is inversely proportional to the grayscale value of the grayscale information of the target noise map.
[0202] In one possible implementation, after rendering the target model based on the snow-covered rendering parameters, the method further includes the following instructions executed by the processor 1010:
[0203] Based on the second grayscale information, interpolation calculations are performed on the inherent rendering parameters and the preset snowfall rendering parameters to obtain the snowflake rendering parameters of the target model;
[0204] The target model is rendered based on the snowflake rendering parameters;
[0205] Determine the first and second material regions of the target model;
[0206] A first texture mask is added to the first material area; wherein, the first texture mask is used to display the rendering effect corresponding to the snowflake rendering parameters;
[0207] A second texture mask is added to the second material area; wherein, the second texture mask is used to display the rendering effect corresponding to the snow rendering parameters.
[0208] In one possible implementation, the instructions executed by the processor 1010 to render the target model based on the snow-covered rendering parameters specifically include:
[0209] Obtain the snowfall amount corresponding to the target model:
[0210] The snow cover weight of the target model is determined based on the amount of snowfall.
[0211] Adjust the snow cover rendering parameters based on the amount of snowfall;
[0212] The target model is rendered based on the adjusted snow-covered rendering parameters.
[0213] In the above manner, during the operation of the electronic device, the target noise map and the inherent rendering parameters of the target model to be rendered are first obtained; and the preset snowfall rendering parameters corresponding to the inherent rendering parameters are obtained; then, the inherent rendering parameters and the preset snowfall rendering parameters are interpolated based on the target noise map to obtain the snow-covered rendering parameters of the target model; finally, the target model is rendered based on the snow-covered rendering parameters, thereby achieving automated rendering of the model's snow-covered effect through the target noise map, improving the efficiency and quality of model snow-covered rendering.
[0214] Exemplary program product
[0215] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the rendering method for the snow-covered model effect as described in any of the above embodiments.
[0216] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0217] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the rendering method of the model snow effect as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0218] Based on the same inventive concept, corresponding to any of the above-described embodiments, this application also provides a computer program product, which includes a computer program. In some embodiments, the computer program instructions can be executed by one or more processors of a computer to cause the computer and / or the processor to execute the rendering method for the model snow-covered effect described in the above embodiments. Corresponding to the execution entity for each step in each embodiment of the scene editing method, the processor executing the corresponding step can belong to the corresponding execution entity.
[0219] The computer program product of the above embodiments is used to cause the computer and / or the processor to execute the rendering method of the model snow effect as described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0220] It is understood that before using the technical solutions of the various embodiments in this application, users will be informed of the type, scope of use, and usage scenarios of the personal information involved in an appropriate manner, and user authorization will be obtained.
[0221] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose, based on the prompt message, whether to provide personal information to the software or hardware such as electronic devices, applications, servers, or storage media performing the operations described in this application.
[0222] As an optional but not limited implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0223] It is understood that the above notification and user authorization process is merely illustrative and does not limit the implementation of this application. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this application.
[0224] Those skilled in the art will understand that embodiments of this application can be implemented as a system, method, or computer program product. Therefore, this application can be specifically implemented as entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, this application can also be implemented as a computer program product contained in one or more computer-readable media, which includes computer-readable program code.
[0225] Any combination of one or more computer-readable media may be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example,, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (not exhaustive) of a computer-readable storage medium may include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.
[0226] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0227] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0228] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network (including a local area network (LAN) or a wide area network (WAN)), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0229] It should be understood that each block of a flowchart and / or block diagram, as well as combinations of blocks in a 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, or other programmable data processing device to produce a machine that, when executed by a computer or other programmable data processing device, creates means for implementing the functions / operations specified in the blocks of the flowchart and / or block diagram.
[0230] These computer program instructions may also be stored in a computer-readable medium that enables a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable medium produce a product comprising an instruction apparatus that implements the functions / operations specified in the boxes of a flowchart and / or block diagram.
[0231] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, such that the instructions that execute on the computer or other programmable apparatus can provide a process for implementing the functions / operations specified in the boxes of a flowchart and / or block diagram.
[0232] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0233] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0234] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this application (including the claims) is limited to these examples; within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this application as described above, which are not provided in the details for the sake of brevity.
[0235] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this application, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this application, and this also takes into account the fact that the details of the implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this application will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuits) have been set forth to describe exemplary embodiments of this application, it will be apparent to those skilled in the art that the embodiments of this application can be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0236] Although this application has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0237] The embodiments of this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of this application.
Claims
1. A method for rendering a snow-covered effect on a model, characterized in that, include: Obtain the target noise map and the inherent rendering parameters of the target model to be rendered; Obtain the preset snowfall rendering parameters corresponding to the inherent rendering parameters; Based on the target noise map, interpolation calculations are performed on the inherent rendering parameters and the preset snowfall rendering parameters to obtain the snow-covered rendering parameters of the target model; The target model is rendered based on the snow-covered rendering parameters; The target noise map includes a snowflake noise map and a snowflake noise map. The noise mesh density corresponding to the snowflake noise map is greater than the noise mesh density corresponding to the snowflake noise map. Interpolation calculations are performed on the inherent rendering parameters and the preset snowfall rendering parameters based on the target noise map, including: The grayscale value of the snowflake noise map is sampled to obtain the first grayscale information; The snowflake noise map is sampled for grayscale values to obtain second grayscale information; Multiply the first grayscale information by the second grayscale information to obtain the superimposed grayscale information; Based on the superimposed grayscale information, interpolation calculations are performed on the inherent rendering parameters and the preset snowfall rendering parameters; or... Based on the target noise map, interpolation calculations are performed on the inherent rendering parameters and the preset snowfall rendering parameters, including: Obtain the normal information of the target model; Adjust the target noise map based on the normal information; Based on the adjusted target noise map, interpolation calculations are performed on the inherent rendering parameters and the preset snowfall rendering parameters; Adjusting the target noise map based on the normal information specifically includes: The vertical component coordinates of the normal of the target model are determined based on the normal information. The grayscale information of the target noise map is adjusted based on the vertical component coordinates; wherein the vertical component coordinates are proportional to the grayscale value of the grayscale information of the target noise map.
2. The method according to claim 1, characterized in that, The inherent rendering parameters include at least one of the following: inherent color, inherent normal, inherent roughness, inherent metallicity, and inherent specular parameters; the preset snow rendering parameters include at least one of the following: preset snow color, preset snow normal, preset snow roughness, preset snow metallicity, and preset snow specular parameters.
3. The method according to claim 1, characterized in that, The snowflake noise map is sampled for grayscale values to obtain first grayscale information, specifically including: The grayscale value of the snowflake noise map is sampled to obtain the first initial grayscale information; The preset snowflake range parameter is added to the first initial grayscale information to obtain the first grayscale information.
4. The method according to claim 1, characterized in that, The snowflake noise map is sampled to obtain the second grayscale information, specifically including: The snowflake noise map is sampled to obtain the second initial grayscale information; The preset snowflake range parameter is added to the second initial grayscale information to obtain the second grayscale information.
5. The method according to claim 1, characterized in that, Adjusting the grayscale information of the target noise map based on the vertical component coordinates specifically includes: Obtain the preset snow cover range parameters of the target model; Adjust the vertical component coordinates based on the preset snow cover range parameters; The grayscale information of the target noise map is adjusted based on the adjusted vertical component coordinates.
6. The method according to claim 1, characterized in that, Adjusting the target noise map based on the normal information specifically includes: Based on the normal information, determine the angle between the direction of the normal of the target model and the preset vertical direction: The grayscale information of the target noise map is adjusted based on the included angle; wherein the included angle is inversely proportional to the grayscale value of the grayscale information of the target noise map.
7. The method according to claim 1, characterized in that, After rendering the target model based on the snow-covered rendering parameters, the method further includes: Based on the second grayscale information, interpolation calculations are performed on the inherent rendering parameters and the preset snowfall rendering parameters to obtain the snowflake rendering parameters of the target model; The target model is rendered based on the snowflake rendering parameters; Determine the first and second material regions of the target model; A first texture mask is added to the first material area; wherein, the first texture mask is used to display the rendering effect corresponding to the snowflake rendering parameters; A second texture mask is added to the second material area; wherein, the second texture mask is used to display the rendering effect corresponding to the snow rendering parameters.
8. The method according to claim 1, characterized in that, Rendering the target model based on the snow-covered rendering parameters specifically includes: Obtain the snowfall amount corresponding to the target model: The snow cover weight of the target model is determined based on the amount of snowfall. Adjust the snow cover rendering parameters based on the amount of snowfall; The target model is rendered based on the adjusted snow-covered rendering parameters.
9. A rendering device for a snow-covered model, characterized in that, include: The first acquisition module acquires the target noise map and the inherent rendering parameters of the target model to be rendered; The second acquisition module acquires preset snowfall rendering parameters corresponding to the inherent rendering parameters; The interpolation module performs interpolation calculations on the inherent rendering parameters and the preset snowfall rendering parameters based on the target noise map to obtain the snowfall rendering parameters of the target model. The rendering module renders the target model based on the snow-covered rendering parameters; The target noise map includes a snowflake noise map and a snowflake noise map. The noise mesh density corresponding to the snowflake noise map is greater than the noise mesh density corresponding to the snowflake noise map. (Interpolation module...) The grayscale value of the snowflake noise map is sampled to obtain the first grayscale information; The snowflake noise map is sampled for grayscale values to obtain second grayscale information; Multiply the first grayscale information by the second grayscale information to obtain the superimposed grayscale information; Based on the superimposed grayscale information, interpolation calculations are performed on the inherent rendering parameters and the preset snowfall rendering parameters; or... The interpolation module obtains the normal information of the target model; Adjust the target noise map based on the normal information; Based on the adjusted target noise map, interpolation calculations are performed on the inherent rendering parameters and the preset snowfall rendering parameters; Adjusting the target noise map based on the normal information specifically includes: The vertical component coordinates of the normal of the target model are determined based on the normal information. The grayscale information of the target noise map is adjusted based on the vertical component coordinates; wherein the vertical component coordinates are proportional to the grayscale value of the grayscale information of the target noise map.
10. An electronic device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor, when executing the program, implements the method as described in any one of claims 1 to 8.
11. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores computer instructions for causing a computer to perform the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Method and device for rendering weather in game, storage medium and electronic device
CN116351065A
Method and device for rendering snow in game scene, electronic equipment and storage medium
CN116370956A