Model rendering method, device, medium and electronic device

By automatically generating missing textures in model rendering software, the problem of low texture creation efficiency in existing technologies is solved, thereby improving model rendering efficiency and visual effects.

CN116310029BActive Publication Date: 2026-11-27SHANGHAI NETEASE CUICAN NETWORK TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310259227.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-16
Publication Date
2026-11-27
Estimated Expiration
2043-03-16

AI Technical Summary

Technical Problem

Existing model rendering software is inefficient when creating different types of textures, which affects modeling efficiency, and it does not support checking for missing textures.

Method used

By obtaining the texture folder address, the textures in the target texture folder are found, the missing textures are generated, and the textures are rendered according to the rules of the texture type, thus automatically generating the missing textures to improve the efficiency and completeness of texture generation.

Benefits of technology

It improves texture generation efficiency, solves the problem of checking for missing textures, and enhances model rendering efficiency and visual effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116310029B_ABST
    Figure CN116310029B_ABST
Patent Text Reader

Abstract

The present disclosure provides a model rendering method, device, medium and electronic equipment, and relates to the technical field of computers. The model rendering method comprises: determining a target map folder corresponding to a map folder address according to the obtained map folder address; determining a target map corresponding to each target map identifier in the target map folder according to at least one obtained target map identifier, and determining a search result; wherein the target map comprises a basic map and / or a mixed map; if the search result indicates that the target map file contains a first target map and does not contain a second target map, generating the second target map according to a map generation rule corresponding to the type of the second target map; and rendering a model according to the first target map and the second target map. The present disclosure improves the model rendering efficiency and visual effect on the basis of improving the generation efficiency of the map and the completeness of the obtained map.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a model rendering method, a model rendering apparatus, a computer-readable storage medium, and an electronic device. Background Technology

[0002] In the process of 3D modeling, in addition to creating the 3D model, different textures can be used to render the 3D model to enrich its visual appearance.

[0003] In related technologies, model rendering software can be used to create various types of textures such as color maps, normal maps, ambient occlusion (AO) maps, and / or roughness maps to render 3D models.

[0004] However, due to the limitations of model rendering software, different types of textures need to be created one by one in the model rendering software, resulting in low texture creation efficiency and affecting modeling efficiency. Summary of the Invention

[0005] This disclosure provides a model rendering method, apparatus, medium, and electronic device, which improves model rendering efficiency and visual effects by increasing the efficiency of texture generation and the completeness of the obtained textures.

[0006] According to a first aspect of this disclosure, a model rendering method is provided, comprising:

[0007] Based on the obtained texture folder address, determine the target texture folder corresponding to the texture folder address;

[0008] Based on at least one target texture identifier obtained, the target texture corresponding to each target texture identifier is searched in the target texture folder to determine the search result; wherein, the target texture includes a base texture and / or a blend texture;

[0009] If the search result indicates that the target texture file contains a first target texture and the target texture file does not contain a second target texture, then the second target texture is generated according to the texture generation rule corresponding to the type of the second target texture;

[0010] The model is rendered based on the first target texture and the second target texture.

[0011] According to a second aspect of this disclosure, a model rendering apparatus is provided, comprising:

[0012] The determination module is configured to determine the target texture folder corresponding to the obtained texture folder address;

[0013] The search module is configured to search for a target texture corresponding to each target texture identifier in the target texture folder based on at least one obtained target texture identifier, and determine the search result; wherein the target texture includes a base texture and / or a blend texture;

[0014] The generation module is configured to generate the second target texture according to the texture generation rule corresponding to the type of the second target texture if the search result indicates that the target texture file contains a first target texture and the target texture file does not contain a second target texture.

[0015] The rendering module is configured to render the model based on the first target texture and the second target texture.

[0016] According to a third aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method of the first aspect.

[0017] According to a fourth aspect of this disclosure, an electronic device is provided, comprising:

[0018] Processor; and

[0019] Memory is used to store the processor's executable instructions;

[0020] The processor is configured to execute the method of the first aspect by executing executable instructions.

[0021] The technical solution disclosed herein has the following beneficial effects:

[0022] This invention provides a model rendering method, apparatus, medium, and electronic device. On one hand, it can inspect existing texture folders to determine the presence of missing textures, thus solving the problem that existing model rendering software does not support texture missing condition inspection. On the other hand, when a target texture in a texture folder is determined to be missing, the missing texture can be automatically generated, eliminating the need to create missing textures one by one, thereby improving texture generation efficiency and thus improving model rendering efficiency. Furthermore, by generating missing textures, the completeness of the acquired texture types can be improved, thereby enhancing the visual effect of the rendered model.

[0023] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0024] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0025] Figure 1 This diagram illustrates a schematic architecture of a model rendering system according to this exemplary embodiment.

[0026] Figure 2 This diagram illustrates a model rendering method according to an exemplary embodiment.

[0027] Figure 3 This diagram illustrates a flowchart of a second target texture generation method in this exemplary embodiment;

[0028] Figure 4 This diagram illustrates a flowchart of an environment occlusion map generation method in this exemplary embodiment.

[0029] Figure 5 A schematic diagram of a three-dimensional model is shown in this exemplary embodiment;

