Image rendering method and device, storage medium and computer device

By monitoring target object models within the range of a virtual camera and calculating UV movement data of the transparency and material layers for rendering, the problem of complexity and resource waste in creating fantasy landscapes in virtual games is solved, thereby enhancing the richness and spatial sense of the game visuals.

CN117710559BActive Publication Date: 2026-05-01BEIJING PERFECT WORLD SOFTWARE TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING PERFECT WORLD SOFTWARE TECH DEV CO LTD
Filing Date
2022-11-30
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing technologies require the creation of complex 3D models when producing fantasy landscapes in virtual games, resulting in a large workload, waste of resources, high consumption of game performance, and difficulty in integrating fantasy effects into the scene.

Method used

By monitoring whether the target object model is included in the shooting range of the virtual camera, calculating the UV movement data of the transparency layer and material layer, and rendering it, a multi-layer texture effect that changes with the camera position is displayed, avoiding the creation of complex 3D models.

Benefits of technology

It enables the display of multi-layered texture changes in virtual games without the need for complex 3D models, enhancing the richness and spatial sense of the game visuals while reducing production costs and resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117710559B_ABST
    Figure CN117710559B_ABST
Patent Text Reader

Abstract

The application discloses an image rendering method and device, a storage medium and a computer device. The method comprises the following steps: monitoring whether a target object model is included in a shooting range of a virtual camera, wherein the target object model comprises a transparent layer and a material layer; when the target object model is included in the shooting range of the virtual camera, performing fusion calculation on preset reflection data corresponding to the transparent layer and a world coordinate position of the virtual camera to obtain transparent layer UV movement data; calculating material layer UV movement data based on the transparent layer UV movement data and a preset transformation coefficient; performing transparent layer rendering according to the transparent layer UV movement data, and performing material layer rendering based on the material layer UV movement data. According to the application, the complex three-dimensional model does not need to be made, and different texture change effects of a map can be exhibited according to different lens position of a virtual camera, and the scene implementation space depth is no longer limited to the original design space depth.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to an image rendering method and apparatus, storage medium, and computer equipment. Background Technology

[0002] Virtual game worlds often feature fantastical landscapes, such as transparent magic spheres with objects placed in the center, frozen objects, and views seen through black holes or portals. Traditional methods of creating 3D spaces require building complex models, resulting in significant workload and resource waste. This also severely limits concept art design, restricting it to existing game materials and available space, making it impossible to integrate more fantastical and abstract effects. For example, a transparent magic sphere requires creating a model and adding meshes within it to achieve the desired spatial scene. This is performance-intensive, costly to produce, and the achievable space is limited by the available space within the game scene. Therefore, how to reduce costs and increase efficiency for these types of landscapes is a worthwhile area for discussion. Summary of the Invention

[0003] In view of this, this application provides an image rendering method and apparatus, a storage medium, and a computer device.

[0004] According to one aspect of this application, an image rendering method is provided, the method comprising:

[0005] The system monitors whether a target object model is included within the shooting range of a virtual camera, wherein the target object model includes a transparency layer and a material layer.

[0006] When the target object model is included in the shooting range of the virtual camera, the preset reflection data corresponding to the transparent layer and the world coordinate position of the virtual camera are fused and calculated to obtain the UV movement data of the transparent layer.

[0007] Based on the UV movement data of the transparent layer and the preset transformation coefficient, the UV movement data of the material layer is calculated;

[0008] Transparent layer rendering is performed based on the UV movement data of the transparent layer, and material layer rendering is performed based on the UV movement data of the material layer.

[0009] Optionally, rendering the transparency layer based on the UV movement data of the transparency layer includes:

[0010] The normal map of the transparent layer is sampled to obtain the normal sampling results, and the color data and self-illumination data of the transparent layer are calculated based on the preset base color map.

[0011] Based on the normal sampling results, the transparent layer color data, and the transparent layer self-emission data, calculate the transparent layer rendering data;

[0012] The transparent layer is rendered based on the transparent layer rendering data and the transparent layer UV movement data.

