Texture processing method, device, equipment, computer readable storage medium and computer program product

CN123015785APending Publication Date: 2026-10-30SHENZHEN TENCENT NETWORK INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510559116.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

大纹理方案通过记录三维模型包围盒范围内的所有纹理信息来保证精度,要实现不同分辨率纹理渲染,需要在显存中加载多个大纹理,显存占用巨大,运行时帧率受影响;虚拟纹理方案通过将大纹理分割为分块并进行动态加载,但运行时动态加载分块会增加数据读写压力,同时也会加载包括无效数据的纹理,导致计算资源浪费

Benefits of technology

[0033]本申请通过将三维模型的初始纹理进行分块得到多个第一分块纹理,相较于第一分块纹理的分辨率,基于多个第一分块纹理,生成多个低分辨率的第二分块纹理,然后从多个第一分块纹理及多个第二分块纹理中,筛选得到包括有效数据的目标分块纹理,从而去除仅包括无效数据的无效分块纹理,可以有效减少纹理加载时中存储空间的占用,优化资源利用率。通过将目标分块纹理存储到物理纹理并记录索引纹理,能够在运行时快速查询和采样所需的多分辨率的纹理数据,减少动态加载的输入输出压力,提升运行效率,从而在保证纹理精度的同时,显著降低显存占用和运行时资源消耗。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123015785A_ABST
    Figure CN123015785A_ABST
Patent Text Reader

Abstract

The application provides a texture processing method, device, equipment, computer readable storage medium and computer program product; the method comprises: obtaining an initial texture of a three-dimensional model, and dividing the initial texture to obtain a plurality of first divided textures of the initial texture; based on the plurality of first divided textures, a plurality of second divided textures are generated, the resolution of the second divided texture is lower than the resolution of the first divided texture; from the plurality of first divided textures and the plurality of second divided textures, a target divided texture including effective data is screened, and the target divided texture is stored in a physical texture; the coordinates of the target divided texture in the physical texture are recorded to an index texture, and the index texture is used to query the coordinates of the target divided texture in the physical texture based on the texture coordinates of the three-dimensional model. Through the application, the memory occupation can be reduced, and the utilization rate of resources can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to computer technology, and more particularly to a method, apparatus, device, computer-readable storage medium, and computer program product for processing textures. Background Technology

[0002] In related technologies, texture processing solutions include large texture solutions and virtual texture solutions. Large texture solutions ensure accuracy by recording all texture information within the bounding box of a 3D model. To achieve texture rendering at different resolutions, multiple large textures need to be loaded into video memory, resulting in huge video memory consumption and affecting runtime frame rate. Virtual texture solutions divide large textures into blocks and load them dynamically, but dynamically loading blocks at runtime increases data read and write pressure and may also load textures containing invalid data, leading to a waste of computing resources. Summary of the Invention

[0003] This application provides a texture processing method, apparatus, device, computer-readable storage medium, and computer program product that can reduce video memory usage and improve resource utilization.

[0004] The technical solution of this application embodiment is implemented as follows:

[0005] This application provides a texture processing method, the method comprising:

[0006] Obtain the initial texture of the 3D model, and divide the initial texture into blocks to obtain multiple first block textures of the initial texture;

[0007] Based on the plurality of first block textures, a plurality of second block textures are generated, wherein the resolution of the second block textures is lower than the resolution of the first block textures;

[0008] From the plurality of first block textures and the plurality of second block textures, a target block texture including valid data is selected and stored in the physical texture;

[0009] The coordinates of the target block texture in the physical texture are recorded to an index texture, which is used to query the coordinates of the target block texture in the physical texture based on the texture coordinates of the 3D model.

[0010] This application provides a texture processing apparatus, the apparatus comprising:

[0011] The segmentation module is used to obtain the initial texture of the 3D model and segment the initial texture into multiple first segment textures of the initial texture.

[0012] A generation module is used to generate multiple second block textures based on the multiple first block textures, wherein the resolution of the second block textures is lower than the resolution of the first block textures;

[0013] The filtering module is used to filter out target block textures containing valid data from the plurality of first block textures and the plurality of second block textures, and store the target block textures into physical textures;

[0014] The recording module is used to record the coordinates of the target block texture in the physical texture to an index texture, and the index texture is used to query the coordinates of the target block texture in the physical texture based on the texture coordinates of the three-dimensional model.

[0015] In the above scheme, the multiple first block textures have the same size. The generation module is further configured to construct a quadtree with the size of the initial texture as the root node and the size of the first block textures as the leaf nodes; store the multiple first block textures in the leaf nodes of the quadtree; and generate second block textures corresponding to the non-leaf nodes at each level of the quadtree based on the leaf nodes; wherein the resolution of the second block textures corresponding to the non-leaf nodes at different levels is different.

[0016] In the above scheme, the generation module is further configured to, based on the first block texture corresponding to the leaf node, traverse the quadtree layer by layer upwards from the parent node of the leaf node to the root node; during the traversal, perform the following operations for each non-leaf node that is the parent node in each level: perform linear filtering on the first block texture corresponding to each child node included in the non-leaf node to obtain the second block texture corresponding to the non-leaf node.

[0017] In the above scheme, the texture processing device further includes: an update module, used to obtain the brush texture of the three-dimensional model drawn by a brush after generating the second block texture corresponding to the non-leaf nodes of each level in the quadtree; to divide the brush texture into blocks based on the size of the first block texture to obtain at least one third block texture; to update the block texture corresponding to each node of the quadtree based on the at least one third block texture; the filtering module is further used to filter out target block textures including valid data from the updated block textures corresponding to each node of the quadtree.

[0018] In the above scheme, the update module is further configured to cache each of the third block textures into nodes of the corresponding resolution in the quadtree based on the resolution of the third block texture; starting from the root node of the quadtree, traverse downwards layer by layer, and perform the following operations for each level of nodes: if the node is a root node and the node includes the third block texture, then replace the second block texture in the node with the third block texture, and use the third block texture as the block texture of the node; if the node is an intermediate node and the node includes the third block texture, then replace the second block texture in the node with the third block texture, and merge the third block texture with the block texture of the node's parent node to obtain the block texture of the node; if the node is a leaf node and the node includes the third block texture, then merge the second block texture with the third block texture to obtain a merged texture, and merge the block texture of the node's parent node with the merged texture to obtain the block texture of the node.

[0019] In the above scheme, the texture processing device further includes: an extension module, used to perform the following processing for each first block texture after dividing the initial texture into blocks to obtain multiple first block textures of the initial texture: determining the adjacent block textures of the first block texture; and performing edge extension on the first block texture based on the resolution of the adjacent block textures to obtain a first block texture carrying edge pixels.

[0020] In the above scheme, the extension module is further configured to, when the resolution of the adjacent block texture is the same as the resolution of the first block texture, obtain the adjacent pixels of the first block texture in the adjacent block texture; copy the adjacent pixels, and add the adjacent pixels as edge pixels to the edge of the first block texture.

[0021] In the above scheme, the extension module is further configured to: obtain the world coordinates of the edge pixels of the first block texture when the resolution of the adjacent block texture is different from the resolution of the first block texture; map the world coordinates to the texture coordinates of the adjacent block texture; sample the adjacent block texture based on the texture coordinates; and add the sampled pixels as edge pixels to the edge of the first block texture.

[0022] In the above scheme, the filtering module is further configured to identify invalid block textures from the plurality of first block textures and the plurality of second block textures, wherein the invalid block texture is a block texture that does not include the valid data; and to remove the invalid block textures from the plurality of first block textures and the plurality of second block textures to obtain the target block texture that includes the valid data.

[0023] In the above scheme, the filtering module is further configured to perform the following operations for each of the plurality of first block textures and the plurality of second block textures when the invalid block texture includes duplicate block textures: comparing the block texture with other block textures to obtain comparison results; determining duplicate block textures that are the same as the block texture from the plurality of first block textures and the plurality of second block textures based on the comparison results; and deduplicating the block textures and the duplicate block textures to obtain target block textures that include valid data.

[0024] In the above scheme, the filtering module is further configured to perform the following operations for each of the plurality of first block textures and the plurality of second block textures when the invalid block texture includes a blank block texture: perform pixel-by-pixel detection on the block texture to obtain the channel value of each pixel in the block texture; when the channel value of each pixel in the block texture is a default value, determine the block texture as the blank block texture; remove the blank block texture from the plurality of first block textures and the plurality of second block textures to obtain a target block texture including valid data.

[0025] In the above scheme, the texture processing device further includes: a creation module, used to determine the number of target block textures before storing the target block textures into physical textures; and to create a blank physical texture based on the number and the size of the target block textures, wherein the size of the physical texture is adapted to the sum of the sizes of the number of target block textures.

[0026] In the above scheme, the texture processing device further includes: a sampling module, used to record the coordinates of the target block texture in the physical texture to the index texture, and then, based on the texture coordinates of the three-dimensional model, sample the index texture to obtain the coordinates of the target block texture in the physical texture; and based on the coordinates in the physical texture, sample the physical texture to obtain the texture of the three-dimensional model.

[0027] This application provides an electronic device, including:

[0028] Memory is used to store executable instructions or computer programs.

[0029] The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the texture processing method provided in the embodiments of this application.

[0030] This application provides a computer-readable storage medium storing computer-executable instructions or computer programs for implementing the texture processing method provided in this application when executed by a processor.

[0031] This application provides a computer program product, including computer-executable instructions or a computer program, which, when executed by a processor, implements the texture processing method provided in this application.

[0032] The embodiments of this application have the following beneficial effects:

[0033] This application divides the initial texture of a 3D model into multiple first-block textures. Based on the resolution of these first-block textures, multiple low-resolution second-block textures are generated. Then, from these first and second-block textures, a target block texture containing valid data is selected, thus removing invalid block textures containing only invalid data. This effectively reduces storage space usage during texture loading and optimizes resource utilization. By storing the target block texture on a physical texture and recording an index texture, the required multi-resolution texture data can be quickly queried and sampled at runtime, reducing the input / output pressure of dynamic loading and improving operational efficiency. This significantly reduces memory usage and runtime resource consumption while maintaining texture accuracy. Attached Figure Description

[0034] Figure 1 This is a schematic diagram of the structure of the texture processing system provided in the embodiments of this application;

[0035] Figure 2 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;

[0036] Figure 3 This is a first flowchart illustrating the texture processing method provided in the embodiments of this application;

[0037] Figure 4 This is a schematic diagram of texture segmentation provided in an embodiment of this application;

[0038] Figure 5 This is a schematic diagram of the second process of the texture processing method provided in the embodiments of this application;

[0039] Figure 6 This is a schematic diagram of the quadtree structure provided in an embodiment of this application;

[0040] Figure 7 This is a schematic diagram of the third process of the texture processing method provided in the embodiments of this application;

[0041] Figure 8 This is a schematic diagram of adjacent block textures provided in an embodiment of this application;

[0042] Figure 9 This is a schematic diagram of adjacent pixels provided in an embodiment of this application;

[0043] Figure 10 This is a schematic diagram of the fourth process of the texture processing method provided in the embodiments of this application;

[0044] Figure 11 This is a schematic diagram of the fifth process of the texture processing method provided in the embodiments of this application;

[0045] Figure 12 This is a schematic diagram of the initial texture provided in an embodiment of this application;

[0046] Figure 13 This is a schematic diagram of the index texture provided in the embodiments of this application;

[0047] Figure 14 This is a schematic diagram of the physical texture provided in the embodiments of this application. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0049] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0050] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0051] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0052] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.

[0053] In the implementation of this application, the collection and processing of relevant data should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.

[0054] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.

[0055] 1) In response to, used to indicate the conditions or states on which the operation performed depends. When the conditions or states on which it depends are met, one or more operations performed may be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations are performed.

[0056] 2) Client, also known as user terminal, refers to the program that provides local services to users in contrast to the server. Except for some applications that can only run locally, it is generally installed on the terminal and needs to work in conjunction with the server. That is, there needs to be a corresponding server and service program on the network to provide the corresponding services. Thus, a specific communication connection needs to be established between the client and the server to ensure the normal operation of the application, such as virtual scene clients (such as game clients) and video clients.