[0030] Figure 6 This diagram illustrates a block diagram of a model rendering apparatus according to this exemplary embodiment;

[0031] Figure 7 A schematic diagram of the structure of an electronic device in this exemplary embodiment is shown. Detailed Implementation

[0032] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of exemplary embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure may be practiced with one or more of these specific details omitted, or other methods, components, apparatus, steps, etc., may be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0033] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0034] The flowchart shown in the attached diagram is merely an illustrative example and does not necessarily include all steps. For example, some steps may be broken down, while others may be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0035] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein.

[0036] Among related technologies, there are implementation schemes that generate textures through model rendering software to render 3D models. In the process of texture creation, for example, normal maps can be generated using the normal plugin (Quixel nDo2) of image processing software (Photoshop, PS); or texture creation tools (Substance Designer) can be used to write texture logic to generate various required textures.

[0037] However, these model rendering software programs mainly support texture creation, and in the process of texture creation, users usually need to create the required textures one by one, which leads to low texture creation efficiency and affects modeling efficiency.

[0038] In view of the above problems, the exemplary embodiments of this disclosure provide a model rendering method for 3D model rendering. Application scenarios of this model rendering method include, but are not limited to: during game modeling, the terminal device can determine the target texture folder corresponding to the obtained texture folder address; based on at least one obtained target texture identifier, search for the target texture corresponding to each target texture identifier in the target texture folder, and determine the search result; wherein, the target texture includes a base texture and / or a blend texture; if the search result indicates that the target texture file contains a first target texture and the target texture file does not contain a second target texture, then a second target texture is generated according to the texture generation rule corresponding to the type of the second target texture; the model is rendered based on the first target texture and the second target texture. This method can check for missing textures in existing texture folders and automatically generate missing textures, simplifying the texture creation process during modeling and improving texture creation efficiency and model rendering efficiency; simultaneously, by ensuring the completeness of the texture types used for rendering the model, the visual effect of the rendered model can be improved.

[0039] To implement the above-described model rendering method, an exemplary embodiment of this disclosure provides a model rendering system. Figure 1 A schematic architecture diagram of the model rendering system is shown. (For example...) Figure 1 As shown, the model rendering system 100 may include a server 110 and a terminal device 120. The server 110 may be a database server, which can store texture files, and these texture files may include at least one texture created for the unrendered 3D model. The terminal device 120 is the terminal device used by the texture creator; more specifically, the terminal device may be a personal computer or tablet computer, etc. The server 110 and the terminal device 120 can establish a connection via a network to perform model rendering.

[0040] It should be understood that server 110 can be a single server or a cluster of multiple servers. This disclosure does not limit the specific architecture of server 110.

[0041] The following explanation of the model rendering method is from the perspective of the terminal device. Figure 2 An exemplary flow of a model rendering method performed by a terminal device is shown, which may include:

[0042] Step S201: Based on the obtained texture folder address, determine the target texture folder corresponding to the texture folder address;

[0043] Step S202: Based on the at least one target texture identifier obtained, search for the target texture corresponding to each target texture identifier in the target texture folder, and determine the search result;

[0044] The target texture includes a base texture and / or a blend texture;

[0045] Step S203: If the search result indicates that the target texture file contains the first target texture and the target texture file does not contain the second target texture, then generate the second target texture according to the texture generation rule corresponding to the type of the second target texture.

[0046] Step S204: Render the model based on the first target texture and the second target texture.

[0047] In summary, the model rendering method provided in this embodiment can determine the target texture folder corresponding to the obtained texture folder address; search for the target texture corresponding to each target texture identifier in the target texture folder based on the obtained at least one target texture identifier, and determine the search result; if the search result indicates that the target texture file contains a first target texture and the target texture file does not contain a second target texture, then generate a second target texture according to the texture generation rule corresponding to the type of the second target texture; and render the model based on the first target texture and the second target texture. On the one hand, it can check the existing texture folder to determine the texture missing situation in the texture folder, solving the problem that existing model rendering software does not support texture missing situation checking; on the other hand, when it is determined that the target texture in the texture folder is missing, the missing texture can be automatically generated, without having to create missing textures one by one, improving texture generation efficiency, thereby improving model rendering efficiency; furthermore, by generating missing textures, the completeness of the obtained texture types can be improved, thereby improving the visual effect of the rendered model.

[0048] The following are Figure 2 The specific implementation methods of each step in the illustrated embodiment are described in detail below:

[0049] In step S201, the terminal device can determine the target texture folder corresponding to the texture folder address based on the obtained texture folder address.

[0050] In this embodiment of the disclosure, a model rendering software can be run on the terminal device. The model rendering software may include 3D image processing software or 3D model development engine, etc. The terminal device can execute the model rendering method in this embodiment of the disclosure based on the model rendering software to render the model after generating the missing texture.

[0051] In one optional implementation, the model rendering software of the terminal device can provide a texture information input interface, which may include a texture folder address input box for the user to input the texture folder address. Before the terminal device determines the target texture folder corresponding to the obtained texture folder address, the terminal device can respond to the texture generation operation and display the texture information input interface.

