A method and system for automatically attaching and processing textures and materials

The method and system automate the attachment of textures and materials in Unity by establishing a texture-material association model and implementing automatic compression, addressing the inefficiencies and errors in manual attachment processes.

CN117853639BActive Publication Date: 2024-12-06BEIJING EASY TIMES DIGITAL TECH
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202311625109.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-30
Publication Date
2024-12-06
Estimated Expiration
2043-11-30

AI Technical Summary

Technical Problem

The process of attaching textures and materials in Unity is time-consuming and prone to errors, requiring manual observation and correction, which wastes development time.

Method used

A method and system for automatically attaching textures and materials by establishing a texture-material association model, setting initial naming rules, and implementing automatic compression to optimize memory usage and improve efficiency.

Benefits of technology

Enables efficient and accurate attachment of textures and materials, reducing file size and development time by allowing user-defined naming rules and automatic compression.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117853639B_ABST
    Figure CN117853639B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of automatic texture processing, and in particular to a method and system for automatic texture and material attachment processing. It includes: establishing a texture database and a material database, and generating a texture-material association model; obtaining a user's texture call instruction, and generating a to-be-called material according to the texture call instruction and the texture-material association model; setting the attachment model working parameters according to the texture call instruction and all the to-be-called material parameters, and generating a preprocessing data packet; establishing a rendering model, and setting the rendering model working parameters according to all the preprocessing data including parameters. By adding a first processing module to set the initial naming rules for textures and materials, and by adding a naming module, it supports user-defined naming specifications, which can be adjusted according to the needs of different projects. Users can create textures and materials according to their own naming rules. And attach them to the model to meet the needs of various projects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of automatic texture processing, and in particular to a method and system for automatic texture and material attachment processing. Background Art

[0002] In Unity, a material is a collection of properties that define the visual appearance of an object. Each material can contain one or more shaders, which define lighting, texture mapping, and other rendering effects. A shader is a program that describes how an object is rendered. Unity provides many built-in shaders and also supports custom shaders. A map is a 2D image that is used to cover the surface of a model to provide texture and details to the model. Unity supports various map types, including diffuse maps, normal maps, specular maps, and more. The diffuse map defines the basic color and texture of the object, the normal map is used to simulate surface details and bumps, and the specular map is used to define the highlight area of ​​the object.

[0003] Since the maps are divided into: main texture, normal, AO, roughness map, height map, etc., these maps need to be attached to the material, and there are a lot of these materials. It takes a lot of time for developers to attach the materials, and there is a possibility of attaching the wrong materials. If you want to correct the errors, you have to observe all the models with the naked eye, which will waste more development time. Summary of the invention

[0004] The purpose of this application is to solve the above technical problems and provide a method and system for automatically attaching textures and materials.

[0005] In some embodiments of the present application, by adding a first processing module to set the initial naming rules for textures and materials, and by adding a naming module, it supports user-defined naming specifications, which can be adjusted according to the needs of different projects. Users can create textures and materials according to their own naming rules and attach them to models to meet the needs of various projects.

[0006] In some embodiments of the present application, a second processing module is added to establish a corresponding material based on the texture selected by the user, and to set the attribute values ​​of the material, such as color and texture, according to the naming specification. The texture and the corresponding material are automatically processed by adding an attachment module, and the automatic texture compression parameter is set for the estimated memory usage of the texture, and the texture is automatically compressed to reduce the file size of the texture and improve the operation efficiency.

[0007] In some embodiments of the present application, a method for automatically attaching a texture and a material is provided, comprising:

[0008] Establish a texture database and a material database, and generate a texture-material association model;

[0009] Obtaining a texture calling instruction from a user, and generating a material to be called according to the texture calling instruction and the texture-material association model;

[0010] Setting the attachment model working parameters according to the texture calling instruction and all the material parameters to be called, and generating a preprocessing data packet;

[0011] A rendering model is established, and working parameters of the rendering model are set according to all preprocessed data including parameters.

[0012] In some embodiments of the present application, when establishing a texture database and a material database, it includes:

[0013] Generate the first-level feature labels for each map and establish a first-level map library;

[0014] Generate the first-level index tag for each material and establish a first-level material library;

[0015] Determine whether there is an update instruction;