[0057] 3) A 3D model is a polygonal representation of an object in geometric space, typically displayed using a computer or other devices. The displayed object can be a real-world entity or a fictional object. 3D models are usually generated using 3D modeling tools, and can be overlaid with textures. A texture is a 2D image, and textures can make the 3D model more detailed and realistic.

[0058] 4) Graphics Processing Unit (GPU), also known as display core, visual processor, or display chip, is a specialized unit used in personal computers, game consoles, and mobile devices (such as tablets and smartphones).

[0059] 5) Textures are two-dimensional images used to enhance the surface details of 3D models. They increase visual complexity and realism by mapping onto the 3D model surface. Textures can be colors, patterns, images, etc., used to define the visual characteristics of the model surface, such as color, gloss, transparency, and reflectivity. Textures are associated with the geometric data of the model surface through texture coordinates, allowing corresponding pixel values ​​to be sampled from the texture image based on these coordinates during rendering, thus presenting rich details on the model surface. Common texture types include color textures, normal textures, height textures, and reflection textures, each used for different rendering effects and simulations of surface properties.

[0060] During the research process, the inventors discovered the following technical problems in the relevant technology:

[0061] In related technologies, texture processing solutions include large texture solutions and virtual texture solutions. Large texture solutions ensure accuracy by recording all texture information within the bounding box of a 3D model. To achieve texture rendering at different resolutions, multiple large textures need to be loaded, resulting in huge memory consumption and affecting runtime frame rate. Virtual texture solutions divide large textures into small tiles and load them dynamically. However, dynamically loading tiles at runtime increases data read / write pressure and may also load invalid texture information, leading to a waste of computing resources.

[0062] Based on this, embodiments of this application provide a texture processing method, apparatus, device, computer-readable storage medium, and computer program product, which can reduce video memory usage and improve resource utilization.

[0063] The following describes the application scenarios of the texture processing method provided in the embodiments of this application. The embodiments of this application provide a texture processing method, apparatus, device, computer-readable storage medium, and computer program product, which can be applied to various scenarios. Examples are given below.

[0064] In some embodiments, the above texture processing method can be applied to virtual scenes, such as water rendering in open-world games. In open-world game water rendering, the water body is vast and rich in detail, but there are areas that players cannot reach or areas without water. By acquiring the initial texture of the water body and dividing it into blocks according to geographical distribution, multiple block textures (first block textures) of the initial water body texture are obtained. Block textures of different resolutions (second block textures) are generated. Target blocks (target block textures) that are visible to the player and contain water features are selected and stored in the physical texture, while the coordinates in the index texture are recorded. At runtime, the index texture is used to quickly query and sample, ensuring high-precision details of the water body within the field of view, while reducing video memory usage and improving rendering efficiency.

[0065] In some embodiments, the above-described texture processing method can also be applied to real-world scenarios, such as the digital preservation and display of cultural heritage. In the digital preservation of cultural heritage, high-precision 3D modeling and texture recording of ancient buildings are required. However, these models often contain a large amount of detail, resulting in massive texture data. By acquiring the initial texture of the ancient building (3D model) and dividing it into blocks, multiple first block textures are obtained. Then, second block textures with lower resolution are generated based on these first block textures. Target block textures containing valid data are selected from these block textures and stored in the physical texture. Simultaneously, the coordinates of the target block textures in the physical texture are recorded in the index texture. During the display process, based on the viewer's perspective and interaction needs, the index texture is used to quickly query and sample the position of the target block in the physical texture. This ensures the detailed display of cultural heritage while optimizing storage and rendering efficiency, supporting the smooth display and interaction of large-scale cultural heritage models.

[0066] In some embodiments, the texture processing method described above can be applied to medical visualization and surgical simulation. In the medical field, the texture details of 3D models, such as human organs, are crucial for diagnosis and surgical simulation. By segmenting the initial texture, different resolution segmented textures (first segmented texture and second segmented texture) are generated, and target segmented textures containing valid data are selected for storage and indexing. During medical visualization, based on the doctor's perspective and operational needs, texture segments of corresponding resolutions are sampled using indexed textures to ensure clear details at different viewing angles and magnifications, while optimizing storage and rendering resources to support efficient and accurate medical diagnosis and surgical simulation training.

[0067] It should be noted that, in addition to the above-mentioned application scenarios, the texture processing method provided in this application can also be widely applied to other scenarios to meet the diverse needs of different user groups, and this application does not impose any restrictions.

[0068] See Figure 1 , Figure 1This is a schematic diagram of the structure of the texture processing system provided in the embodiments of this application. Figure 1 The texture processing system 100 shown is configured to support a texture processing application. Terminal 400 is connected to server 200 via network 300, which can be a wide area network, a local area network, or a combination of both.

[0069] Terminal 400 is used to respond to user operations on the client by sending a texture processing request to server 200 via network 300.

[0070] Server 200 is used to respond to texture processing requests, obtain the initial texture of the 3D model, and divide the initial texture into blocks to obtain multiple first block textures of the initial texture. Based on the multiple first block textures, multiple second block textures are generated. The resolution of the second block textures is lower than that of the first block textures. From the multiple first block textures and multiple second block textures, a target block texture containing valid data is selected and stored in the physical texture. The coordinates of the target block texture in the physical texture are recorded in the index texture. The index texture is used to query the coordinates of the target block texture in the physical texture based on the texture coordinates of the 3D model.

[0071] In other embodiments, the texture processing method provided by the present invention can also be implemented independently by a terminal. A client capable of implementing the texture processing method is installed on the terminal. When a user requests texture processing in the client, the client obtains the initial texture of the three-dimensional model and divides the initial texture into blocks to obtain multiple first block textures of the initial texture. Based on the multiple first block textures, multiple second block textures are generated. The resolution of the second block textures is lower than that of the first block textures. From the multiple first block textures and the multiple second block textures, a target block texture including valid data is selected and stored in the physical texture. The coordinates of the target block texture in the physical texture are recorded in the index texture. The index texture is used to query the coordinates of the target block texture in the physical texture based on the texture coordinates of the three-dimensional model.

[0072] The client running on the terminal can also embed texture processing plugins to implement texture processing methods locally on the client. For example, after receiving a texture processing request, the terminal obtains the initial texture of the 3D model and divides the initial texture into blocks, resulting in multiple first block textures. Based on these first block textures, multiple second block textures are generated, with the resolution of the second block textures being lower than that of the first block textures. From the multiple first block textures and the multiple second block textures, a target block texture containing valid data is selected and stored in the physical texture. The coordinates of the target block texture in the physical texture are recorded in the index texture. The index texture is used to query the coordinates of the target block texture in the physical texture based on the texture coordinates of the 3D model.

[0073] In some embodiments, server 200 may be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Terminal 400 may be a smartphone, tablet, laptop, desktop computer, set-top box, smart voice interaction device, smart home appliance, virtual reality device, vehicle terminal, aircraft, portable music player, personal digital assistant, dedicated messaging device, portable gaming device, smart speaker, and smartwatch, but is not limited thereto. Terminals and servers can be directly or indirectly connected via wired or wireless communication, which is not limited in this embodiment.

[0074] The electronic device implementing the texture processing method provided in the embodiments of this application will now be described. See also Figure 2 , Figure 2 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. In practical applications, the electronic device can be implemented as various types of terminals such as laptops, tablets, desktop computers, smartphones, smart speakers, smartwatches, smart TVs, and vehicle terminals. It can also be implemented as a server or as a device cluster composed of servers and terminals. Figure 2 The illustrated electronic device includes at least one processor 510, a memory 550, at least one network interface 520, and a user interface 530. The various components of the electronic device are coupled together via a bus system 540. It is understood that the bus system 540 is used to implement communication between these components. In addition to a data bus, the bus system 540 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in… Figure 2The general labeled all buses as Bus System 540.

[0075] The processor 510 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0076] User interface 530 includes one or more output devices 531 that enable the presentation of media content, including one or more speakers and / or one or more visual displays. User interface 530 also includes one or more input devices 532, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0077] The memory 550 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 550 may optionally include one or more storage devices physically located away from the processor 510.

[0078] The memory 550 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 550 described in this application embodiment is intended to include any suitable type of memory.

[0079] In some embodiments, memory 550 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.

[0080] Operating system 551 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, and driver layer, for implementing various basic business functions and handling hardware-based tasks.

[0081] The network communication module 552 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 520, exemplary network interfaces 520 including Bluetooth, WiFi, and Universal Serial Bus (USB).

[0082] Presentation module 553 enables the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 531 (e.g., a display screen, a speaker, etc.) associated with user interface 530.

[0083] The input processing module 554 is used to detect one or more user inputs or interactions from one or more input devices 532, and to translate the detected inputs or interactions.

[0084] In some embodiments, the texture processing apparatus provided in this application can be implemented in software. Figure 2 A texture processing apparatus 555 stored in memory 550 is shown. This apparatus can be software in the form of programs and plugins, and includes the following software modules: a chunking module 5551, a generation module 5552, a filtering module 5553, and a recording module 5554. These modules are logically linked and can therefore be arbitrarily combined or further subdivided according to their implemented functions. The functions of each module will be described below.

[0085] In other embodiments, the apparatus provided in this application can be implemented in hardware. As an example, the texture processing apparatus provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the texture processing method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0086] In some embodiments, the terminal or server can implement the texture processing method provided in this application by running a computer program. For example, the computer program can be a native program or software module in an operating system; it can be a native application (APP), i.e., a local client, i.e., a program that needs to be installed in the operating system to run, such as an instant messaging APP or a web browser APP; it can also be a mini-program, i.e., a program that only needs to be downloaded into a browser environment to run; or it can be a mini-program that can be embedded in any APP. In short, the above-mentioned computer program can be any form of client, module, or plugin.

[0087] Below, based on the electronic device and system provided in the embodiments of this application, the texture processing method provided in the embodiments of this application will be described.

[0088] See Figure 3 , Figure 3 This is a first flowchart illustrating the texture processing method provided in this application embodiment. In practical applications, this method can be implemented by the terminal or server alone, or by the terminal and server working together. The following example uses a terminal implementation and will be combined with... Figure 3 The steps shown illustrate the texture processing method provided in the embodiments of this application.

[0089] In step 101, the initial texture of the 3D model is obtained, and the initial texture is divided into blocks to obtain multiple first block textures of the initial texture.

[0090] Here, a 3D model refers to an object that needs to be rendered with texture mapping to show surface details. A 3D model can be various natural and man-made elements, such as water bodies, mountains, vegetation, and terrain; it can also be buildings, roads, decorations, furniture, etc. The initial texture covering the surface of a 3D model is a rectangular image that records the surface features of the object. A 3D model is a three-dimensional model composed of geometric elements such as points, lines, and surfaces, used to simulate real or fictional objects and scenes, such as water bodies, buildings, and terrain in games.

[0091] It's important to note that 3D models in 3D scenes exhibit sparsity, primarily manifested in the distribution of textures. Only certain regions within the texture contain valid data, while the remainder is invalid. Valid data refers to the portions of the 3D model texture that contain actual visual information or details required for rendering; this data directly impacts the rendering result. For example, a water texture contains areas with information such as water surface height, ground height, and water flow direction—data crucial for accurately rendering water effects. Valid data is sampled and used during rendering to ensure the final visual effect meets design requirements. Invalid data refers to portions of the 3D model texture that contain no actual visual information or details required for rendering, including repetitive texture blocks or completely blank areas. This data contributes nothing to the rendering result, only increasing storage and processing burdens without improving rendering quality. Examples include blank areas outside water bodies in a water texture, or redundant data areas due to high texture precision requirements. These areas are not sampled during rendering and can therefore be discarded to reduce storage space and video memory usage.

[0092] The initial texture of a 3D model refers to the texture pre-generated during the 3D model rendering process. The initial texture includes all texture information within the bounding box of the 3D model, including key information such as the height of the 3D model's surface and ground level. It is used to adjust the vertex height of the 3D model mesh during rendering to achieve accurate 3D model representation. Unlike runtime dynamic generation, the initial texture is generated through editor preprocessing. The resolution of the initial texture can be set very high to ensure that the 3D model mesh exhibits higher accuracy at runtime. Since the vertex precision of the runtime 3D model mesh is usually higher than that of the initial texture, increasing the resolution of the initial texture can effectively improve the performance accuracy of the 3D model mesh while reducing the resource consumption of runtime texture generation.