[0013] Optionally, before fusing the preset reflection data corresponding to the transparent layer and the world coordinate position of the virtual camera, the method further includes:

[0014] Obtain the preset reflection adjustment value of the target object model, wherein the preset reflection adjustment value is obtained by simulating the lighting effect of ambient light shining on a preset material, and the preset material is selected based on the expected simulation effect of the transparent layer;

[0015] The normal coordinates of the transparent layer normal map are converted to world coordinates, and the normal coordinate values ​​of the transparent layer normal map in world coordinates are added to the preset reflection adjustment value to obtain the preset reflection data corresponding to the transparent layer.

[0016] Optionally, the material layer rendering based on the material layer UV movement data includes:

[0017] Obtain the texture map of the material layer, and calculate the UV coordinate offset of the texture map of the material layer based on the preset height map corresponding to the material layer;

[0018] Based on the preset height map, the UV coordinates of the material layer texture map after offset are processed by UV scaling to obtain material layer rendering data;

[0019] Material layer rendering is performed based on the material layer rendering data and the material layer UV movement data.

[0020] Optionally, when there are multiple material layers, the preset height maps corresponding to different material layers are different.

[0021] Optionally, the material layer rendering based on the material layer rendering data and the material layer UV movement data includes:

[0022] Based on the preset color map corresponding to the material layer, obtain the material layer color data;

[0023] The material layer is rendered based on the material layer rendering data, the material layer color data, and the material layer UV movement data.

[0024] Optionally, the preset transformation coefficient includes preset attenuation coefficients that correspond one-to-one with multiple material layers, wherein the preset attenuation coefficient corresponding to the upper material layer is smaller than the preset attenuation coefficient corresponding to the lower material layer;

[0025] The calculation of material layer UV movement data based on the transparent layer UV movement data and preset transformation coefficients includes:

[0026] Based on the UV movement data of the transparent layer and the preset attenuation coefficient of each material layer, the UV movement data of each material layer is calculated respectively.

[0027] According to another aspect of this application, an image rendering apparatus is provided, the apparatus comprising:

[0028] A monitoring module is used to monitor whether a target object model is included within the shooting range of a virtual camera, wherein the target object model includes a transparency layer and a material layer;

[0029] The calculation module is used to fuse the preset reflection data corresponding to the transparent layer and the world coordinate position of the virtual camera when the target object model is included in the shooting range of the virtual camera, to obtain the UV movement data of the transparent layer; and to calculate the UV movement data of the material layer based on the UV movement data of the transparent layer and the preset transformation coefficient.

[0030] The rendering module is used to render the transparent layer based on the UV movement data of the transparent layer, and to render the material layer based on the UV movement data of the material layer.

[0031] Optionally, the rendering module is further configured to:

[0032] The normal map of the transparent layer is sampled to obtain the normal sampling results, and the color data and self-illumination data of the transparent layer are calculated based on the preset base color map.

[0033] Based on the normal sampling results, the transparent layer color data, and the transparent layer self-emission data, calculate the transparent layer rendering data;

[0034] The transparent layer is rendered based on the transparent layer rendering data and the transparent layer UV movement data.

[0035] Optionally, the computing module is further configured to:

[0036] Obtain the preset reflection adjustment value of the target object model, wherein the preset reflection adjustment value is obtained by simulating the lighting effect of ambient light shining on a preset material, and the preset material is selected based on the expected simulation effect of the transparent layer;

[0037] The normal coordinates of the transparent layer normal map are converted to world coordinates, and the normal coordinate values ​​of the transparent layer normal map in world coordinates are added to the preset reflection adjustment value to obtain the preset reflection data corresponding to the transparent layer.

[0038] Optionally, the rendering module is further configured to:

[0039] Obtain the texture map of the material layer, and calculate the UV coordinate offset of the texture map of the material layer based on the preset height map corresponding to the material layer;

[0040] Based on the preset height map, the UV coordinates of the material layer texture map after offset are processed by UV scaling to obtain material layer rendering data;

