Texture data processing method and apparatus and electronic device
Patent Information
- Application Number
- PCT/CN2025/077192
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-07
- Filing Date
- 2025-02-13
- Publication Date
- 2025-10-02
AI Technical Summary
In cloud games, texture data formats that are not supported by the graphics card need to be decompressed into formats such as RGBA, resulting in high video memory usage, a reduction in the number of concurrent paths that the graphics card can support, and reduced resource utilization.
By acquiring texture data and its metadata, determining whether the format of the target texture data is consistent with the preset compression format, and performing corresponding encoding or decoding processing, a target image is generated.
It reduces the graphics card memory usage and improves the resource utilization of cloud games. The graphics memory usage is reduced by 62% and the number of concurrent paths is doubled.
Smart Images

Figure CN2025077192_02102025_PF_FP_ABST
Abstract
Description
Texture data processing method, device and electronic equipment
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Chinese patent application filed on March 7, 2024, with application number 202410263601.5, entitled “Method, device and electronic device for processing texture data”, the entire contents of which are incorporated herein by reference. Technical Field
[0003] The present disclosure relates to the technical field of cloud computing, and in particular to a texture data processing method, device, and electronic device. Background Art
[0004] Cloud gaming is a gaming method based on cloud computing. In this mode, all games are run on cloud servers, and the rendered game screens are compressed and transmitted to users over the network. The graphics processing module used for rendering in cloud servers typically requires graphics card hardware. Graphics cards generally do not support texture formats such as ETC / ASTC used on Android devices. When cloud games require texture rendering, if the texture data is in a format unsupported by the graphics card, it is usually necessary to decompress the texture into a format such as RGBA. In other words, compressed textures are directly decompressed into uncompressed data after entering the GPU to simulate these unsupported compressed textures. However, with this method, the video memory occupied by the decompressed compressed textures is at least four times the size of the uncompressed texture data. This extremely high video memory usage leads to a sharp decrease in the number of concurrent paths that each graphics card can support, reducing the resource utilization of cloud gaming. Summary of the Invention
[0005] The present disclosure provides a texture data processing method, device, and electronic device to reduce graphics card memory occupancy and improve cloud gaming resource utilization.
[0006] In a first aspect, an embodiment of the present disclosure provides a method for processing texture data, including: obtaining texture data to be processed, and metadata corresponding to the texture data to be processed; the metadata is used to indicate the data format of the texture data to be processed; based on the texture data to be processed and the metadata, determining target texture data; the data format of the target texture data is consistent with a preset target texture compression format; based on the target texture data, rendering and generating a target image.
[0007] In a second aspect, an embodiment of the present disclosure provides a texture data processing device, comprising: a texture data acquisition module, configured to acquire texture data to be processed and metadata corresponding to the texture data to be processed; the metadata is used to indicate the data format of the texture data to be processed; a target texture data determination module, configured to determine target texture data based on the texture data to be processed and the metadata; the data format of the target texture data is consistent with a preset target texture compression format; and a rendering module, configured to render and generate a target image based on the target texture data.
[0008] In a third aspect, an embodiment of the present disclosure provides an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-mentioned texture data processing method.
[0009] In a fourth aspect, an embodiment of the present disclosure provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned texture data processing method.
[0010] The information processing method in the game provided by the embodiment of the present disclosure has the following beneficial effects:
[0011] The aforementioned texture data processing method, device, and electronic device obtain to-be-processed texture data and metadata corresponding to the to-be-processed texture data; the metadata indicates the data format of the to-be-processed texture data; target texture data is determined based on the to-be-processed texture data and the metadata; the data format of the target texture data is consistent with a preset target texture compression format; and a target image is rendered based on the target texture data. This method converts the display format of the to-be-processed texture data to the target texture compression format when it differs from the preset target texture compression format, allowing the cloud server's graphics processing module to use the compressed texture data for texture rendering, reducing graphics card memory usage and improving resource utilization for cloud gaming.
[0012] Other features and advantages of the present disclosure will be described in the following description, and in part will become apparent from the description, or understood by practicing the present disclosure. The objectives and other advantages of the present disclosure are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0013] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] FIG1 is a flowchart of a method for processing texture data according to an embodiment of the present disclosure;
[0015] FIG2 is a flowchart of a method for processing texture data according to an embodiment of the present disclosure;
[0016] FIG3 is a schematic structural diagram of a texture data processing device according to one embodiment of the present disclosure;
[0017] FIG4 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0018] To make the purpose, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present disclosure, not all of them. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0019] Cloud gaming is a gaming method based on cloud computing. In this mode, all games are run on cloud servers, which compress the rendered game images and transmit them to users over the network. On the client side, the user's gaming device does not require any high-end processors or graphics cards; only basic video decompression capabilities are required.
[0020] The graphics processing modules used for rendering in cloud servers typically require graphics card hardware. In cloud gaming, if the PC graphics card doesn't support texture data in formats like ETC / ASTC used by Android, the texture data typically needs to be soft- or hard-coded into formats like RGBA. This means that compressed textures are directly decompressed into uncompressed data upon entering the GPU to simulate these unsupported compressed textures, without any subsequent processing steps, such as texture recompression.
[0021] However, the above approach will cause the following problems:
[0022] (1) The video memory occupied by the compressed texture after decompression is at least 4 times the size of the texture data before decompression, which is very high.
[0023] (2) High video memory usage leads to a sharp decrease in the number of concurrent paths that each graphics card can support.
[0024] (3) Although there are some open source texture compression solutions in the industry, they are usually implemented by the CPU rather than the GPU.
[0025] (4) There is currently no reliable solution for BC7's GPU fast compression.
[0026] Based on this, the embodiments of the present disclosure provide a method, device, and electronic device for processing texture data. This technology can be applied to the texture rendering process based on cloud games.
[0027] In one possible implementation, the present disclosure provides a method for processing texture data. As shown in FIG1 , the method includes the following steps:
[0028] Step S102 , obtaining texture data to be processed and metadata corresponding to the texture data to be processed; the metadata is used to indicate the data format of the texture data to be processed.
[0029] Generally speaking, a texture is one or more two-dimensional images representing the surface of an object, also known as a texture map. When textures are mapped onto an object in a specific way, they can make the object appear more realistic. When understanding texture mapping, think of textures as pixel colors applied to an object's surface. Textures are widely used in games, animation, virtual reality, and other fields.
[0030] With the development of cloud computing technology, the aforementioned services for game development, animation production, and virtual reality development can all be implemented through cloud servers. In the process of implementing these services, cloud servers typically perform texture rendering to generate image or video data, which is then sent to the client without the client having to perform texture rendering.
[0031] The above-mentioned texture data to be processed can be generated by a texture generation module in a game engine, an animation production engine, or a texture generation module in a virtual reality production engine. The format of the texture data to be processed can be an uncompressed format or a compressed format. Among them, the uncompressed format of texture data generally includes RGB (Red-Green-Blue), RGBA (Red-Green-Blue-Alpha), etc. The compressed format of texture data generally includes DXT (also known as S3TC, S3 texture compression), ETC (Ericsson texture compression)), PVRTC (PowerVR texture compression), ASTC (Adaptive Scalable Texture Compression), etc.
[0032] When texture data is generated, corresponding metadata is typically generated. Metadata, also known as intermediary data or relay data, is data about data. Metadata is primarily used to describe data attributes, such as storage location, data format, historical data, resource search, and file logging.
[0033] Step S104 : determining target texture data based on the texture data to be processed and the metadata; the data format of the target texture data is consistent with a preset target texture compression format.
[0034] Because the metadata describes the data format of the texture data to be processed, the metadata of the texture data to be processed can be parsed to determine the data format of the texture data to be processed. After determining the data format of the texture data to be processed, it can be determined whether the texture data to be processed is compressed by determining whether the data format of the texture data to be processed is one of several common compression formats.
[0035] The target texture compression format is typically a compression format supported by the graphics card used by the cloud server. The target texture compression format can be one or more, such as one or more of the aforementioned DXT, ETC, PVRTC, and ASTC formats. The specific format can be set based on your needs and is not limited here.
[0036] If the texture data being processed is compressed, it is necessary to determine whether its data format is the same as the target texture compression format, or whether it belongs to one of multiple target texture compression formats. If so, the texture data being processed can be used directly as the target texture data. If not, it is necessary to decode the texture data to uncompressed texture data, and then encode the uncompressed texture data to the target texture compression format.
[0037] When there are multiple target texture compression formats, one of them can be randomly selected and the corresponding encoding method can be determined to encode the texture data. Alternatively, based on the amount of texture data being encoded and the scenarios for which each target texture compression format is applicable, the target texture compression format corresponding to the encoding process can be determined from the multiple target texture compression formats. The specific setting can be determined based on needs and is not limited here.
[0038] If the texture data to be processed is not compressed, the graphics card can directly process the uncompressed texture data, so the texture data can be rendered directly based on the texture data. Alternatively, the texture data to be processed can be encoded and converted to the target texture compression format. The amount of texture data to be processed can also determine whether it needs to be compressed. For example, if the texture data to be processed exceeds a certain preset data volume threshold, the texture data to be processed needs to be compressed to the target texture compression format.
[0039] Step S106: Rendering and generating a target image based on the target texture data.
[0040] After obtaining the target texture data, the graphics processing module in the cloud server can perform texture rendering based on the target texture data to generate the target image. The target image can be a single image, such as a graphical user interface, or multiple images, such as multiple video frames. The specific configuration can be customized and will not be detailed here.
[0041] The above-mentioned texture data processing method obtains the texture data to be processed and metadata corresponding to the texture data to be processed; the metadata is used to indicate the data format of the texture data to be processed; based on the texture data to be processed and the metadata, target texture data is determined; the data format of the target texture data is consistent with a preset target texture compression format; and based on the target texture data, a target image is rendered and generated. This method converts the display format of the texture data to the target texture compression format when it differs from the preset target texture compression format, allowing the cloud server's graphics processing module to use the compressed texture data for texture rendering, reducing graphics card memory usage and improving cloud gaming resource utilization.
[0042] The following embodiments provide specific methods for obtaining texture data to be processed.
[0043] In a specific implementation, the above method can be implemented through a cloud server. The resources in the cloud server can be divided into a game engine module, a graphics processing module, etc., wherein the graphics processing module is equivalent to a graphics processing unit (GPU), and the system running therein is also referred to as a graphics system. The graphics processing module based on the Android graphics system includes a graphics driver layer. When the game engine generates texture data to be processed and the graphics processing model is required to perform texture rendering based on it, the graphics processing module does not perform texture rendering processing first, but intercepts the texture data to be processed generated by the game engine through the graphics driver layer, and then generates target texture data that is convenient for the graphics processing module to process based on the texture data to be processed and its metadata, and then performs texture rendering processing.
[0044] After determining the target texture data, considering the texture data processing flow, the target texture data can also be sent to the game engine module through the graphics driver layer, and then the graphics processing module is called through the game engine module, and the graphics processing module is used to render and generate the target image based on the target texture data.
[0045] The following embodiments provide a specific method for determining target texture data based on the texture data to be processed and metadata.
[0046] In a specific implementation, the data format of the texture data to be processed can be determined based on the metadata of the texture data to be processed. For example, the metadata can be parsed to obtain parsed data representing the data format, thereby determining the data format of the texture data to be processed; then, it is determined whether the data format of the texture data to be processed is consistent with the target texture compression format. When the target texture compression format is one, when the data format of the texture data to be processed is the same as the target texture compression format, the two are considered to be consistent. When the target texture compression format includes multiple, when the data format of the texture data to be processed is one of the multiple target texture compression formats, the two can be considered to be consistent. If they are consistent, the texture data to be processed can be directly determined as the target texture data; if they are inconsistent, the target texture data needs to be determined based on the data format of the texture data to be processed and the target texture compression format.
[0047] If the data format indicates that the texture data to be processed is compressed, that is, the data format is ETC, ASTC, etc., the texture data to be processed is decoded to obtain decoded texture data to be processed. Specifically, the texture data to be processed can be decoded by a decoder in the graphics processing module. The decoded texture data to be processed is then encoded based on the target texture compression format to obtain target texture data. Specifically, the texture data to be processed can be decoded in real time by a compute shader in the graphics processing module. A compute shader (also known as a "shader") is a compilable program used to implement image rendering.
[0048] The disclosed embodiment also provides another method for processing texture data. The method is implemented on the basis of the method shown in Figure 1. The method can be regarded as a real-time texture compression method without obvious loss of image quality and maintaining the game frame rate. This method targets the shortcomings of the industry's solutions and combines them with the actual situation of cloud games. The driver layer of Android graphics intercepts the data of compressed textures according to the format description information (such as whether it is a compressed format), and then uses the powerful computing power of the PC graphics card to decompress the compressed texture into non-compressed formats such as RGBA. The powerful computing power of the GPU is used again to convert the RGBA format into the BC7 format supported by the PC graphics card in real time, and finally completes the process of uploading texture data.
[0049] The core of this method lies first in the interception and implementation of the Android native graphics interface. It is necessary to effectively filter out the calls that need to be intercepted, adapt to different texture formats, complete the decompression of graphics textures without the perception of the upper-level game engine, and compress them to the BC7 format supported by the PC graphics card in real time while ensuring efficiency, while keeping the resource usage as small as possible; secondly, it lies in the targeted modification of the graphics driver source code level, and put the decompression and recompression of compressed textures on the GPU for execution, which is very difficult for competitors to reverse engineer; thirdly, the graphics driver code of cloud games runs on the cloud server, and it is much more difficult for competitors to crack our implementation than on the client.
[0050] This method is a practical implementation of a fast compression solution for decompressed texture data in cloud gaming, which significantly improves image quality, compression speed, reduced video memory usage, and the number of concurrent paths. The following is a breakdown of the benefits of each step of this method:
[0051] 1. Image quality comparison
[0052] This solution is to re-compress the decompressed data into the BC7 format with relatively high image quality, and does not use the BC3 format with relatively low image quality, because the BC7 format can largely maintain the original RGBA format information.
[0053] 2. Compression performance comparison
[0054] In terms of compression performance, GPU implementation has a huge advantage over CPU implementation. The compression rate comparison data of the two is shown in Table 1:
[0055] Table 1
[0056] As can be seen from the table above, the compression performance is significantly improved. Compared with the pure CPU implementation, the performance is improved by at least 30 times.
[0057] 3. Video memory usage comparison
[0058] Taking a certain game as an example, Table 2 compares the optimization of video memory usage brought by this solution.
[0059] Table 2
[0060] It can be seen that after compressing the texture to BC7 in real time, the video memory usage is greatly reduced, by about 62%.
[0061] 4. Concurrent path comparison
[0062] Table 3
[0063] As can be seen from Table 3, after the real-time compression of textures, the number of concurrent paths has doubled. As can be seen from the above table, after the real-time compression of textures, the number of concurrent paths has doubled.
[0064] Generally speaking, the implementation process of this method is as follows: the game engine transmits the compressed texture data and the corresponding metadata to the graphics driver. The driver layer then intercepts the compressed texture data based on the metadata information and sends the intercepted data to the GPU for decoding. After decoding, the texture is in RGBA format. Finally, the RGBA format texture and the related metadata are sent to the GPU encoding compute shader for real-time encoding. After the encoding is completed, the texture is converted to BC7 format and the BC7 texture object is returned to the game engine for use. The entire processing flow is shown in Figure 2, which specifically includes the following steps:
[0065] 1. The game or game engine at the application layer passes the compressed texture and metadata to the driver;
[0066] 2. The driver layer intercepts the compressed data according to the texture format and inputs the compressed data and format information into the decoder;
[0067] 3. After the decoder obtains the compressed data and corresponding metadata, it is sent to the GPU for decoding. After decoding, it is stored in a temporary RGBA texture;
[0068] 4. Send the decoded temporary texture and metadata to the GPU encoded compute shader;
[0069] 5. Start BC7 compression and return the BC7 compressed texture to the game (game engine) after compression is completed;
[0070] 6. Return to the game program and continue executing subsequent logic.
[0071] This method can significantly reduce video memory usage, greatly increase the number of concurrent paths on a single machine, and reduce the cost of cloud gaming.
[0072] For the above method embodiment, referring to a texture data processing device shown in FIG3 , the device includes:
[0073] The texture data acquisition module 302 is configured to acquire the texture data to be processed and metadata corresponding to the texture data to be processed; the metadata is used to indicate the data format of the texture data to be processed;
[0074] The target texture data determination module 304 is configured to determine target texture data based on the texture data to be processed and the metadata; the data format of the target texture data is consistent with the preset target texture compression format;
[0075] The rendering module 306 is configured to perform rendering to generate a target image based on the target texture data.
[0076] The aforementioned texture data processing device obtains texture data to be processed and metadata corresponding to the texture data to be processed; the metadata indicates the data format of the texture data to be processed; target texture data is determined based on the texture data to be processed and the metadata; the data format of the target texture data is consistent with a preset target texture compression format; and a target image is rendered based on the target texture data. This method converts the display format of the texture data to the target texture compression format when it differs from the preset target texture compression format, allowing the cloud server's graphics processing module to use the compressed texture data for texture rendering, reducing graphics card memory usage and improving resource utilization for cloud gaming.
[0077] The target texture data determination module 304 is further configured to execute: determining the data format of the texture data to be processed based on the metadata of the texture data to be processed; judging whether the data format of the texture data to be processed is consistent with the target texture compression format; if they are consistent, determining the texture data to be processed as the target texture data; if they are inconsistent, determining the target texture data based on the data format of the texture data to be processed and the target texture compression format.
[0078] The target texture data determination module 304 is further configured to perform: if the data format indicates that the texture data to be processed is in a compressed state, decoding the texture data to be processed to obtain decoded texture data to be processed; encoding the decoded texture data to be processed based on the target texture compression format to obtain target texture data.
[0079] The above-mentioned device is set in a cloud server; the cloud server includes a game engine module and a graphics processing module; the graphics processing module includes a graphics driver layer; the texture data acquisition module 302 is also configured to execute: intercepting the texture data to be processed generated by the game engine through the graphics driver layer.
[0080] The above-mentioned device also includes: a texture data sending module, which is configured to execute sending the target texture data to the game engine module through the graphics driver layer; the rendering module 306 is also configured to execute: calling the graphics processing module through the game engine module, and rendering and generating the target image based on the target texture data through the graphics processing module.
[0081] The above-mentioned device is set in a cloud server; the cloud server includes a graphics processing module; the graphics processing module includes a decoder; the above-mentioned target texture data determination module 304 is further configured to execute: decoding the texture data to be processed through the decoder.
[0082] The above-mentioned device is set in a cloud server; the cloud server includes a graphics processing module; the graphics processing module includes a compute shader; the above-mentioned target texture data determination module 304 is also configured to execute: real-time decoding processing of the texture data to be processed by the compute shader.
[0083] This embodiment further provides an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-mentioned texture data processing method, for example:
[0084] Obtaining texture data to be processed and metadata corresponding to the texture data to be processed; the metadata is used to indicate the data format of the texture data to be processed; determining target texture data based on the texture data to be processed and the metadata; the data format of the target texture data is consistent with a preset target texture compression format; and rendering and generating a target image based on the target texture data.
[0085] When the display format of the texture data to be processed is different from the preset target texture compression format, the above method converts its format into the target texture compression format, so that the graphics processing module of the cloud server can use the compressed texture data for texture rendering, reducing the memory occupancy rate of the graphics card and improving the resource utilization of cloud games.
[0086] Optionally, the above-mentioned step of determining the target texture data based on the texture data to be processed and the metadata includes: determining the data format of the texture data to be processed based on the metadata of the texture data to be processed; judging whether the data format of the texture data to be processed is consistent with the target texture compression format; if they are consistent, determining the texture data to be processed as the target texture data; if they are inconsistent, determining the target texture data based on the data format of the texture data to be processed and the target texture compression format.
[0087] Optionally, the above-mentioned step of generating target texture data based on the texture data to be processed and the target texture compression format includes: if the data format indicates that the texture data to be processed is in a compressed state, decoding the texture data to be processed to obtain decoded texture data to be processed; encoding the decoded texture data to be processed based on the target texture compression format to obtain target texture data.
[0088] Optionally, the above method is applied to a cloud server; the cloud server includes a game engine module and a graphics processing module; the graphics processing module includes a graphics driver layer; the step of obtaining the texture data to be processed includes: intercepting the texture data to be processed generated by the game engine through the graphics driver layer.
[0089] Optionally, the above method also includes: sending the target texture data to the game engine module through the graphics driver layer; the step of rendering and generating the target image based on the target texture data includes: calling the graphics processing module through the game engine module, and rendering and generating the target image based on the target texture data through the graphics processing module.
[0090] Optionally, the above method is applied to a cloud server; the cloud server includes a graphics processing module; the graphics processing module includes a decoder; the step of decoding the texture data to be processed includes: decoding the texture data to be processed through a decoder.
[0091] Optionally, the above method is applied to a cloud server; the cloud server includes a graphics processing module; the graphics processing module includes a compute shader; the step of encoding the decoded texture data to be processed based on the target texture compression format includes: real-time decoding of the texture data to be processed through the compute shader.
[0092] As shown in FIG4 , the electronic device includes a processor 100 and a memory 101 . The memory 101 stores machine executable instructions that can be executed by the processor 100 . The processor 100 executes the machine executable instructions to implement the above-mentioned texture data processing method.
[0093] Furthermore, the electronic device shown in FIG. 4 further includes a bus 102 and a communication interface 103 , and the processor 100 , the communication interface 103 and the memory 101 are connected via the bus 102 .
[0094] Memory 101 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between the system network element and at least one other network element is achieved through at least one communication interface 103 (which may be wired or wireless), and may utilize the Internet, a wide area network, a local area network, a metropolitan area network, etc. Bus 102 may be an ISA bus, a PCI bus, or an EISA bus. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, FIG4 uses only one bidirectional arrow, but this does not imply that there is only one bus or only one type of bus.
[0095] The processor 100 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 100 or by instructions in the form of software. The above-mentioned processor 100 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as a random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or register. The storage medium is located in the memory 101. The processor 100 reads the information in the memory 101 and, in conjunction with its hardware, completes the steps of the method of the aforementioned embodiment.
[0096] This embodiment further provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned texture data processing method.
[0097] The present disclosure provides a method, apparatus, and electronic device for processing texture data, including a computer-readable storage medium storing program code. The program code includes instructions that can be used to execute the methods described in the preceding method embodiments, for example:
[0098] Obtaining texture data to be processed and metadata corresponding to the texture data to be processed; the metadata is used to indicate the data format of the texture data to be processed; determining target texture data based on the texture data to be processed and the metadata; the data format of the target texture data is consistent with a preset target texture compression format; and rendering and generating a target image based on the target texture data.
[0099] When the display format of the texture data to be processed is different from the preset target texture compression format, the above method converts its format into the target texture compression format, so that the graphics processing module of the cloud server can use the compressed texture data for texture rendering, reducing the memory occupancy rate of the graphics card and improving the resource utilization of cloud games.
[0100] Optionally, the above-mentioned step of determining the target texture data based on the texture data to be processed and the metadata includes: determining the data format of the texture data to be processed based on the metadata of the texture data to be processed; judging whether the data format of the texture data to be processed is consistent with the target texture compression format; if they are consistent, determining the texture data to be processed as the target texture data; if they are inconsistent, determining the target texture data based on the data format of the texture data to be processed and the target texture compression format.
[0101] Optionally, the above-mentioned step of generating target texture data based on the texture data to be processed and the target texture compression format includes: if the data format indicates that the texture data to be processed is in a compressed state, decoding the texture data to be processed to obtain decoded texture data to be processed; encoding the decoded texture data to be processed based on the target texture compression format to obtain target texture data.
[0102] Optionally, the above method is applied to a cloud server; the cloud server includes a game engine module and a graphics processing module; the graphics processing module includes a graphics driver layer; the step of obtaining the texture data to be processed includes: intercepting the texture data to be processed generated by the game engine through the graphics driver layer.
[0103] Optionally, the above method also includes: sending the target texture data to the game engine module through the graphics driver layer; the step of rendering and generating the target image based on the target texture data includes: calling the graphics processing module through the game engine module, and rendering and generating the target image based on the target texture data through the graphics processing module.
[0104] Optionally, the above method is applied to a cloud server; the cloud server includes a graphics processing module; the graphics processing module includes a decoder; the step of decoding the texture data to be processed includes: decoding the texture data to be processed through a decoder.
[0105] Optionally, the above method is applied to a cloud server; the cloud server includes a graphics processing module; the graphics processing module includes a compute shader; the step of encoding the decoded texture data to be processed based on the target texture compression format includes: real-time decoding of the texture data to be processed through the compute shader.
[0106] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems and devices can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0107] In addition, in the description of the embodiments of the present disclosure, unless otherwise expressly specified or limited, the terms "installed," "connected," and "connected" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium; and they can refer to internal connections between two components. Those skilled in the art will understand the specific meanings of the above terms in the present disclosure based on the specific circumstances.
[0108] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the relevant technology or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0109] In the description of this disclosure, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate the description of this disclosure and simplify the description. They do not indicate or imply that the devices or components referred to must have a specific orientation, be constructed, or operate in a specific orientation. Therefore, they should not be construed as limitations on this disclosure. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0110] Finally, it should be noted that the above embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The scope of protection of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above embodiments within the technical scope disclosed in the present disclosure, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.
Claims
1. A method for processing texture data, comprising: Acquire texture data to be processed and metadata corresponding to the texture data to be processed; The metadata is used to indicate the data format of the texture data to be processed; Determining target texture data based on the texture data to be processed and the metadata; The data format of the target texture data is consistent with a preset target texture compression format; A target image is generated by rendering based on the target texture data.
2. The method according to claim 1, wherein The step of determining target texture data based on the texture data to be processed and the metadata includes: Determining a data format of the texture data to be processed based on metadata of the texture data to be processed; Determining whether a data format of the texture data to be processed is consistent with the target texture compression format; If they are consistent, determining the texture data to be processed as target texture data; If they are inconsistent, target texture data is determined based on the data format of the texture data to be processed and the target texture compression format.
3. The method according to claim 2, wherein: The step of generating target texture data based on the texture data to be processed and the target texture compression format includes: If the data format indicates that the texture data to be processed is in a compressed state, decoding the texture data to be processed to obtain decoded texture data to be processed; The decoded texture data to be processed is encoded based on the target texture compression format to obtain target texture data.
4. The method according to claim 3, wherein: The method is applied to a cloud server; the cloud server includes a game engine module and a graphics processing module; The graphics processing module includes a graphics driver layer; The steps for obtaining texture data to be processed include: The texture data to be processed generated by the game engine is intercepted through the graphics driver layer.
5. The method according to claim 4, wherein The method further comprises: Sending the target texture data to the game engine module through the graphics driver layer; The step of rendering and generating a target image based on the target texture data includes: The graphics processing module is called by the game engine module, and the graphics processing module is rendered to generate a target image based on the target texture data.
6. The method according to claim 3, wherein: The method is applied to a cloud server; the cloud server includes a graphics processing module; the graphics processing module includes a decoder; The step of decoding the texture data to be processed comprises: The texture data to be processed is decoded by the decoder.
7. The method according to claim 3, wherein: The method is applied to a cloud server; the cloud server includes a graphics processing module; the graphics processing module includes a compute shader; The step of encoding the decoded texture data to be processed based on the target texture compression format includes: The texture data to be processed is decoded in real time by the compute shader.
8. A texture data processing device, comprising: A texture data acquisition module is configured to acquire texture data to be processed and metadata corresponding to the texture data to be processed; The metadata is used to indicate the data format of the texture data to be processed; a target texture data determination module, configured to determine target texture data based on the texture data to be processed and the metadata; The data format of the target texture data is consistent with a preset target texture compression format; The rendering module is configured to perform rendering to generate a target image based on the target texture data.
9. An electronic device comprising a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the texture data processing method according to any one of claims 1 to 7.
10. A machine-readable storage medium storing machine-executable instructions, wherein when the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the texture data processing method according to any one of claims 1 to 7.