[0052] In one optional implementation, the display interface of the model rendering software may display a target control, which is a trigger control for the texture generation function in the model rendering software. The process of the terminal device responding to the texture generation operation and displaying the texture information input interface may include: the terminal device responding to the trigger operation of the target control and displaying the texture information input interface. The trigger operation of the target control may include a single click or a double click operation of the target control, which is not limited in this embodiment. This allows the user to control the terminal device to display the texture information input interface based on the target control, reducing the complexity of the user's operation in viewing the texture information input interface and improving the user experience.

[0053] In one optional implementation, the texture generation function in the texture creation software can be triggered by a preset command. The process of the terminal device responding to the texture generation operation and displaying the texture information input interface may include: the terminal device responding to the input operation of the preset command and displaying the texture information input interface.

[0054] It is understandable that the process by which a terminal device determines the target texture folder corresponding to the obtained texture folder address may include: determining the target texture folder corresponding to the texture folder address obtained from the texture information input interface. The texture folder can be stored on the terminal device or a server.

[0055] It should be noted that if the texture folder is stored on a server, the process by which the terminal device determines the target texture folder corresponding to the texture folder address may include: generating a texture folder retrieval request based on the texture folder address, sending the texture folder retrieval request to the server, so that the server retrieves the target texture folder corresponding to the texture folder address based on the texture folder address in the texture folder retrieval request, and returns the target texture folder to the terminal device. By storing the texture folder on a server, the data storage pressure on the terminal device can be reduced.

[0056] In step S202, the terminal device can search for the target texture corresponding to each target texture identifier in the target texture folder based on the at least one target texture identifier obtained, and determine the search result.

[0057] In this embodiment of the disclosure, the target texture identifier is a texture identifier for a target texture used to render the model. At least one target texture identifier may include a base texture identifier and / or a blend texture. Then the target texture includes a base texture and / or a blend texture. The base texture may be a color texture, a normal texture, a roughness texture, a metallic texture, an AO texture, or an emissive texture, etc., and the blend texture may be composed of the base texture.

[0058] It should be noted that, in this embodiment of the disclosure, the texture information input interface may further include a texture identifier input box, which is used for the user to input the target texture identifier. The target texture folder may include various textures, and different textures have different texture suffixes; for example, the texture suffix of a color texture may be "_b"; the texture suffix of a roughness texture may be "_r"; the texture suffix of a metallic texture may be "_m"; the texture suffix of a blend texture may be "_mix", etc. The texture suffix can be determined based on actual needs, and this embodiment of the disclosure does not limit it; wherein, the target texture identifier may be the texture suffix of the target texture.

[0059] In one optional implementation, the terminal device searches for a target texture corresponding to each target texture identifier in a target texture folder based on at least one target texture identifier obtained. The process of determining the search result may include: in response to an information input operation in the texture identifier input box, obtaining the input content in the texture identifier input box to obtain at least one target texture identifier; for each target texture identifier, comparing the target texture identifier with the texture identifier of each texture in the target texture folder; if a texture with the same target texture identifier exists in the target texture folder, then the texture with the same target texture identifier is determined as the first target texture; if no texture with the same target texture identifier exists in the target texture folder, then it is determined that no second target texture exists in the target texture folder, and a search result is generated, wherein the search result is used to record the situation where the target texture file contains textures.

[0060] For example, at least one target texture identifier obtained by the terminal device includes: the texture suffix "_b" for the color texture; the texture suffix "_r" for the roughness texture; and the texture suffix "_mix" for the blending texture. If a color texture corresponding to the texture suffix "_b" for the color texture is found in the target texture folder, and a roughness texture corresponding to the texture suffix "_r" for the roughness texture is found in the target texture folder, and no blending texture corresponding to the texture suffix "_mix" for the blending texture is found in the target texture folder, then the generated search result indicates that the first target texture contained in the target texture file is a color texture and a roughness texture; and the second target texture not contained in the target texture file is a blending texture.

[0061] In step S203, if the search result indicates that the target texture file contains the first target texture and the target texture file does not contain the second target texture, then the second target texture is generated according to the texture generation rule corresponding to the type of the second target texture.

[0062] In this embodiment of the disclosure, the target texture file contains at least a color texture, so as to generate a second target texture that is not contained in the target texture file based on the color texture.

[0063] In one alternative implementation, the second target texture includes a blended texture, such as... Figure 3 As shown, the process by which the terminal device generates the second target texture according to the texture generation rules corresponding to the type of the second target texture may include:

[0064] Step S301: Determine the multiple base map types associated with the multiple map channels of the blend map;

[0065] In this embodiment, the texture typically includes four texture channels: R channel, G channel, B channel, and A channel. For the base texture, the R channel is the red channel, the G channel is the green channel, the B channel is the blue channel, and the A channel is the transparency channel. For the blend texture, the R channel can be a roughness map channel for storing the roughness map; the G channel can be a metallicity map channel for storing the metallicity map; the B channel can be an ambient occlusion map channel for storing the AO map; and the A channel can be an emissive illumination map channel for storing the emissive illumination map. For the blend texture, the type of base texture stored in each texture channel can be determined based on actual needs, and this embodiment does not limit this.