[0041] Material layer rendering is performed based on the material layer rendering data and the material layer UV movement data.

[0042] Optionally, when there are multiple material layers, the preset height maps corresponding to different material layers are different.

[0043] Optionally, the rendering module is further configured to:

[0044] Based on the preset color map corresponding to the material layer, obtain the material layer color data;

[0045] The material layer is rendered based on the material layer rendering data, the material layer color data, and the material layer UV movement data.

[0046] Optionally, the preset transformation coefficient includes preset attenuation coefficients that correspond one-to-one with multiple material layers, wherein the preset attenuation coefficient corresponding to the upper material layer is smaller than the preset attenuation coefficient corresponding to the lower material layer;

[0047] The calculation module is also used to: calculate the UV movement data of each material layer based on the UV movement data of the transparent layer and the preset attenuation coefficient of each material layer.

[0048] According to another aspect of this application, a storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the above-described image rendering method.

[0049] According to another aspect of this application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor executes the program to implement the above-described image rendering method.

[0050] By employing the above technical solutions, this application provides an image rendering method, apparatus, storage medium, and computer device. For a target object model requiring special effects, when the target object model needs to be displayed, the preset reflection data corresponding to the transparent layer is fused with the virtual camera position to obtain the UV movement data of the transparent layer. Then, the UV movement data of the transparent layer is multiplied by a preset transformation coefficient to obtain the UV movement data of the material layer. Finally, the UV movement data of the transparent layer and the material layer are used to render the transparent layer and the material layer respectively, to display the final effect of the target object model. This application embodiment does not require the creation of complex 3D models; it only requires pre-creating transparent and material layers for the target object model to display special effects. By calculating the UV movement data of different layers, it can display multi-layered texture changes that vary with the virtual camera's movement position. The spatial depth of the scene is no longer limited by the original design's spatial depth. Through multi-layer design, special scenes can be integrated into the game scene, and the design of different layers corresponding to different UV movement data makes the scene more spatial, helping to enhance the richness of the game screen.

[0051] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0052] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0053] Figure 1 A flowchart illustrating an image rendering method provided in an embodiment of this application is shown;

[0054] Figure 2 A flowchart illustrating another image rendering method provided in an embodiment of this application is shown;

[0055] Figure 3 This paper shows a schematic diagram of the structure of an image rendering apparatus provided in an embodiment of the present application;

[0056] Figure 4 A schematic diagram of the device structure of a computer device provided in an embodiment of this application is shown. Detailed Implementation

[0057] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.

[0058] This embodiment provides an image rendering method, such as Figure 1 As shown, the method includes:

[0059] Step 101: Monitor whether the target object model is included in the shooting range of the virtual camera, wherein the target object model includes a transparency layer and a material layer.

[0060] In this embodiment, for a target object model requiring special landscape creation, such as a rainbow bridge within a sect in a game world, the goal is to create a fantastical feeling by allowing special views (like a starry sky) to be seen from the rainbow bridge, complementing the grand and ethereal atmosphere of the sect. Two types of textures can be created for the target object model: a transparent layer texture and a material layer texture. The number of material layer textures is unlimited, and there can be one or more. Figure 1 Generally, a single texture layer is used, placed on top of all textures. If multiple texture layers are used, their order needs to be distinguished. Thus, when the scene visible within the Rainbow Bridge needs to be displayed, the scene is rendered based on these two types of textures, creating a spatial effect. This avoids creating complex 3D models of the Rainbow Bridge, reducing the workload of game development, and freeing the scene from the space reserved in the game's original artwork design. This technical solution can be applied to game clients, monitoring in real-time whether the target object model is included within the shooting range of the game's virtual camera during gameplay. When the virtual camera detects that the target object model is captured, the transparency layer texture and the texture layer texture are used to render the target object, thus showcasing its visual effect.

[0061] Step 102: When the target object model is included in the shooting range of the virtual camera, the preset reflection data corresponding to the transparent layer and the world coordinate position of the virtual camera are fused and calculated to obtain the UV movement data of the transparent layer.