[0093] For example, in 3D model rendering, for a terrain model containing mountains, valleys, and plains, the initial texture pre-records information such as the height of the mountains, the depth of the valleys, and the undulations of the plains. During rendering, the 3D model mesh adjusts its vertex heights based on this initial texture, making the mountains appear more majestic, the valleys more profound, and the plains more flat. Because the initial texture is pre-generated in the editor, its resolution can be set very high. This allows the 3D model mesh to present more realistic terrain features at runtime based on this high-precision information, while avoiding the additional computational burden of dynamically generating textures at runtime.

[0094] It should be noted that the size of the block is the same as the size of the first block texture. It can be preset according to specific application requirements. Dividing the initial texture into blocks to obtain multiple first block textures of the initial texture means that the initial texture is evenly divided according to the preset block size, that is, the size of the first block texture, to obtain multiple first block textures of the same size. Each block texture is a sub-region of the initial texture, containing surface information of a specific part of the 3D model.

[0095] As an example, see Figure 4 , Figure 4 This is a schematic diagram of texture segmentation provided in the embodiment of this application. The initial texture 401 is 512×512 pixels in size. The initial texture 401 will be evenly divided into four first segment textures of the same size, namely first segment texture 402, first segment texture 403, first segment texture 404 and first segment texture 405, each of which is 256×256 pixels in size.

[0096] In step 102, multiple second block textures are generated based on multiple first block textures.

[0097] In some embodiments, multiple first-segment textures have the same size; see corresponding examples. Figure 5 , Figure 5This is a second flowchart illustrating the texture processing method provided in this application embodiment. Multiple second-block textures are generated based on multiple first-block textures, which can be achieved by constructing a quadtree. Specifically, this can be achieved through steps 1021 to 1022, as detailed below.

[0098] In step 1021, a quadtree is constructed with the size of the initial texture as the root node and the size of the first segment texture as the leaf node.

[0099] Here, the root node of the quadtree represents the entire range of the initial texture, indicating its full size and storing the original texture. Each leaf node of the quadtree represents the size of the first chunk texture, storing the smallest texture unit after partitioning, i.e., the first chunk texture. For example, if the initial texture size is 1024×1024 pixels and the chunk size is 256×256 pixels, then the initial texture will be divided into four first chunk textures, with each leaf node storing one 256×256 pixel first chunk texture.

[0100] As an example, see Figure 6 , Figure 6 This is a schematic diagram of the quadtree structure provided in the embodiment of this application. The root node is 610 with the size of the initial texture 601 of the 3D model, and the leaf nodes are the sizes of the first block textures 602, 603, 604, and 605. The root node 610 stores the original texture 601, the leaf node 606 stores the first block texture 602, the leaf node 607 stores the first block texture 603, the leaf node 608 stores the first block texture 604, and the leaf node 609 stores the first block texture 605.

[0101] In step 1022, multiple first block textures are stored in the leaf nodes of the quadtree, and based on the leaf nodes, second block textures corresponding to the non-leaf nodes at each level of the quadtree are generated.

[0102] Here, the resolution of the second texture chunk is lower than that of the first texture chunk. The resolution of the second texture chunk varies depending on the level of the non-leaf nodes. The second texture chunk corresponds to non-leaf nodes, including the root node and intermediate nodes. Texture resolution refers to the number of pixels in the texture image, expressed as the pixel values ​​of its width and height. Texture resolution determines the level of detail; higher resolution allows for richer detail and more refined rendering. Conversely, lower resolution results in less detail and a blurrier image. High-resolution textures are suitable for close-up observation or high-precision rendering, while low-resolution textures are used for long-distance observation or performance optimization, reducing memory usage and rendering time.

[0103] In some embodiments, generating the second block texture corresponding to the non-leaf nodes at each level of the quadtree based on the leaf nodes can be achieved by traversing the quadtree layer by layer upwards from the parent node of the leaf node, performing linear filtering on the parent nodes at each level, and generating the corresponding low-resolution texture. Specifically, this can be implemented as follows: based on the first block texture corresponding to the leaf node, starting from the parent node of the leaf node of the quadtree, traversing the quadtree layer by layer upwards until the root node, and performing the following operations for the non-leaf nodes that are parent nodes at each level: performing linear filtering on the first block texture corresponding to each child node included in the non-leaf node to obtain the second block texture corresponding to the non-leaf node.

[0104] Here, the parent node of a leaf node is the lowest non-leaf node level in the quadtree. Traversing upwards level by level to the root node ensures that when each parent node is processed, all its child nodes have already completed texture generation. Thus, child nodes have higher resolution and are generated before their parent nodes. Linear filtering, used to generate low-resolution textures, is a technique that calculates target pixel values ​​through weighted averaging. Its core is to use preset weights to linearly combine the input signal, such as image pixels, to achieve operations such as smoothing, downsampling, or interpolation. The result satisfies the principle of linear superposition. Linear filtering includes bilinear interpolation, averaging filtering, and Gaussian filtering.

[0105] As an example, taking an initial texture size of 1024×1024 pixels and a block size of 256×256 pixels as an illustration, the initial texture is divided into four 256×256 pixel first block textures. Each leaf node stores one first block texture. Starting from the parent node of a leaf node, linear filtering is performed on the first block textures corresponding to the four child nodes (leaf nodes) of each parent node, generating a 128×128 pixel second block texture. Continuing upwards to the grandparent node, linear filtering is performed on the second block textures corresponding to the four child nodes (first-level non-leaf nodes) of each grandparent node, generating a 64×64 pixel second block texture. Finally, reaching the root node, linear filtering is performed on the second block textures corresponding to the four child nodes (second-level non-leaf nodes) of the root node, generating a texture of the lowest resolution, such as 16×16 pixels. Ultimately, each level of the quadtree stores texture data of different resolutions, supporting multi-level detail rendering requirements. Low-resolution textures are used for viewing at a distance, while high-resolution textures are used for viewing at close range, thereby optimizing rendering performance and video memory usage.

[0106] Thus, by traversing upwards from the parent node of a leaf node and performing linear filtering, a hierarchical generation of multi-level textures is achieved. The second block texture of each non-leaf node is essentially a generalized compression of the high-resolution details of its child nodes, preserving the overall shape while reducing the amount of data by halving the resolution. This process is deeply bound to the hierarchical structure of the quadtree, providing a complete framework for subsequent edge pixel addition, invalid data removal, and physical texture construction. The target block texture, including valid data, is obtained by filtering from the block textures corresponding to each node of the updated quadtree.

[0107] In some embodiments, after generating the second block textures corresponding to the non-leaf nodes at each level of the quadtree, the brush texture of the 3D model drawn with a brush is obtained, and it is divided into at least one (or more) third block textures according to the size of the first block texture, and then the block textures of each node of the quadtree are updated using these third block textures. Specifically, the brush texture of the 3D model drawn with a brush is obtained; based on the size of the first block texture, the brush texture is divided into blocks to obtain at least one third block texture; based on the at least one third block texture, the block textures corresponding to each node of the quadtree are updated. Correspondingly, the target block texture including valid data can be selected from multiple first block textures and multiple second block textures, which can be achieved by selecting the target block texture including valid data from the block textures corresponding to each node of the updated quadtree.

[0108] Here, brush textures for 3D models refer to textures drawn by users (such as artists) in the editor using brush tools. These textures are used to add high-precision detail information to the surface of 3D models. The detail information can be the height, color, normals, etc. of the 3D model, aiming to enhance the visual effect of the 3D model.

[0109] It's important to note that each drawn element is stored in a separate brush texture. These brush textures are cached in the editor. Whenever a new brush texture is applied, it's blended with existing ones to maintain texture integrity and consistency. To integrate the brush textures into the quadtree structure, they are divided into third-level textures, each the same size as the first texture. Depending on the resolution of these third-level textures, they are stored in either a leaf node or an intermediate node of the quadtree. The quadtree structure is updated layer by layer to ensure that the textures of each node are consistent with the latest brush texture. The resolution of the third-level texture can be the same as the resolution of a leaf node or an intermediate node, depending on the user's settings.

[0110] In this way, the brush texture of the 3D model drawn with a brush is obtained, and it is divided into third-level textures based on the size of the first-level texture. The textures of each node in the quadtree can be dynamically updated. The brush drawing content can be integrated into the texture in real time without regenerating the entire texture, improving editing efficiency. The segmentation process allows the brush texture to be loaded into different levels of the quadtree as needed, supporting multi-level detail rendering and optimizing memory usage and rendering performance. The high-precision details of the brush texture can be efficiently integrated into the quadtree, ensuring that the details drawn by the artists are presented during rendering, improving the final visual effect. The segmented brush texture can be stored in the leaf nodes or intermediate nodes of the quadtree as needed, supporting different precision rendering requirements and adapting to various scenarios. This not only improves the efficiency of texture updates but also ensures high-quality rendering and performance optimization.

[0111] In some embodiments, updating the block texture corresponding to each node of the quadtree based on at least one third block texture can be achieved in the following way: based on the resolution of the third block texture, each third block texture is cached in the node of the corresponding resolution in the quadtree; starting from the root node of the quadtree, traverse downwards layer by layer, and perform the following operations for each level of node: if the node is the root node and the node includes a third block texture, then replace the second block texture in the node with the third block texture, and use the third block texture as the block texture of the node; if the node is an intermediate node and the node includes a third block texture, then replace the second block texture in the node with the third block texture, and merge the third block texture with the block texture of the node's parent node to obtain the block texture of the node; if the node is a leaf node and the node includes a third block texture, then merge the second block texture with the third block texture to obtain a merged texture, and merge the block texture of the node's parent node with the merged texture to obtain the block texture of the node.

[0112] Here, the third-level texture is obtained by dividing the brush texture into blocks. The resolution of each third-level texture determines its storage location in the quadtree, and its resolution is strictly consistent with the resolution of a node at a certain level in the quadtree. According to the resolution matching principle, each third-level texture is precisely cached in a node with the same resolution in the quadtree. High-resolution third-level textures are cached in the leaf nodes of the quadtree, while low-resolution third-level textures are cached in the middle nodes or the root node.

[0113] The process of fusing the third-level texture with the parent node's texture to obtain the node's texture involves merging the third-level texture with one-quarter of the parent node's texture. This can be achieved using a linear interpolation algorithm, which weights the parent node's texture with the current node's third-level texture to generate an intermediate node texture that retains both global trends and local features. For example, if the parent node texture defines the overall water flow from west to east, while the third-level texture adds counter-clockwise vortices in local areas, the merged texture of this intermediate node maintains the main eastward water flow while overlaying brush rotation details in the vortex areas. This ensures that mid-range rendering captures both the macroscopic flow direction and the microscopic changes in brush design, avoiding detail gaps caused by differences in layer resolution.

[0114] The second and third segmented textures are blended to obtain a merged texture. This is achieved through specific algorithms, such as linear interpolation, color overlay, or maximum value optimization, performing pixel-level blending to generate a merged texture that simultaneously contains basic form and creative details. For example, the second segmented texture defines the overall smooth undulation of the water surface, while the third segmented texture adds 0.3-meter wave protrusions in local areas. During blending, an additive operation of the base height plus brush offset is used, preserving the overall undulating trend of the water surface while highlighting the details of the wave drawn by the brush. Similarly, merging the segmented texture of a node's parent node with the merged texture results in a node's segmented texture, which is obtained by merging one-quarter of the parent node's segmented texture with the merged texture.

[0115] As an example, let's take water texture as an illustration. The root node of the quadtree detects the overall blue brush texture (third block texture) applied by the artist and directly replaces the original initial texture, establishing a global blue tone. Traversing downwards to the intermediate nodes, if a counter-clockwise swirling brush is applied to that area, the original automatically generated flow texture is first replaced, and then merged with the macroscopic flow direction of its parent node to generate a transitional texture that contains both mainstream flow and local swirling patterns. Finally, at the leaf nodes, the brush wave protrusions are first merged with the automatically generated micro-ripple texture, preserving wave details, and then mixed with the parent node's base height, increasing the wave height from 10 meters at the parent node to 10.375 meters. This highlights the details of the foreground waves without deviating from the overall height framework of the midground water. This hierarchical processing, through global coverage at the root node, weighted fusion at intermediate nodes, and dual constraints at leaf nodes, allows the local creative elements of the artist's brushes, such as swirling patterns and waves, to grow naturally from macro to micro within the quadtree, ultimately achieving a water rendering effect with a unified global tone and vivid local details.