[0066] In one optional implementation, the base map type associated with each map channel of the hybrid map can be predetermined. The process by which the terminal device determines the multiple base map types associated with the multiple map channels of the hybrid map can include: obtaining the base map type associated with each map channel of the hybrid map from predetermined configuration information, thereby obtaining the multiple base map types associated with the multiple map channels of the hybrid map.

[0067] Step S302: Locate multiple base maps corresponding to multiple base map types in the first target map, and generate a blend map based on the search results.

[0068] In this embodiment of the disclosure, the multiple base map types include base map types associated with each map channel of the blending map. It is understood that, when the target map file does not contain a blending map, the first target map contained in the target map file is a base map. Multiple base maps corresponding to the multiple base map types are searched within the first target map, and a blending map is generated based on the search results. This process combines the first target map to generate the blending map, improving the matching degree between the generated blending map and the actual blending map required for rendering the model.

[0069] The process of finding multiple base maps corresponding to multiple base map types in the first target map may include: finding the base map corresponding to each base map identifier in the first target map according to the base map identifiers corresponding to the multiple base map types.

[0070] In one optional implementation, if the first target texture image contains multiple base texture images corresponding to all base texture types among multiple base texture types, or if the first target texture image does not contain multiple base texture images corresponding to all base texture types among multiple base texture types, then the process of the terminal device generating a hybrid texture image based on the search results may include: if the first target texture image contains multiple base texture images corresponding to all base texture types, then obtaining a hybrid texture image based on the multiple base texture images corresponding to all base texture types; or, if the first target texture image does not contain multiple base texture images corresponding to all base texture types, then searching for multiple first channel values ​​in the pre-determined texture configuration information that are configured as texture channels associated with all base texture types in the hybrid texture image; and obtaining a hybrid texture image based on the multiple first channel values. If the first target texture map contains a base texture map corresponding to each texture channel of the blending texture map, a blending texture map can be generated based on the first target texture map to further improve the matching degree between the generated blending texture map and the actual blending texture map required for rendering the model; or, if the first target texture map does not contain a base texture map corresponding to each texture channel of the blending texture map, a blending texture map can be generated based on the texture configuration information to ensure that the texture map used for rendering the model includes the blending texture map, thereby improving the visual effect of the rendered model.

[0071] The process by which the terminal device obtains a blended texture based on multiple base textures corresponding to all base texture types may include: assigning the pixel values ​​of the base textures corresponding to each base texture type in the texture configuration information to the texture channel associated with that base texture type to obtain the blended texture.

[0072] For example, all base map types may include roughness maps, metallic maps, ambient occlusion maps, and emissive maps. If the first target map contains multiple base maps corresponding to all base map types, the process by which the terminal device obtains a blended map based on the multiple base maps corresponding to all base map types may include: assigning the pixel values ​​of the roughness map to the roughness map channel corresponding to the roughness map; assigning the pixel values ​​of the metallic map to the metallic map channel corresponding to the metallic map; assigning the pixel values ​​of the ambient occlusion map to the ambient occlusion map channel corresponding to the ambient occlusion map; and assigning the pixel values ​​of the emissive map to the emissive map channel corresponding to the emissive map.

[0073] The process by which the terminal device obtains a blended texture based on multiple first channel values ​​may include: assigning the first channel value of the texture channel associated with each basic texture type to the texture channel associated with that basic texture type to obtain the blended texture.

[0074] For example, all basic texture types may include roughness maps, metallic maps, ambient occlusion maps, and self-illuminating maps. If the first target texture does not contain multiple basic textures corresponding to all basic texture types, the process by which the terminal device obtains the mixed texture based on multiple first channel values ​​may include: assigning the first channel value 1 of the roughness map channel associated with the roughness map to the roughness map channel; assigning the first channel value 0 of the metallic map channel associated with the metallic map to the metallic map channel; assigning the first channel value 1 of the ambient occlusion map channel associated with the ambient occlusion map to the ambient occlusion map channel; and assigning the first channel value 0 of the self-illuminating map channel associated with the self-illuminating map to the self-illuminating map channel. The channel values ​​configured for each texture channel of the mixed texture in the texture configuration information can be determined based on actual needs, and this embodiment does not limit this.

[0075] In one optional implementation, the first target texture image contains base textures corresponding to some of the base texture types among multiple base texture types. The process by which the terminal device generates a blended texture image based on the search results may include: if the first target texture image contains base textures corresponding to some of the base texture types, then generating a blended texture image based on the multiple base textures corresponding to the multiple base texture types in the first target texture image, and the multiple first channel values ​​configured for the texture channels associated with the target base texture type in a pre-determined texture configuration information; wherein the first target texture image does not contain base textures corresponding to the target base texture type. When the first target texture image contains base textures corresponding to some of the texture channels of the blended texture image, a blended texture image can be generated based on the first target texture image and the texture configuration information to improve the matching degree between the generated blended texture image and the actual required blended texture image for rendering the model, while ensuring that the blended texture image is obtained.

[0076] The process of generating a blended texture, based on multiple base textures corresponding to certain base texture types in the first target texture image and multiple first channel values ​​configured for the texture channels associated with the target base texture types in the pre-determined texture configuration information, may include: assigning the pixel values ​​of the base textures corresponding to certain base texture types in the first target texture image to the texture channels associated with certain base texture types; and assigning the first channel values ​​configured for the texture channels associated with each target base texture type to the texture channels associated with the target base texture type, thereby obtaining a blended texture.