[0062] When the virtual camera captures the target object model, the UV movement data of the transparency layer is calculated first, followed by the UV movement data of the material layer. In this embodiment, neither the transparency layer nor the material layer is connected to the normal calculation, so no realistic reflection effect is produced when the virtual camera rotates. To represent the effect of the landscape changing with the virtual camera's movement, this application pre-sets preset reflection data in world coordinates for the transparency layer texture. When calculating the UV texture of the transparency layer, the preset reflection data is fused with the virtual camera's position in world coordinates. Specifically, the LERP fusion algorithm can be used to obtain the UV movement data of the transparency layer, causing the transparency layer texture to change with the virtual camera's position.

[0063] Step 103: Calculate the UV movement data of the material layer based on the UV movement data of the transparent layer and the preset transformation coefficient.

[0064] After obtaining the UV movement data of the transparent layer, the UV movement data of the material layer is further calculated. In specific application scenarios, in order to make the changes of different layers of the target object model coherent but not completely consistent, a preset transformation coefficient can be set for the material layer. The UV movement data of the transparent layer is then multiplied by the preset transformation coefficient to obtain the UV movement data of the material layer, so that the texture changes of different layers in the same model are similar but not the same, taking into account both rationality and richness.

[0065] Step 104: Render the transparent layer based on the UV movement data of the transparent layer, and render the material layer based on the UV movement data of the material layer.

[0066] Finally, as the virtual camera moves, based on the calculated UV movement data of the transparency layer and the UV movement data of the material layer, the transparency layer and the material layer are rendered separately by combining the transparency layer texture and the material layer texture. The rendering results of different layers are superimposed together for display, showing the special scene on the target object model.

[0067] By applying the technical solution of this embodiment to target object models that need to display special effects, when the target object model needs to be displayed, the preset reflection data corresponding to the transparent layer is fused with the virtual camera position to obtain the UV movement data of the transparent layer. Then, the UV movement data of the transparent layer is multiplied by the preset transformation coefficient to obtain the UV movement data of the material layer. Finally, the UV movement data of the transparent layer and the material layer are used to render the transparent layer and the material layer respectively to display the final effect of the target object model. This embodiment of the application does not require the creation of complex 3D models. It only requires the pre-creation of transparent layers and material layers for the target object model that needs to display special effects. By calculating the UV movement data of different layers, the multi-layer texture change effect that varies with the position of the virtual camera can be displayed. The spatial depth of the scene is no longer limited by the spatial depth of the original artwork design. Through multi-layer design, special scenes can be integrated into the game scene, and the design of different layers corresponding to different UV movement data makes the scene more spatial and helps to improve the richness of the game screen.

[0068] In this embodiment of the application, optionally, in step 104, transparent layer rendering data can be obtained from the transparent layer texture, and transparent layer rendering is performed by combining the transparent layer rendering data and transparent layer UV movement data. The transparent layer texture is a normal map with a self-illuminating effect, created as follows: a normal map is sampled as an initial transparent layer texture, and a base color and self-illuminating color are set on the initial transparent layer texture to obtain an intermediate transparent layer texture; the reflective surface effect data of the initial transparent layer texture under lighting conditions is extracted; and the self-illuminating effect data of the intermediate transparent layer texture is set according to the reflective surface effect data to obtain the transparent layer texture.

[0069] In this embodiment, the first layer of the target object model is transparent. First, a normal map is sampled as the initial transparent layer map to calculate the surface bump effect. Since there is no base color map, in order to ensure that the bump effect can still be seen in low light conditions at night, the effect of the transparent layer needs to be connected to the base color node of the material. Then, the reflection effect of the initial transparent layer map under the lighting conditions is extracted, and the reflection effect is input into the emissive color node. The effect of the transparent layer is then connected to the emissive color node to calculate the emissive effect, so that the target object model can also exhibit a good reflective mirror effect in low light conditions.