[0116] In this way, direct replacement of the root node solves the problem of global detail coverage, parent-child fusion of intermediate nodes balances regional details and hierarchical transitions, and dual fusion of leaf nodes ensures seamless connection between local high-precision details and the parent level. This strategy integrates the creative details of the artistic brush (third-segment texture) according to the quadtree hierarchy, respecting the global-to-local logic from root to leaf, and achieving the optimal solution for detail injection and visual coherence at different levels through differentiated fusion algorithms, namely replacement, unidirectional fusion, and bidirectional fusion. It is especially suitable for complex scenes such as water bodies and vegetation that require a unified global tone and rich local variations.

[0117] In some embodiments, after dividing the initial texture into blocks to obtain multiple first block textures of the initial texture, see [link to previous section]. Figure 7 , Figure 7 This is a schematic diagram of the third process of the texture processing method provided in the embodiments of this application. For each first block texture, the following steps 105 to 106 are performed respectively, which are described in detail below.

[0118] In step 105, the adjacent block textures of the first block texture are determined.

[0119] Here, the adjacent textures of the first texture block refer to all texture blocks that have a direct spatial adjacency with the current first texture block in the initial texture coordinate system. The adjacent texture blocks cover the eight directional neighborhoods of the current block, namely the upper adjacent texture block, the lower adjacent texture block, the left adjacent texture block, the right adjacent texture block, the upper left adjacent texture block, the upper right adjacent texture block, the lower left adjacent texture, and the lower right adjacent texture. Each adjacent block shares an edge or corner point with the current block in the texture space, and together they form a complete local texture neighborhood. The resolution of the adjacent texture blocks of the first texture block may be the same as the resolution of the first texture block, or it may be different from the resolution of the first texture block.

[0120] The top adjacent texture is located directly above the current texture and adjacent to its top edge; the bottom adjacent texture is located directly below the current texture and adjacent to its bottom edge; the left adjacent texture is located directly to the left of the current texture and adjacent to its left edge; the right adjacent texture is located directly to the right of the current texture and adjacent to its right edge; the top-left adjacent texture is located to the top-left of the current texture and adjacent to its top-left corner; the top-right adjacent texture is located to the top-right of the current texture and adjacent to its top-right corner; the bottom-left adjacent texture is located to the bottom-left of the current texture and adjacent to its bottom-left corner; and the bottom-right adjacent texture is located to the bottom-right of the current texture and adjacent to its bottom-right corner.

[0121] As an example, see Figure 8 , Figure 8 This is a schematic diagram of adjacent block textures provided in the embodiments of this application. The first block texture 801 has adjacent block textures 802, 803, 804, 805, 806, 807, 808, and 809 that have a direct spatial adjacency relationship.

[0122] In step 106, based on the resolution of adjacent block textures, the first block texture is edge-extended to obtain a first block texture carrying edge pixels.

[0123] It should be noted that, since bilinear interpolation during texture sampling requires reference to adjacent pixels, to avoid sampling errors at the boundaries of segmented textures, each segmented texture needs to extend pixels at its edges. The pixel values ​​in this area must be obtained from the corresponding edges of adjacent segments. For example, the edge pixels of the left edge of the current segmented texture must be taken from the first column of pixels on the right edge of the adjacent left segment, and the edge pixels of the bottom edge must be taken from the first row of pixels on the top edge of the adjacent bottom segment.

[0124] The resolution of adjacent texture blocks refers to the size of other texture blocks that are spatially adjacent to the current first texture block. Adjacent texture blocks can be other first texture blocks at the same level or texture blocks at different levels. The resolution of adjacent texture blocks is used to determine how to perform edge extension on the current first texture block. The purpose of edge extension is to ensure that the boundaries between texture blocks can transition smoothly during rendering, avoiding obvious seams or incorrect pixel values.

[0125] Thus, in quadtree texture processing, determining the adjacent block textures for each first block texture and performing edge expansion based on resolution ensures that the pixel expansion area of ​​the current block edge is consistent with or smoothly transitions to the corresponding edge of the adjacent block in terms of pixel values. This eliminates visual breaks at the block splicing points and avoids obtaining invalid region data during sampling, providing effective data with complete boundaries and hierarchical compatibility for subsequent operations. Ultimately, it achieves natural connection of textures between different resolution levels, ensuring the accuracy of near-field detail sampling and the efficiency of far-field rendering, and avoiding visual defects or sampling errors caused by incomplete block edge data.

[0126] In some embodiments, the first block texture is edge-extended based on the resolution of the adjacent block textures to obtain a first block texture carrying edge pixels. This can be achieved in the following way: when the resolution of the adjacent block textures is the same as the resolution of the first block texture, the adjacent pixels of the first block texture in the adjacent block textures are obtained, the adjacent pixels are copied, and the adjacent pixels are added as edge pixels to the edge of the first block texture.

[0127] Here, the adjacent pixels of the first block texture can be one or more. Copying adjacent pixels and adding them as edge pixels to the edge means directly copying the pixel values ​​of the corresponding edges of the adjacent blocks to the edge extension area of ​​the current block.

[0128] It should be noted that the judgment point coordinates of the first block texture can be calculated according to formula (1). The judgment point coordinates are used to determine the position of adjacent block textures. Adjacent block textures can be found based on the judgment point coordinates, thereby determining the resolution of adjacent block textures.

[0129] NewCenterPos=CurCenterPos+NeighborOffset(CurExtent+FVector2D*(LeafSize,LeafSize)*0.5f) Formula (1)

[0130] Wherein, NewCenterPos represents the calculated coordinates of the judgment point of adjacent texture blocks, used to find adjacent texture blocks in the quadtree; CurCenterPos represents the center coordinates of the first texture block; NeighborOffset is a vector representing one of the eight directions around the first texture block, and its value can be one of the following eight vectors: (1,1), (1,0), (1,-1), (0,1), (0,1), (-1,1), (-1,0), (-1,-1) correspond to the upper right, right, lower right, upper right, lower right, upper left, left, and lower left directions of the first texture block, respectively; CurExtent represents the width of the first texture block; FVector2D is a two-dimensional vector type used to represent vectors in two-dimensional space; LeafSize represents the width of the leaf node, where the leaf node refers to the node in the quadtree that stores the first texture block, defined relative to the absolute coordinates of the texture image; 0.5f is a floating-point value used to adjust the size of the offset in the calculation. Thus, by using the center coordinates of the first segment texture, combined with the width of the first segment texture, the size of the leaf nodes, and the specified directional offset, the coordinates of the judgment points of adjacent segment textures are calculated.

[0131] Adjacent pixels include top edge adjacent pixels, bottom edge adjacent pixels, left edge adjacent pixels, right edge adjacent pixels, top left corner adjacent pixels, top right corner adjacent pixels, bottom left corner adjacent pixels, and bottom right corner adjacent pixels. Top edge adjacent pixels are located directly above the first block texture, in the row of pixels directly adjacent to the top edge of the first block texture, and belong to the bottom edge of the upper adjacent block texture. Bottom edge adjacent pixels are located directly below the first block texture, in the row of pixels directly adjacent to the bottom edge of the first block texture, and belong to the top edge of the lower adjacent block texture. Left edge adjacent pixels are located directly to the left of the first block texture, in the column of pixels directly adjacent to the left edge of the first block texture, and belong to the right edge of the left adjacent block texture. Right edge adjacent pixels are located directly to the right of the first block texture, in the column of pixels directly adjacent to the right edge of the first block texture, and belong to the left edge of the right adjacent block texture. The top-left adjacent pixel is located in the upper left of the first block texture. The pixel directly adjacent to the upper left corner of the first block texture belongs to the lower right corner of the upper left adjacent block texture. The top-right adjacent pixel is located in the upper right of the first block texture. The pixel directly adjacent to the upper right corner of the first block texture belongs to the lower left corner of the upper right adjacent block texture. The bottom-left adjacent pixel is located in the lower left of the first block texture. The pixel directly adjacent to the lower left corner of the first block texture belongs to the upper right corner of the lower left adjacent block texture. The bottom-right adjacent pixel is located in the lower right of the first block texture. The pixel directly adjacent to the lower right corner of the first block texture belongs to the upper left corner of the lower right adjacent block texture.

[0132] As an example, see Figure 9 , Figure 9 This is a schematic diagram of adjacent pixels provided in an embodiment of this application. The adjacent pixels of the first block texture 901 include the pixel 902 adjacent to the upper left corner, the pixel 903 adjacent to the upper edge, the pixel 904 adjacent to the upper edge, the pixel 905 adjacent to the upper right corner, the pixel 906 adjacent to the left edge, the pixel 907 adjacent to the left edge, the pixel 908 adjacent to the lower left corner, the pixel 909 adjacent to the lower edge, the pixel 910 adjacent to the lower edge, the pixel 911 adjacent to the lower right corner, the pixel 912 adjacent to the right edge, and the pixel 913 adjacent to the right edge.

[0133] Thus, when the resolution of an adjacent texture block is the same as that of the first texture block, the adjacent pixels are copied and added as edge pixels to the edge of the first texture block. This ensures the continuity and consistency of the textures during stitching, avoiding obvious seams or visual discontinuities. By directly copying adjacent pixels, the edges of texture blocks can be expanded quickly and effectively, ensuring that texture filtering techniques such as bilinear interpolation work properly at the boundaries. This improves the overall visual effect, achieves smooth transitions, enhances the realism and immersion of the scene, and reduces runtime texture boundary processing overhead, optimizing rendering performance.

[0134] In some embodiments, the first block texture is edge-extended based on the resolution of the adjacent block textures to obtain a first block texture carrying edge pixels. This can be achieved in the following way: when the resolution of the adjacent block textures is different from the resolution of the first block texture, the world coordinates of the edge pixels of the first block texture are obtained, the world coordinates are mapped to the texture coordinates of the adjacent block textures, the adjacent block textures are sampled based on the texture coordinates, and the sampled pixels are added as edge pixels to the edge of the first block texture.

[0135] Here, the resolution of adjacent texture blocks differs from that of the first texture block. This means that the adjacent texture blocks differ in pixel size from the first texture block, and the first texture block and the adjacent blocks are at different quadtree levels. When adjacent texture blocks have different resolutions, coordinate mapping and texture sampling techniques are needed to ensure a smooth transition of textures at the boundaries. Specifically, the edge pixels of the high-resolution texture blocks need to be mapped to the corresponding positions of the low-resolution texture, or appropriate pixel values ​​need to be obtained through methods such as bilinear interpolation to avoid visual discontinuities or errors.

[0136] Here, obtaining the world coordinates of the edge pixels of the first texture block refers to determining the specific positions of these edge pixels in the 3D scene. This step is achieved by converting texture coordinates to world coordinates, ensuring that the position of each edge pixel is accurately located and aligned with other elements in the scene. Specifically, world coordinates are the absolute positions of objects in 3D space, while texture coordinates are the relative positions within the texture image. By mapping the texture coordinates of the edge pixels to the world coordinate system, it is ensured that these pixels are correctly aligned with adjacent texture blocks or other 3D model elements during rendering, thus achieving seamless texture stitching and correct visual effects.

[0137] The mapping of edge pixel texture coordinates to the world coordinate system is achieved through the mapping relationship between the geometric information of the 3D model and texture coordinates. Specifically, each vertex of the 3D model has corresponding world coordinates and texture coordinates. Through interpolation, the world coordinates corresponding to any point on the texture can be obtained. This process is completed in the vertex shader and fragment shader of the graphics rendering pipeline. The vertex shader is responsible for converting the texture coordinates of vertices into world coordinates, while the fragment shader uses this information to sample and render the texture. In this way, the texture coordinates of edge pixels can be accurately mapped to the world coordinate system.