[0077] For example, the R channel of the blended texture is a roughness map channel; the G channel is a metallicity map channel; the B channel is an ambient occlusion map channel; and the A channel is an emissivity map channel. If the first target texture contains a roughness map and a metallicity map, the process by which the terminal device generates the blended texture based on the search results may include: assigning the pixel values ​​of the roughness map to the roughness map channel corresponding to the roughness map; assigning the pixel values ​​of the metallicity map to the metallicity map channel corresponding to the metallicity map; and assigning the first channel value 1 of the ambient occlusion map channel associated with the ambient occlusion map to the ambient occlusion map channel; and assigning the first channel value 0 of the emissivity map channel associated with the emissivity map to the emissivity map channel, thus obtaining the blended texture.

[0078] In one optional implementation, the second target texture includes a normal texture. The process by which the terminal device generates the second target texture according to the texture generation rules corresponding to the type of the second target texture may include: finding the second channel value configured for each texture channel of the normal texture in a pre-determined texture configuration information; obtaining the second channel value corresponding to each texture channel of the normal texture to obtain the normal texture. This allows for automatic generation of the normal texture based on the pre-determined texture configuration information when the normal texture is missing, improving the generation efficiency of the normal texture.

[0079] It should be noted that, in the embodiments of this disclosure, the first channel value configured for each map channel of the normal map can be determined based on actual needs, and this disclosure does not limit this; for example, the first channel value configured for the R channel of the normal map in the map configuration information can be 0.5, the first channel value configured for the G channel of the normal map can be 0.5, the first channel value configured for the B channel of the normal map can be 1, and the first channel value configured for the A channel of the normal map can be 1.

[0080] In one alternative implementation, the first target texture includes a normal map and a color map, and the second target texture includes an ambient occlusion map, such as... Figure 4 As shown, the process of generating the second target texture, according to the texture generation rules corresponding to the type of the second target texture, may include:

[0081] Step S401: Obtain the normal map and color map from the target texture folder;

[0082] In one optional implementation, the process of the terminal device obtaining a color map in the target map folder may include: comparing the color map identifier with the map identifier of each map in the target map folder, and determining the map in the target map folder that corresponds to the color map identifier as the color map.

[0083] It should be noted that, in the embodiments of this disclosure, the process of the terminal device obtaining the normal map in the target map folder can refer to the process of the terminal device obtaining the color map in the target map folder, and will not be described in detail in the embodiments of this disclosure.

[0084] Step S402: Generate a height map based on the color map;

[0085] In this embodiment of the disclosure, the height map is used to represent the depth information of the model to be rendered; the depth information carried by the height map can be used to replace the vertex information of the model, and the environment occlusion map can be generated without obtaining the vertex information of the model to be rendered, thus improving the convenience of generating the environment occlusion map.

[0086] In one optional implementation, the process of generating a height map from a color map may include converting the color map to grayscale to obtain a grayscale image, and then determining the grayscale image as the height map. The process of converting the color map to grayscale to obtain the grayscale image may include multiplying the R, G, and B channels of the color map by a fixed value to obtain the grayscale image. This fixed value can be determined based on actual needs, and this disclosure does not limit it. For example, the fixed value corresponding to the R channel may be 0.21, the fixed value corresponding to the G channel may be 0.7, and the fixed value corresponding to the B channel may be 0.07.

[0087] Step S403: Generate an environment occlusion map based on the height map and normal map.

[0088] In this embodiment, an ambient occlusion map can be generated based on the Screen Space Ambient Occlusion (SSAO) principle, using both height and normal maps. Instead of directly using pre-configured default values ​​to obtain the ambient occlusion map when it is missing, the map is rendered based on the height and normal models, further improving the accuracy of the resulting map.