[0070] In this embodiment of the application, optionally, in step 104, material layer rendering data is obtained from the material layer texture map, and material layer rendering is performed by combining the material layer rendering data and material layer UV movement data. The material layer texture map is created as follows: an initial material layer texture map is obtained; UV depth offset calculation is performed on the initial material layer texture map based on a preset height grayscale image to obtain an intermediate material layer texture map; UV scaling processing is performed on the intermediate material layer texture map to obtain the final material layer texture map. In another embodiment, the initial material layer texture map can be subjected to multiple UV depth offsets based on the preset height grayscale image until the number of UV depth offset calculations reaches the preset number corresponding to the material layer texture map. Where the material layer texture map comprises multiple maps, the preset number corresponding to the upper material layer texture map is less than or equal to the preset number corresponding to the lower material layer texture map.

[0071] In this embodiment, the creation of the material layer effect determines the material's depth and normal texture. First, based on preset height data (represented by a preset height grayscale image, where height data is represented by values ​​from 0 to 1 in the grayscale image), the parallax node Bump Offest is used to calculate the UV offset of the initial material layer texture, resulting in an intermediate material layer texture with the calculated UV depth offset. Then, the intermediate material layer texture is UV scaled to create the desired sense of space, resulting in the final material layer texture. In another embodiment, the preset height grayscale image can be used again to calculate the UV depth offset of the scaled intermediate material layer texture, and this process is repeated until the number of bump map offset calculations reaches a preset number, resulting in the final material layer texture. Furthermore, multiple material layer textures can be included. When creating different material layer textures, the material layer texture further away from the transparent layer corresponds to a deeper spatial UV, requiring more repeated calculations.

[0072] Furthermore, as a refinement and extension of the specific implementation of the above embodiments, and to fully illustrate the specific implementation process of this embodiment, another image rendering method is provided, such as... Figure 2 As shown, the method includes:

[0073] Step 201: Monitor whether the target object model is included in the shooting range of the virtual camera, wherein the target object model includes a transparency layer and a material layer.

[0074] Step 202: When the target object model is included in the shooting range of the virtual camera, a preset reflection adjustment value of the target object model is obtained. The preset reflection adjustment value is obtained by simulating the lighting effect of ambient light shining on a preset material. The preset material is selected based on the expected simulation effect of the transparent layer.

[0075] Step 203: Convert the normal coordinates of the transparent layer normal map to world coordinates, and add the normal coordinate values ​​of the transparent layer normal map in world coordinates to the preset reflection adjustment value to obtain the preset reflection data corresponding to the transparent layer.

[0076] Step 204: The preset reflection data corresponding to the transparent layer and the world coordinate position of the virtual camera are fused and calculated to obtain the UV movement data of the transparent layer.

[0077] In this embodiment, the transparent layer is not connected to the normal calculation, so it will not produce a realistic reflection effect when the camera is rotated. When calculating the UV movement data of the transparent layer, the coordinates of the normal map connected to the Base Color are converted into engine world coordinates. Then, a fake reflection coordinate value (i.e., a preset reflection adjustment value, which is obtained by simulating the texture effect produced when the environment shines on transparent glass and metal) and the world position coordinates of the virtual camera are fused together. Finally, the fused value is normalized and input into the UV movement coordinates of the original Base Color map. As the camera moves on the protagonist and the position changes under engine operation, the fused value changes, and the fake reflection effect fused on the Base Color map also changes and moves accordingly. In this way, the effect of the first transparent layer is calculated to ensure that the material has depth and has the reflection properties in the PBR material.

[0078] Step 205: Based on the UV movement data of the transparent layer and the preset attenuation coefficient of each material layer, calculate the UV movement data of each material layer. The preset transformation coefficient includes a preset attenuation coefficient that corresponds one-to-one with multiple material layers. The preset attenuation coefficient corresponding to the upper material layer is less than the preset attenuation coefficient corresponding to the lower material layer.