[0138] Mapping world coordinates to texture coordinates of adjacent tile textures is achieved by converting the world coordinates of edge pixels into their relative positions with respect to adjacent tile textures. Specifically, the world coordinates of the edge pixels are subtracted from the starting position of the adjacent tile texture, and then divided by the size of the first tile texture to obtain normalized texture coordinates, which range from 0 to 1.

[0139] It should be noted that sampling adjacent texture blocks based on texture coordinates means using the calculated texture coordinates of adjacent texture blocks, finding the corresponding pixel values ​​in the adjacent texture blocks, sampling the adjacent texture blocks through bilinear interpolation, and adding these sampled pixels as edge pixels to the corresponding edge positions of the first texture block. This achieves a smooth transition between textures and avoids visual seams or discontinuities. Specifically, adding the sampled pixels to the corresponding edge positions of the first texture block means placing the pixel values ​​sampled from the adjacent texture blocks at specific positions on the edge of the first texture block, including the top edge adjacent pixel position, bottom edge adjacent pixel position, left edge adjacent pixel position, right edge adjacent pixel position, top left corner adjacent pixel position, top right corner adjacent pixel position, bottom left corner adjacent pixel position, and bottom right corner adjacent pixel position.

[0140] Thus, when the resolution of adjacent texture blocks differs from that of the first texture block, by obtaining the world coordinates of the edge pixels of the first block and mapping them to the texture coordinates of the adjacent blocks, and then performing sampling and edge expansion based on these coordinates, the problem of cross-level detail connection in quadtree texture blocks can be effectively solved. By locating the absolute position of the block in the global scene using world coordinates, the correspondence between edge pixels and adjacent blocks is ensured to be accurate. Converting world coordinates to texture coordinates allows blocks of different resolutions to establish connections in the local texture space, avoiding misalignment and gaps caused by direct splicing. Sampling operations based on texture coordinates can inherit the macroscopic texture features of adjacent blocks while adapting to the detail precision requirements of the current block, enabling smooth transitions of edge pixels, eliminating visual gaps between levels, thereby improving rendering quality and visual experience, and providing an accurate and consistent edge data foundation for subsequent texture fusion, sampling, and other operations.

[0141] In step 103, a target block texture containing valid data is selected from multiple first block textures and multiple second block textures, and the target block texture is stored in the physical texture.

[0142] Here, effective data refers to data that has practical value in actual rendering or application scenarios and needs to be retained and used. This includes target tile textures with effective data, excluding tile textures that only contain invalid data in the initial texture, such as completely blank, pure black or pure white, or tile textures that are repetitive with adjacent tiles and have no difference in detail. For example, in water rendering in a game scene, the water surface area far from the camera may only need to retain basic color and flow direction data, while the splashing waves in the foreground require high-resolution detailed texture data. This data that contributes to the actual visual experience is effective data. Storing target tile textures that filter out effective data ensures that necessary visual details are presented during rendering, while reducing the storage space occupied by physical textures by eliminating invalid or redundant data, improving the efficiency of texture sampling and rendering, and achieving a balance between visual effects and performance.

[0143] Physical textures are the physical storage space used to actually store and retrieve valid chunked texture data. They serve as the carrier for persistently saving the filtered target chunked textures. Physical textures can be implemented using physical storage media such as video memory, RAM, or disk, providing direct access to texture data for the rendering pipeline. Compared to raw chunked textures, physical textures use a filtering mechanism to remove blank, duplicate, or redundant data, retaining only the effective information that actually contributes to rendering. This optimizes the utilization efficiency of storage resources and reduces data reading and transmission overhead. In practical applications, physical textures support fast sampling during real-time rendering, ensuring that textures such as terrain and water in game scenes can present rich details at different viewpoints and distances. They also improve rendering performance through efficient data access, making them a crucial storage link connecting texture data processing and final visual presentation.

[0144] In some embodiments, see Figure 10 , Figure 10 This is a schematic diagram of the fourth process of the texture processing method provided in this application embodiment. From multiple first block textures and multiple second block textures, a target block texture containing valid data is obtained by filtering. This can be achieved by first identifying invalid block textures that do not contain valid data and then removing them, thereby obtaining the target block texture containing valid data. Specifically, this can be achieved through the following steps 1031 to 1032, which are described in detail below.

[0145] In step 1031, invalid block textures are identified from multiple first block textures and multiple second block textures.

[0146] In step 1032, invalid block textures are removed from multiple first block textures and multiple second block textures to obtain target block textures that include valid data.

[0147] In some embodiments, identifying invalid block textures from a plurality of first block textures and a plurality of second block textures can be achieved in the following manner: when invalid block textures include duplicate block textures, for each block texture in the plurality of first block textures and a plurality of second block textures, the following operations are performed respectively: the block texture is compared with other block textures respectively to obtain comparison results; and based on the comparison results, the duplicate block texture that is the same as the block texture is determined from the plurality of first block textures and a plurality of second block textures.

[0148] Correspondingly, from multiple first block textures and multiple second block textures, invalid block textures are removed to obtain target block textures containing valid data. This can be achieved by deduplicating the block textures and duplicate block textures to obtain target block textures containing valid data.

[0149] Here, invalid tile textures are tile textures that do not contain valid data. Duplicate tile textures refer to tile textures that are completely identical in data content to other tile textures among multiple first tile textures and multiple second tile textures. For example, in a game scene with a large, flat ground surface, when dividing the ground texture into tiles, some adjacent tiles may contain the same ground material pattern and color information; these tile textures are considered duplicate tile textures.

[0150] The segmented texture is compared with other segmented textures to obtain the comparison results. This is achieved through pixel-by-pixel comparison. Specifically, each corresponding pixel of the segmented texture is compared with each other segmented texture one by one, and their pixel values, such as color value, height value, velocity, normal, etc., are checked to see if they are the same. If all pixel values ​​are the same, then the segmented texture is identified as a duplicate segmented texture.

[0151] It should be noted that compute shaders can be used to perform pixel-by-pixel comparisons of the patch textures to be compared, leveraging the parallel computing power of the graphics processor to efficiently compare each pixel of the texture, and then the comparison results can be read back from the graphics processor to identify the repeating patch textures that are the same as the patch textures.

[0152] As an example, consider two 2x2 pixel block textures, texture A and texture B, where each pixel has a color value and a height value. Texture A's pixel values ​​are: Pixel 1: Color (255, 0, 0), Height 100; Pixel 2: Color (0, 255, 0), Height 150; Pixel 3: Color (0, 0, 255), Height 200; Pixel 4: Color (255, 255, 0), Height 250. Texture B's pixel values ​​are: Pixel 1: Color (255, 0, 0), Height 100; Pixel 2: Color (0, 255, 0), Height 150; Pixel 3: Color (0, 0, 255), Height 200; Pixel 4: Color (255, 255, 0), Height 250. By comparing pixel by pixel, textures A and B are identical in both color and height values ​​for each corresponding pixel. Therefore, texture B is determined to be a repeating block texture of texture A.

[0153] Thus, in quadtree texture chunking, when invalid chunks contain duplicate chunks, comparing each chunk with other chunks one by one to identify duplicate chunks, and then deduplicating the duplicate chunks, significantly improves the storage and processing efficiency of texture data. It can accurately locate redundant data in textures caused by scene similarity or chunking strategies, avoiding repeated storage and computation of the same texture content. Through deduplication, only one valid data set is retained to represent these duplicate areas, greatly reducing the storage space occupied by physical textures. The deduplicated target chunks retain only valid data, simplifying texture management logic and ensuring that texture details are fully rendered at different resolution levels without performance degradation due to redundant data, ultimately achieving a balance between visual effects and resource consumption.

[0154] In some embodiments, identifying invalid block textures from a plurality of first block textures and a plurality of second block textures can be achieved in the following manner: when an invalid block texture includes a blank block texture, for each block texture in the plurality of first block textures and a plurality of second block textures, the following operations are performed respectively: pixel-by-pixel detection is performed on the block texture to obtain the channel value of each pixel in the block texture; when the channel value of each pixel in the block texture is a default value, the block texture is determined to be a blank block texture.

[0155] Correspondingly, the invalid block textures are removed from multiple first block textures and multiple second block textures to obtain the target block texture containing valid data. This can be achieved by removing blank block textures from multiple first block textures and multiple second block textures to obtain the target block texture containing valid data.

[0156] Here, a blank block texture refers to a block texture where all pixel channel values, such as color, height, and opacity, are at their default values. For example, if all pixels of a block texture are pure black and the color value (RGB) is (0, 0, 0) or transparent (i.e., the opacity value is 0), then the texture is identified as a blank block texture, which does not contain valid visual information.

[0157] It should be noted that a compute shader can be used to perform pixel-by-pixel detection on the block texture to be detected, taking advantage of the parallel computing power of the graphics processor to efficiently detect each pixel of the texture, and then read back the detection results from the graphics processor to determine the blank block texture.

[0158] As an example, suppose there are two tiled textures, Texture A and Texture B, both 2×2 pixels, containing color and alpha values. All pixels in Texture A have color values ​​(0, 0, 0) and a color value of 0 (the default value), and are therefore identified as a blank tiled texture. Texture B, on the other hand, has pixels with non-default color and alpha values, containing valid data. Specifically, each pixel in Texture A appears as pure black and completely transparent, lacking any visual information, and is thus identified as a blank tiled texture. In contrast, the pixels in Texture B have diverse colors and opacities; for example, pixel 1 has a color value of (255, 0, 0) representing red and an alpha value of 255 representing complete opacity. Other pixels also have different color and alpha values, and are therefore identified as a target tiled texture containing valid data. By performing pixel-by-pixel detection, blank textures like Texture A are eliminated, while valid textures like Texture B are retained, thereby optimizing storage and rendering efficiency.

[0159] Thus, in quadtree texture chunking, when invalid chunk textures contain blank chunk textures, by performing pixel-by-pixel channel value detection on each chunk texture and identifying chunks with all pixel channel values ​​as default values ​​as blank chunk textures for removal, redundant data without actual visual meaning can be effectively eliminated. This can accurately identify and remove areas in the scene that have not been assigned valid texture information, avoiding invalid data occupying physical texture storage space and reducing data transmission and sampling overhead. By reducing the amount of invalid data, not only is texture storage efficiency improved, but data reading and processing speed during rendering is also accelerated, resource utilization is optimized, and clear texture details and stable rendering performance are ensured in complex scenes, achieving a dual improvement in data simplification and rendering quality.

[0160] In step 104, the coordinates of the target block texture in the physical texture are recorded to the index texture.

[0161] Here, the indexed texture is used to query the coordinates of a target tile texture within the physical texture, based on the texture coordinates of the 3D model. The coordinates of the target tile texture within the physical texture refer to its specific location within the physical texture. The physical texture is a contiguous memory region used to store all valid tile textures. Each target tile texture occupies a specific area within the physical texture, and its coordinates represent the starting position of that area. This coordinate information is recorded in the indexed texture to enable quick location and access to the corresponding texture data during rendering.

[0162] Texture coordinates refer to the coordinates of a 3D model's surface mapped to a 2D plane after the surface is unwrapped. The texture coordinate system used to define these coordinates is called texture space, also known as UV space. U corresponds to the x-axis of a 2D Cartesian coordinate system, and V corresponds to the y-axis. Texture coordinates are points in UV space associated with vertices of the 3D model's surface. Since texture coordinates are all in the range [0, 1], they are floating-point numbers between 0 and 1. Multiplying the texture coordinates by the texture's height or width gives the position of a vertex on the texture. For example, consider a texture with a resolution of 320×200 (the texture can be any 2D image), meaning a texture width of 320 and a texture height of 200. For texture coordinates [0.5, 0.1], the position of a texture cell (which can be understood as a pixel) in the texture is (160, 20), i.e., (0.5×320=160 and 0.1×200=20). It can provide the positional information needed when applying textures to objects. UVs are used as markers to locate points and correspond the pixels on the texture image (also known as the texture map file) to the vertices of the 3D model surface, which helps to accurately map the texture image onto the surface of the 3D model.

[0163] In some embodiments, before storing the target chunk texture into the physical texture, the number of target chunk textures is determined, and a blank physical texture is created based on the number and the size of the target chunk textures, the size of the physical texture being adapted to the sum of the sizes of the number of target chunk textures.