[0016] If there is an update instruction, generate a secondary feature tag for each texture according to the update instruction, establish a secondary texture library, and set the secondary texture library as a texture database;

[0017] Generate a secondary index tag for each material according to the update instruction, establish a secondary material library, and set the secondary material library as a material database;

[0018] If there is no update command, set the first-level texture library as the texture database and the first-level material library as the material database;

[0019] Generate a texture-material mapping table according to the texture database and the material database;

[0020] Generate a texture-material association model based on the texture-material mapping table.

[0021] In some embodiments of the present application, the generating of the material to be called includes:

[0022] Generate a map sequence A according to the map call instruction, A=(a1,a2…an), where n is the number of called maps, and ai is the i-th called map;

[0023] A material sequence B is generated according to the texture sequence A and the texture-material association model, where B=(b1, b2…bn), wherein bi is the material corresponding to the i-th called texture.

[0024] In some embodiments of the present application, when setting the working parameters of the attachment model, it includes:

[0025] Obtain the available storage capacity C1;

[0026] Generate the required storage occupancy C2 according to the texture mapping sequence A;

[0027] Judge whether to generate a compression instruction according to the storage occupancy C2 and the available storage capacity C1;

[0028] If C1 < C2, generate a storage capacity difference d according to the storage occupancy C2 and the available storage capacity C1;

[0029] Preset the first storage capacity difference threshold D1;

[0030] When the storage capacity difference d is greater than the first storage capacity difference threshold D1, generate a first-level compression instruction; when the storage capacity difference d is less than the first storage capacity difference threshold D1, generate a second-level compression instruction.

[0031] In some embodiments of the present application, when judging whether to generate a compression instruction, it further includes:

[0032] If C1 > C2, generate feedback nodes according to the number of texture mappings n called, and set the expected storage occupancy C3 for each feedback node;

[0033] Obtain the real-time storage occupancy C4 according to the feedback node. If the real-time storage occupancy C4 of the current feedback node is less than the expected storage occupancy C3, no compression instruction is generated; if the real-time storage occupancy C4 of the current feedback node is greater than the expected storage occupancy C3, generate a third-level compression instruction.

[0034] In some embodiments of the present application, when generating feedback nodes, it includes:

[0035] Preset the first texture mapping number interval (N1, N2), the second texture mapping number interval (N2, N3), and the third texture mapping number interval (N3, N4);

[0036] Set the single processing amount ratio e according to the number of texture mappings n called;

[0037] If the number of texture mappings n called is in the first texture mapping number interval, set the single processing amount ratio e as the preset first processing amount ratio e1, that is, e = e1; if the number of texture mappings n called is in the second texture mapping number interval, set the single processing amount ratio e as the preset second processing amount ratio e2, that is, e = e2; if the number of texture mappings n called is in the third texture mapping number interval, set the processing amount ratio e as the preset third processing amount ratio e3, that is, e = e3;

[0038] Set feedback nodes according to the single processing amount ratio e.

[0039] In some embodiments of the present application, a system for automatically attaching textures and materials is provided, comprising:

[0040] The first processing module is used to establish a texture database and a material database, and generate a texture-material association model;

[0041] The naming module is used to obtain the user's naming rules and determine whether to generate an update instruction based on the naming rules;

[0042] The second processing module is used for the user's texture calling instruction, and generates the material to be called according to the texture calling instruction and the texture-material association model;

[0043] An attachment module, used for generating an attachment model, the attachment module is further used for setting attachment model working parameters according to the texture call instruction and all the material parameters to be called, and generating a pre-processing data packet;

[0044] The rendering module is used to establish a rendering model and set working parameters of the rendering model according to all pre-processed data including parameters.

[0045] In some embodiments of the present application, the first processing module is further used to:

[0046] Generate the first-level feature labels for each map and establish a first-level map library;

[0047] Generate the first-level index tag for each material and establish a first-level material library;

[0048] Determine whether there is an update instruction;

[0049] If there is an update instruction, generate a secondary feature tag for each texture according to the update instruction, establish a secondary texture library, and set the secondary texture library as a texture database;

[0050] Generate a secondary index tag for each material according to the update instruction, establish a secondary material library, and set the secondary material library as a material database;

[0051] If there is no update command, set the first-level texture library as the texture database and the first-level material library as the material database;