[0079] In this embodiment, the target object model comprises multiple material layers. To represent similar but distinct texture changes across different layers, a gradually decreasing preset attenuation coefficient is set for each material layer, based on the physical property that objects farther away appear to move more slowly in the visual field at the same speed. For example, the attenuation coefficient for the first material layer is 0.9, the attenuation coefficient for the second material layer is 0.8, and so on. After calculating the UV movement data of the transparent layer, this data is multiplied by the preset attenuation coefficients for each material layer to obtain the UV movement data for each material layer. This results in different texture movement speeds for different material layers, making the texture changes more realistic and enhancing the spatial and three-dimensional feel of the target object model.

[0080] Additionally, it should be noted that the preset transformation coefficients in this application embodiment can be arbitrarily set according to the game effects that game developers actually want to show. This allows for the creation of exaggerated effects within the game, without being bound by the visual laws of the real physical world. For example, multiplying the UV movement data of the transparent layer by a large coefficient can produce an effect where the character moves very slowly, but the material itself moves rapidly, even creating afterimages.

[0081] Step 206: Sample the normal map of the transparent layer to obtain the normal sampling result, and calculate the color data and self-illumination data of the transparent layer according to the preset base color map; calculate the rendering data of the transparent layer according to the normal sampling result, the color data and the self-illumination data of the transparent layer; and render the transparent layer according to the rendering data and the UV movement data of the transparent layer.

[0082] When rendering the transparent layer of a model, firstly, a preset transparent layer normal map is sampled to obtain the normal sampling result of the transparent layer. Secondly, the transparent layer color data is extracted from the preset base color map corresponding to the transparent layer, or the transparent layer normal map is connected to the base color node of the material to calculate the transparent layer color data. Next, self-illumination effect calculation is performed on the preset base color map to obtain the transparent layer self-illumination data. Specifically, the reflective surface effect of the transparent layer normal map under lighting conditions can be extracted, and the reflective surface effect is input into the emissive color node for self-illumination effect calculation, so that the target object model can exhibit a good reflective mirror effect even in low light conditions. Finally, after combining the transparent layer normal sampling result, color data, and self-illumination data to calculate the transparent layer rendering data, the transparent layer of the model is rendered based on the transparent layer rendering data and transparent layer UV movement data, so that the transparent layer can show texture changes in the game as the virtual camera moves.

[0083] Step 207: Obtain the texture map of the material layer; calculate the UV coordinate offset of the texture map of the material layer based on the preset height map corresponding to the material layer; perform UV scaling processing on the UV coordinates of the offset texture map of the material layer based on the preset height map to obtain the material layer rendering data; perform material layer rendering based on the material layer rendering data and the material layer UV movement data, wherein, when there are multiple material layers, the preset height maps corresponding to different material layers are different.

[0084] When rendering the material layer of the model, the texture map and preset height map corresponding to the material layer are first obtained. The UV coordinates of the texture map are then offset based on the preset height map. The offset UV coordinates are then scaled using the height map to create the desired sense of space. Finally, the material layer rendering data is determined based on the UV coordinates after UV offset calculation and scaling, and the material layer rendering data is performed by combining the material layer rendering data and the material layer UV movement data.

[0085] Optionally, effects can also be overlaid on the material layer. Step 207, when rendering the material layer, includes: obtaining material layer color data based on the preset color map corresponding to the material layer; and rendering the material layer according to the material layer rendering data, the material layer color data, and the material layer UV movement data.

[0086] For material layer rendering, you can directly use the material layer UV movement data and material layer rendering data. Alternatively, you can first obtain the material layer color data for the desired effect from a preset color map, and then combine the material layer rendering data, material layer color data, and material layer UV data during material layer rendering. The preset color map can contain any texture you want to display, such as a solid color map or an environment map of the target object model's surroundings.

[0087] After rendering using the above method, when the virtual camera moves at any speed, different layers of the model can exhibit the effect that layers farther away from the virtual camera move more slowly within the field of view, which is more consistent with the visual effects of the physical world. The UV movement data of the material layers can be calculated simply by multiplying the UV movement data of the transparent layers by a preset attenuation coefficient. This provides players with rich visual effects without imposing excessive performance overhead on the client.