[0164] Here, the target block texture refers to the valid block texture that is retained after filtering. The size of the target block texture is the same as the size of the first block texture.

[0165] It should be noted that the number of valid target chunk textures retained after filtering can be counted, and the size of each texture, such as width and height, can be determined. Based on the number and size of the target chunk textures, the total required storage space is calculated. Specifically, the area (width × height) of all target chunk textures is added together to determine the total size of the physical texture. Based on the total size of the physical texture and the layout of the target chunk textures, the width and height of the physical texture are determined to accommodate all target chunk textures.

[0166] Traverse all target chunk textures, recording the number n of each target chunk texture, and determine the width and height of each target chunk texture. To find a suitable physical texture size, the arrangement of the target chunk textures needs to be considered. A common arrangement is a rectangular arrangement, i.e., arranged by rows and columns. Let the number of rows be r and the number of columns be c, then r × c ≥ n. To minimize the area of ​​the physical texture, we can try to find r and c that are closest to n, such that r × c = n or r × c is slightly greater than n and |rc| is as small as possible. Based on the determined number of rows r and columns c, and the width w and height h of the target chunk textures, calculate the width W and height H of the physical texture. The width W of the physical texture = c × w, and the height H = r × h. Thus, the rectangular area determined by the obtained physical texture width W and height H is the suitable physical texture size that can accommodate all chunk textures.

[0167] As an example, for the initial texture of a 3D model, after a series of operations such as segmentation, generating textures of different resolutions, and filtering, 20 target segmented textures are obtained. For example, the width and height of each target segmented texture are 100 pixels. The total storage space required is calculated. The area of ​​each target segmented texture is 100 × 100 = 10,000 square pixels, and the total area of ​​the 20 target segmented textures is 20 × 10,000 = 200,000 square pixels. Based on this total area and possible layout methods, the width and height of the physical texture are determined. For ease of arrangement, assuming these target segmented textures are arranged in a 4x5 matrix, the width of the physical texture should be the sum of the widths of the five target segmented textures, i.e., 5 × 100 = 500 pixels; the height is the sum of the heights of the four target segmented textures, i.e., 4 × 100 = 400 pixels. Finally, according to this calculated width of 500 pixels and height of 400 pixels, a blank physical texture is created. The size of this physical texture is suitable for these 20 target segmented textures.

[0168] Therefore, by pre-determining the number of target chunk textures and creating suitable blank physical textures based on their dimensions before storing the target chunk textures into physical textures, storage space waste and data storage conflicts can be effectively avoided. By accurately calculating the required space, physical texture resources can be rationally allocated according to the actual data volume, avoiding the creation of excessively large physical textures that lead to memory idleness; at the same time, it can also prevent the inability to completely store all chunk textures due to insufficient physical texture space, ensuring the integrity of data storage.

[0169] In some embodiments, after recording the coordinates of the target block texture in the physical texture to the index texture, the index texture is sampled based on the texture coordinates of the 3D model to obtain the coordinates of the target block texture in the physical texture, and the physical texture is sampled based on the coordinates in the physical texture to obtain the texture of the 3D model.

[0170] In actual implementation, since physical textures only store the target block textures that have been filtered and include valid data, they occupy little space. The index texture and physical texture can be loaded into the video memory at once. Based on the texture coordinates of the three-dimensional model, the index texture can be sampled and the coordinate transformation calculation can be performed by formula (2). The position of the target block texture in the physical texture can be accurately located.

[0171] IndirCoord=(UV*TextureSize) / PageSize formula (2)

[0172] In this context, `IndirCoord` represents the coordinates used for pixel reading on the indexed texture. It's an intermediate result calculated to retrieve relevant information from the indexed texture and locate the target tile texture within the physical texture. `UV` represents texture coordinates, a two-dimensional vector describing the position of a point on the texture. In texture mapping of 3D models, UV coordinates specify a particular location on the texture image to ensure correct mapping of the texture to the model surface. `TextureSize` represents the initial texture size, a two-dimensional value such as the width and height in pixels, used to measure the overall size of the initial texture. `PageSize` represents the size of the tile texture without edge pixels, also a two-dimensional value, referring to the size of a single tile texture. Dividing this value by `UV*TextureSize` yields the coordinates of the target tile texture to which the `UV` belongs, thus helping to determine the position to be read within the indexed texture.

[0173] Furthermore, the texture of the three-dimensional model can be obtained by sampling the physical texture using formulas (3) and (4).

[0174] PageCoord=(UV*TextureSize)%PageSize formula (3)

[0175] PhysicalCoord=IndirCoord*PageWithBorderSize+(PageCoord+1) Formula (4)

[0176] Here, PageCoord represents the tile texture coordinates, used to determine the relative position of a pixel within the current tile texture. Using these coordinates, the required pixel can be accurately located within a specific texture page. PhysicalCoord represents the coordinate position of the point to be sampled in the physical texture, used to accurately obtain the corresponding texture information from the physical texture. IndirCoord is used to read pixels on the index texture, used to find the position information of the target tile texture in the physical texture from the index texture. PageWithBorderSize refers to the size of the tile texture with edge pixels, which is a two-dimensional vector. Multiplying by IndirCoord locates the starting pixel address of the target block texture in the physical texture, because IndirCoord determines the coordinates of the target block texture. Multiplying by PageWithBorderSize gives the starting position of the target block texture in the physical texture. PageCoord+1: PageCoord is the coordinate of the pixel within the target block texture. Adding 1 may be to take into account factors such as boundaries or offsets. Finally, the specific position of the sampling point within the target block texture is obtained and added to the starting position of the target block texture to determine the complete position of the sampling point in the physical texture.

[0177] As an example, let's take a 3D ocean model that requires texture mapping. The initial texture is a 4096×4096 pixel ocean texture image. To improve storage and rendering efficiency, it is divided into multiple block textures without edge pixels. Each block texture is 256×256 pixels in size, and after filtering, only the target block texture containing valid data is stored in the physical texture. At the same time, the coordinates of the target block texture in the physical texture are recorded in the index texture.

[0178] When rendering a 3D ocean model, the texture coordinates of a certain point on the model are (0.2, 0.3). First, the coordinates (3.2, 4.8) used for pixel reading on the index texture are calculated using formula (2). The position information of the target block texture in the physical texture can be obtained from the index texture using the coordinates (3.2, 4.8). Next, the relative position of the pixel in the current block texture is determined to be (51.2, 240.8) using formula (3). Assuming that the size of the block texture with edge pixels is 260×260 pixels, the coordinates (884.2, 1489.8) of the point to be sampled in the physical texture are obtained using formula (4). Based on this coordinate, the texture information of the corresponding position can be accurately sampled from the physical texture and applied to the 3D ocean model to make the model surface present a realistic ocean texture effect.

[0179] Thus, since physical textures only store the filtered target chunk textures, they occupy little space and can be loaded into video memory all at once. Combined with the fast lookup mechanism of indexed textures, this significantly improves the efficiency of texture data reading and reduces rendering latency. As a navigation map, the indexed texture establishes a precise mapping between the texture coordinates of the 3D model and their actual positions in the physical texture, avoiding blind searching directly in the physical texture. This allows for rapid location and retrieval of the required texture data during rendering. Furthermore, when texture data changes or is updated, only the coordinate mapping relationship in the indexed texture needs to be adjusted to quickly adapt to the new texture layout, reducing the complexity of texture management and providing strong support for improving the stability and flexibility of 3D scene rendering.

[0180] By applying the embodiments described above, the initial texture of the 3D model is divided into blocks to generate multi-resolution second block textures. Texture data is organized using a quadtree structure, and combined with brush texture updates and block texture edge expansion, a hierarchical and refined texture data structure can be effectively constructed. Simultaneously, by identifying and removing duplicate, blank, and other invalid block textures, the target block textures with valid data are accurately selected, reducing redundant data usage. Adaptive physical textures are created based on the number and size of the target block textures, storage resources are rationally planned, and a mapping relationship between the 3D model texture coordinates and physical texture coordinates is established through indexed textures, achieving efficient and fast texture sampling and rendering. This significantly reduces the storage space of texture data, improves texture loading and rendering efficiency, optimizes the performance of the 3D model during rendering, and greatly reduces hardware resource consumption while ensuring texture detail and visual effects.

[0181] The following example, using a 3D model of water in a game scene, illustrates an exemplary application of the embodiments of this application in a real-world application scenario.

[0182] In the processing of water (3D model) textures, the main techniques include large texture schemes and virtual texture schemes. Large texture schemes directly record all information within the water body's bounding box into a single texture. At runtime, the water body determines information such as height by sampling this texture. Virtual texture schemes, on the other hand, divide the large texture into small tiles, recording the position of each tile using an additional indexed texture. At runtime, the physical and indexed textures are dynamically constructed in video memory. When the camera position changes, only the tiles that need to be sampled are loaded, replacing the parts that are no longer needed, attempting to achieve a balance between high precision and video memory control through dynamic loading.

[0183] During implementation, the applicant discovered the following problems with the relevant technology for texture processing:

[0184] Using a large texture scheme to process water textures requires increasing the texture resolution to improve the accuracy of water information, resulting in a quadratic increase in texture data volume. This leads to a sharp increase in video memory usage, severely impacting runtime frame rate. It is difficult to control video memory usage while maintaining high-precision water texture representation, making it impossible to balance the contradiction between accuracy and video memory consumption. Using a virtual texture scheme to process water textures, dynamically loading tiles at runtime increases input / output pressure. When the camera moves or the scene changes, new tiles need to be frequently loaded from the disk and old tiles need to be unloaded. This process introduces significant latency, especially on mobile devices or devices with weak storage performance, easily causing screen stuttering or loading pauses. Moreover, although the tiles are dynamically loaded, each tile still contains invalid information from the original large texture. This redundant content not only does not reduce the actual texture data volume but also increases system overhead due to dynamic scheduling.

[0185] When rendering water textures using a virtual engine, a water information texture (i.e., the initial texture) is generated, containing information such as water surface height, ground height, and water flow direction. During rendering, this texture is sampled to adjust the vertex height of the water mesh. If a high-resolution water information texture is generated in advance in the editor, the resolution of the water information texture can effectively improve the rendering accuracy of the water mesh, since the vertex precision of the mesh at runtime is usually higher than the texture precision. Conversely, a low-precision water information texture may cause water surface gaps in areas requiring smaller water surface widths, such as small streams. This not only wastes high-precision vertices but also affects the realism of the water surface effect. Because water is sparsely distributed in the terrain (i.e., exhibits sparsity), using a large texture to record water texture data for a certain area will contain a large amount of redundant data (i.e., invalid data), especially when high precision of water data is required. This redundant data will further increase, and this data will never be sampled in the actual rendering. Therefore, by removing invalid data from the water information texture, the space occupied by the texture can be significantly reduced. Therefore, indexed textures and physical textures can be used to store the water body information texture after removing invalid data. The indexed texture is used to record the position of each block in the physical texture (i.e., block texture), while the physical texture only stores the blocks containing valid data, thereby achieving efficient storage and sampling.

[0186] Based on this, this application provides a texture processing method. By removing the parts of the water information texture that do not contain valid information, the texture is divided into two parts for storage: an index texture and a physical texture. The index texture records the position of each block in the physical texture, while the physical texture only stores blocks containing valid data. Multi-level resolution textures are generated through block division and quadtree organization, and edge pixels are added to each block to support bilinear interpolation, ensuring the correctness of the data during sampling. Finally, by combining the index texture and the physical texture, efficient storage and sampling are achieved, significantly reducing memory usage and improving operating efficiency.

[0187] The following section will continue to describe the texture processing method provided in the embodiments of this application from a technical perspective.

[0188] See Figure 11 , Figure 11 This is a schematic diagram of the fifth step of the texture processing method provided in this application embodiment. This method can be implemented by the terminal or server alone, or by the terminal and server collaboratively. The following example uses a terminal implementation and will be combined with... Figure 11 The steps shown illustrate the texture processing method provided in the embodiments of this application.

[0189] In step 1101, a hierarchical refinement texture is generated.