[0052] Generate a texture-material mapping table according to the texture database and the material database;

[0053] Generate a texture-material association model based on the texture-material mapping table.

[0054] In some embodiments of the present application, the second processing module is further used for:

[0055] Generate a texture sequence A according to the texture calling instruction, A = (a1, a2…an), where n is the number of called textures, and ai is the i-th called texture;

[0056] Generate a material sequence B according to the texture sequence A and the texture - material association model, B = (b1, b2…bn), where bi is the material corresponding to the i-th called texture.

[0057] In some embodiments of the present application, when setting the working parameters of the attachment model by the attachment module, it includes:

[0058] Obtain the available storage capacity C1;

[0059] Generate the required storage occupancy C2 according to the texture sequence A;

[0060] Judge whether to generate a compression instruction according to the storage occupancy C2 and the available storage capacity C1;

[0061] If C1 < C2, generate a storage difference d according to the storage occupancy C2 and the available storage capacity C1;

[0062] Preset a first storage difference threshold D1;

[0063] When the storage difference d is greater than the first storage difference threshold D1, generate a first - level compression instruction; when the storage difference d is less than the first storage difference threshold D1, generate a second - level compression instruction;

[0064] If C1 > C2, generate feedback nodes according to the number of called textures n, and set the expected storage occupancy C3 for each feedback node;

[0065] Obtain the real - time storage occupancy C4 according to the feedback nodes. If the real - time storage occupancy C4 of the current feedback node is less than the expected storage occupancy C3, do not generate a compression instruction; if the real - time storage occupancy C4 of the current feedback node is greater than the expected storage occupancy C3, generate a third - level compression instruction;

[0066] Among them, when generating feedback nodes, it includes:

[0067] Preset a first called texture number interval (N1, N2), a second called texture number interval (N2, N3), and a third called texture number interval (N3, N4);

[0068] Set the single - processing volume ratio e according to the number of called textures n;

[0069] If the number of called maps n is in the first interval of called maps, the single processing capacity ratio e is set to the preset first processing capacity ratio e1, that is, e=e1; if the number of called maps n is in the second interval of called maps, the single processing capacity ratio e is set to the preset second processing capacity ratio e2, that is, e=e2; if the number of called maps n is in the third interval of called maps, the processing capacity ratio e is set to the preset third processing capacity ratio e3, that is, e=e3;

[0070] The feedback node is set according to the single processing volume ratio e.

[0071] Compared with the prior art, the method and system for automatically attaching maps and materials in the embodiment of the present application have the following beneficial effects:

[0072] By adding the first processing module to set the initial naming rules for textures and materials, and by adding the naming module, users can customize the naming rules and adjust them according to the needs of different projects. Users can create textures and materials according to their own naming rules and attach them to models to meet the needs of various projects.

[0073] Notify the user to add a second processing module, create a corresponding material based on the texture selected by the user, and set the material's attribute values, such as color and texture, according to the naming convention. And automatically process the texture and the corresponding material by adding an attachment module, and set automatic texture compression parameters for the estimated memory usage of the texture, automatically compress the texture, reduce the texture file size, and improve operating efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] Figure 1 It is a flow chart of a method for automatically attaching textures and materials in a preferred embodiment of the present application. DETAILED DESCRIPTION

[0075] The specific implementation methods of the present application are further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present application but are not intended to limit the scope of the present application.

[0076] In the description of the present application, it should be understood that the terms "center", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.

[0077] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "plurality" means two or more.

[0078] In the description of this application, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0079] like Figure 1 As shown, a method for automatically attaching a texture and a material in a preferred embodiment of the present application includes:

[0080] S101: Establishing a texture database and a material database, and generating a texture-material association model;

[0081] S102: Obtaining a texture calling instruction from a user, and generating a material to be called according to the texture calling instruction and a texture-material association model;

[0082] S103: setting the attachment model working parameters according to the texture call instruction and all the material parameters to be called, and generating a pre-processing data packet;

[0083] S104: Establish a rendering model, and set working parameters of the rendering model according to all pre-processed data including parameters.