[0088] Furthermore, as Figure 1 To specifically implement the method, this application provides an image rendering apparatus, such as... Figure 3 As shown, the device includes:

[0089] A monitoring module is used to monitor whether a target object model is included within the shooting range of a virtual camera, wherein the target object model includes a transparency layer and a material layer;

[0090] The calculation module is used to fuse the preset reflection data corresponding to the transparent layer and the world coordinate position of the virtual camera when the target object model is included in the shooting range of the virtual camera, to obtain the UV movement data of the transparent layer; and to calculate the UV movement data of the material layer based on the UV movement data of the transparent layer and the preset transformation coefficient.

[0091] The rendering module is used to render the transparent layer based on the UV movement data of the transparent layer, and to render the material layer based on the UV movement data of the material layer.

[0092] Optionally, the rendering module is further configured to:

[0093] The normal map of the transparent layer is sampled to obtain the normal sampling results, and the color data and self-illumination data of the transparent layer are calculated based on the preset base color map.

[0094] Based on the normal sampling results, the transparent layer color data, and the transparent layer self-emission data, calculate the transparent layer rendering data;

[0095] The transparent layer is rendered based on the transparent layer rendering data and the transparent layer UV movement data.

[0096] Optionally, the computing module is further configured to:

[0097] Obtain the preset reflection adjustment value of the target object model, wherein the preset reflection adjustment value is obtained by simulating the lighting effect of ambient light shining on a preset material, and the preset material is selected based on the expected simulation effect of the transparent layer;

[0098] The normal coordinates of the transparent layer normal map are converted to world coordinates, and the normal coordinate values ​​of the transparent layer normal map in world coordinates are added to the preset reflection adjustment value to obtain the preset reflection data corresponding to the transparent layer.

[0099] Optionally, the rendering module is further configured to:

[0100] Obtain the texture map of the material layer, and calculate the UV coordinate offset of the texture map of the material layer based on the preset height map corresponding to the material layer;

[0101] Based on the preset height map, the UV coordinates of the material layer texture map after offset are processed by UV scaling to obtain material layer rendering data;

[0102] Material layer rendering is performed based on the material layer rendering data and the material layer UV movement data.

[0103] Optionally, when there are multiple material layers, the preset height maps corresponding to different material layers are different.

[0104] Optionally, the rendering module is further configured to:

[0105] Based on the preset color map corresponding to the material layer, obtain the material layer color data;

[0106] The material layer is rendered based on the material layer rendering data, the material layer color data, and the material layer UV movement data.

[0107] Optionally, the preset transformation coefficient includes preset attenuation coefficients that correspond one-to-one with multiple material layers, wherein the preset attenuation coefficient corresponding to the upper material layer is smaller than the preset attenuation coefficient corresponding to the lower material layer;

[0108] The calculation module is also used to: calculate the UV movement data of each material layer based on the UV movement data of the transparent layer and the preset attenuation coefficient of each material layer.

[0109] It should be noted that other corresponding descriptions of the functional units involved in the image rendering apparatus provided in this application embodiment can be found by referring to... Figures 1 to 2 The corresponding descriptions in the method will not be repeated here.

[0110] This application also provides a computer device, which may specifically be a personal computer, a server, a network device, etc. Figure 4 As shown, the computer device includes a bus, a processor, memory, and a communication interface, and may also include an input / output interface and a display device. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores location information. The network interface allows communication with external terminals via a network connection. When the computer program is executed by the processor, it implements the steps in the various method embodiments.