[0089] In one optional implementation, the process of generating an ambient occlusion map by the terminal device based on the height map and the normal map may include: obtaining linear depth information of each segment in the screen space based on the depth information of the height map and the normal information in the normal map; determining the sampling position corresponding to each segment based on the number of samples and a predetermined sampling offset value; determining the ambient light occlusion coefficient of each segment based on the linear depth information corresponding to each segment and the linear depth information of the sampling position; and performing a smooth transition processing on the ambient light occlusion coefficient of each segment to obtain the ambient occlusion map. The number of samples can be determined based on actual needs, and this disclosure does not limit this. On the one hand, in the process of determining the ambient occlusion map, the depth information of the height map is used instead of the vertex information of the 3D model, so that the ambient occlusion map can be generated without obtaining the vertex information of the 3D model, thus improving the generation efficiency of the ambient occlusion map; and even when the vertex information of the 3D model cannot be obtained, the ambient occlusion map can still be generated, expanding the application scenarios for generating the ambient occlusion map; on the other hand, in the process of determining the ambient light occlusion coefficient, regarding the sampling point (S... i The direction from the sample point (p) to the sample point (in the prior art, it is the view from the sample point to the sample point, minus the random sampling number determined for the image frame where the sample point is located). Instead of calculating the random sampling number for each image frame corresponding to the sample point, a pre-determined sampling offset value is used to replace the random sampling number, which can reduce performance consumption and improve the efficiency of the terminal device in generating environment occlusion maps.

[0090] It should be noted that, in this embodiment of the disclosure, the process of pre-determining the sampling offset value may include: determining initial data (a1, a2, a3); for a1, determining the difference between twice a1 and parameter 1 to obtain a first difference, and determining the product of the first difference and a1 to obtain a first product; similarly, for a2, determining the difference between twice a2 and parameter 1 to obtain a second difference, and determining the product of the first difference and a2 to obtain a second product; further, the fractional part of the first product and the fractional part of the second product can be multiplied with a3 to obtain an initial sampling offset value; and the sin value and cos value of the initial sampling offset value are determined to obtain the sampling offset value. The initial data may be (0.06711, 4*0.00583, 52.9828).

[0091] The process of determining the ambient light occlusion coefficient of each segment based on the linear depth information corresponding to each segment and the linear depth information of the sampling position may include: determining a first number of sampling positions associated with each segment whose linear depth is greater than the linear depth of the segment, determining the ratio of the first number to the total number of sampling positions, and obtaining the ambient light occlusion coefficient of each segment.

[0092] In one optional implementation, the first target texture includes a color texture, and the second target texture includes an environment occlusion texture and a normal texture. The process by which the terminal device generates the second target texture according to the texture generation rules corresponding to the type of the second target texture may include: generating a normal texture and a height texture based on the color texture; and generating an environment occlusion texture based on the height texture and the normal texture. This can prevent the inability to generate an environment occlusion texture due to the absence of a normal texture, thus improving the reliability of obtaining the environment occlusion texture, even when both the environment occlusion texture and the normal texture are missing.

[0093] In one optional implementation, the process by which the terminal device generates a normal map based on a color map may include: converting the color map to grayscale to obtain a grayscale image, and determining the normal map based on the grayscale image. Specifically, determining the normal map based on the grayscale image may include: determining the direction vector of each pixel in the grayscale image in a first direction and a second direction; obtaining the normal vector of each pixel by performing a cross product on the two direction vectors; and combining the normal vectors of each pixel to obtain the normal map, wherein the first direction is the x-direction and the second direction is the y-direction.

[0094] It should be noted that, in this embodiment of the present disclosure, the process of generating a height map based on a color map can refer to step S402 above, and will not be described in detail here; the process of generating an environment occlusion map based on a height map and a normal map can refer to step S403 above, and will not be described in detail here.

[0095] It should be noted that, in this embodiment of the disclosure, for hybrid textures, the pre-set texture generation rules may include a first texture generation rule and a second texture generation rule. The first texture generation rule instructs the generation of missing hybrid textures based on the channel values ​​set for each texture channel in the texture configuration information, while the second texture generation rule instructs the generation of missing hybrid textures based on other base textures. The terminal device can determine whether to use the first or second texture generation rule to generate the missing hybrid texture based on the user's selection.

[0096] In one optional implementation, the texture information input interface may further include texture generation rule options. The terminal device can respond to the user-selected texture generation rules and generate the missing texture according to these rules when the target texture is missing. This can meet the diverse needs of users in the process of drawing missing textures.

[0097] In step S204, the terminal device can render the model based on the first target texture and the second target texture.

[0098] In one optional implementation, after generating the second target texture according to the texture generation rules corresponding to the type of the second target texture, the terminal device can render the 3D model using the first target texture and the second target texture, such as... Figure 5 As shown, Figure 5 The left side of the image shows the rendering effect of the 3D model using target textures, while the right side shows the rendering effect of the 3D model without target textures. When rendering the model on the left, missing target textures can be filled in to obtain a more detailed rendering effect.

[0099] Understandably, if the search results indicate that the target texture file contains a target texture corresponding to each target texture identifier, and the first target texture is the target texture corresponding to each target texture identifier, then the terminal device can render the model based on the first target texture; the 3D model can be rendered without generating missing textures.

[0100] Figure 6 This disclosure illustrates a model rendering apparatus provided in an embodiment of the present disclosure. The model rendering apparatus can be a terminal device, such as... Figure 6 As shown, the model rendering device 600 includes:

[0101] The determination module 601 is configured to determine the target texture folder corresponding to the obtained texture folder address;

[0102] The search module 602 is configured to search for a target texture corresponding to each target texture identifier in the target texture folder based on at least one target texture identifier obtained, and determine the search result; wherein the target texture includes a base texture and / or a blend texture;

[0103] The generation module 603 is configured to generate a second target texture according to the texture generation rule corresponding to the type of the second target texture if the search result indicates that the target texture file contains a first target texture and the target texture file does not contain a second target texture.

[0104] Rendering module 604 is configured to render the model based on the first target texture and the second target texture.

[0105] Optionally, the second target texture includes a blending texture, and the generation module 603 is configured as follows:

[0106] Identify the multiple base map types associated with multiple map channels of the blend map;

[0107] The system searches for multiple base maps corresponding to multiple base map types in the first target map and generates a blend map based on the search results.

[0108] Optionally, generation module 603 is configured as follows:

[0109] If the first target texture contains multiple base textures corresponding to all base texture types, then a blended texture is obtained based on the multiple base textures corresponding to all base texture types.

[0110] If the first target texture does not contain multiple base textures corresponding to all base texture types, then in the pre-determined texture configuration information, find multiple first channel values ​​that are associated with the texture channel configuration of all base texture types in the mixed texture;

[0111] A blended texture is obtained based on multiple first channel values.

[0112] Optionally, generation module 603 is configured as follows:

[0113] If the first target texture map contains a base texture map corresponding to a partial base texture map type, then a mixed texture map is generated based on the base texture map corresponding to the partial base texture map type in the first target texture map and the multiple first channel values ​​configured for the texture channel associated with the target base texture map type in the pre-determined texture configuration information; wherein, the first target texture map does not contain a base texture map corresponding to the target base texture map type.

[0114] Optionally, the second target texture includes a normal map, and the generation module 603 is configured as follows:

[0115] In the pre-determined texture configuration information, find the second channel value configured for each texture channel of the normal map;

[0116] Obtain the second channel value corresponding to each map channel of the normal map to obtain the normal map.

[0117] Optionally, the first target texture includes a normal map and a color map, and the second target texture includes an ambient occlusion map. The generation module 603 is configured as follows:

[0118] Obtain the normal map and color map from the target texture folder;

[0119] Generate a height map based on the color map;

[0120] An ambient occlusion map is generated based on the height map and normal map.

[0121] Optionally, the first target texture includes a color texture, and the second target texture is an environment occlusion texture and a normal texture. The generation module 603 is configured as follows:

[0122] Generate normal maps and height maps based on the color maps;

[0123] An ambient occlusion map is generated based on the height map and normal map.

[0124] Optionally, generation module 603 is configured as follows:

[0125] Based on the depth information in the height map and the normal information in the normal map, the linear depth information of each segment in screen space is obtained;

[0126] Based on the number of samples and the predetermined sampling offset value, determine the sampling position corresponding to each segment;

[0127] The ambient light occlusion coefficient of each segment is determined based on the linear depth information corresponding to each segment and the linear depth information of the sampling position.

[0128] The ambient occlusion coefficient of each segment is smoothed to obtain the ambient occlusion map.

[0129] Optional, such as Figure 6 As shown, the model rendering device 600 also includes a display control module 605, configured as follows:

[0130] In response to texture generation operations, display the texture information input interface;

[0131] Module 601 is configured as follows:

[0132] Based on the texture folder address obtained from the texture information input interface, determine the target texture folder corresponding to the texture folder address.

[0133] Exemplary embodiments of this disclosure also provide a computer-readable storage medium that can be implemented as a program product including program code, which, when run on an electronic device, causes the electronic device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. In one embodiment, the program product can be implemented as a portable compact disc read-only memory (CD-ROM) including program code and can run on an electronic device, such as a personal computer. However, the program product of this disclosure is not limited thereto. In this document, the readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0134] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0135] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0136] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0137] Program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing devices can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0138] Exemplary embodiments of this disclosure also provide an electronic device, which may be a terminal device. References below... Figure 7 This electronic device will be described. It should be understood that... Figure 7 The electronic device 700 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.