[0084] Specifically, the corresponding material is automatically created according to the texture call instruction, and the relevant texture is assigned to the corresponding material attribute. Use Unity's API to create materials, and set the material's attribute values, such as color, texture, etc., according to the naming convention. Attaching materials to the model can be achieved by assigning the material to the model's rendering module. The rendering module presets the rendering model, which includes multiple sub-rendering models. The specified material is assigned to the corresponding sub-rendering model according to the naming convention.

[0085] Specifically, when establishing a texture database and a material database, it includes:

[0086] Generate the first-level feature labels for each map and establish a first-level map library;

[0087] Generate the first-level index tag for each material and establish a first-level material library;

[0088] Determine whether there is an update instruction;

[0089] If there is an update instruction, generate the secondary feature labels of each texture according to the update instruction, establish a secondary texture library, and set the secondary texture library as a texture database;

[0090] Generate secondary index tags for each material according to the update instruction, establish a secondary material library, and set the secondary material library as a material database;

[0091] If there is no update command, set the first-level texture library as the texture database and the first-level material library as the material database;

[0092] Generate a texture-material mapping table according to the texture database and the material database;

[0093] Generate a texture-material association model based on the texture-material mapping table.

[0094] Specifically, the first-level feature label and the first-level index label are set according to the original naming rules, and the material corresponding to the map can be quickly established by setting the first-level feature label and the first-level index label.

[0095] Specifically, the update instruction means that after receiving the user's customized naming rules, the naming module generates an update instruction, and generates secondary feature tags and secondary index tags that are suitable for the current user according to the update instruction, so as to meet the needs of various projects.

[0096] Specifically, the texture-material mapping table establishes a texture-material association model based on the correspondence between the feature label of the texture and the miniature label of the material.

[0097] Specifically, when generating the material to be called, it includes:

[0098] Generate a map sequence A according to the map call instruction, A=(a1,a2…an), where n is the number of called maps, and ai is the i-th called map;

[0099] Generate a material sequence B according to the texture sequence A and the texture-material association model, B=(b1,b2…bn), where bi is the material corresponding to the i-th called texture.

[0100] Specifically, when generating the material array B, the material attribute parameters corresponding to each texture in the texture array A are set according to the texture-material association model, such as color, texture, etc.

[0101] In a preferred embodiment of the present application, when setting the working parameters of the attachment model, it includes:

[0102] Get the available storage capacity C1;

[0103] Generate the required storage occupancy C2 according to the texture mapping sequence A;

[0104] Judge whether to generate a compression instruction according to the storage occupancy C2 and the available storage C1;

[0105] If C1 < C2, generate the storage difference d according to the storage occupancy C2 and the available storage C1;

[0106] Preset the first storage difference threshold D1;

[0107] When the storage difference d is greater than the first storage difference threshold D1, generate a first-level compression instruction; when the storage difference d is less than the first storage difference threshold D1, generate a second-level compression instruction.

[0108] Specifically, the available storage C1 refers to the available memory that can be occupied generated according to the hardware parameters of the current device platform. The required storage occupancy refers to the memory required to attach the texture mapping and materials without compression processing.

[0109] Specifically, the first-level compression instruction means setting the memory threshold for a single texture mapping. When the texture mapping is attached to the corresponding material, if the actual memory occupancy is greater than the set memory threshold for a single texture mapping, texture compression processing is performed. The second-level compression instruction means performing texture compression processing on all texture mappings.

[0110] Specifically, when judging whether to generate a compression instruction, it also includes:

[0111] If C1 > C2, generate feedback nodes according to the number of texture mappings n called, and set the expected storage occupancy C3 for each feedback node;

[0112] Obtain the real-time storage occupancy C4 according to the feedback nodes. If the real-time storage occupancy C4 of the current feedback node is less than the expected storage occupancy C3, no compression instruction is generated; if the real-time storage occupancy C4 of the current feedback node is greater than the expected storage occupancy C3, generate a third-level compression instruction.

[0113] Specifically, the third-level compression instruction means performing texture compression processing on the remaining unprocessed texture mappings. By setting multi-level compression instructions, the texture mappings are automatically compressed, reducing the file size of the texture mappings and improving the operation efficiency.

[0114] Specifically, the real-time storage occupancy C4 refers to the memory occupancy of the texture mappings processed by the current feedback node.

[0115] Specifically, when generating feedback nodes, it includes:

[0116] Preset a first interval (N1, N2) of the number of tiles to be called, a second interval (N2, N3) of the number of tiles to be called, and a third interval (N3, N4) of the number of tiles to be called;

[0117] Set the single processing volume ratio e according to the number of called maps n;

[0118] If the number of called maps n is in the first interval of called maps, the single processing capacity ratio e is set to the preset first processing capacity ratio e1, that is, e=e1; if the number of called maps n is in the second interval of called maps, the single processing capacity ratio e is set to the preset second processing capacity ratio e2, that is, e=e2; if the number of called maps n is in the third interval of called maps, the processing capacity ratio e is set to the preset third processing capacity ratio e3, that is, e=e3;

[0119] The feedback node is set according to the single processing volume ratio e.

[0120] Specifically, whenever the proportion of completed processing volume reaches a preset single processing volume proportion e, a feedback node is generated, and the real-time storage occupancy C4 is obtained according to the feedback node, so as to dynamically adjust the attachment process of the map and material.

[0121] Based on another preferred embodiment of a method for automatically attaching a texture and a material in any of the above preferred embodiments, this preferred embodiment provides an automatic attachment processing system for a texture and a material, comprising:

[0122] The first processing module is used to establish a texture database and a material database, and generate a texture-material association model;

[0123] The naming module is used to obtain the user's naming rules and determine whether to generate an update instruction based on the naming rules;

[0124] The second processing module is used for the user's texture calling instruction, and generates the material to be called according to the texture calling instruction and the texture-material association model;

[0125] The attachment module is used to generate an attachment model. The attachment module is also used to set the attachment model working parameters according to the texture call instruction and all the material parameters to be called, and generate a pre-processing data packet;

[0126] The rendering module is used to establish a rendering model and set working parameters of the rendering model according to all pre-processed data including parameters.

[0127] Specifically, the first processing module is also used for:

[0128] Generate the first-level feature labels for each map and establish a first-level map library;

[0129] Generate the first-level index tags for each material and establish the first-level material library;

[0130] Determine whether there is an update instruction;

[0131] If there is an update instruction, generate the second-level feature tags for each texture map according to the update instruction, establish the second-level texture map library, and set the second-level texture map library as the texture map database;

[0132] Generate the second-level index tags for each material according to the update instruction, establish the second-level material library, and set the second-level material library as the material database;

[0133] If there is no update instruction, set the first-level texture map library as the texture map database and the first-level material library as the material database;

[0134] Generate a texture map - material mapping table according to the texture map database and the material database;

[0135] Generate a texture map - material association model according to the texture map - material mapping table.

[0136] Specifically, the second processing module is also used for:

[0137] Generate a texture map sequence A according to the texture map call instruction, A=(a1,a2…an), where n is the number of called texture maps and ai is the i-th called texture map;

[0138] Generate a material sequence B according to the texture map sequence A and the texture map - material association model, B=(b1,b2…bn), where bi is the material corresponding to the i-th called texture map.

[0139] In the preferred embodiment of this application, when the attachment module sets the working parameters of the attachment model, it includes:

[0140] Obtain the available storage capacity C1;

[0141] Generate the required storage capacity occupancy C2 according to the texture map sequence A;

[0142] Judge whether to generate a compression instruction according to the storage occupancy C2 and the available storage capacity C1;

[0143] If C1 < C2, generate a storage capacity difference d according to the storage occupancy C2 and the available storage capacity C1;

[0144] Preset the first storage capacity difference threshold D1;

[0145] When the storage capacity difference d is greater than the first storage capacity difference threshold D1, generate a first-level compression instruction; when the storage capacity difference d is less than the first storage capacity difference threshold D1, generate a second-level compression instruction;

[0146] If C1>C2, generate feedback nodes according to the number of called maps n, and set the expected storage occupancy C3 of each feedback node;

[0147] Acquire the real-time storage occupancy C4 according to the feedback node, if the real-time storage occupancy C4 of the current feedback node is less than the expected storage occupancy C3, do not generate a compression instruction; if the real-time storage occupancy C4 of the current feedback node is greater than the expected storage occupancy C3, generate a three-level compression instruction;

[0148] When generating a feedback node, it includes:

[0149] Preset a first interval (N1, N2) of the number of tiles to be called, a second interval (N2, N3) of the number of tiles to be called, and a third interval (N3, N4) of the number of tiles to be called;