[0190] In some embodiments, when using a quadtree to organize and manage the tiled textures of water areas, each leaf node of the quadtree stores water information for a single texture tile (i.e., the first tile texture), such as surface height and water flow direction. When high-precision water textures are required, a high-precision texture containing detailed water information is first drawn in the editor, and then imported into the quadtree structure. The quadtree uniformly divides the high-precision texture according to the preset texture tile size, ensuring that each divided texture tile is a complete and independent tile, and caches these texture tiles in the leaf nodes of the quadtree. This cached texture is named the original cached texture (i.e., the first tile texture). Artists can use brush tools to draw high-precision water details in the editor, such as local water flow ripples and water surface reflections. The water information generated by these brushes is stored as a separate texture (brush texture). This texture is only cached in the editor environment. Each time brush content is added or modified, the new data is updated to the cached texture through a blending method. Subsequently, the texture generated by the brush is divided into several small blocks (i.e., the third block texture) according to the texture block size. These small blocks are cached to the corresponding nodes of the quadtree according to their precision requirements. That is, high-precision detail blocks are cached to leaf nodes, while medium-precision blocks may be cached to middle nodes. This part of the texture is named brush cache texture (i.e., the third block texture).

[0191] It should be noted that when generating hierarchical refinement textures for the water texture data stored in the quadtree, including the original cached textures and brush cached textures, the process is divided into two core stages: The first stage involves fusing brush details and basic texture data layer by layer from the root node to the leaf node, ensuring that the leaf nodes contain complete water information, that is, the original texture data and the high-precision details of the art brushes; The second stage involves generating layers layer by layer from the leaf node to the root node, generating sub-textures of different resolutions through filtering algorithms, and finally forming a complete hierarchical refinement texture.

[0192] Specifically, if the current node is not a leaf node and the brush cache texture has valid data (meaning there is an art brush input at the corresponding level), the texture data of the brush cache texture is directly copied to the original cache texture. At this point, the original cache texture has only initially integrated the brush details of the current level and has not yet completed the fusion with the child node data, so the child nodes need to be processed further. If the current node is not the root node and the original cache texture and brush cache texture of the parent node have data, or the parent node's subtree has brush cache texture data, then one-quarter of the parent node's original cache texture is fused with the current node's original cache texture using bilinear interpolation. This process essentially uses a super-resolution algorithm to precisely match the low-resolution data of the parent node with the details of the current node, avoiding detail gaps between levels. When traversing to a leaf node and both the original cache texture and the brush cache texture are not empty, the texture data of the two are directly fused to ensure that the original cache texture of the leaf node contains complete water information for that area. At this point, the processed original cache texture of each node is the new cache texture corresponding to the node. Then, starting from the leaf nodes, the process iterates upwards layer by layer to the root node, using a mean filtering algorithm to generate textures for each level. The new cached texture for each parent node is generated by averaging the new cached textures of its four child nodes, resulting in the new cached texture for the current level. This process is repeated until the root node, ultimately generating a complete hierarchy from the highest to the lowest precision. This ensures that during rendering, textures matching the resolution can be dynamically invoked based on object distance, achieving a balance between precision and performance.

[0193] In step 1102, a graded, refined texture with edge pixels is generated.

[0194] It should be noted that, in order to ensure the correctness of bilinear interpolation, each texture block data needs to have a one-pixel edge. These texture block data are processed by preorder traversal of the quadtree. During the traversal, the parent node is always processed before its leaf node. This ensures that when the leaf node is processed, its parent node has already been processed, thus guaranteeing data consistency.

[0195] For each current texture chunk, edge pixels need to be copied from its eight neighboring texture chunks. To accurately locate these neighboring texture chunks, the coordinates of the decision points for the neighboring texture chunks are calculated. These decision point coordinates are calculated using the center coordinates of the current texture chunk, the bounding box width, the leaf node width, and the neighbor offsets, so that the edge pixels can be found and copied from the quadtree.

[0196] When processing adjacent texture blocks, two scenarios need to be considered. The first is when the adjacent valid texture block has the same layer as the current node. In this case, pixels from the adjacent texture block (i.e., the adjacent texture block itself) can be directly copied to the edge of the current texture block. The second scenario is when the adjacent valid texture block has a higher layer. In this case, the boundary's position in world space needs to be calculated, and then the texture coordinates of the adjacent texture block corresponding to that position need to be found. Using these texture coordinates, sampling can be directly performed in the adjacent texture block, and the sampling results can be filled onto the boundary of the current texture block. Although this process involves super-resolution sampling, because the adjacent texture block has a higher layer and its precision is relatively lower, it will not have a significant impact on the final result.

[0197] The above steps ensure that the boundary pixels of each texture block are correct, thus guaranteeing the accuracy of bilinear interpolation. The entire process is accomplished by traversing the quadtree in a preorder order, ensuring that the generation of boundary judgment point coordinates is both efficient and accurate.

[0198] In step 1103, valid texture blocks are retained.

[0199] It's important to note that to reduce redundant data, all texture blocks with edge pixels are traversed. Since pixel-by-pixel comparison generates numerous input / output operations, a compute shader (CS) in the Graphics Processing Unit (GPU) is used to perform pixel-by-pixel comparisons on the texture blocks with edge pixels to be compared. Specifically, the compute shader loads the pixel data of each texture block into the GPU's parallel computing unit and compares the texture information of two texture blocks pixel by pixel. If every pixel of two texture blocks matches perfectly, the two blocks are considered duplicates. In this way, the compute shader can efficiently identify completely identical or highly similar texture blocks. To ensure the accuracy of the comparison, the compute shader stores the results in GPU memory and reads these results back from the GPU to the CPU to confirm which blocks are duplicates. Finally, the texture blocks with edge pixels that remain are the valid texture blocks that need to be stored in the physical texture. This method not only optimizes storage efficiency but also ensures the integrity and accuracy of the texture data.

[0200] In step 1104, the effective texture is divided into blocks and sparsely stored.

[0201] In some embodiments, the minimum physical texture size capable of storing all texture blocks is calculated based on the number of texture blocks with edge pixels. Each texture block with edge pixels is then stored individually in the physical texture, and the coordinates of each block in the physical texture are recorded. The coordinates of each block in the physical texture are further stored in an index texture, which acts as a "map" recording the storage location. During water rendering, sparse graph compression technology achieves efficient sampling of water information by combining physical and index textures. Specifically, the water shader first queries the index texture for the location of the required water information, and then reads the corresponding data from the physical texture based on this location. This method not only significantly reduces the space occupied by invalid textures but also improves the accuracy of water information. Through sparse graph compression, textures that might otherwise occupy a large amount of space can now be stored efficiently and accessed quickly, thereby optimizing texture usage efficiency.

[0202] In practice, sparsely compressed textures (indexed textures and physical textures) can be loaded into video memory all at once due to their small space footprint. When sampling water information from the material, the indexed texture is first sampled based on texture coordinates. The absolute pixel coordinates are obtained by multiplying the texture coordinates by the size of the uncompressed water texture. Then, the absolute pixel coordinates are divided by the size of the texture block without edge pixels to obtain a coordinate position for pixel reading on the indexed texture. This coordinate position is used to obtain the coordinates of the texture block with edge pixels in the physical texture from the indexed texture. Next, sampling is performed in the physical texture. The pixel coordinates are multiplied by the size of the uncompressed water texture and moduloed by the size of the texture block without edge pixels to obtain the pixel coordinates within the texture block. The starting pixel address of the texture block in the physical texture is obtained by multiplying the coordinate position obtained from the indexed texture by the size of the texture block with edge pixels. Finally, the starting pixel address is added to the pixel coordinates within the texture block to obtain the final position of the point to be sampled in the physical texture. Finally, the required water information is sampled from the physical texture using this position information. In this way, the storage structure of sparse textures is used efficiently, ensuring that water information can be obtained quickly and accurately at runtime, while reducing memory usage and input / output pressure.

[0203] As an example, see Figure 12 , Figure 12 This is a schematic diagram of the initial texture provided in the embodiments of this application. The initial texture image 1203 includes water 1202. As can be seen from the image information 1201, the maximum import size, maximum display size, and maximum in-game size of the initial texture are all 1024×1024 pixels, and the size of the texture resource is 8192KB. See [link / reference] Figure 13 , Figure 13This is a schematic diagram of the indexed texture provided in an embodiment of this application. In the indexed texture image 1302, the color of each pixel is used to provide richer index information storage and more accurate texture mapping control. For example, red can represent the X coordinate of the starting position of the target block texture in the physical texture; green can represent the Y coordinate of the starting position of the target block texture in the physical texture; yellow can represent other attributes of the target block texture, such as the pixel density of the texture, i.e., the number of pixels contained in a unit area; and black invisible areas indicate that no data is stored. According to the image information 1301 of the indexed texture, the maximum import size, maximum display size, and maximum in-game size of the indexed texture are all 256×256 pixels, and the size of the texture resource is 683KB; see also... Figure 14 , Figure 14 This is a schematic diagram of the physical texture provided in this application embodiment. From the image information 1401 of the physical texture, it can be seen that the maximum import size, maximum display size, and maximum in-game size of the physical texture are all 650×250 pixels, and the size of the texture resource is 2641KB. Therefore, the sum of the sizes of the index texture and the physical texture is 650×520 + 256×256 = 403536 pixels, while the size of the original texture is 1024×1024 = 1048576 pixels. That is to say, the sum of the sizes of the index texture and the physical texture is approximately 38.5% of the original texture, reducing texture usage and reducing video memory pressure. Region 1402 is a region that does not store any textures.

[0204] By applying the embodiments described above, the memory usage of water textures can be significantly reduced while maintaining high-precision water information. This solution ensures efficient storage and fast access to texture data by eliminating invalid data and optimizing the storage structure. At runtime, sparsely compressed textures can be loaded into video memory all at once, reducing input / output pressure. Furthermore, the combination of indexed and physically based textures enables rapid sampling, which not only improves rendering efficiency but also ensures high-quality water effects.

[0205] The following description continues to illustrate the exemplary structure of the texture processing apparatus 555 provided in the embodiments of this application as a software module. In some embodiments, such as... Figure 2 As shown, the software modules of the texture processing device 555 may include: a segmentation module 5551, a generation module 5552, a filtering module 5553, and a recording module 5554.

[0206] The segmentation module 5551 is used to obtain the initial texture of the three-dimensional model and segment the initial texture into blocks to obtain multiple first segmented textures of the initial texture.

[0207] The generation module 5552 is used to generate a plurality of second block textures based on the plurality of first block textures, wherein the resolution of the second block textures is lower than the resolution of the first block textures;

[0208] The filtering module 5553 is used to filter out a target block texture including valid data from the plurality of first block textures and the plurality of second block textures, and store the target block texture into a physical texture;

[0209] The recording module 5554 is used to record the coordinates of the target block texture in the physical texture to an index texture, and the index texture is used to query the coordinates of the target block texture in the physical texture based on the texture coordinates of the three-dimensional model.

[0210] In some embodiments, the plurality of first block textures have the same size. The generation module 5552 is further configured to construct a quadtree with the size of the initial texture as the root node and the size of the first block textures as the leaf nodes; store the plurality of first block textures in the leaf nodes of the quadtree; and generate second block textures corresponding to the non-leaf nodes at each level of the quadtree based on the leaf nodes; wherein the resolution of the second block textures corresponding to the non-leaf nodes at different levels is different.

[0211] In some embodiments, the generation module 5552 is further configured to, based on the first block texture corresponding to the leaf node, traverse the quadtree layer by layer upwards from the parent node of the leaf node until the root node; during the traversal, perform the following operations for each non-leaf node that is a parent node in each level: perform linear filtering on the first block texture corresponding to each child node included in the non-leaf node to obtain the second block texture corresponding to the non-leaf node.

[0212] In some embodiments, the texture processing apparatus further includes: an update module, configured to, after generating the second block texture corresponding to the non-leaf nodes of each level in the quadtree, obtain the brush texture of the three-dimensional model drawn by a brush; divide the brush texture into blocks based on the size of the first block texture to obtain at least one third block texture; update the block texture corresponding to each node of the quadtree based on the at least one third block texture; the filtering module 5553 is further configured to, from the updated block texture corresponding to each node of the quadtree, filter to obtain a target block texture including valid data.