[0111] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0112] In one embodiment, a computer-readable storage medium is provided, which may be non-volatile or volatile, having stored thereon a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0113] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0114] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0115] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0116] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0117] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. An image rendering method, characterized in that, The method includes: The system monitors whether a target object model is included within the shooting range of a virtual camera, wherein the target object model includes a transparency layer and a material layer. When the target object model is included in the shooting range of the virtual camera, the preset reflection data corresponding to the transparent layer and the world coordinate position of the virtual camera are fused and calculated to obtain the UV movement data of the transparent layer. Based on the UV movement data of the transparent layer and the preset transformation coefficient, the UV movement data of the material layer is calculated; Rendering the transparent layer based on the UV movement data of the transparent layer includes: sampling the normal map of the transparent layer to obtain the normal sampling result, and calculating the color data and self-illumination data of the transparent layer according to the preset base color map; calculating the rendering data of the transparent layer based on the normal sampling result, the color data and the self-illumination data of the transparent layer; and rendering the transparent layer based on the rendering data and the UV movement data of the transparent layer. Rendering a material layer based on the material layer UV movement data includes: obtaining a material layer texture map; calculating the UV coordinate offset of the material layer texture map based on a preset height map corresponding to the material layer; performing UV scaling processing on the offset UV coordinates of the material layer texture map based on the preset height map to obtain material layer rendering data; and rendering the material layer based on the material layer rendering data and the material layer UV movement data.

2. The method according to claim 1, characterized in that, Before fusing the preset reflection data corresponding to the transparent layer and the world coordinate position of the virtual camera, the method further includes: Obtain the preset reflection adjustment value of the target object model, wherein the preset reflection adjustment value is obtained by simulating the lighting effect of ambient light shining on a preset material, and the preset material is selected based on the expected simulation effect of the transparent layer; The normal coordinates of the transparent layer normal map are converted to world coordinates, and the normal coordinate values ​​of the transparent layer normal map in world coordinates are added to the preset reflection adjustment value to obtain the preset reflection data corresponding to the transparent layer.

3. The method according to claim 1 or 2, characterized in that, The process of rendering the material layer based on the material layer rendering data and the material layer UV movement data includes: Based on the preset color map corresponding to the material layer, obtain the material layer color data; The material layer is rendered based on the material layer rendering data, the material layer color data, and the material layer UV movement data.

4. The method according to claim 1 or 2, characterized in that, The preset transformation coefficients include preset attenuation coefficients that correspond one-to-one with multiple material layers, and the preset attenuation coefficients corresponding to the upper material layer are smaller than the preset attenuation coefficients corresponding to the lower material layer. The calculation of material layer UV movement data based on the transparent layer UV movement data and preset transformation coefficients includes: Based on the UV movement data of the transparent layer and the preset attenuation coefficient of each material layer, the UV movement data of each material layer is calculated respectively.

5. An image rendering apparatus, characterized in that, The device includes: A monitoring module is used to monitor whether a target object model is included within the shooting range of a virtual camera, wherein the target object model includes a transparency layer and a material layer; The calculation module is used to calculate the UV movement data of the transparent layer by fusing the preset reflection data corresponding to the transparent layer and the world coordinate position of the virtual camera when the target object model is included in the shooting range of the virtual camera; and to calculate the UV movement data of the material layer based on the UV movement data of the transparent layer and the preset transformation coefficient. The rendering module is used to render the transparent layer based on the UV movement data of the transparent layer, and to render the material layer based on the UV movement data of the material layer. The rendering module is further configured to: sample the normal map of the transparent layer to obtain the normal sampling result, and calculate the color data and self-illumination data of the transparent layer according to the preset base color map; calculate the rendering data of the transparent layer according to the normal sampling result, the color data and the self-illumination data of the transparent layer; and render the transparent layer according to the rendering data and the UV movement data of the transparent layer. The rendering module is further configured to: acquire a material layer texture map; calculate the UV coordinate offset of the material layer texture map based on a preset height map corresponding to the material layer; perform UV scaling processing on the UV coordinates of the offset material layer texture map based on the preset height map to obtain material layer rendering data; and perform material layer rendering based on the material layer rendering data and the material layer UV movement data.

6. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 4.

7. A computer device, comprising a storage medium, a processor, and a computer program stored on the storage medium and running on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 4.

Citation Information

Patent Citations

  • Model editing method and device

    CN110176051A

  • Three-dimensional model and material merging method and device, terminal, storage medium and rendering method

    CN111028361A