[0150] Set the single processing volume ratio e according to the number of called maps n;

[0151] If the number of called maps n is in the first interval of called maps, the single processing capacity ratio e is set to the preset first processing capacity ratio e1, that is, e=e1; if the number of called maps n is in the second interval of called maps, the single processing capacity ratio e is set to the preset second processing capacity ratio e2, that is, e=e2; if the number of called maps n is in the third interval of called maps, the processing capacity ratio e is set to the preset third processing capacity ratio e3, that is, e=e3;

[0152] The feedback node is set according to the single processing volume ratio e.

[0153] According to the first concept of the present application, by adding a first processing module to set the initial naming rules for textures and materials, and by adding a naming module, it supports user-defined naming specifications, which can be adjusted according to the needs of different projects. Users can create textures and materials according to their own naming rules and attach them to models to meet the needs of various projects.

[0154] According to the second concept of the present application, a second processing module is added to establish a corresponding material based on the texture selected by the user, and to set the attribute values ​​of the material, such as color and texture, according to the naming specification. The texture and the corresponding material are automatically processed by adding an attachment module, and the automatic texture compression parameters are set for the estimated memory usage of the texture, and the texture is automatically compressed to reduce the file size of the texture and improve the operation efficiency.

[0155] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and substitutions can be made without departing from the technical principles of the present application. These improvements and substitutions should also be regarded as the scope of protection of the present application.

Claims

1. A method for automatically attaching textures and materials, characterized in that: Including: Establish a texture database and a material database, and generate a texture - material association model; Obtain the user's texture call instruction, and generate the material to be called according to the texture call instruction and the texture - material association model; Set the working parameters of the attachment model according to the texture call instruction and all the parameters of the material to be called, and generate a pre - processing data packet; Establish a rendering model, and set the working parameters of the rendering model according to all the pre - processing data including parameters; When establishing the texture database and the material database, including: Generate the first - level feature tags of each texture, and establish a first - level texture library; Generate the first - level index tags of each material, and establish a first - level material library; Judge whether there is an update instruction; If there is an update instruction, generate the second - level feature tags of each texture according to the update instruction, establish a second - level texture library, and set the second - level texture library as the texture database; Generate the second - level index tags of each material according to the update instruction, establish a second - level material library, and set the second - level material library as the material database; If there is no update instruction, set the first - level texture library as the texture database and the first - level material library as the material database; Generate a texture - material mapping table according to the texture database and the material database; Generate a texture - material association model according to the texture - material mapping table; When generating the material to be called, including: Generate a texture sequence A according to the texture call instruction, A=(a1,a2…an), where n is the number of called textures, and ai is the i - th called texture; Generate a material sequence B according to the texture sequence A and the texture - material association model, B=(b1,b2…bn), where bi is the material corresponding to the i - th called texture; When setting the working parameters of the attachment model, including: Obtain the available storage capacity C1; Generate the required storage occupancy C2 according to the texture sequence A; Judge whether to generate a compression instruction according to the storage occupancy C2 and the available storage capacity C1; If C1 < C2, generate a storage difference d according to the storage occupancy C2 and the available storage capacity C1; Preset a first storage difference threshold D1; When the storage difference d is greater than the first storage difference threshold D1, generate a first - level compression instruction; when the storage difference d is less than the first storage difference threshold D1, generate a second - level compression instruction; When judging whether to generate a compression instruction, it also includes: If C1 > C2, generate feedback nodes according to the number of called textures n, and set the expected storage occupancy C3 of each feedback node; Obtain the real - time storage occupancy C4 according to the feedback nodes. If the real - time storage occupancy C4 of the current feedback node is less than the expected storage occupancy C3, do not generate a compression instruction; if the real - time storage occupancy C4 of the current feedback node is greater than the expected storage occupancy C3, generate a third - level compression instruction.

2. The method for automatically attaching textures and materials as claimed in claim 1, characterized in that: When generating feedback nodes, including: Preset a first called texture number range (N1,N2), a second called texture number range (N2,N3), and a third called texture number range (N3,N4); Set the single - processing volume ratio e according to the number of called textures n; If the number of called texture maps n is within the first called texture map quantity range, set the single - processing quantity ratio e to the preset first processing quantity ratio e1, that is, e = e1; if the number of called texture maps n is within the second called texture map quantity range, set the single - processing quantity ratio e to the preset second processing quantity ratio e2, that is, e = e2; if the number of called texture maps n is within the third called texture map quantity range, set the processing quantity ratio e to the preset third processing quantity ratio e3, that is, e = e3; Set the feedback node according to the single - processing quantity ratio e.