[0213] In some embodiments, the update module is further configured to cache each of the third block textures in the quadtree at the corresponding resolution nodes based on the resolution of the third block texture; starting from the root node of the quadtree, traverse downwards layer by layer, and perform the following operations for each level of nodes: if the node is a root node and the node includes the third block texture, then replace the second block texture in the node with the third block texture, and use the third block texture as the block texture of the node; if the node is an intermediate node and the node includes the third block texture, then replace the second block texture in the node with the third block texture, and merge the third block texture with the block texture of the node's parent node to obtain the block texture of the node; if the node is a leaf node and the node includes the third block texture, then merge the second block texture with the third block texture to obtain a merged texture, and merge the block texture of the node's parent node with the merged texture to obtain the block texture of the node.

[0214] In some embodiments, the texture processing apparatus further includes: an extension module, configured to, after dividing the initial texture into blocks to obtain a plurality of first block textures of the initial texture, perform the following processing for each first block texture: determine the adjacent block textures of the first block texture; and perform edge extension on the first block texture based on the resolution of the adjacent block textures to obtain a first block texture carrying edge pixels.

[0215] In some embodiments, the extension module is further configured to, when the resolution of the adjacent block texture is the same as the resolution of the first block texture, obtain the adjacent pixels of the first block texture in the adjacent block texture; copy the adjacent pixels, and add the adjacent pixels as edge pixels to the edge of the first block texture.

[0216] In some embodiments, the extension module is further configured to: obtain the world coordinates of the edge pixels of the first block texture when the resolution of the adjacent block texture is different from the resolution of the first block texture; map the world coordinates to the texture coordinates of the adjacent block texture; sample the adjacent block texture based on the texture coordinates; and add the sampled pixels as edge pixels to the edge of the first block texture.

[0217] In some embodiments, the filtering module 5553 is further configured to identify invalid block textures from the plurality of first block textures and the plurality of second block textures, wherein the invalid block texture is a block texture that does not include the valid data; and to remove the invalid block textures from the plurality of first block textures and the plurality of second block textures to obtain the target block texture that includes the valid data.

[0218] In some embodiments, the filtering module 5553 is further configured to, when the invalid block texture includes a duplicate block texture, perform the following operations for each of the plurality of first block textures and the plurality of second block textures: compare the block texture with other block textures respectively to obtain a comparison result; based on the comparison result, determine the duplicate block texture that is the same as the block texture from the plurality of first block textures and the plurality of second block textures; and deduplicate the block texture and the duplicate block texture to obtain a target block texture including valid data.

[0219] In some embodiments, the filtering module 5553 is further configured to, when the invalid block texture includes a blank block texture, perform the following operations for each of the plurality of first block textures and the plurality of second block textures: perform pixel-by-pixel detection on the block texture to obtain the channel value of each pixel in the block texture; when the channel value of each pixel in the block texture is a default value, determine the block texture as the blank block texture; remove the blank block texture from the plurality of first block textures and the plurality of second block textures to obtain a target block texture including valid data.

[0220] In some embodiments, the texture processing apparatus further includes: a creation module, configured to determine the number of target block textures before storing the target block textures into a physical texture; and to create a blank physical texture based on the number and the size of the target block textures, wherein the size of the physical texture is adapted to the sum of the sizes of the number of target block textures.

[0221] In some embodiments, the texture processing apparatus further includes: a sampling module, configured to: after recording the coordinates of the target block texture in the physical texture to the index texture, sample the index texture based on the texture coordinates of the three-dimensional model to obtain the coordinates of the target block texture in the physical texture; and sample the physical texture based on the coordinates in the physical texture to obtain the texture of the three-dimensional model.

[0222] This application provides a computer program product including a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the texture processing method described above in this application.

[0223] This application provides a computer-readable storage medium storing computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the processor will execute the texture processing method provided in this application, for example, such as... Figure 3 The methods shown are as follows.

[0224] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.

[0225] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.

[0226] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).

[0227] As an example, computer-executable instructions can be deployed to execute on a single electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.

[0228] In summary, this embodiment of the application effectively constructs a hierarchical and refined texture data structure by dividing the initial texture of the 3D model into blocks, generating multi-resolution second block textures, organizing texture data using a quadtree structure, and combining brush texture updates and block texture edge expansion. Simultaneously, by identifying and removing duplicate, blank, and other invalid block textures, it accurately selects target block textures with valid data, reducing redundant data usage. Adaptive physical textures are created based on the number and size of the target block textures, storage resources are rationally planned, and a mapping relationship between the 3D model texture coordinates and physical texture coordinates is established through indexed textures, achieving efficient and fast texture sampling and rendering. This significantly reduces the storage space of texture data, improves texture loading and rendering efficiency, optimizes the performance of the 3D model during rendering, and greatly reduces hardware resource consumption while ensuring texture detail and visual effects.

[0229] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. A texture processing method, characterized in that, The method includes: Obtain the initial texture of the 3D model, and divide the initial texture into blocks to obtain multiple first block textures of the initial texture; Based on the plurality of first block textures, a plurality of second block textures are generated, wherein the resolution of the second block textures is lower than the resolution of the first block textures; From the plurality of first block textures and the plurality of second block textures, a target block texture including valid data is selected and stored in the physical texture; The coordinates of the target block texture in the physical texture are recorded to an index texture, which is used to query the coordinates of the target block texture in the physical texture based on the texture coordinates of the 3D model.

2. The method according to claim 1, characterized in that, The plurality of first block textures have the same size, and the generation of a plurality of second block textures based on the plurality of first block textures includes: A quadtree is constructed using the size of the initial texture as the root node and the size of the first segmented texture as the leaf nodes; The multiple first block textures are stored in the leaf nodes of the quadtree, and based on the leaf nodes, the second block textures corresponding to the non-leaf nodes at each level of the quadtree are generated. Among them, the resolution of the second block texture corresponding to non-leaf nodes at different levels is different.

3. The method according to claim 2, characterized in that, The step of generating the second block texture corresponding to the non-leaf nodes at each level of the quadtree based on the leaf nodes includes: Based on the first block texture corresponding to the leaf node, starting from the parent node of the leaf node of the quadtree, the quadtree is traversed layer by layer upwards until the root node. During the traversal, the following operations are performed on each non-leaf node that serves as a parent node at each level: Linear filtering is performed on the first block texture corresponding to each child node included in the non-leaf node to obtain the second block texture corresponding to the non-leaf node.

4. The method according to claim 2, characterized in that, After generating the second block texture corresponding to the non-leaf nodes of each level in the quadtree, the method further includes: Obtain the brush texture of the 3D model obtained by drawing with a brush; Based on the size of the first segmented texture, the brush texture is divided into segments to obtain at least one third segmented texture; Based on the at least one third block texture, update the block texture corresponding to each node of the quadtree; The step of filtering out the target block texture containing valid data from the plurality of first block textures and the plurality of second block textures includes: From the block textures corresponding to each node of the updated quadtree, target block textures containing valid data are selected.

5. The method according to claim 4, characterized in that, The step of updating the block texture corresponding to each node of the quadtree based on the at least one third block texture includes: Based on the resolution of the third block texture, each of the third block textures is cached in the corresponding resolution node of the quadtree; Starting from the root node of the quadtree, traverse downwards level by level, and perform the following operations for each level of nodes: If the node is a root node and the node includes the third block texture, then the second block texture in the node is replaced with the third block texture, and the third block texture is used as the block texture of the node; If the node is an intermediate node and the node includes the third block texture, then the second block texture in the node is replaced with the third block texture, and the third block texture is merged with the block texture of the node's parent node to obtain the block texture of the node. If the node is a leaf node and the node includes the third block texture, then the second block texture and the third block texture are merged to obtain a merged texture, and the block texture of the parent node of the node is merged with the merged texture to obtain the block texture of the node.

6. The method according to claim 1, characterized in that, After dividing the initial texture into blocks to obtain multiple first block textures of the initial texture, the method further includes: For each of the first segmented textures, perform the following processing: Determine the adjacent block textures of the first block texture; Based on the resolution of the adjacent block textures, the first block texture is extended at the edges to obtain a first block texture carrying edge pixels.

7. The method according to claim 6, characterized in that, The step of extending the first block texture based on the resolution of the adjacent block textures to obtain a first block texture carrying edge pixels includes: When the resolution of the adjacent block texture is the same as the resolution of the first block texture, the adjacent pixels of the first block texture in the adjacent block texture are obtained; The adjacent pixels are copied and added as edge pixels to the edge of the first block texture.

8. The method according to claim 6, characterized in that, The step of extending the first block texture based on the resolution of the adjacent block textures to obtain a first block texture carrying edge pixels includes: When the resolution of the adjacent block texture is different from the resolution of the first block texture, the world coordinates of the edge pixels of the first block texture are obtained; Map the world coordinates to the texture coordinates of the adjacent block textures; The adjacent block textures are sampled based on the texture coordinates, and the sampled pixels are added as edge pixels to the edge of the first block texture.

9. The method according to claim 1, characterized in that, The step of filtering out the target block texture containing valid data from the plurality of first block textures and the plurality of second block textures includes: From the plurality of first block textures and the plurality of second block textures, invalid block textures are identified, wherein the invalid block texture is a block texture that does not include the valid data; From the plurality of first block textures and the plurality of second block textures, the invalid block textures are removed to obtain the target block texture including valid data.

10. The method according to claim 9, characterized in that, The step of identifying invalid block textures from the plurality of first block textures and the plurality of second block textures includes: When the invalid chunk texture includes a duplicate chunk texture, the following operations are performed for each of the plurality of first chunk textures and the plurality of second chunk textures: The segmented texture is compared with other segmented textures to obtain the comparison results; Based on the comparison results, a repeating block texture identical to the block texture is determined from the plurality of first block textures and the plurality of second block textures; The step of removing invalid block textures from the plurality of first block textures and the plurality of second block textures to obtain the target block texture including valid data includes: The segmented texture and the repeated segmented texture are deduplicated to obtain the target segmented texture including valid data.

11. The method according to claim 9, characterized in that, The step of identifying invalid block textures from the plurality of first block textures and the plurality of second block textures includes: When the invalid block texture includes a blank block texture, the following operations are performed for each of the plurality of first block textures and the plurality of second block textures: Pixel-by-pixel detection is performed on the segmented texture to obtain the channel value of each pixel in the segmented texture; When the channel values ​​of each pixel in the segmented texture are all default values, the segmented texture is determined as the blank segmented texture; The step of removing invalid block textures from the plurality of first block textures and the plurality of second block textures to obtain the target block texture including valid data includes: From the plurality of first block textures and the plurality of second block textures, the blank block textures are removed to obtain the target block texture including valid data.

12. The method according to claim 1, characterized in that, Before storing the target segmented texture to a physical texture, the method further includes: Determine the number of the target tile textures; Based on the quantity and the size of the target block texture, a blank physical texture is created, the size of which is adapted to the sum of the sizes of the quantity of target block textures.

13. The method according to claim 1, characterized in that, After recording the coordinates of the target block texture in the physical texture to the index texture, the method further includes: Based on the texture coordinates of the 3D model, the index texture is sampled to obtain the coordinates of the target block texture in the physical texture; Based on the coordinates in the physical texture, the physical texture is sampled to obtain the texture of the three-dimensional model.

14. A texture processing apparatus, characterized in that, The device includes: The segmentation module is used to obtain the initial texture of the 3D model and segment the initial texture into multiple first segment textures of the initial texture. A generation module is used to generate multiple second block textures based on the multiple first block textures, wherein the resolution of the second block textures is lower than the resolution of the first block textures; The filtering module is used to filter out target block textures containing valid data from the plurality of first block textures and the plurality of second block textures, and store the target block textures into physical textures; The recording module is used to record the coordinates of the target block texture in the physical texture to an index texture, and the index texture is used to query the coordinates of the target block texture in the physical texture based on the texture coordinates of the three-dimensional model.

15. An electronic device, characterized in that, The electronic device includes: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the texture processing method according to any one of claims 1 to 13.

16. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, the texture processing method according to any one of claims 1 to 13 is implemented.

17. A computer program product comprising computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, the texture processing method according to any one of claims 1 to 13 is implemented.