[0139] like Figure 7 As shown, the electronic device 700 is presented in the form of a general-purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one storage unit 720, and a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710).

[0140] The storage unit stores program code, which can be executed by the processing unit 710 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 710 can perform actions such as... Figure 2 The methods and steps shown are as follows.

[0141] Storage unit 720 may include volatile storage units, such as random access memory (RAM) 721 and / or cache memory 722, and may further include read-only memory (ROM) 723.

[0142] The storage unit 720 may also include a program / utility 724 having a set (at least one) of program modules 725, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0143] Bus 730 may include a data bus, an address bus, and a control bus.

[0144] Electronic device 700 can also communicate with one or more external devices 800 (e.g., keyboards, pointing devices, Bluetooth devices, etc.) via input / output (I / O) interface 740. Electronic device 700 can also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via network adapter 750. As shown, network adapter 750 communicates with other modules of electronic device 700 via bus 730. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0145] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to exemplary embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0146] Those skilled in the art will understand that various aspects of this disclosure can be implemented as systems, methods, or program products. Therefore, various aspects of this disclosure can be embodied in entirely hardware implementations, entirely software implementations (including firmware, microcode, etc.), or implementations combining hardware and software aspects, collectively referred to herein as “circuit,” “module,” or “system.” Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

[0147] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is defined only by the appended claims.

Claims