3. A system for automatically attaching and processing textures and materials, using the method for automatically attaching and processing textures and materials as claimed in any one of claims 1 to 2, characterized in that: Including: The first processing module is used to establish a texture map database and a material database, and generate a texture map - material association model; The naming module is used to obtain the user's naming rule and judge whether to generate an update instruction according to the naming rule; The second processing module is used for the user's texture map call instruction, and generates the material to be called according to the texture map call instruction and the texture map - material association model; The attachment module is used to generate an attachment model. The attachment module is also used to set the working parameters of the attachment model according to the texture map call instruction and all the parameters of the material to be called, and generate a pre - processing data packet; The rendering module is used to establish a rendering model and set the working parameters of the rendering model according to all the pre - processing data including parameters; The first processing module is also used for: Generate the first - level feature tags of each texture map and establish a first - level texture map library; Generate the first - level index tags of each material and establish a first - level material library; Judge whether there is an update instruction; If there is an update instruction, generate the second - level feature tags of each texture map according to the update instruction, establish a second - level texture map library, and set the second - level texture map library as the texture map database; Generate the second - level index tags of each material according to the update instruction, establish a second - level material library, and set the second - level material library as the material database; If there is no update instruction, set the first - level texture map library as the texture map database and the first - level material library as the material database; Generate a texture map - material mapping table according to the texture map database and the material database; Generate a texture map - material association model according to the texture map - material mapping table; The second processing module is also used for: Generate a texture map sequence A according to the texture map call instruction, A=(a1,a2…an), where n is the number of called texture maps and ai is the i - th called texture map; Generate a material sequence B according to the texture map sequence A and the texture map - material association model, B=(b1,b2…bn), where bi is the material corresponding to the i - th called texture map; When the attachment module sets the working parameters of the attachment model, it includes: Obtain the available storage capacity C1; Generate the required storage occupancy C2 according to the texture map sequence A; Judge whether to generate a compression instruction according to the storage occupancy C2 and the available storage capacity C1; If C1 < C2, generate a storage quantity difference d according to the storage occupancy C2 and the available storage capacity C1; Preset the first storage quantity difference threshold D1; When the storage quantity difference d is greater than the first storage quantity difference threshold D1, generate a first - level compression instruction; when the storage quantity difference d is less than the first storage quantity difference threshold D1, generate a second - level compression instruction; If C1>C2, generate feedback nodes according to the number of called maps n, and set the expected storage occupancy C3 of each feedback node; Acquire the real-time storage occupancy C4 according to the feedback node, if the real-time storage occupancy C4 of the current feedback node is less than the expected storage occupancy C3, do not generate a compression instruction; if the real-time storage occupancy C4 of the current feedback node is greater than the expected storage occupancy C3, generate a three-level compression instruction; When generating a feedback node, it includes: Preset a first interval (N1, N2) of the number of tiles to be called, a second interval (N2, N3) of the number of tiles to be called, and a third interval (N3, N4) of the number of tiles to be called; Set the single processing volume ratio e according to the number of map calls n; If the number of called maps n is in the first interval of called maps, the single processing capacity ratio e is set to the preset first processing capacity ratio e1, that is, e=e1; if the number of called maps n is in the second interval of called maps, the single processing capacity ratio e is set to the preset second processing capacity ratio e2, that is, e=e2; if the number of called maps n is in the third interval of called maps, the processing capacity ratio e is set to the preset third processing capacity ratio e3, that is, e=e3; The feedback node is set according to the single processing volume ratio e.

Citation Information

Patent Citations

  • Material generation method and device

    CN111192353A

  • Texture map generation method and device and electronic equipment

    CN113838155A

  • Model training method, chartlet determination method, device and equipment

    CN115063645A

  • Three-dimensional graph rendering display method and device for product display

    CN116843816A

  • Map processing method and device, computer readable storage medium and electronic device

    CN116912388A