Ice body material rendering method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202211141829.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-20
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2042-09-20
AI Technical Summary
[0002]目前,为了更好的实现对冰体的模拟效果,服务端主要运用光线步进(RayMarching)算法和有向距离场(signed distance field,SDF)来模拟光线追踪渲染冰体的体积,但是所需的开销较大
[0009]本发明实施例提供的技术方案中,获取待处理的冰体模型和预置的多个贴图,多个贴图包括基础颜色贴图、冰体法线贴图和冰体表面纹理贴图;根据冰体法线贴图和冰体表面纹理贴图进行各向异性处理,得到各向异性贴图;根据基础颜色贴图和各向异性贴图生成冰体模型对应的第一冰体材质贴图。本发明实施例,通过各向异性贴图来模拟冰体在不同视角下不同的扭曲扰动,提高了冰体材质在移动终端的各向异性表现效果。
Smart Images

Figure CN115690298B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a rendering method, apparatus, electronic device, and storage medium for ice material. Background Technology
[0002] Currently, in order to better simulate the ice body, the server mainly uses the RayMarching algorithm and the signed distance field (SDF) to simulate the volume of the ice body by ray tracing, but the overhead is relatively large.
[0003] Due to performance limitations, mobile devices cannot directly utilize ray stepping algorithms to represent the translucent internal transmission effect of ice. They also cannot use conventional anisotropic shading models to represent the unique anisotropic effects within the microstructure of ice. Summary of the Invention
[0004] This invention provides a rendering method, apparatus, electronic device, and storage medium for ice material, used to simulate the distortion and disturbance effect of ice on mobile terminals, thereby improving the anisotropic performance of ice material on mobile terminals.
[0005] A first aspect of this invention provides a method for rendering ice material, comprising: acquiring an ice model to be processed and a plurality of preset textures, the plurality of textures including a base color texture, an ice normal texture, and an ice surface texture texture; performing anisotropic processing on the ice normal texture and the ice surface texture texture to obtain an anisotropic texture; and generating a first ice material texture map corresponding to the ice model based on the base color texture and the anisotropic texture.
[0006] A second aspect of this invention provides a rendering apparatus for ice body materials, comprising: an acquisition module for acquiring an ice body model to be processed and a plurality of preset textures, the plurality of textures including a base color texture, an ice body normal texture, and an ice body surface texture texture; an anisotropic processing module for performing anisotropic processing on the ice body normal texture and the ice body surface texture texture to obtain an anisotropic texture; and a first generation module for generating a first ice body material texture corresponding to the ice body model based on the base color texture and the anisotropic texture.
[0007] A third aspect of the present invention provides an electronic device, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor invokes the instructions in the memory to cause the electronic device to execute the above-described method for rendering ice materials.
[0008] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the above-described method for rendering ice materials.
[0009] In the technical solution provided by this invention, an ice model to be processed and multiple preset textures are obtained. These textures include a base color texture, an ice normal texture, and an ice surface texture texture. Anisotropic processing is performed on the ice normal texture and the ice surface texture texture to obtain an anisotropic texture. A first ice material texture corresponding to the ice model is generated based on the base color texture and the anisotropic texture. This invention uses anisotropic textures to simulate different distortions and disturbances of the ice body from different viewpoints, improving the anisotropic representation of the ice material on mobile terminals. Attached Figure Description
[0010] Figure 1 This is a schematic diagram of an embodiment of the rendering method for ice material in this invention;
[0011] Figure 2 This is a schematic diagram of another embodiment of the rendering method for ice material in this invention;
[0012] Figure 3 This is a schematic diagram of another embodiment of the rendering method for ice material in this invention;
[0013] Figure 4 This is a schematic diagram of another embodiment of the rendering method for ice material in this invention;
[0014] Figure 5 This is a schematic diagram of another embodiment of the rendering method for ice material in this invention;
[0015] Figure 6 This is a schematic diagram of an ice body normal map in an embodiment of the present invention;
[0016] Figure 7 This is a schematic diagram of an ice surface texture mapping in an embodiment of the present invention;
[0017] Figure 8 This is a schematic diagram of an anisotropic map from one perspective in an embodiment of the present invention;
[0018] Figure 9 This is another perspective schematic diagram of anisotropic mapping in an embodiment of the present invention;
[0019] Figure 10 This is a schematic diagram of another embodiment of the rendering method for ice material in this invention;
[0020] Figure 11This is a schematic diagram of the internal texture mapping of ice in an embodiment of the present invention;
[0021] Figure 12 This is a schematic diagram of a first self-illuminating texture in an embodiment of the present invention;
[0022] Figure 13 This is a schematic diagram of a second self-illuminating texture in an embodiment of the present invention;
[0023] Figure 14 This is a schematic diagram of an ice body self-illuminating texture in an embodiment of the present invention;
[0024] Figure 15 This is a schematic diagram of an embodiment of the rendering device for ice material in this invention;
[0025] Figure 16 This is a schematic diagram of one embodiment of the electronic device in this invention. Detailed Implementation
[0026] This invention provides a rendering method, apparatus, electronic device, and storage medium for ice material, used to simulate the distortion and disturbance effect of ice on mobile terminals, thereby improving the anisotropic performance of ice material on mobile terminals.
[0027] It is understood that the present invention can be applied to electronic devices. By way of example and not limitation, the electronic device can be a mobile terminal. This application uses a mobile terminal as an example for illustration.
[0028] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises 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 such processes, methods, products, or apparatus.
[0029] In existing solutions, mobile terminals cannot meet the overhead requirements for using ray stepping algorithms and directed distance fields. Therefore, ray stepping algorithms and directed distance fields cannot be used directly on mobile terminals to simulate ice bodies. Other solutions used have poor simulation effects on ice bodies. However, the ice body material rendering method provided by this invention can simulate the distortion and disturbance effects of ice bodies on mobile terminals, thereby improving the anisotropic performance of ice body materials on mobile terminals.
[0030] Please see Figure 1 A flowchart of the ice material rendering method provided in this embodiment of the invention specifically includes:
[0031] 101. Obtain the ice model to be processed and multiple preset textures, including a base color texture, an ice normal map, and an ice surface texture map.
[0032] It should be noted that existing mobile terminal ice rendering solutions simulate the smooth reflection of ice by mimicking roughness and specular highlights, and pre-draw base color maps to simulate the color of ice. However, the anisotropic properties resulting from the unique microstructure of ice cannot be represented by existing solutions using conventional anisotropic shading models. This invention decomposes the representation of ice materials into different material functions: base color, anisotropic representation, normals, emissivity, and transparency. Therefore, the corresponding function maps need to be prepared in advance. The mobile terminal acquires the ice model to be processed and multiple pre-set maps, including a base color map, an ice normal map, and an ice surface texture map.
[0033] 102. Perform anisotropic processing on the ice body normal map and ice body surface texture map to obtain an anisotropic map.
[0034] During the rendering process, the mobile device performs anisotropic processing on the ice body's normal map and surface texture map to obtain an anisotropic map. The mobile device represents the anisotropy of the ice body by perturbing the sampled texture, simulating the different specular appearances of the ice body from different viewpoints.
[0035] 103. Generate the first ice body material texture map corresponding to the ice body model based on the base color map and the anisotropic map.
[0036] The mobile terminal generates the first ice material texture map corresponding to the ice model based on the base color map and the anisotropic map. Specifically, the mobile terminal overlays the base color map and the anisotropic map corresponding to the ice model to generate the first ice material texture map.
[0037] In this embodiment of the invention, anisotropic mapping is used to represent the different specular effects of ice bodies under different viewing angles, and the distortion and disturbance effect of ice bodies on light is simulated on mobile terminals, thereby improving the anisotropic representation effect of ice body materials on mobile terminals.
[0038] Please see Figure 2 Another flowchart of the ice material rendering method provided in this embodiment of the invention specifically includes:
[0039] 201. Obtain the ice model to be processed and multiple preset textures, including a base color texture, an ice normal map, and an ice surface texture map.
[0040] 202. Perform anisotropic processing on the ice body normal map and ice body surface texture map to obtain an anisotropic map.
[0041] 203. Generate the first ice body material texture map corresponding to the ice body model based on the base color map and the anisotropic map.
[0042] Steps 201-203 are similar to steps 101-103, and will not be described in detail here.
[0043] 204. Perform bump offset processing on the preset ice body internal texture map to obtain the parallax map.
[0044] The mobile terminal performs bump offset processing on the preset ice body internal texture map to obtain a parallax map.
[0045] It's worth noting that bump offset can create the illusion of depth in ice materials without requiring additional geometry. The brighter the depth information and height map values, the more pronounced the "bump" effect of the ice material. As the camera moves across the surface, these areas will generate parallax, which increases the visual depth of the ice's internal texture map without altering the model, thus creating a parallax map.
[0046] 205. Overlay the parallax map and the first ice body material map to generate the second ice body material map corresponding to the ice body model.
[0047] The mobile terminal overlays the parallax map and the first ice body material map to obtain the second ice body material map.
[0048] In this embodiment of the invention, anisotropic mapping is used to represent the different specular effects of ice bodies under different viewing angles, simulating the distortion and disturbance effect of light by ice bodies on mobile terminals, thereby improving the anisotropic representation effect of ice body materials on mobile terminals; parallax mapping is used to represent the depth effect inside the ice body, enhancing the transparency of the internal structure and color of the ice body.
[0049] Please see Figure 3 Another flowchart of the ice material rendering method provided in this embodiment of the invention specifically includes:
[0050] 301. Obtain the ice model to be processed and multiple preset textures, including a base color texture, an ice normal map, and an ice surface texture map.
[0051] 302. Perform anisotropic processing on the ice body normal map and ice body surface texture map to obtain an anisotropic map.
[0052] 303. Generate the first ice body material texture map corresponding to the ice body model based on the base color map and the anisotropic map.
[0053] Steps 301-303 are similar to steps 101-103, and will not be described in detail here.
[0054] 304. Determine the first transition region and the second transition region in the ice body model to be processed, and generate an ice body self-illuminating texture based on the first transition region and the second transition region.
[0055] The mobile terminal divides the ice model into a first transition region and a second transition region, and generates an ice self-illumination map based on these regions. The first transition region, the InnerCore, is the area extending from the center point to a radius of a first preset distance, representing the inner glow of the ice. The second transition region, the OuterCore, is the area outside the boundary, extending to a radius of the second preset distance, representing the outline of the ice. The first and second transition regions are superimposed to obtain the ice self-illumination map. The transition between the inner and outer regions is achieved through the dot product of the camera view vector and the vertex normal vector, thus reflecting the transparency of different parts of the ice. This simulates the Fresnel effect while avoiding the high overhead associated with the SDF algorithm.
[0056] It should be noted that when the angle θ between the camera's line of sight vector and the normal is 0 degrees (i.e., the camera's line of sight vector is parallel to the normal), cosθ is 1, and the amount of light reflected is small; when the angle θ between the camera's line of sight vector and the normal is 90 degrees (i.e., the camera's line of sight vector is perpendicular to the normal), cosθ is 0, and the amount of light reflected is large.
[0057] 305. Overlay the self-illuminating ice body texture map and the first ice body material texture map to generate the third ice body material texture map corresponding to the ice body model.
[0058] The mobile terminal overlays the self-illuminating ice texture map and the first ice texture map to obtain the third ice texture map.
[0059] In this embodiment of the invention, anisotropic mapping is used to represent the different specular effects of ice under different viewing angles, simulating the distortion and disturbance effect of ice on light on mobile terminals, thereby improving the anisotropic representation of ice material on mobile terminals; and the translucency of ice is represented by ice self-illumination mapping.
[0060] Please see Figure 4 Another flowchart of the ice material rendering method provided in this embodiment of the invention specifically includes:
[0061] 401. Obtain the ice model to be processed and multiple preset textures, including a base color texture, an ice normal map, and an ice surface texture map.
[0062] 402. Perform anisotropic processing on the ice body normal map and ice body surface texture map to obtain an anisotropic map.
[0063] 403. Generate the first ice body material texture map corresponding to the ice body model based on the base color map and the anisotropic map.
[0064] 404. Perform bump offset processing on the preset ice body internal texture map to obtain a parallax map.
[0065] Steps 401-403 are similar to steps 201-204, and will not be described in detail here.
[0066] 405. Determine the first transition region and the second transition region in the ice body model to be processed, and generate an ice body self-illuminating texture based on the first transition region and the second transition region.
[0067] Step 405 is similar to step 304, and will not be described in detail here.
[0068] 406. Overlay the parallax map, the ice body self-illumination map, and the first ice body material map to generate the fourth ice body material map corresponding to the ice body model.
[0069] In this embodiment of the invention, anisotropic mapping is used to represent the different specular highlights of ice bodies from different viewing angles, simulating the distortion and disturbance effect of light by ice bodies on mobile terminals, thereby improving the anisotropic representation of ice body materials on mobile terminals; parallax mapping is used to represent the depth effect inside ice bodies, enhancing the transparency of the internal structure and color of ice bodies; and self-illuminating ice body mapping is used to represent the translucency of ice bodies, better simulating the real physical transmission effect of ice bodies on mobile terminals, and reducing the performance overhead required to simulate ice bodies.
[0070] Please see Figure 5 Another flowchart of the ice material rendering method provided in this embodiment of the invention specifically includes:
[0071] 501. Obtain the ice model to be processed and multiple preset textures, including a base color texture, an ice normal map, and an ice surface texture map.
[0072] Step 501 is similar to step 101, and will not be described in detail here.
[0073] 502. Determine the initial ice reflection noise based on the ice body normal map.
[0074] Specifically, the mobile terminal normalizes the normals in the ice body normal map to obtain the first interpolation parameter; the mobile terminal samples the ice body normal map to obtain the second interpolation parameter; the mobile terminal performs linear interpolation based on the first interpolation parameter, the second interpolation parameter, and a preset first scaling parameter to obtain the initial ice body reflection noise.
[0075] For example, the mobile terminal determines the normalized normal parameter float3(0,0,1) as the first interpolation parameter A, and samples the ice body normal map, as shown in the example. Figure 6 As shown, the second interpolation parameter B is obtained; the mobile terminal performs linear interpolation based on the first interpolation parameter A, the second interpolation parameter B, and a preset first scaling parameter to obtain the initial ice body reflection noise. The linear interpolation formula is: Lerp = A + (BA) * Alpha, where Alpha is a user-defined first scaling parameter.
[0076] 503. Determine the scaling parameters based on the preset time function, and perform two interpolation processes based on the scaling parameters and the initial ice body reflection noise to obtain the target ice body reflection noise.
[0077] Specifically, the mobile terminal inputs the frame rendering time into a preset time function to obtain the function period; the mobile terminal determines the function period as a second proportional parameter, and performs linear interpolation based on the second proportional parameter, a preset reflection vector contribution parameter, and the initial ice reflection noise to obtain a first interpolation result; the mobile terminal performs linear interpolation based on the first interpolation result, a preset third interpolation parameter, and a preset fourth interpolation parameter to obtain a second interpolation result; the mobile terminal multiplies the second interpolation result with the initial ice reflection noise to obtain the target ice reflection noise.
[0078] For example, the mobile terminal receives a sine function (i.e., a sine function) via the frame rendering time (FrameTime). In the mobile terminal, the sine function has a period of 2π. The mobile terminal then determines the function period, which varies with FrameTime, as the Alpha1 parameter of the first linear interpolation function, i.e., the second proportional parameter. It then sets the default value of the preset reflection vector contribution parameter to 1 and multiplies it by a coefficient of 0.7. Finally, it applies the formula for the first linear interpolation function: Lerp1 = A1 + (B1 - A1) / 2π. The reflection vector contribution parameter is determined as parameter A1, and the product of the reflection vector contribution parameter and the coefficient is used as parameter B1 to obtain the first interpolation result Lerp1. Then, Lerp1 is used as the formula for the second linear interpolation function: Lerp2=A2+(B2-A2)*Alpha2. The Alpha2 parameter is set to A2 and B2 respectively to 0.3 and 0.65 to calculate the second interpolation result Lerp2. The mobile terminal multiplies the second interpolation result Lerp2 with the initial ice body reflection noise to obtain the target ice body reflection noise.
[0079] It should be noted that the coefficient can also take other values, such as 0.5 or 0.4. In order to make the product of the reflection vector contribution parameter and the coefficient close to the original value (i.e., the reflection vector contribution parameter), the coefficient can be set to less than 0.5.
[0080] 504. Superimpose the target ice body reflection noise with the initial reflection vector to obtain the tangent space reflection vector. The initial reflection vector is the reflection vector of the camera's line of sight relative to the ice body model normal.
[0081] The mobile terminal superimposes the target ice body reflection noise with the initial reflection vector to obtain the tangent space reflection vector. The initial reflection vector is the reflection vector of the camera's line of sight relative to the ice body model normal.
[0082] It should be noted that the reflection vector is the symmetric vector of the camera's line of sight relative to the normal vector. The reflection vector V′ is calculated according to the vector projection formula: V′ = V - 2*(V*N)*N, where V is the camera's line of sight vector.
[0083] 505. Transform the tangent space reflection vector from tangent space to world space to obtain the world space reflection vector, and perform linear interpolation on the world space reflection vector based on the camera's line of sight vector to obtain the target interpolation result.
[0084] Specifically, the mobile terminal multiplies the tangent space reflection vector in tangent space with the target matrix to obtain the world space reflection vector in world space; the mobile terminal then performs linear interpolation based on the camera line-of-sight vector and the world space reflection vector to obtain the target interpolation result.
[0085] For example, suppose the initial reflection vector is 'a', and the world matrix is denoted as M. Then, multiplying vector 'a' from its original tangent space by the transpose of the inverse of the world matrix, i.e., multiplying vector 'a' by (M... -1 ) T Multiplying, the tangent space TBN is transformed into world space to obtain the world space reflection vector; the camera line-of-sight vector (CameraVector) is determined as the A3 parameter of the third interpolation function, and the value after the above spatial transformation (world space reflection vector) is determined as the B3 parameter of the third interpolation function. The third interpolation function is Lerp3 = A3 + (B3 – A3) * Alpha3, where Alpha3 is a user-defined reflection vector interpolation parameter.
[0086] 506. Based on the target interpolation results, sample the surface texture map of the ice body to obtain anisotropic maps.
[0087] The mobile terminal samples the surface texture map of the ice body based on the target interpolation result to obtain an anisotropic map. It should be noted that the target interpolation result is used as the UV sampling value for sampling anisotropic noise. Figure 7 The surface texture map of the ice body shown is sampled to obtain the sampling result, i.e., the anisotropic map. For example, the sampling result is as follows: Figure 8 , Figure 9 As shown, Figure 8 and Figure 9 These are sampling results from different perspectives.
[0088] 507. Generate the first ice body material texture map corresponding to the ice body model based on the base color map and the anisotropic map.
[0089] In this embodiment of the invention, the reflection vector in the tangent space is transformed into the world space through normal mapping, and then linear interpolation and sampling are performed in combination with the camera's line-of-sight vector. This achieves different specular representations of ice bodies from different perspectives, improves the anisotropic representation of ice body materials on mobile terminals, and simulates the distortion and perturbation effect of ice bodies on light on mobile terminals, further enhancing the anisotropic representation of ice body materials on mobile terminals.
[0090] Please see Figure 10 Another flowchart of the ice material rendering method provided in this embodiment of the invention specifically includes:
[0091] 1001. Obtain the ice model to be processed and multiple preset textures, including a base color texture, an ice normal map, and an ice surface texture map.
[0092] 1002. Determine the initial ice reflection noise based on the ice body normal map.
[0093] 1003. Determine the scaling parameters based on the preset time function, and perform two interpolation processes based on the scaling parameters and the initial ice body reflection noise to obtain the target ice body reflection noise.
[0094] 1004. Superimpose the target ice body reflection noise with the initial reflection vector to obtain the tangent space reflection vector. The initial reflection vector is the reflection vector of the camera's line of sight relative to the ice body model normal.
[0095] 1005. Transform the tangent space reflection vector from tangent space to world space to obtain the world space reflection vector, and perform linear interpolation on the world space reflection vector based on the camera's line of sight vector to obtain the target interpolation result.
[0096] 1006. Based on the target interpolation results, sample the surface texture map of the ice body to obtain anisotropic maps.
[0097] Steps 1001-1006 are similar to steps 501-506, and will not be described in detail here.
[0098] 1007. Obtain the preset height map and determine the first channel value of the height map as the height parameter of the bump offset node.
[0099] The mobile terminal obtains a preset height map and determines the first channel value of the height map as the height parameter of the bump offset node. The first channel value can be the alpha channel value, and there is no specific limitation here.
[0100] It should be noted that the height map can provide depth information for the alpha channel of the diffuse map. When the gap in the diffuse map is white, the corresponding alpha channel is transparent, and the gap produces a recessed effect.
[0101] 1008. Determine the bump offset value of the bump offset node based on the height parameter, the preset height ratio, and the UV coordinates of the base color map.
[0102] It's important to note that using the BumpOffset expression with a mobile terminal can create the illusion of depth in materials without requiring additional geometry. The brighter the heightmap value, the more pronounced the "bump" effect of the material; these areas will create parallax as the camera moves across the surface. The BumpOffset expression's properties include Coordinate, Height, and HeightRatioInput. Coordinate receives the base texture coordinates to be modified by the BumpOffset expression; Height receives the texture (or value) to be used as the heightmap; and HeightRatioInput indicates the multiplier of the depth obtained from the heightmap—the larger this value, the more extreme the depth. The reference plane specifies the approximate height in texture space to which this effect is applied. A value of 0 will cause the texture to completely detach from the surface, while a value of 0.5 (the default) indicates that some areas of the surface are raised while others are recessed. A preset height ratio can be set to 0.005.
[0103] 1009. Adjust the UV coordinates of the preset ice body internal texture map, ice body normal map and / or height map according to the bump offset value to generate the parallax map of the ice body material.
[0104] Specifically, the mobile terminal inputs the bump offset value into the preset UV coordinates of the ice body's internal texture map, the ice body's normal map, and / or the height map; the mobile terminal determines the first channel value of the height map (e.g., RGB channel value) as the background color parameter of the ice body material node; or, the mobile terminal determines the first channel value of the ice body's internal texture map (e.g., red channel value) as the roughness parameter of the ice body material node; the mobile terminal determines the second channel value of the ice body's internal texture map (e.g., green or blue channel value) as the ambient occlusion parameter of the ice body material node; or, the mobile terminal determines the first channel value of the ice body's normal map (e.g., RGB channel value) as the normal parameter of the ice body material node; the mobile terminal generates a parallax map of the ice body material based on the background color parameter, roughness parameter, ambient occlusion parameter, and / or normal parameter. Figure 11 As shown, the internal texture map of ice can be used to represent scratches or cracks inside the ice. The height offset value of the internal texture map of ice is -5 by default, and a negative value indicates an offset in the opposite direction of the normal.
[0105] 1010. Determine the first transition region and the second transition region in the ice body model to be processed, and generate an ice body self-illuminating texture based on the first transition region and the second transition region.
[0106] Specifically, the mobile terminal divides the ice model to be processed into a first transition region and a second transition region; the mobile terminal generates a first self-illuminating map based on the first transition region; the mobile terminal generates a second self-illuminating map based on the second transition region; the mobile terminal overlays the first and second self-illuminating maps to generate the ice body self-illuminating map. For example, the first self-illuminating map is as follows: Figure 12 As shown, the second self-illuminating map is as follows: Figure 13 As shown, the two are superimposed to obtain the ice body self-illumination texture, as follows. Figure 14 As shown.
[0107] In one feasible implementation, the mobile terminal generates a first self-illuminating map based on a first transition region, including:
[0108] The mobile terminal obtains the initial color values of the base color map;
[0109] The mobile terminal calculates the first transition region based on the camera's line-of-sight vector and generates the first transmission map;
[0110] The mobile terminal performs interpolation processing based on the first transmissive map, the initial color value, and the preset color threshold to obtain the first self-illuminating map.
[0111] In one feasible implementation, the mobile terminal generates a second self-illuminating map based on the second transition region, including:
[0112] The mobile terminal obtains the initial color values of the base color map;
[0113] The mobile terminal calculates the second transition region based on the camera's line-of-sight vector and generates a second transmission map;
[0114] The mobile terminal performs interpolation processing based on the second transmissive map, the initial color value, and the preset color threshold to obtain the second self-illuminating map.
[0115] 1011. Overlay the parallax map, the ice body self-illumination map, and the first ice body material map to generate the fourth ice body material map corresponding to the ice body model.
[0116] In this embodiment of the invention, the reflection vector in tangent space is transformed into world space through normal mapping, and then linear interpolation and sampling are performed in combination with the camera's view vector to achieve different specular performance of ice body under different viewpoints. This improves the anisotropic performance of ice body material on mobile terminals. By processing the bump offset of the texture map inside the ice body, the internal structure of the ice body material is simulated, enhancing the transparency of the internal structure and color of the ice body. By simulating the Fresnel effect through the self-illuminating map of the ice body, the light transmission effect of the ice body material is simulated, which better simulates the real physical transmission effect of ice body on mobile terminals and reduces the performance overhead required to simulate ice body.
[0117] The rendering method for ice materials in this embodiment of the invention has been described above. The rendering apparatus for ice materials in this embodiment of the invention is described below. Please refer to [link / reference]. Figure 15 One embodiment of the rendering device for ice material in this invention includes:
[0118] The acquisition module 1501 is used to acquire the ice model to be processed and multiple preset textures, including a base color texture, an ice normal texture, and an ice surface texture texture.
[0119] Anisotropic processing module 1502 is used to perform anisotropic processing based on the ice body normal map and the ice body surface texture map to obtain anisotropic map;
[0120] The first generation module 1503 is used to generate a first ice body material texture map corresponding to the ice body model based on the base color map and the anisotropic map.
[0121] In one feasible implementation, the rendering apparatus for ice materials further includes:
[0122] Offset processing module 1504 is used to perform bump offset processing on the preset internal texture map of ice body to obtain parallax map;
[0123] The second generation module 1505 is further configured to overlay the parallax map and the first ice body material map to generate a second ice body material map corresponding to the ice body model.
[0124] In one feasible implementation, the rendering apparatus for ice materials further includes:
[0125] The transition processing module 1506 is used to determine a first transition region and a second transition region in the ice body model to be processed, and to generate an ice body self-illuminating texture based on the first transition region and the second transition region.
[0126] The third generation module 1507 is used to overlay the self-illuminating ice body texture map and the first ice body material texture map to generate the third ice body material texture map corresponding to the ice body model.
[0127] In one feasible implementation, the rendering apparatus for ice materials further includes:
[0128] The offset processing module 1504 is used to perform bump offset processing on the preset ice body internal texture map to obtain a parallax map.
[0129] The transition processing module 1506 is used to determine a first transition region and a second transition region in the ice body model to be processed, and to generate an ice body self-illuminating texture based on the first transition region and the second transition region.
[0130] The third generation module 1507 is further configured to overlay the parallax map, the ice body self-illumination map, and the first ice body material map to generate a fourth ice body material map corresponding to the ice body model.
[0131] In one feasible implementation, the anisotropy processing module 1502 includes:
[0132] The first determining unit 15021 is used to determine the initial ice body reflection noise based on the ice body normal map;
[0133] The interpolation unit 15022 is determined to determine the scaling parameter according to the preset time function, and to perform two interpolation processes according to the scaling parameter and the initial ice body reflection noise to obtain the target ice body reflection noise;
[0134] The superposition unit 15023 is used to superimpose the target ice body reflection noise with the initial reflection vector to obtain the tangent space reflection vector, wherein the initial reflection vector is the reflection vector of the camera line of sight vector relative to the ice body model normal.
[0135] The transformation interpolation unit 15024 is used to transform the tangent space reflection vector from tangent space to world space to obtain the world space reflection vector, and to perform linear interpolation processing on the world space reflection vector according to the camera line-of-sight vector to obtain the target interpolation result.
[0136] The sampling unit 15025 is used to sample the surface texture map of the ice body according to the target interpolation result to obtain an anisotropic map.
[0137] In one feasible implementation, the first determining unit 15021 is specifically used for:
[0138] The normals in the ice body normal map are normalized to obtain the first interpolation parameter;
[0139] The ice body normal map is sampled to obtain the second interpolation parameters;
[0140] Linear interpolation is performed based on the first interpolation parameter, the second interpolation parameter, and the preset first scaling parameter to obtain the initial ice body reflection noise.
[0141] In one feasible implementation, the determining interpolation unit 15022 is specifically used for:
[0142] The frame rendering time is passed to a preset time function to obtain the function period;
[0143] The period of the function is determined as the second proportional parameter, and linear interpolation is performed based on the second proportional parameter and the preset reflection vector contribution parameter to obtain the first interpolation result;
[0144] Linear interpolation is performed based on the first interpolation result, the preset third interpolation parameter, and the preset fourth interpolation parameter to obtain the second interpolation result;
[0145] The second interpolation result is multiplied by the initial ice body reflection noise to obtain the target ice body reflection noise.
[0146] In one feasible implementation, the transformation interpolation unit 15024 is specifically used for:
[0147] Multiply the tangent space reflection vector in the tangent space with the target matrix to obtain the world space reflection vector in the world space;
[0148] Linear interpolation is performed based on the camera line-of-sight vector and the world space reflection vector to obtain the target interpolation result.
[0149] In one feasible implementation, the offset processing module 1504 includes:
[0150] The determination unit 15041 is used to acquire a preset height map and determine the first channel value of the height map as the height parameter of the bump offset node.
[0151] The second determining unit 15042 is used to determine the bump offset value of the bump offset node based on the height parameter, the preset height ratio and the UV coordinates of the base color map.
[0152] The first generation unit 15043 is used to adjust the UV coordinates of the preset ice body internal texture map, the ice body normal map and / or the height map according to the bump offset value, and generate a parallax map of the ice body material.
[0153] In one feasible implementation, the first generating unit 15043 is specifically used for:
[0154] The bump offset value is input into the UV coordinates of the preset ice body interior texture map, the UV coordinates of the ice body normal map, and / or the UV coordinates of the height map;
[0155] The first channel value of the height map is determined as the background color parameter of the ice material node; or,
[0156] The first channel value of the texture map inside the ice body is determined as the roughness parameter of the ice body material node;
[0157] The second channel value of the texture map inside the ice body is determined as the ambient occlusion parameter of the ice body material node; or...
[0158] The first channel value of the ice body normal map is determined as the normal parameter of the ice body material node;
[0159] A parallax map of the ice body material is generated based on the background color parameter, the roughness parameter, the ambient occlusion parameter, and / or the normal parameter.
[0160] In one feasible implementation, the transition processing module 1506 includes:
[0161] The dividing unit 15061 is used to divide the ice body model to be processed into a first transition region and a second transition region.
[0162] The second generation unit 15062 is used to generate a first self-illuminating texture based on the first transition region.
[0163] The third generation unit 15063 is used to generate a second self-illuminating texture based on the second transition region;
[0164] The overlay unit 15064 is used to overlay the first self-illuminating map and the second self-illuminating map to generate an ice body self-illuminating map.
[0165] In one feasible implementation, the second generating unit 15062 is specifically used for:
[0166] Obtain the initial color values of the base color map;
[0167] The first transition region is calculated based on the camera's line-of-sight vector to generate a first transmission map;
[0168] The first self-illuminating map is obtained by interpolation based on the first transmissive map, the initial color value, and the preset color threshold.
[0169] In one feasible implementation, the third generation unit 15063 is specifically used for:
[0170] Obtain the initial color values of the base color map;
[0171] The second transition region is calculated based on the camera's line-of-sight vector to generate a second transmission map;
[0172] The second self-illuminating map is obtained by interpolation based on the second transmissive map, the initial color value, and the preset color threshold.
[0173] In this embodiment of the invention, the reflection vector in tangent space is transformed into world space through normal mapping, and then linear interpolation and sampling are performed in combination with the camera's view vector to achieve different specular performance of ice body under different viewpoints. This improves the anisotropic performance of ice body material on mobile terminals. By processing the bump offset of the texture map inside the ice body, the internal structure of the ice body material is simulated, enhancing the transparency of the internal structure and color of the ice body. By simulating the Fresnel effect through the self-illuminating map of the ice body, the light transmission effect of the ice body material is simulated, which better simulates the real physical transmission effect of ice body on mobile terminals and reduces the performance overhead required to simulate ice body.
[0174] Figure 16 This is a schematic diagram of the structure of an electronic device 1600 provided in an embodiment of the present invention. The electronic device 1600 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 1610 (e.g., one or more processors) and a memory 1620, and one or more storage media 1630 (e.g., one or more mass storage devices) for storing application programs 1633 or data 1632. The memory 1620 and storage media 1630 can be temporary or persistent storage. The program stored in the storage media 1630 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the electronic device 1600. Furthermore, the processor 1610 may be configured to communicate with the storage media 1630 and execute the series of instruction operations in the storage media 1630 on the electronic device 1600.
[0175] Electronic device 1600 may also include one or more power supplies 1640, one or more wired or wireless network interfaces 1650, one or more input / output interfaces 1660, and / or one or more operating devices 1631, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 16 The illustrated electronic device structure does not constitute a limitation on the electronic device and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0176] As an example, and not a limitation, electronic device 1600 may be a mobile terminal.
[0177] This invention provides an electronic device, including a memory and at least one processor. The memory stores instructions. The at least one processor invokes the instructions in the memory to cause the electronic device to execute the aforementioned ice material rendering method. The specific method includes: acquiring an ice model to be processed and multiple preset textures, including a base color texture, an ice normal map, and an ice surface texture map; performing anisotropic processing on the ice normal map and the ice surface texture map to obtain an anisotropic map; and generating a first ice material texture map corresponding to the ice model based on the base color map and the anisotropic map. By using anisotropic maps to represent the different specular highlights of the ice body from different viewpoints, the distortion and perturbation effect of the ice body on light is simulated on mobile terminals, improving the anisotropic representation of the ice material on mobile terminals.
[0178] The method also includes: performing bump offset processing on a pre-set internal texture map of the ice body to obtain a parallax map; and superimposing the parallax map and the first ice body material map to generate a second ice body material map corresponding to the ice body model. This method uses a parallax map to represent the depth effect inside the ice body, enhancing the transparency of the ice body's internal structure and color.
[0179] The method further includes: determining a first transition region and a second transition region in the ice model to be processed, and generating an ice self-illumination map based on the first and second transition regions; and superimposing the ice self-illumination map and the first ice material map to generate a third ice material map corresponding to the ice model. This method uses the ice self-illumination map to represent the translucency of the ice.
[0180] The method further includes: performing bump offset processing on a pre-set internal texture map of the ice body to obtain a parallax map; determining a first transition region and a second transition region in the ice body model to be processed, and generating an ice body self-illumination map based on the first and second transition regions; and superimposing the parallax map, the ice body self-illumination map, and the first ice body material map to generate a fourth ice body material map corresponding to the ice body model. This method uses anisotropic mapping to represent the different specular highlights of the ice body from different viewing angles, simulating the distortion and disturbance effect of light by the ice body on mobile devices, thus improving the anisotropic representation of the ice body material on mobile devices; it uses parallax mapping to represent the depth effect inside the ice body, enhancing the transparency of the ice body's internal structure and color; and it uses the ice body self-illumination map to represent the translucency of the ice body, better simulating the realistic physical transmission effect of the ice body on mobile devices and reducing the performance overhead required to simulate the ice body.
[0181] The above-mentioned anisotropic processing based on the ice body normal map and ice body surface texture map to obtain an anisotropic map includes: determining the initial ice body reflection noise based on the ice body normal map; determining the scale parameter based on a preset time function, and performing two interpolation processes based on the scale parameter and the initial ice body reflection noise to obtain the target ice body reflection noise; superimposing the target ice body reflection noise with the initial reflection vector to obtain the tangent space reflection vector, where the initial reflection vector is the reflection vector of the camera view vector relative to the ice body model normal; transforming the tangent space reflection vector from tangent space to world space to obtain the world space reflection vector, and performing linear interpolation processing on the world space reflection vector based on the camera view vector to obtain the target interpolation result; sampling the ice body surface texture map based on the target interpolation result to obtain the anisotropic map. This method, by transforming the tangent space reflection vector to world space through the normal map, and then combining it with the camera view vector for linear interpolation and sampling, achieves different specular highlights on the ice body under different viewpoints.
[0182] The above-mentioned method for determining the initial ice reflection noise based on the ice normal map includes: normalizing the normals in the ice normal map to obtain a first interpolation parameter; sampling the ice normal map to obtain a second interpolation parameter; and performing linear interpolation based on the first interpolation parameter, the second interpolation parameter, and a preset first scaling parameter to obtain the initial ice reflection noise. This method refines the process of determining the initial ice reflection noise, enhances the strength of the anisotropic parameters, and improves the realism of the simulation.
[0183] The above method determines the scaling parameters based on a preset time function, and performs two linear interpolation processes based on the scaling parameters and the initial ice reflection noise to obtain the target ice reflection noise. This includes: inputting the frame rendering time into a preset time function to obtain the function period; determining the function period as a second scaling parameter, and performing linear interpolation based on the second scaling parameter and a preset reflection vector contribution parameter to obtain a first interpolation result; performing linear interpolation based on the first interpolation result, a preset third interpolation parameter, and a preset fourth interpolation parameter to obtain a second interpolation result; and multiplying the second interpolation result with the initial ice reflection noise to obtain the target ice reflection noise. This method achieves a visual perturbation effect on the ice surface by periodically adjusting the initial ice reflection noise using a periodic function.
[0184] The above method transforms the tangent space reflection vector from tangent space to world space, obtaining the world space reflection vector. Then, it performs linear interpolation on the world space reflection vector based on the camera's line-of-sight vector to obtain the target interpolation result. This includes: multiplying the tangent space reflection vector in tangent space with the target matrix to obtain the world space reflection vector; and performing linear interpolation based on the camera's line-of-sight vector and the world space reflection vector to obtain the target interpolation result. This method transforms the tangent space reflection vector from tangent space to world space, unifying the coordinate systems of the reflection vector and the camera's line-of-sight vector, thereby enabling the interpolation operation.
[0185] The above-described process of performing bump offset processing on a pre-set ice body internal texture map to obtain a parallax map includes: acquiring a pre-set height map and determining the first channel value of the height map as the height parameter of the bump offset node; determining the bump offset value of the bump offset node based on the height parameter, a pre-set height ratio, and the UV coordinates of the base color map; and adjusting the UV coordinates of the pre-set ice body internal texture map, ice body normal map, and / or height map based on the bump offset value to generate a parallax map of the ice body material. This method clarifies the specific adjustment method of bump offset processing, realizes the simulation of the internal structure of the ice body material, and improves the realism of the simulation effect.
[0186] The above-mentioned adjustment of the UV coordinates of the preset ice body internal texture map, ice body normal map, and / or height map based on the bump offset value to generate the disparity map of the ice body material includes: inputting the bump offset value into the UV coordinates of the preset ice body internal texture map, ice body normal map, and / or height map; determining the first channel value of the height map as the background color parameter of the ice body material node; or, determining the first channel value of the ice body internal texture map as the roughness parameter of the ice body material node; determining the second channel value of the ice body internal texture map as the ambient occlusion parameter of the ice body material node; or, determining the first channel value of the ice body normal map as the normal parameter of the ice body material node; and generating the disparity map of the ice body material based on the background color parameter, roughness parameter, ambient occlusion parameter, and / or normal parameter. This method clarifies the specific generation process of the parallax map, adjusts at least one parameter of the ice material, improves the simulation effect of the ice material's interior, enhances editability and application range, and enables the simulation of ice bodies in different environments.
[0187] The above-mentioned method involves determining a first transition region and a second transition region in the ice model to be processed, and generating an ice self-illuminating texture based on the first and second transition regions. This includes: dividing the ice model into a first transition region and a second transition region; generating a first self-illuminating texture based on the first transition region; generating a second self-illuminating texture based on the second transition region; and superimposing the first and second self-illuminating textures to generate the ice self-illuminating texture. This method clarifies the generation process of the ice self-illuminating texture, simulates the light transmission effect of the ice material through the Fresnel effect, thereby reflecting the transparency of different parts of the ice and avoiding the high overhead caused by the SDF algorithm.
[0188] The above-mentioned method for generating a first self-illuminating map based on a first transition region includes: obtaining the initial color values of a base color map; calculating the first transition region based on the camera's gaze vector to generate a first transmissive map; and performing interpolation processing based on the first transmissive map, the initial color values, and a preset color threshold to obtain the first self-illuminating map. This method clarifies the generation process of the first self-illuminating map and enhances the light transmission effect of the first transition region in the ice model.
[0189] The above-mentioned method for generating a second self-illuminating map based on the second transition region includes: obtaining the initial color values of the base color map; calculating the second transition region based on the camera's gaze vector to generate a second transmissive map; and performing interpolation processing based on the second transmissive map, the initial color values, and a preset color threshold to obtain the second self-illuminating map. This method clarifies the generation process of the second self-illuminating map and enhances the light transmission effect of the second transition region in the ice model.
[0190] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the steps of the rendering method for the ice material. The steps specifically include:
[0191] The process acquires the ice model to be processed and multiple pre-set textures, including a base color map, an ice normal map, and an ice surface texture map. Anisotropic processing is performed on the ice normal map and the ice surface texture map to obtain an anisotropic map. A first ice material map corresponding to the ice model is generated based on the base color map and the anisotropic map. The anisotropic map is used to represent the different specular highlights of the ice body under different viewing angles, simulating the distortion and perturbation effect of light by the ice body on mobile devices, thus improving the anisotropic representation of the ice material on mobile devices.
[0192] The method also includes: performing bump offset processing on a pre-set internal texture map of the ice body to obtain a parallax map; and superimposing the parallax map and the first ice body material map to generate a second ice body material map corresponding to the ice body model. This method uses a parallax map to represent the depth effect inside the ice body, enhancing the transparency of the ice body's internal structure and color.
[0193] The method further includes: determining a first transition region and a second transition region in the ice model to be processed, and generating an ice self-illumination map based on the first and second transition regions; and superimposing the ice self-illumination map and the first ice material map to generate a third ice material map corresponding to the ice model. This method uses the ice self-illumination map to represent the translucency of the ice.
[0194] The method further includes: performing bump offset processing on a pre-set internal texture map of the ice body to obtain a parallax map; determining a first transition region and a second transition region in the ice body model to be processed, and generating an ice body self-illumination map based on the first and second transition regions; and superimposing the parallax map, the ice body self-illumination map, and the first ice body material map to generate a fourth ice body material map corresponding to the ice body model. This method uses anisotropic mapping to represent the different specular highlights of the ice body from different viewing angles, simulating the distortion and disturbance effect of light by the ice body on mobile devices, thus improving the anisotropic representation of the ice body material on mobile devices; it uses parallax mapping to represent the depth effect inside the ice body, enhancing the transparency of the ice body's internal structure and color; and it uses the ice body self-illumination map to represent the translucency of the ice body, better simulating the realistic physical transmission effect of the ice body on mobile devices and reducing the performance overhead required to simulate the ice body.
[0195] The above-mentioned anisotropic processing based on the ice body normal map and ice body surface texture map to obtain an anisotropic map includes: determining the initial ice body reflection noise based on the ice body normal map; determining the scale parameter based on a preset time function, and performing two interpolation processes based on the scale parameter and the initial ice body reflection noise to obtain the target ice body reflection noise; superimposing the target ice body reflection noise with the initial reflection vector to obtain the tangent space reflection vector, where the initial reflection vector is the reflection vector of the camera view vector relative to the ice body model normal; transforming the tangent space reflection vector from tangent space to world space to obtain the world space reflection vector, and performing linear interpolation processing on the world space reflection vector based on the camera view vector to obtain the target interpolation result; sampling the ice body surface texture map based on the target interpolation result to obtain the anisotropic map. This method, by transforming the tangent space reflection vector to world space through the normal map, and then combining it with the camera view vector for linear interpolation and sampling, achieves different specular highlights on the ice body under different viewpoints.
[0196] The above-mentioned method for determining the initial ice reflection noise based on the ice normal map includes: normalizing the normals in the ice normal map to obtain a first interpolation parameter; sampling the ice normal map to obtain a second interpolation parameter; and performing linear interpolation based on the first interpolation parameter, the second interpolation parameter, and a preset first scaling parameter to obtain the initial ice reflection noise. This method refines the process of determining the initial ice reflection noise, enhances the strength of the anisotropic parameters, and improves the realism of the simulation.
[0197] The above method determines the scaling parameters based on a preset time function, and performs two linear interpolation processes based on the scaling parameters and the initial ice reflection noise to obtain the target ice reflection noise. This includes: inputting the frame rendering time into a preset time function to obtain the function period; determining the function period as a second scaling parameter, and performing linear interpolation based on the second scaling parameter and a preset reflection vector contribution parameter to obtain a first interpolation result; performing linear interpolation based on the first interpolation result, a preset third interpolation parameter, and a preset fourth interpolation parameter to obtain a second interpolation result; and multiplying the second interpolation result with the initial ice reflection noise to obtain the target ice reflection noise. This method achieves a visual perturbation effect on the ice surface by periodically adjusting the initial ice reflection noise using a periodic function.
[0198] The above method transforms the tangent space reflection vector from tangent space to world space, obtaining the world space reflection vector. Then, it performs linear interpolation on the world space reflection vector based on the camera's line-of-sight vector to obtain the target interpolation result. This includes: multiplying the tangent space reflection vector in tangent space with the target matrix to obtain the world space reflection vector; and performing linear interpolation based on the camera's line-of-sight vector and the world space reflection vector to obtain the target interpolation result. This method transforms the tangent space reflection vector from tangent space to world space, unifying the coordinate systems of the reflection vector and the camera's line-of-sight vector, thereby enabling the interpolation operation.
[0199] The above-described process of performing bump offset processing on a pre-set ice body internal texture map to obtain a parallax map includes: acquiring a pre-set height map and determining the first channel value of the height map as the height parameter of the bump offset node; determining the bump offset value of the bump offset node based on the height parameter, a pre-set height ratio, and the UV coordinates of the base color map; and adjusting the UV coordinates of the pre-set ice body internal texture map, ice body normal map, and / or height map based on the bump offset value to generate a parallax map of the ice body material. This method clarifies the specific adjustment method of bump offset processing, realizes the simulation of the internal structure of the ice body material, and improves the realism of the simulation effect.
[0200] The above-mentioned adjustment of the UV coordinates of the preset ice body internal texture map, ice body normal map, and / or height map based on the bump offset value to generate the disparity map of the ice body material includes: inputting the bump offset value into the UV coordinates of the preset ice body internal texture map, ice body normal map, and / or height map; determining the first channel value of the height map as the background color parameter of the ice body material node; or, determining the first channel value of the ice body internal texture map as the roughness parameter of the ice body material node; determining the second channel value of the ice body internal texture map as the ambient occlusion parameter of the ice body material node; or, determining the first channel value of the ice body normal map as the normal parameter of the ice body material node; and generating the disparity map of the ice body material based on the background color parameter, roughness parameter, ambient occlusion parameter, and / or normal parameter. This method clarifies the specific generation process of the parallax map, adjusts at least one parameter of the ice material, improves the simulation effect of the ice material's interior, enhances editability and application range, and enables the simulation of ice bodies in different environments.
[0201] The above-mentioned method involves determining a first transition region and a second transition region in the ice model to be processed, and generating an ice self-illuminating texture based on the first and second transition regions. This includes: dividing the ice model into a first transition region and a second transition region; generating a first self-illuminating texture based on the first transition region; generating a second self-illuminating texture based on the second transition region; and superimposing the first and second self-illuminating textures to generate the ice self-illuminating texture. This method clarifies the generation process of the ice self-illuminating texture, simulates the light transmission effect of the ice material through the Fresnel effect, thereby reflecting the transparency of different parts of the ice and avoiding the high overhead caused by the SDF algorithm.
[0202] The above-mentioned method for generating a first self-illuminating map based on a first transition region includes: obtaining the initial color values of a base color map; calculating the first transition region based on the camera's gaze vector to generate a first transmissive map; and performing interpolation processing based on the first transmissive map, the initial color values, and a preset color threshold to obtain the first self-illuminating map. This method clarifies the generation process of the first self-illuminating map and enhances the light transmission effect of the first transition region in the ice model.
[0203] The above-mentioned method for generating a second self-illuminating map based on the second transition region includes: obtaining the initial color values of the base color map; calculating the second transition region based on the camera's gaze vector to generate a second transmissive map; and performing interpolation processing based on the second transmissive map, the initial color values, and a preset color threshold to obtain the second self-illuminating map. This method clarifies the generation process of the second self-illuminating map and enhances the light transmission effect of the second transition region in the ice model.
[0204] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0205] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.
[0206] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0207] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0208] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for rendering ice material, characterized in that, include: Obtain the ice model to be processed and multiple preset textures, including a base color texture, an ice normal map, and an ice surface texture map; Anisotropic processing is performed on the ice body normal map and the ice body surface texture map to obtain an anisotropic map; Generate the first ice body material texture map corresponding to the ice body model based on the base color map and the anisotropic map; The step of performing anisotropic processing based on the ice body normal map and the ice body surface texture map to obtain an anisotropic map includes: The initial ice reflection noise is determined based on the ice body normal map. The scaling parameter is determined according to a preset time function, and the target ice body reflection noise is obtained by two interpolation processes based on the scaling parameter and the initial ice body reflection noise. The first interpolation process obtains a first interpolation result based on the scaling parameter, and the second interpolation process obtains a second interpolation result based on the first interpolation result. The target ice body reflection noise is determined based on the initial ice body reflection noise and the second interpolation result. The target ice body reflection noise is superimposed with the initial reflection vector to obtain the tangent space reflection vector, where the initial reflection vector is the reflection vector of the camera line of sight relative to the ice body model normal. The tangent space reflection vector is transformed from tangent space to world space to obtain the world space reflection vector. Then, linear interpolation is performed on the world space reflection vector based on the camera line-of-sight vector to obtain the target interpolation result. Based on the target interpolation result, the surface texture map of the ice body is sampled to obtain an anisotropic map.
2. The rendering method for ice material according to claim 1, characterized in that, Also includes: A parallax map is obtained by performing bump offset processing on the preset internal texture map of the ice body; The parallax map and the first ice body material map are superimposed to generate the second ice body material map corresponding to the ice body model.
3. The rendering method for ice material according to claim 1, characterized in that, Also includes: In the ice model to be processed, a first transition region and a second transition region are determined, and an ice self-illuminating texture is generated based on the first transition region and the second transition region. The self-illuminating ice texture and the first ice material texture are superimposed to generate the third ice material texture corresponding to the ice model.
4. The rendering method for ice material according to claim 1, characterized in that, Also includes: A parallax map is obtained by performing bump offset processing on the preset internal texture map of the ice body; In the ice model to be processed, a first transition region and a second transition region are determined, and an ice self-illuminating texture is generated based on the first transition region and the second transition region. The parallax map, the ice body self-illumination map, and the first ice body material map are superimposed to generate the fourth ice body material map corresponding to the ice body model.
5. The rendering method for ice material according to claim 1, characterized in that, The step of determining the initial ice reflection noise based on the ice normal map includes: The normals in the ice body normal map are normalized to obtain the first interpolation parameter; The ice body normal map is sampled to obtain the second interpolation parameters; Linear interpolation is performed based on the first interpolation parameter, the second interpolation parameter, and the preset first scaling parameter to obtain the initial ice body reflection noise.
6. The rendering method for ice material according to claim 1, characterized in that, The step of determining the scaling parameter according to a preset time function, and performing two linear interpolation processes based on the scaling parameter and the initial ice reflection noise to obtain the target ice reflection noise includes: The frame rendering time is passed to a preset time function, the output value of the time function is determined as the second scaling parameter, and linear interpolation is performed based on the second scaling parameter and the preset reflection vector contribution parameter to obtain the first interpolation result. Linear interpolation is performed based on the first interpolation result, the preset third interpolation parameter, and the preset fourth interpolation parameter to obtain the second interpolation result; The second interpolation result is multiplied by the initial ice body reflection noise to obtain the target ice body reflection noise.
7. The rendering method for ice material according to claim 1, characterized in that, The process of transforming the tangent space reflection vector from tangent space to world space to obtain a world space reflection vector, and then performing linear interpolation on the world space reflection vector based on the camera's line-of-sight vector to obtain the target interpolation result, includes: Multiply the tangent space reflection vector in the tangent space with the target matrix to obtain the world space reflection vector in the world space; Linear interpolation is performed based on the camera line-of-sight vector and the world space reflection vector to obtain the target interpolation result.
8. The rendering method for ice material according to claim 2 or 4, characterized in that, The process of performing bump offset processing on the pre-set internal texture map of the ice body to obtain a parallax map includes: Obtain a preset height map, and determine the first channel value of the height map as the height parameter of the bump offset node; The bump offset value of the bump offset node is determined based on the height parameter, the preset height ratio, and the UV coordinates of the base color map. Adjust the UV coordinates of the preset ice body internal texture map, the ice body normal map, and / or the height map according to the bump offset value to generate a parallax map of the ice body material.
9. The rendering method for ice material according to claim 8, characterized in that, The step of adjusting the UV coordinates of the preset ice body internal texture map, the ice body normal map, and / or the height map according to the bump offset value to generate a parallax map of the ice body material includes: The bump offset value is input into the UV coordinates of the preset ice body interior texture map, the UV coordinates of the ice body normal map, and / or the UV coordinates of the height map; The first channel value of the height map is determined as the background color parameter of the ice material node; or, The first channel value of the texture map inside the ice body is determined as the roughness parameter of the ice body material node; The second channel value of the texture map inside the ice body is determined as the ambient occlusion parameter of the ice body material node; or, The first channel value of the ice body normal map is determined as the normal parameter of the ice body material node; A parallax map of the ice body material is generated based on the background color parameter, the roughness parameter, the ambient occlusion parameter, and / or the normal parameter.
10. The rendering method for ice material according to claim 3 or 4, characterized in that, The step of determining a first transition region and a second transition region in the ice model to be processed, and generating an ice self-illumination texture based on the first transition region and the second transition region, includes: Divide the ice body model to be processed into a first transition region and a second transition region; A first self-illuminating texture is generated based on the first transition region; A second self-illuminating texture is generated based on the second transition region; The first self-illuminating map and the second self-illuminating map are superimposed to generate an ice body self-illuminating map.
11. The rendering method for ice material according to claim 10, characterized in that, The step of generating a first self-illuminating map based on the first transition region includes: Obtain the initial color values of the base color map; The first transition region is calculated based on the camera's line-of-sight vector to generate a first transmission map; The first self-illuminating map is obtained by interpolation based on the first transmissive map, the initial color value, and the preset color threshold.
12. The rendering method for ice material according to claim 10, characterized in that, The step of generating a second self-illuminating map based on the second transition region includes: Obtain the initial color values of the base color map; The second transition region is calculated based on the camera's line-of-sight vector to generate a second transmission map; The second self-illuminating map is obtained by interpolation based on the second transmissive map, the initial color value, and the preset color threshold.
13. A rendering device for ice material, characterized in that, include: The acquisition module is used to acquire the ice model to be processed and multiple preset textures, including a base color texture, an ice normal map, and an ice surface texture map. An anisotropic processing module is used to perform anisotropic processing based on the ice body normal map and the ice body surface texture map to obtain an anisotropic map; The first generation module is used to generate a first ice body material texture map corresponding to the ice body model based on the base color texture map and the anisotropic texture map. The anisotropy processing module includes: The first determining unit is used to determine the initial ice body reflection noise based on the ice body normal map; An interpolation unit is defined to determine a scaling parameter based on a preset time function, and to perform two interpolation processes based on the scaling parameter and the initial ice reflection noise to obtain the target ice reflection noise; wherein, the first interpolation process obtains a first interpolation result based on the scaling parameter, the second interpolation process obtains a second interpolation result based on the first interpolation result, and the target ice reflection noise is determined based on the initial ice reflection noise and the second interpolation result; The superposition unit is used to superimpose the target ice body reflection noise with the initial reflection vector to obtain the tangent space reflection vector, wherein the initial reflection vector is the reflection vector of the camera line-of-sight vector relative to the ice body model normal. The transformation interpolation unit is used to transform the tangent space reflection vector from tangent space to world space to obtain the world space reflection vector, and to perform linear interpolation on the world space reflection vector according to the camera line-of-sight vector to obtain the target interpolation result. The sampling unit is used to sample the surface texture map of the ice body according to the target interpolation result to obtain an anisotropic map.
14. An electronic device, characterized in that, The electronic device includes: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor invokes the instructions in the memory to cause the electronic device to execute the rendering method for ice material as described in any one of claims 1-12.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed by a processor, implement the rendering method for ice material as described in any one of claims 1-12.
Citation Information
Patent Citations
Cartoon hair rendering method based on UE4 platform, and storage medium
CN109035381A
Ice block model rendering method and device
CN114299212A
Rendering method and device of freezing effect model and electronic equipment
CN114998502A