1. A model rendering method, characterized in that, include: Based on the obtained texture folder address, determine the target texture folder corresponding to the texture folder address; Based on at least one target texture identifier obtained, the target texture corresponding to each target texture identifier is searched in the target texture folder to determine the search result; wherein, the target texture includes a base texture and / or a blend texture; If the search result indicates that the target texture file contains a first target texture and the target texture file does not contain a second target texture, then the second target texture is generated according to the texture generation rule corresponding to the type of the second target texture; wherein, if the target texture folder contains a texture with the same identifier as the target texture, then the texture with the same identifier is identified as the first target texture; if the target texture folder does not contain a texture with the same identifier as the target texture, then it is determined that the target texture folder does not contain a second target texture; when the first target texture includes a normal map and a color map, and the second target texture includes an environment occlusion map, the step of generating the second target texture according to the texture generation rule corresponding to the type of the second target texture includes: obtaining the normal map and the color map from the target texture folder; generating a height map based on the color map; and generating the environment occlusion map based on the height map and the normal map; When the first target texture includes a color texture and the second target texture is an environment occlusion texture and a normal texture, generating the second target texture according to the texture generation rules corresponding to the type of the second target texture includes: generating the normal texture and the height texture according to the color texture; and generating the environment occlusion texture according to the height texture and the normal texture. The step of generating the ambient occlusion map based on the height map and the normal map includes: obtaining linear depth information for each segment in screen space based on the depth information in the height map and the normal information in the normal map; determining the sampling position corresponding to each segment based on the number of samples and a predetermined sampling offset value; determining the ambient occlusion coefficient of each segment based on the linear depth information corresponding to each segment and the linear depth information of the sampling position; and performing a smooth transition processing on the ambient occlusion coefficient of each segment to obtain the ambient occlusion map. The model is rendered based on the first target texture and the second target texture.

2. The method according to claim 1, characterized in that, The second target texture includes a blended texture. Generating the second target texture according to a texture generation rule corresponding to the type of the second target texture includes: Identify the multiple base map types associated with multiple map channels of the blend map; The first target texture map is used to find multiple base textures that correspond to the multiple base texture types, and the hybrid texture is generated based on the search results.

3. The method according to claim 2, characterized in that, The step of generating the hybrid texture based on the search results includes: If the first target texture contains multiple base textures corresponding to all base texture types, then the hybrid texture is obtained based on the multiple base textures corresponding to all base texture types. If the first target texture does not contain multiple base textures corresponding to all base texture types, then in the pre-determined texture configuration information, find multiple first channel values ​​configured for the texture channels associated with all base texture types in the mixed texture; The hybrid texture is obtained based on the multiple first channel values.

4. The method according to claim 2, characterized in that, The step of generating the hybrid texture based on the search results includes: If the first target texture map contains a base texture map corresponding to a partial base texture map type, then the hybrid texture map is generated based on the base texture map corresponding to the partial base texture map type in the first target texture map and the multiple first channel values ​​configured for the texture channel associated with the target base texture map type in the pre-determined texture configuration information; wherein, the first target texture map does not contain a base texture map corresponding to the target base texture map type.

5. The method according to claim 1, characterized in that, The second target texture includes a normal map. Generating the second target texture according to the texture generation rule corresponding to the type of the second target texture includes: In the predetermined texture configuration information, find the second channel value configured for each texture channel of the normal map; Obtain the second channel value corresponding to each map channel of the normal map to obtain the normal map.

6. The method according to claim 1, characterized in that, The method further includes: In response to texture generation operations, display the texture information input interface; The step of determining the target texture folder corresponding to the obtained texture folder address includes: Based on the texture folder address obtained from the texture information input interface, determine the target texture folder corresponding to the texture folder address.

7. A model rendering device, characterized in that, include: The determination module is configured to determine the target texture folder corresponding to the obtained texture folder address; The search module is configured to search for a target texture corresponding to each target texture identifier in the target texture folder based on at least one obtained target texture identifier, and determine the search result; wherein the target texture includes a base texture and / or a blend texture; The generation module is configured to, if the search result indicates that the target texture file contains a first target texture and the target texture file does not contain a second target texture, generate a second target texture according to a texture generation rule corresponding to the type of the second target texture; wherein, if a texture with the same identifier as the target texture exists in the target texture folder, the texture with the same identifier is identified as the first target texture; if a texture with the same identifier as the target texture does not exist in the target texture folder, it is determined that the second target texture does not exist in the target texture folder; when the first target texture includes a normal map and a color map, and the second target texture includes an environment occlusion map, generating the second target texture according to the texture generation rule corresponding to the type of the second target texture includes: obtaining the normal map and the color map from the target texture folder; generating a height map based on the color map; and generating the environment occlusion map based on the height map and the normal map; When the first target texture includes a color texture and the second target texture is an environment occlusion texture and a normal texture, generating the second target texture according to the texture generation rules corresponding to the type of the second target texture includes: generating the normal texture and the height texture according to the color texture; and generating the environment occlusion texture according to the height texture and the normal texture. The step of generating the ambient occlusion map based on the height map and the normal map includes: obtaining linear depth information for each segment in screen space based on the depth information in the height map and the normal information in the normal map; determining the sampling position corresponding to each segment based on the number of samples and a predetermined sampling offset value; determining the ambient occlusion coefficient of each segment based on the linear depth information corresponding to each segment and the linear depth information of the sampling position; and performing a smooth transition processing on the ambient occlusion coefficient of each segment to obtain the ambient occlusion map. The rendering module is configured to render the model based on the first target texture and the second target texture.

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

9. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1 to 6 by executing the executable instructions.

Citation Information

Patent Citations

  • Texture management method and device, equipment and storage medium

    CN114549727A

  • Model rendering method and device, computer equipment and computer readable storage medium

    CN115345976A