CN113902840A - Texture map display method and device, storage medium and cloud server - Google Patents

Texture map display method and device, storage medium and cloud server Download PDF

Info

Publication number
CN113902840A
CN113902840A CN202111160384.XA CN202111160384A CN113902840A CN 113902840 A CN113902840 A CN 113902840A CN 202111160384 A CN202111160384 A CN 202111160384A CN 113902840 A CN113902840 A CN 113902840A
Authority
CN
China
Prior art keywords
texture
data
data format
texture data
map
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111160384.XA
Other languages
Chinese (zh)
Inventor
周旭光
吴锴
顾昕
黄康泉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202111160384.XA priority Critical patent/CN113902840A/en
Publication of CN113902840A publication Critical patent/CN113902840A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20112Image segmentation details
    • G06T2207/20132Image cropping

Abstract

The embodiment of the application discloses a method and a device for displaying a texture map, a computer-readable storage medium and a cloud server, wherein the method comprises the following steps: acquiring coded texture data corresponding to a texture map to be displayed and sent by a service program and a first data format of the coded texture data; when the first data format belongs to the preset data format set, decoding the encoded texture data to obtain texture data of a second data format; and controlling the graphics processor to display the texture map to be displayed based on the texture data in the second data format. The texture data of the coded first data format which is not supported by the graphic processor is decoded into the texture data of the second data format which is supported by the graphic processor by performing soft decoding on the coded texture data of the first data format which is not supported by the graphic processor, so that texture maps corresponding to the texture data of different data formats can be displayed, the compatibility is improved, and the black screen or collapse of a game is avoided.

Description

Texture map display method and device, storage medium and cloud server
Technical Field
The application relates to the field of computers, in particular to a method and a device for displaying a texture map, a computer-readable storage medium and a cloud server.
Background
In recent years, games have become an indispensable activity in life as a popular entertainment item, and as the image quality in games is continuously improved, the performance requirements of clients of users are increased, so that cloud games are created, and users can establish connection with a cloud server through the clients, run the games through the cloud server, and receive game pictures returned by the cloud server.
In the prior art, when a game is run, a cloud server is required to display a game picture, and in the process of display, a game program installed in the local of the cloud server is required to send texture data of a fixed data type obtained after a texture map is encoded by a fixed encoding mode to the cloud server side for decoding and displaying. Texture mapping is the pasting of any type of picture on one or more faces of a 3d model. The picture can be of any but generally a common style, such as: bricks, plants, barren land and the like, thereby improving the reality of the scene in the game.
In the research and practice process of the prior art, the inventor of the application finds that in the prior art, due to the difference of the configuration of the cloud servers, part of the cloud servers cannot decode texture data of fixed data types, so that the game is blacked or collapsed, and the compatibility is poor.
Disclosure of Invention
The embodiment of the application provides a method and a device for displaying a texture map, which can improve compatibility and avoid black screen or breakdown of a game.
In order to solve the above technical problem, an embodiment of the present application provides the following technical solutions:
a display method of a texture map is applied to a cloud server with a graphic processor, a service program is installed on the cloud server, the cloud server is connected with a client, the cloud server is used for sending a display picture which can be displayed by the cloud server to the client, and the method comprises the following steps:
acquiring coded texture data corresponding to a texture map to be displayed and sent by the service program and a first data format of the coded texture data;
when the first data format belongs to a preset data format set, decoding the encoded texture data to obtain texture data of a second data format, wherein the second data format is a data format supported by the graphics processor, and the preset data format set comprises at least one data format not supported by the graphics processor;
and controlling the graphics processor to display the texture map to be displayed based on the texture data in the second data format.
A display device of a texture mapping is applied to a cloud server with a graphic processor, a service program is installed on the cloud server, the cloud server is connected with a client, and the cloud server is used for sending a display picture which can be displayed by the cloud server to the client, and comprises:
the first obtaining module is used for obtaining coded texture data corresponding to the texture map to be displayed and sent by the service program and a first data format of the coded texture data;
a decoding module, configured to decode the encoded texture data to obtain texture data in a second data format when the first data format belongs to a preset data format set, where the second data format is a data format supported by the graphics processor, and the preset data format set includes at least one data format that is not supported by the graphics processor;
and the first display module is used for controlling the graphics processor to display the texture map to be displayed based on the texture data in the second data format.
In some embodiments, the apparatus further comprises:
the generating module is used for generating the texture data of the first data format into a corresponding first texture object on a graphic driving layer of the cloud server through the graphic processor when the first data format does not belong to a preset data format set;
and the return module is used for returning the first texture object to the service program and controlling the graphics processor to display the texture map to be displayed according to the first texture object when the service program receives the first texture object.
In some embodiments, the decoding module comprises:
the first decoding submodule is used for decoding the encoded texture data to obtain initial decoded texture data in a second data format;
and the cutting submodule is used for cutting the texture map to be cut corresponding to the initially decoded texture data to obtain the cut texture map and the texture data of a second data format corresponding to the cut texture map.
In some embodiments, the first decoding sub-module comprises:
the first determining unit is used for determining target decoding logic corresponding to a first data format based on the corresponding relation between a plurality of preset data formats and the decoding logic;
and the first decoding unit is used for decoding the encoded texture data according to the target decoding logic to obtain the initial decoded texture data in the second data format.
In some embodiments, the encoded texture data is texture data encoded in a preset encoding manner, the encoded texture data includes a plurality of sub-texture data, and the first decoding sub-module further includes:
an obtaining unit configured to obtain a first amount of the sub-texture data;
the first decoding unit includes:
and the decoding subunit is configured to decode the encoded texture data according to the target decoding logic until a second quantity of decoded sub-texture data in the encoded texture data is the same as the first quantity, so as to obtain initial decoded texture data in a second data format.
In some embodiments, the obtaining unit includes:
an obtaining subunit, configured to obtain an original size carried in the encoded texture data, where the original size is an original size of the texture map to be displayed;
the calculation subunit is used for calculating the coding size of the texture map to be displayed after the texture map is coded by a preset coding mode;
a determining subunit, configured to determine the first number of sub-texture data based on the preset encoding mode and the encoding size.
In some embodiments, the determining subunit is configured to:
obtaining the cutting size adopted by the preset coding mode, wherein the cutting size is the size of a cutting block adopted when the preset coding mode is used for coding the texture mapping to be displayed;
determining a first number of the sub-texture data based on the crop size and the encoding size.
In some embodiments, the cropping size comprises a cropping length and a cropping width, the original size comprises an original length and an original width, the decoding module further comprises:
the calculating submodule is used for calculating a first ratio of the original length to the cutting length and calculating a second ratio of the original width to the cutting width;
the first judgment submodule is used for judging whether the first ratio and the second ratio are integers or not;
the first determining submodule is used for determining that the coded texture data is the texture data obtained by coding the expanded texture data obtained by expanding the texture map if the texture data is not the coded texture data;
and the execution submodule is used for executing the steps of cutting the texture map to be cut corresponding to the initially decoded texture data to obtain the cut texture map and the texture data of the second data format corresponding to the cut texture map.
In some embodiments, the cropping sub-module comprises:
and the cutting unit is used for cutting the texture mapping to be cut corresponding to the initially decoded texture data according to the original size to obtain the cut texture mapping and the texture data of the second data format corresponding to the cut texture mapping.
In some embodiments, the decoding module further comprises:
the second determining submodule is used for determining the coded texture data as texture data obtained by coding the original texture data corresponding to the texture map to be displayed if the texture data is the coded texture data;
and the display sub-module is used for controlling the graphics processor to display the texture map to be displayed based on the initially decoded texture data in the second data format.
In some embodiments, the decoding module comprises:
the second judgment submodule is used for judging whether the first data format belongs to a preset data format set or not on a graph driving layer of the cloud server;
and the second decoding submodule is used for decoding the encoded texture data to obtain texture data in a second data format when the first data format belongs to a preset data format set.
In some embodiments, the cloud server is further configured with a decoder, the second decoding submodule to:
and when the first data format belongs to a preset data format set, sending the encoded texture data to the decoder for decoding to obtain texture data of a second data format.
In some embodiments, the first display module comprises:
the generating submodule is used for returning the texture data of the second data format obtained by decoding of the decoder to the graphics driving layer, and generating the texture data of the second data format into a corresponding second texture object in the graphics driving layer through the graphics processor;
and the return submodule is used for returning the second texture object to the service program, and controlling the graphics processor to display the texture map to be displayed according to the second texture object when the service program receives the second texture object.
A computer readable storage medium, wherein a plurality of instructions are stored in the computer readable storage medium, and the instructions are suitable for being loaded by a processor to execute the steps in the method for displaying the texture map.
A cloud server comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps in the method of displaying a texture map as described above when executing the program.
The method comprises the steps that coded texture data corresponding to a texture map to be displayed and sent by a service program and a first data format of the coded texture data are obtained; when the first data format belongs to a preset data format set, decoding the encoded texture data to obtain texture data of a second data format, wherein the second data format is a data format supported by the graphics processor, and the preset data format set comprises at least one data format not supported by the graphics processor; and controlling the graphics processor to display the texture map to be displayed based on the texture data in the second data format. Therefore, the encoded texture data in the first data format which is not supported by the graphics processor is subjected to soft decoding to be decoded into the texture data in the second data format which is supported by the graphics processor, and then the texture maps corresponding to the texture data in different data formats can be displayed, so that the compatibility is improved, and the game is prevented from being blacked or collapsed.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1a is a scene schematic diagram of a display method of a texture map according to an embodiment of the present application.
Fig. 1b is a flowchart illustrating a method for displaying a texture map according to an embodiment of the present disclosure.
Fig. 1c is a schematic diagram of a texture map attached to a template according to an embodiment of the present disclosure.
Fig. 2 is another schematic flow chart of a method for displaying a texture map according to an embodiment of the present disclosure.
FIG. 3 is a schematic structural diagram of a display device for texture mapping according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a cloud server provided in an embodiment of the present application.
Fig. 5 is an execution schematic diagram of a texture map to be displayed, which is sent by a service program and received by a cloud server according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a method and a device for displaying a texture map and a computer readable storage medium.
Referring to fig. 1a, fig. 1a is a schematic system diagram of a texture mapping display system according to an embodiment of the present disclosure, which may include at least one client 1000, at least one cloud server 2000, at least one database 3000, and a network 4000. The client 1000 may be a computer device such as a mobile phone, a computer, or a personal digital assistant, and various service programs such as a game program, a taxi-taking program, and the like may be installed on the cloud server 2000, the cloud server 2000 and the client 1000 may establish a connection through the network 4000, and the cloud server 2000 is configured to send a display screen displayable by the cloud server 2000 to the client 1000. The network 4000 may be a wireless network or a wired network, for example, the wireless network is a Wireless Local Area Network (WLAN), a Local Area Network (LAN), a cellular network, a 2G network, a 3G network, a 4G network, a 5G network, or the like. In addition, different cloud servers 2000 may be connected to each other using their own bluetooth network or hotspot network to the cloud server 2000. In addition, the system may include a database 3000, and the database 3000 may be used to store business information of users.
The embodiment of the application provides a display method of a texture map, which can be executed by a cloud server. As shown in fig. 1a, the service program sends encoded texture data corresponding to a texture map to be displayed to the cloud server 2000; the cloud server 2000 acquires a first data format of the encoded texture data; when the first data format belongs to a preset data format set, decoding the encoded texture data to obtain texture data of a second data format, wherein the second data format is a data format supported by the graphics processor, and the preset data format set comprises at least one data format not supported by the graphics processor; and controlling the graphics processor to display the texture map to be displayed based on the texture data in the second data format.
It should be noted that the scene schematic diagram of the display system of the texture map shown in fig. 1a is only an example, and the display system of the texture map and the scene described in the embodiment of the present application are for more clearly illustrating the technical solution of the embodiment of the present application, and do not form a limitation on the technical solution provided in the embodiment of the present application, and as can be known by those skilled in the art, with the evolution of the display system of the texture map and the appearance of a new service scene, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.
In the present embodiment, description will be made from the perspective of a display device of a texture map, which may be specifically integrated in a cloud server having a storage unit and a microprocessor installed therein and having an arithmetic capability.
Referring to fig. 1b, fig. 1b is a schematic flow chart illustrating a method for displaying a texture map according to an embodiment of the present disclosure. The display method of the texture map comprises the following steps:
in step 101, coded texture data corresponding to a texture map to be displayed sent by a service program and a first data format of the coded texture data are obtained.
The service program is used for providing corresponding service display for the user according to the operation information of the user aiming at the client. For example, a user clicks a certain service interface in the client, so that the service program can execute a corresponding service presentation according to the service interface. The service program can be a game program, a user can perform game control on the client, and the service program can display pictures such as running and jumping on the cloud server according to the game control. The texture map is a bitmap stored in memory that can be mapped to the surface of the rendered object by the UV coordinates to form an object that can be seen by the user in the game. In games, uncoded texture data corresponding to texture maps occupies most of the memory (video memory) space, and bandwidth (bandwidth) is a scarce resource in games, especially mobile devices. Therefore, texture data needs to be encoded, so that memory and bandwidth are saved, the frame rate is increased, and heat generation of the cloud server is reduced.
Specifically, since the texture map needs to be encoded, the texture data corresponding to the acquired texture map to be displayed is the encoded texture data. When a user operates a virtual character in a game to change the view angle orientation, the object is in the changed view angle orientation, so that the texture map corresponding to the object is the texture map to be displayed, and a service program needs to send the texture map to be displayed to a cloud server, so that the cloud server obtains the texture map to be displayed.
The encoding modes of texture maps of different games are different, and the encoding modes of DXT series, ETC series and PVRTC series are generally adopted, wherein the DXT series comprises DXT1, DXT2, DXT3, DXT4 and DXT5, the ETC series comprises ETC1 and ETC2 encoding modes, and the PVRTC series comprises PVRTC 2-bpp and PVRTC 4-bpp encoding modes. The encoding method includes a plurality of sub-encoding methods, for example, the ETC2 encoding method includes sub-encoding methods such as complete _ RGB8_ ETC2 and complete _ SRGB8_ ETC 2. COMPRESSED _ RGB8_ ETC 2: for compressing RGB8 data, it is a super set (super set) of the old texture compression format OES _ compressed _ ETC1_ RGB8_ texture, and can decode the texture of ETC1 with downward compatibility. Three new modes are included-T-mode, which favors sharp chroma blocks, H-mode, and Planar, which favors smooth blocks. COMPRESSED _ SRGB8_ ETC 2: similar in effect to the compact _ RGB8_ ETC2, except that this is compiled as the value of sRGB. The data format is a data format of data generated by a sub-coding mode adopted when the texture map is coded, and the first data format is a data format of data generated by a sub-coding mode adopted when the texture map to be displayed is coded.
In step 102, when the first data format belongs to a preset data format set, the encoded texture data is decoded to obtain texture data of a second data format.
The preset data format set includes at least one data format that is not supported by a graphics processing unit (gpu). When the first data format belongs to the preset data format set, it is indicated that the graphics processor does not support the first data format, that is, the graphics processor cannot display the texture map to be displayed, and therefore, a Central Processing Unit (CPU) is required to perform soft decoding on the compressed texture data, so as to obtain decoded texture data, where the decoded texture data is a second data format that the graphics processor can support, and the graphics processor can display the texture map to be displayed.
Specifically, taking ETC2 as an example, if the graphics processor cannot support the encoding scheme of ETC2, the preset data format set is a set of data formats of the data obtained through a plurality of sub-encoding schemes included in ETC 2. If the first data format is data encoded by the compact _ RGB8_ ETC2, and the first data format belongs to a preset data format set, the encoded texture data needs to be decoded, so that the graphics processor displays the texture map to be displayed based on the decoded texture data.
In some embodiments, when the first data format belongs to a preset data format set, the step of decoding the encoded texture data to obtain texture data in a second data format includes:
(1) judging whether the first data format belongs to a preset data format set or not on a graphic driving layer of the cloud server;
(2) and when the first data format belongs to a preset data format set, decoding the encoded texture data to obtain texture data of a second data format.
Because the graphics processor does not support only a part of coding modes, the coded texture data coded by the coding mode which is not supported by the graphics processor can be intercepted at the Vulkan driving layer according to the data format. Therefore, whether the first data format belongs to the preset data format set or not is judged at the graphics driver layer of the cloud server, if so, the first data format is the data format of data generated by a coding mode which is not supported by the graphics processor, and the coded texture data needs to be decoded.
Specifically, in the decoding process, the encoded texture data can be decoded and accelerated by using a RenderScript high-performance computing frame, and in combination with a Vulkan driving layer, when the driving layer judges that the data format is the data format of data generated by adopting a coding mode which is not supported by a graphics processor, the encoded texture data is transmitted into the RenderScript computing frame, and the RenderScript can distribute tasks to cores such as a CPU (central processing unit), the graphics processor and the like for parallel processing, so that the technical effect of exerting the performance of the graphics processor is achieved.
In some embodiments, the step of decoding the encoded texture data to obtain texture data in the second data format includes:
(1) decoding the encoded texture data to obtain initial decoded texture data in a second data format;
(2) and cutting the texture mapping to be cut corresponding to the initially decoded texture data to obtain the cut texture mapping and the texture data of a second data format corresponding to the cut texture mapping.
In the encoding process, the texture map is attached to the template and compressed together with the template, so that the size of the map corresponding to the initially decoded texture data of the decoded second data format is larger than that of the original texture map, and in order not to influence the normal display of the texture map, the texture map to be clipped corresponding to the initially decoded texture data under the condition needs to be clipped, so that the size of the obtained clipped texture map is the same as the original size of the texture map, and the texture data of the second data format corresponding to the clipped texture map is obtained.
In some embodiments, the step of decoding the encoded texture data to obtain the initial decoded texture data in the second data format includes:
(1.1) determining target decoding logic corresponding to the first data format based on the corresponding relation between a plurality of preset data formats and the decoding logic;
and (1.2) decoding the encoded texture data according to the target decoding logic to obtain the initial decoded texture data in the second data format.
Because the encoding logics corresponding to different encoding modes are different, different decoding logics need to be set for the encoded texture data of different data formats generated by different encoding modes. The corresponding relationship between a plurality of data formats and the decoding logic can be set in advance, so that the corresponding target decoding logic can be determined according to the first data format of the decoded texture data. And then decoding the encoded texture data according to the target decoding logic to obtain the initial decoded texture data of the second data format.
In some embodiments, the encoded texture data is texture data encoded in a preset encoding manner, where the encoded texture data includes a plurality of sub-texture data, and before the step of decoding the encoded texture data to obtain the initial decoded texture data in the second data format, the method further includes:
obtaining a first quantity of the sub-texture data;
the step of decoding the encoded texture data according to the target decoding logic to obtain the initial decoded texture data in the second data format includes:
and decoding the encoded texture data according to the target decoding logic until the second quantity of the decoded sub-texture data in the encoded texture data is the same as the first quantity, so as to obtain the initial decoded texture data in a second data format.
When some encoding methods are used for encoding texture data, the texture maps corresponding to the texture data are cut into a plurality of sub-texture maps with the same size, and the sub-texture data corresponding to the sub-texture maps are encoded in sequence, so that the encoded texture data comprises a plurality of sub-texture data. The first quantity of the sub-texture data can be obtained, a decoder used for decoding is informed that the first quantity of the sub-texture data needs to be decoded, the decoder records the sub-texture data during decoding, and when the second quantity of the decoded sub-texture data in the encoded texture data is the same as the first quantity, the initial decoded texture data in the second data format is obtained, namely the texture data corresponding to a complete texture mapping is decoded.
In some embodiments, the step of obtaining the first amount of sub-texture data comprises:
(1.1) acquiring an original size carried in the encoded texture data, wherein the original size is the original size of the texture map to be displayed;
(1.2) calculating the coding size of the texture map to be displayed after the texture map is coded in a preset coding mode;
and (1.3) determining the first number of the sub-texture data based on the preset coding mode and the coding size.
Wherein the encoded texture data carries the original size of the texture map to be displayed. For example, the original size of the texture map to be displayed is 1680 × 1050, and when encoding is performed by using the ETC2 series encoding method, the texture map to be displayed of 1680 × 1050 needs to be attached to the template of 1680 × 1052, and then segmentation and encoding are performed. The encoded code size is therefore 1680 x 1052. And determining the first quantity of the sub-texture data based on the preset coding mode and the coding size.
In some embodiments, the determining the first amount of sub-texture data based on the preset coding mode and the coding size includes:
(1.1) obtaining the cutting size adopted by the preset coding mode, wherein the cutting size is the size of a cutting block adopted when the preset coding mode is used for coding the texture map to be displayed;
(1.2) determining a first number of the sub-texture data based on the clipping size and the encoding size.
In order to save memory, the image with the coding size is cut during coding. Taking ETC2 as an example, in the coding method of the ETC2 series, an image with a coding size is cut by using a 4 × 4 cropping block, and if the coding size is 1680 × 1052, the image with 1680 × 1052 is cut into transverse 1680 ÷ 4 ÷ 420 blocks and longitudinal 1052 ÷ 4 ÷ 263 blocks according to the 4 × 4 cropping block, so that the total number of 420 × 263 ═ 110460 sub-texture maps corresponds to the first number of sub-texture data 110460.
Specifically, to ensure that the size of each sub-texture map obtained by cropping the image according to 4 × 4 cropping blocks is the same, it is necessary to determine that the width and the length of the image are both integer multiples of 4. Taking the texture map of 1680 x 1050 as an example, since 1680 is a multiple of 4, and 1050 is not an integer multiple of 4, it is necessary to create a template whose size needs to satisfy a number greater than the width 1050 and whose size is just greater than 1050 and can be divided by 4, so that the width 1052 of the template is 1680 x 1052 as a whole. Then, the 1680 × 1050 texture map is pasted on the 1680 × 1052 template, and the whole is cut and encoded.
In some embodiments, the cropping size includes a cropping length and a cropping width, and the original size includes an original length and an original width, and before the step of cropping the texture map to be cropped corresponding to the initially decoded texture data to obtain a cropped texture map and texture data in the second data format corresponding to the cropped texture map, the method further includes:
(1) calculating a first ratio of the original length to the trimmed length, and calculating a second ratio of the original width to the trimmed width;
(2) judging whether the first ratio and the second ratio are integers or not;
(3) if not, determining that the coded texture data is texture data obtained by coding expanded texture data obtained by expanding the texture map;
(4) and cutting the texture map to be cut corresponding to the initially decoded texture data to obtain the cut texture map and the texture data of the second data format corresponding to the cut texture map.
In order to determine whether an image corresponding to the decoded texture data is consistent with the size of the texture map, calculating a first ratio of the original length to the cropping length, calculating a second ratio of the original width to the cropping width, and judging whether the first ratio and the second ratio are integers; if not, determining that the coded texture data is the texture data obtained by coding the expanded texture data obtained by expanding the texture map, and cutting the texture map to be cut corresponding to the initially decoded texture data to obtain the cut texture map and the texture data of a second data format corresponding to the cut texture map.
For example, if the cropping block is 4 long and 4 wide, the original length is 1680, and the original width is 1050, the first ratio is 420, and the second ratio is 262.5, and since the second ratio is not an integer, it is determined that the obtained encoded texture data is the texture data obtained by extending the texture map of 1680 × 1050, pasting the texture data to the template 1680 × 1052, and then cropping and encoding the texture data together with the template. Therefore, the image size corresponding to the initially decoded texture data is 1680 × 1052, and not 1680 × 1050, so the steps of cropping the texture map to be cropped corresponding to the initially decoded texture data to obtain the cropped texture map and the texture data in the second data format corresponding to the cropped texture map are performed, thereby cropping 1680 × 1052 of the image to be cropped into 1680 × 1050.
In some embodiments, the clipping the texture map to be clipped corresponding to the initially decoded texture data to obtain the clipped texture map and the texture data in the second data format corresponding to the clipped texture map includes:
and clipping the texture map to be clipped corresponding to the initially decoded texture data according to the original size to obtain the clipped texture map and the texture data of a second data format corresponding to the clipped texture map.
Wherein, the texture mapping mode can be unified in advance when coding. Referring to fig. 1c, fig. 1c is a schematic diagram illustrating a texture map attached to a template according to an embodiment of the present disclosure. When the texture map is pasted on the template, the upper left corner of the texture map A can be uniformly superposed with the upper left corner of the template B, so that the part of the template B exceeding the texture map A is the part needing to be cut off when the texture map to be cut is subsequently cut.
For example, when the image of 1680 × 1052 is clipped to 1680 × 1050, only the portion of 1052-1050 that has the extra width needs to be clipped, so as to obtain the clipped texture map and the texture data in the second data format corresponding to the clipped texture map.
In some embodiments, the method further comprises:
(1) if so, determining the encoded texture data as texture data obtained by encoding the original texture data corresponding to the texture map;
(2) and controlling the graphics processor to display the texture map to be displayed based on the initial decoded texture data of the second data format.
If the original size of the texture map is 800 x 600, the length and the width are all integer multiples of 4, so that the texture map can be directly cut into a plurality of sub-texture maps with the same size during coding without creating a template. Therefore, the map corresponding to the initially decoded texture data of the subsequently decoded second data format is the original texture map to be displayed. The graphics processor may be controlled to display the texture map to be displayed based on an initial decoding of the second data format.
In some embodiments, the cloud server is further configured with a decoder, and the step of decoding the encoded texture data to obtain texture data in a second data format when the first data format belongs to a preset data format set includes:
and when the first data format belongs to a preset data format set, sending the encoded texture data to the decoder for decoding to obtain texture data of a second data format.
The texture data in the first data format needs to be decoded by a decoder, so that the data format of the texture data is converted from the first data format which cannot be supported into the second data format which can be supported.
In some embodiments, the method further comprises:
(1) when the first data format does not belong to a preset data format set, generating texture data of the first data format into a corresponding first texture object on a graphic driving layer of the cloud server through the graphic processor;
(2) and returning the first texture object to the service program, and controlling the graphics processor to display the texture map to be displayed according to the first texture object when the service program receives the first texture object.
When the first data format does not belong to the preset data format set, it is indicated that the data format of the texture data sent by the service program can be supported by the graphics processor, and then the existing texture map display process is normally executed.
Specifically, when the cloud server displays the texture map, the texture data needs to be generated into a corresponding texture object through the graphics processor, so that the graphics processor is called through the service program to perform display operations such as rendering on the texture object, and finally display is performed. The texture data of the first data format may be generated as a corresponding first texture object by a graphic processor installed in the cloud server; and returning the first texture object to the service program, and controlling the graphics processor to display the texture map to be displayed according to the first texture object when the service program receives the first texture object.
In step 103, controlling the graphics processor to display the texture map to be displayed based on the texture data in the second data format.
And controlling the graphics processor to display the texture map to be displayed based on the texture data in the second data format.
In some embodiments, the step of controlling the graphics processor to display the texture map to be displayed based on the texture data in the second data format comprises:
(1) returning the texture data of the second data format decoded by the decoder to the graphics driver layer, and generating the texture data of the second data format into a corresponding second texture object in the graphics driver layer through the graphics processor;
(2) and returning the second texture object to the service program, and controlling the graphics processor to display the texture mapping to be displayed according to the second texture object when the service program receives the second texture object.
Since the data format conversion is performed in the decoder, the texture data in the second data format obtained in the decoder needs to be returned to the graphics driver layer, so as to perform the subsequent texture map display process.
Specifically, the method comprises the following steps. And generating the texture data in the second data format into a corresponding second texture object through a graphics processor on a graphics driving layer, returning the second texture object to the service program, and controlling the graphics processor to display the texture map to be displayed according to the second texture object when the second texture object is received through the service program.
As can be seen from the above, in the embodiment of the present application, encoded texture data corresponding to a texture map to be displayed and sent by the service program, and a first data format of the encoded texture data are obtained; when the first data format belongs to a preset data format set, decoding the encoded texture data to obtain texture data of a second data format, wherein the second data format is a data format supported by the graphics processor, and the preset data format set comprises at least one data format not supported by the graphics processor; and controlling the graphics processor to display the texture map to be displayed based on the texture data in the second data format. Therefore, the encoded texture data in the first data format which is not supported by the graphics processor is subjected to soft decoding to be decoded into the texture data in the second data format which is supported by the graphics processor, and then the texture maps corresponding to the texture data in different data formats can be displayed, so that the compatibility is improved, and the game is prevented from being blacked or collapsed.
The method described in connection with the above embodiments will be described in further detail below by way of example.
Referring to fig. 2, fig. 2 is another schematic flow chart illustrating a method for displaying a texture map according to an embodiment of the present application. The method flow can comprise the following steps:
in step 201, the cloud server obtains encoded texture data corresponding to the texture map to be displayed and sent by the service program, and a first data format of the encoded texture data.
The texture map is a bitmap stored in a memory, and can be mapped to the surface of a rendered object through UV coordinates, so that the object which can be seen by a user in the game is formed. In games, uncoded texture data corresponding to texture maps occupies most of the memory (video memory) space, and bandwidth (bandwidth) is a scarce resource in games, especially mobile devices. Therefore, texture data needs to be encoded, so that memory and bandwidth are saved, the frame rate is increased, and heat generation of the cloud server is reduced.
Specifically, since the texture map needs to be encoded, the texture data corresponding to the acquired texture map to be displayed is the encoded texture data. When a user operates a virtual character in a game to change the view angle orientation, the object is located in the changed view angle orientation, so that the texture map corresponding to the object is the texture map to be displayed, the server needs to send the texture map to be displayed to the cloud server, and the cloud server obtains the texture map to be displayed.
The encoding modes of texture maps of different games are different, and the encoding modes of DXT series, ETC series and PVRTC series are generally adopted, wherein the DXT series comprises DXT1, DXT2, DXT3, DXT4 and DXT5, the ETC series comprises ETC1 and ETC2 encoding modes, and the PVRTC series comprises PVRTC 2-bpp and PVRTC 4-bpp encoding modes. The encoding method includes a plurality of sub-encoding methods, for example, the ETC2 encoding method includes sub-encoding methods such as complete _ RGB8_ ETC2 and complete _ SRGB8_ ETC 2. COMPRESSED _ RGB8_ ETC 2: for compressing RGB8 data, it is a super set (super set) of the old texture compression format OES _ compressed _ ETC1_ RGB8_ texture, and can decode the texture of ETC1 with downward compatibility. Three new modes are included-T-mode, which favors sharp chroma blocks, H-mode, and Planar, which favors smooth blocks. COMPRESSED _ SRGB8_ ETC 2: similar in effect to the compact _ RGB8_ ETC2, except that this is compiled as the value of sRGB. The data format is a data format of data generated by a sub-coding mode adopted when the texture map is coded, and the first data format is a data format of data generated by a sub-coding mode adopted when the texture map to be displayed is coded.
In step 202, it is determined whether the first data format belongs to a preset data format set at a graphics driver layer of the cloud server.
The preset data format set includes at least one data format that is not supported by a graphics processing unit (gpu). When the first data format belongs to the preset data format set, the graphics processor does not support the first data format, that is, the graphics processor cannot display the texture map to be displayed.
Specifically, taking ETC2 as an example, if the graphics processor cannot support the encoding scheme of ETC2, the preset data format set is a set of data formats of the data obtained through a plurality of sub-encoding schemes included in ETC 2. If the first data format is data encoded by the compact _ RGB8_ ETC2, the first data format belongs to a set of predetermined data formats.
Because the graphics processor does not support only a part of coding modes, the coded texture data coded by the coding mode which is not supported by the graphics processor can be intercepted at the Vulkan driving layer according to the data format. Therefore, whether the first data format belongs to the preset data format set or not is judged at the graphics driver layer of the cloud server, if so, the first data format is the data format of data generated by a coding mode which is not supported by the graphics processor, and the coded texture data needs to be decoded.
In step 203, when the first data format belongs to the preset data format set, the cloud server obtains an original size carried in the encoded texture data, where the original size is an original size of the texture map to be displayed.
Wherein the encoded texture data carries the original size of the texture map to be displayed.
For example, the original size of the texture map to be displayed is 1680 x 1050.
In step 204, the cloud server calculates an encoding size of the texture map after encoding in a preset encoding manner.
When the ETC2 series encoding method is used for encoding, the texture map to be displayed of 1680 x 1050 needs to be attached to the template of 1680 x 1052, and then segmentation and encoding are carried out. The encoded code size is therefore 1680 x 1052.
Specifically, to ensure that the size of each sub-texture map obtained by cropping the image according to 4 × 4 cropping blocks is the same, it is necessary to determine that the width and the length of the image are both integer multiples of 4. Taking the texture map of 1680 x 1050 as an example, since 1680 is a multiple of 4, and 1050 is not an integer multiple of 4, it is necessary to create a template whose size needs to satisfy a number greater than the width 1050 and whose size is just greater than 1050 and can be divided by 4, so that the width 1052 of the template is 1680 x 1052 as a whole. Then, the 1680 × 1050 texture map is pasted on the 1680 × 1052 template, and the whole is cut and encoded.
In step 205, the cloud server obtains a clipping size adopted by the preset encoding method, where the clipping size is a size of a clipping block adopted when the texture map to be displayed is encoded in the preset encoding method.
In order to save memory, the image with the coding size is cut during coding.
In step 206, the cloud server determines a first amount of sub-texture data based on the crop size and the encoding size.
Taking ETC2 as an example, an image with a coding size is cut by using a 4 × 4 cropping block in the coding method of the ETC2 series, and if the coding size is 1680 × 1052, the image with 1680 × 1052 is cropped into transverse 1680 ÷ 4 ÷ 420 blocks and longitudinal 1052 ÷ 4 ÷ 263 blocks according to the 4 × 4 cropping block, so that the total number of 420 × 263 ═ 110460 sub-texture maps corresponds to the first number of 110460 sub-texture data.
In step 207, the cloud server determines a target decoding logic corresponding to the first data format based on a corresponding relationship between a plurality of preset data formats and the decoding logic.
Because the encoding logics corresponding to different encoding modes are different, different decoding logics need to be set for the encoded texture data of different data formats generated by different encoding modes. The corresponding relationship between a plurality of data formats and the decoding logic can be set in advance, so that the corresponding target decoding logic can be determined according to the first data format of the decoded texture data.
In step 208, the cloud server decodes the encoded texture data according to the target decoding logic until the second quantity of the decoded sub-texture data in the encoded texture data is the same as the first quantity, so as to obtain the initial decoded texture data in the second data format.
Since the graphics processor does not support the first data format, the compressed texture data needs to be soft-decoded by a Central Processing Unit (CPU) to obtain decoded texture data, where the decoded texture data is in a second data format that can be supported by the graphics processor, and the graphics processor can display a texture map to be displayed.
Specifically, when encoding texture data, some encoding methods cut texture maps corresponding to the texture data into a plurality of sub-texture maps having the same size, and sequentially encode sub-texture data corresponding to the sub-texture maps, so that the encoded texture data includes a plurality of sub-texture data. The first quantity of the sub-texture data can be obtained, a decoder used for decoding is informed that the first quantity of the sub-texture data needs to be decoded, the decoder records the sub-texture data during decoding, and when the second quantity of the decoded sub-texture data in the encoded texture data is the same as the first quantity, the initial decoded texture data in the second data format is obtained, namely the texture data corresponding to a complete texture mapping is decoded.
In step 209, the cloud server calculates a first ratio of the original length to the trimmed length and calculates a second ratio of the original width to the trimmed width.
In order to determine whether an image corresponding to the decoded texture data is consistent with the size of the texture map, a first ratio of the original length to the cropping length and a second ratio of the original width to the cropping width are calculated.
For example, if the cropping block is 4 long by 4 wide, the original length is 1680, and the original width is 1050, the first ratio is 420, and the second ratio is 262.5.
In step 210, the cloud server determines whether the first ratio and the second ratio are both integers, if not, step 211 is executed; if yes, go to step 214.
For example, if the first ratio is 420 and the second ratio is 262.5, then the non-uniformity is an integer, go to 211; if the first ratio is 420 and the second ratio is 262, both are integers, 214 is performed.
In step 211, if not, the cloud server determines that the encoded texture data is texture data obtained by encoding extended texture data obtained by extending the texture map.
For example, the first ratio is 420, the second ratio is 262.5, and since the second ratio is not an integer, it is determined that the obtained encoded texture data is the texture map of 1680 × 1050, and after being pasted to the template of 1680 × 1052, the texture data obtained after clipping and encoding together with the template is obtained. Therefore, the decoded texture data corresponds to an image size of 1680 x 1052, not the original size of 1680 x 1050.
In step 212, the cloud server cuts the texture map to be cut corresponding to the initially decoded texture data according to the original size to obtain the cut texture map and the texture data in the second data format corresponding to the cut texture map.
Wherein, the texture mapping mode can be unified in advance when coding. Referring to fig. 1c, fig. 1c is a schematic diagram illustrating a texture map attached to a template according to an embodiment of the present disclosure. When the texture map is pasted on the template, the upper left corner of the texture map A can be uniformly superposed with the upper left corner of the template B, so that the part of the template B exceeding the texture map A is the part needing to be cut off when the texture map to be cut is subsequently cut.
For example, when the image of 1680 × 1052 is clipped to 1680 × 1050, only the portion of 1052-1050 that has the extra width needs to be clipped, so as to obtain the clipped texture map and the texture data in the second data format corresponding to the clipped texture map.
In step 213, the cloud server controls the graphics processor to display the texture map to be displayed based on the texture data in the second data format.
And controlling the graphics processor to display the texture map to be displayed based on the texture data in the second data format.
In step 214, if yes, the cloud server determines that the encoded texture data is texture data obtained by encoding the original texture data corresponding to the texture map.
For example, the original size of the texture map is 800 × 600, and the length and the width are all integer multiples of 4, so that the texture map can be directly cut into a plurality of sub-texture maps with the same size during encoding without creating a template. Therefore, the image corresponding to the texture data after the subsequent decoding is the texture map.
In step 215, the cloud server controls the graphics processor to display a texture map to be displayed based on the initially decoded texture data.
Wherein the graphics processor may be controlled to display the texture map to be displayed based on the encoded texture data.
As can be seen from the above, in the embodiment of the present application, encoded texture data corresponding to a texture map to be displayed and sent by the service program, and a first data format of the encoded texture data are obtained; when the first data format belongs to a preset data format set, decoding the encoded texture data to obtain texture data of a second data format, wherein the second data format is a data format supported by the graphics processor, and the preset data format set comprises at least one data format not supported by the graphics processor; and controlling the graphics processor to display the texture map to be displayed based on the texture data in the second data format. Therefore, the encoded texture data in the first data format which is not supported by the graphics processor is subjected to soft decoding to be decoded into the texture data in the second data format which is supported by the graphics processor, and then the texture maps corresponding to the texture data in different data formats can be displayed, so that the compatibility is improved, and the game is prevented from being blacked or collapsed.
In order to better implement the method for displaying the texture map provided by the embodiment of the present application, the embodiment of the present application further provides a device based on the method for displaying the texture map. The meaning of the noun is the same as that in the display method of the texture map, and the specific implementation details can refer to the description in the method embodiment.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a display device of a texture map according to an embodiment of the present application. The display device of the texture map is applied to a cloud server with a graphic processor, a service program is installed on the cloud server, the cloud server is connected with a client, and the cloud server is used for sending a display picture displayable by the cloud server to the client, and may include a first obtaining module 301, a decoding module 302, a first display module 303, and the like.
A first obtaining module 301, configured to obtain encoded texture data corresponding to a texture map to be displayed sent by the service program, and a first data format of the encoded texture data;
a decoding module 302, configured to, when the first data format belongs to a preset data format set, decode the encoded texture data to obtain texture data in a second data format, where the second data format is a data format supported by the graphics processor, and the preset data format set includes at least one data format that is not supported by the graphics processor;
a first display module 303, configured to control the graphics processor to display the texture map to be displayed based on the texture data in the second data format.
In some embodiments, the apparatus further comprises:
the generating module is used for generating the texture data of the first data format into a corresponding first texture object on a graphic driving layer of the cloud server through the graphic processor when the first data format does not belong to a preset data format set;
and the return module is used for returning the first texture object to the service program and controlling the graphics processor to display the texture map to be displayed according to the first texture object when the service program receives the first texture object.
In some embodiments, the decoding module 302 includes:
the first decoding submodule is used for decoding the encoded texture data to obtain initial decoded texture data in a second data format;
and the cutting submodule is used for cutting the texture map to be cut corresponding to the initially decoded texture data to obtain the cut texture map and the texture data of a second data format corresponding to the cut texture map.
In some embodiments, the first decoding sub-module comprises:
the first determining unit is used for determining target decoding logic corresponding to a first data format based on the corresponding relation between a plurality of preset data formats and the decoding logic;
and the first decoding unit is used for decoding the encoded texture data according to the target decoding logic to obtain the initial decoded texture data in the second data format.
In some embodiments, the encoded texture data is texture data encoded by a preset encoding method, the encoded texture data includes a plurality of sub-texture data, and the first decoding sub-module further includes:
an obtaining unit configured to obtain a first amount of the sub-texture data;
the first decoding unit includes:
and the decoding subunit is configured to decode the encoded texture data according to the target decoding logic until a second quantity of decoded sub-texture data in the encoded texture data is the same as the first quantity, so as to obtain initial decoded texture data in a second data format.
In some embodiments, the obtaining unit includes:
an obtaining subunit, configured to obtain an original size carried in the encoded texture data, where the original size is an original size of the texture map to be displayed;
the calculation subunit is used for calculating the coding size of the texture map to be displayed after the texture map is coded by a preset coding mode;
a determining subunit, configured to determine the first number of sub-texture data based on the preset encoding mode and the encoding size.
In some embodiments, the determining subunit is configured to:
obtaining the cutting size adopted by the preset coding mode, wherein the cutting size is the size of a cutting block adopted when the preset coding mode is used for coding the texture mapping to be displayed;
determining a first number of the sub-texture data based on the crop size and the encoding size.
In some embodiments, the cropping size comprises a cropping length and a cropping width, the original size comprises an original length and an original width, the decoding module further comprises:
the calculating submodule is used for calculating a first ratio of the original length to the cutting length and calculating a second ratio of the original width to the cutting width;
the first judgment submodule is used for judging whether the first ratio and the second ratio are integers or not;
the first determining submodule is used for determining that the coded texture data is the texture data obtained by coding the expanded texture data obtained by expanding the texture map if the texture data is not the coded texture data;
and the execution submodule is used for executing the steps of cutting the texture map to be cut corresponding to the initially decoded texture data to obtain the cut texture map and the texture data of the second data format corresponding to the cut texture map.
In some embodiments, the cropping sub-module comprises:
and the cutting unit is used for cutting the texture mapping to be cut corresponding to the initially decoded texture data according to the original size to obtain the cut texture mapping and the texture data of the second data format corresponding to the cut texture mapping.
In some embodiments, the decoding module 302 further comprises:
the second determining submodule is used for determining the coded texture data as texture data obtained by coding the original texture data corresponding to the texture map to be displayed if the texture data is the coded texture data;
and the display sub-module is used for controlling the graphics processor to display the texture map to be displayed based on the initially decoded texture data in the second data format.
In some embodiments, the decoding module 302 includes:
the second judgment submodule is used for judging whether the first data format belongs to a preset data format set or not on a graph driving layer of the cloud server;
and the second decoding submodule is used for decoding the encoded texture data to obtain texture data in a second data format when the first data format belongs to a preset data format set.
In some embodiments, the cloud server is further configured with a decoder, the second decoding submodule to:
and when the first data format belongs to a preset data format set, sending the encoded texture data to the decoder for decoding to obtain texture data of a second data format.
In some embodiments, the first display module 303 includes:
the generating submodule is used for returning the texture data of the second data format obtained by decoding of the decoder to the graphics driving layer, and generating the texture data of the second data format into a corresponding second texture object in the graphics driving layer through the graphics processor;
and the return submodule is used for returning the second texture object to the service program, and controlling the graphics processor to display the texture map to be displayed according to the second texture object when the service program receives the second texture object.
As can be seen from the above, in the embodiment of the present application, the first obtaining module 301 obtains the encoded texture data corresponding to the texture map to be displayed sent by the service program, and the first data format of the encoded texture data; when the first data format belongs to a preset data format set, the decoding module 302 decodes the encoded texture data to obtain texture data in a second data format, where the second data format is a data format supported by the graphics processor, and the preset data format set includes at least one data format that is not supported by the graphics processor; the first display module 303 controls the graphics processor to display the texture map to be displayed based on the texture data in the second data format. Therefore, the encoded texture data in the first data format which is not supported by the graphics processor is subjected to soft decoding to be decoded into the texture data in the second data format which is supported by the graphics processor, and then the texture maps corresponding to the texture data in different data formats can be displayed, so that the compatibility is improved, and the game is prevented from being blacked or collapsed.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Correspondingly, an embodiment of the present application further provides a cloud server, as shown in fig. 4, fig. 4 is a schematic structural diagram of the cloud server provided in the embodiment of the present application. The cloud server 2000 includes a processor 401 having one or more processing cores, a memory 402 having one or more computer-readable storage media, and a computer program stored on the memory 402 and executable on the processor. The processor 401 is electrically connected to the memory 402. Those skilled in the art will appreciate that the cloud server architecture shown in the figures does not constitute a limitation of cloud servers and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
The processor 401 is a control center of the cloud server 2000, connects various parts of the entire cloud server 2000 using various interfaces and lines, and performs various functions of the cloud server 2000 and processes data by running or loading software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby integrally monitoring the cloud server 2000.
In this embodiment of the present application, the processor 401 in the cloud server 2000 loads instructions corresponding to processes of one or more application programs into the memory 402 according to the following steps, and the processor 401 runs the application programs stored in the memory 402, thereby implementing various functions:
acquiring coded texture data corresponding to a texture map to be displayed and sent by the service program and a first data format of the coded texture data; when the first data format belongs to a preset data format set, decoding the encoded texture data to obtain texture data of a second data format, wherein the second data format is a data format supported by the graphics processor, and the preset data format set comprises at least one data format not supported by the graphics processor; and controlling the graphics processor to display the texture map to be displayed based on the texture data in the second data format.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Optionally, as shown in fig. 4, the cloud server 2000 further includes: an input unit 403, a power supply 404, a decoder 405, and a graphics processor 406. The processor 401 is electrically connected to the input unit 403, the power source 404, the decoder 405, and the graphics processor 406, respectively. Those skilled in the art will appreciate that the cloud server architecture shown in fig. 4 does not constitute a limitation of a cloud server, and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
The input unit 403 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The power supply 404 is used to supply power to the various components of the cloud server 2000. Optionally, the power source 404 may be logically connected to the processor 401 through a power management system, so as to implement functions of managing charging, discharging, power consumption management, and the like through the power management system. The power supply 404 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The decoder 405 is configured to receive texture data in a data format that cannot be supported by the graphics processor and is determined by the graphics driver layer of the cloud server, and decode the texture data in the data format that is not supported, so as to convert the data format of the texture data from a first data format that cannot be supported to a second data format that can be supported.
The graphics processor 406 is configured to generate texture data in a data format that can be supported as a corresponding texture object, so that a subsequent display process such as rendering can be performed on the texture object based on the game program, and the display process is finally performed on the cloud server.
Although not shown in fig. 4, the cloud server 2000 may further include a camera, a sensor, a wireless fidelity module, a bluetooth module, and the like, which are not described in detail herein.
An embodiment of the present application further provides a cloud server, and as shown in fig. 5, fig. 5 is an execution schematic diagram of the cloud server provided in the embodiment of the present application when receiving a texture map to be displayed sent by a service program.
The cloud server is provided with a service program, and is correspondingly provided with a graphic driving layer and a decoder. The data format judging module is used for judging whether a first data format of texture data corresponding to a texture map to be displayed, which is acquired by the graph driving layer from a business program, belongs to a preset data format set or not, and if so, sending the texture data of the first data format to a decoder; if not, the graphics processor is directly controlled in the graphics driver layer to generate the texture data in the first data format into a corresponding first texture object, and the corresponding first texture object is returned to the service program.
Specifically, a module for calculating the encoding width and height and the block number, a module for configuring input and output data, a module for executing decoding and a module for cutting are arranged in the decoder. The module for calculating the width and the height of the code and the number of the blocks is used for calculating the code width and the height of the chartlet to be displayed during the coding and the number of the blocks cut out by the cutting block adopted by the preset coding mode during the coding according to the original size.
The configuration input and output data module is used for carrying out decoding configuration on a decoder, the input data module is used for configuring the number of sub-texture data needing to be decoded during the current decoding, and the output data module is used for configuring how much memory space needs to be reserved for storing the texture data after the initial decoding in the second data format output in the current decoding process.
The decoding module is used for decoding the input texture data in the first data format so as to obtain the initial decoded texture data in the second data format.
And the cutting module is used for cutting the texture map to be cut corresponding to the initially decoded texture data to obtain the cut texture map and the texture data of a second data format corresponding to the cut texture map.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
As can be seen from the above, the cloud server provided in this embodiment obtains the encoded texture data corresponding to the texture map to be displayed and sent by the service program, and the first data format of the encoded texture data; when the first data format belongs to a preset data format set, decoding the encoded texture data to obtain texture data of a second data format, wherein the second data format is a data format supported by the graphics processor, and the preset data format set comprises at least one data format not supported by the graphics processor; and controlling the graphics processor to display the texture map to be displayed based on the texture data in the second data format. Therefore, the encoded texture data in the first data format which is not supported by the graphics processor is subjected to soft decoding to be decoded into the texture data in the second data format which is supported by the graphics processor, and then the texture maps corresponding to the texture data in different data formats can be displayed, so that the compatibility is improved, and the game is prevented from being blacked or collapsed.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer-readable storage medium, in which a plurality of computer programs are stored, where the computer programs can be loaded by a processor to perform the steps in any one of the methods for displaying a texture map provided by the embodiments of the present application. For example, the computer program may perform the steps of:
acquiring coded texture data corresponding to a texture map to be displayed and sent by the service program and a first data format of the coded texture data; when the first data format belongs to a preset data format set, decoding the encoded texture data to obtain texture data of a second data format, wherein the second data format is a data format supported by the graphics processor, and the preset data format set comprises at least one data format not supported by the graphics processor; and controlling the graphics processor to display the texture map to be displayed based on the texture data in the second data format.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the computer program stored in the storage medium can execute the steps in any texture map display method provided in the embodiments of the present application, beneficial effects that can be achieved by any texture map display method provided in the embodiments of the present application can be achieved, for details, see the foregoing embodiments, and are not described herein again.
The method, the apparatus, the storage medium, and the cloud server for displaying a texture map provided in the embodiments of the present application are described in detail above, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the above embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (16)

1. A display method of a texture map is applied to a cloud server with a graphic processor, and is characterized in that a service program is installed on the cloud server, the cloud server is connected with a client, and the cloud server is used for sending a display picture which can be displayed by the cloud server to the client, and comprises the following steps:
acquiring coded texture data corresponding to a texture map to be displayed and sent by the service program and a first data format of the coded texture data;
when the first data format belongs to a preset data format set, decoding the encoded texture data to obtain texture data of a second data format, wherein the second data format is a data format supported by the graphics processor, and the preset data format set comprises at least one data format not supported by the graphics processor;
and controlling the graphics processor to display the texture map to be displayed based on the texture data in the second data format.
2. The method of displaying a texture map of claim 1, the method further comprising:
when the first data format does not belong to a preset data format set, generating texture data of the first data format into a corresponding first texture object on a graphic driving layer of the cloud server through the graphic processor;
and returning the first texture object to the service program, and controlling the graphics processor to display the texture map to be displayed according to the first texture object when the service program receives the first texture object.
3. The method of claim 1, wherein the step of decoding the encoded texture data to obtain texture data in a second data format comprises:
decoding the encoded texture data to obtain initial decoded texture data in a second data format;
and cutting the texture mapping to be cut corresponding to the initially decoded texture data to obtain the cut texture mapping and the texture data of a second data format corresponding to the cut texture mapping.
4. The method of claim 3, wherein the step of decoding the encoded texture data to obtain the initial decoded texture data in the second data format comprises:
determining target decoding logic corresponding to the first data format based on the corresponding relation between a plurality of preset data formats and the decoding logic;
and decoding the encoded texture data according to the target decoding logic to obtain the initial decoded texture data in the second data format.
5. The method according to claim 4, wherein the encoded texture data is texture data encoded in a preset encoding manner, the encoded texture data includes a plurality of sub-texture data, and before the step of decoding the encoded texture data to obtain the initial decoded texture data in the second data format, the method further includes:
obtaining a first quantity of the sub-texture data;
the step of decoding the encoded texture data according to the target decoding logic to obtain the initial decoded texture data in the second data format includes:
and decoding the encoded texture data according to the target decoding logic until the second quantity of the decoded sub-texture data in the encoded texture data is the same as the first quantity, so as to obtain the initial decoded texture data in a second data format.
6. The method of claim 5, wherein the step of obtaining the first amount of sub-texture data comprises:
acquiring an original size carried in the encoded texture data, wherein the original size is the original size of the texture map to be displayed;
calculating the coding size of the texture map to be displayed after the texture map is coded in a preset coding mode;
and determining the first quantity of the sub-texture data based on the preset coding mode and the coding size.
7. The method according to claim 6, wherein the step of determining the first amount of sub-texture data based on the predetermined encoding mode and the encoding size comprises:
obtaining the cutting size adopted by the preset coding mode, wherein the cutting size is the size of a cutting block adopted when the preset coding mode is used for coding the texture mapping to be displayed;
determining a first number of the sub-texture data based on the crop size and the encoding size.
8. The method according to claim 7, wherein the cropping size includes a cropping length and a cropping width, the original size includes an original length and an original width, and before the step of cropping the texture map to be cropped corresponding to the initially decoded texture data to obtain the cropped texture map and the texture data in the second data format corresponding to the cropped texture map, the method further comprises:
calculating a first ratio of the original length to the trimmed length, and calculating a second ratio of the original width to the trimmed width;
judging whether the first ratio and the second ratio are integers or not;
if not, determining that the coded texture data is texture data obtained by coding expanded texture data obtained by expanding the texture map;
and cutting the texture map to be cut corresponding to the initially decoded texture data to obtain the cut texture map and the texture data of the second data format corresponding to the cut texture map.
9. The method for displaying the texture map according to claim 8, wherein the step of clipping the texture map to be clipped corresponding to the initially decoded texture data to obtain the clipped texture map and the texture data in the second data format corresponding to the clipped texture map comprises:
and clipping the texture map to be clipped corresponding to the initially decoded texture data according to the original size to obtain the clipped texture map and the texture data of a second data format corresponding to the clipped texture map.
10. The method of displaying a texture map of claim 8, further comprising:
if so, determining the coded texture data as texture data obtained by coding the original texture data corresponding to the texture map to be displayed;
and controlling the graphics processor to display the texture map to be displayed based on the initial decoded texture data of the second data format.
11. The method for displaying a texture map according to claim 1, wherein the step of decoding the encoded texture data to obtain the texture data in the second data format when the first data format belongs to a preset data format set comprises:
judging whether the first data format belongs to a preset data format set or not on a graphic driving layer of the cloud server;
and when the first data format belongs to a preset data format set, decoding the encoded texture data to obtain texture data of a second data format.
12. The method according to claim 11, wherein the cloud server is further configured with a decoder, and the step of decoding the encoded texture data to obtain the texture data in the second data format when the first data format belongs to a preset data format set includes:
and when the first data format belongs to a preset data format set, sending the encoded texture data to the decoder for decoding to obtain texture data of a second data format.
13. The method according to claim 12, wherein the step of controlling the graphics processor to display the texture map to be displayed based on the texture data in the second data format comprises:
returning the texture data of the second data format decoded by the decoder to the graphics driver layer, and generating the texture data of the second data format into a corresponding second texture object in the graphics driver layer through the graphics processor;
and returning the second texture object to the service program, and controlling the graphics processor to display the texture mapping to be displayed according to the second texture object when the service program receives the second texture object.
14. A display device of texture mapping is applied to a cloud server with a graphic processor, and is characterized in that a service program is installed on the cloud server, the cloud server is connected with a client, and the cloud server is used for sending a display picture which can be displayed by the cloud server to the client, and the display device comprises:
the first obtaining module is used for obtaining coded texture data corresponding to the texture map to be displayed and sent by the service program and a first data format of the coded texture data;
a decoding module, configured to decode the encoded texture data to obtain texture data in a second data format when the first data format belongs to a preset data format set, where the second data format is a data format supported by the graphics processor, and the preset data format set includes at least one data format that is not supported by the graphics processor;
and the first display module is used for controlling the graphics processor to display the texture map to be displayed based on the texture data in the second data format.
15. A computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the method for displaying a texture map according to any one of claims 1 to 13.
16. A cloud server comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the steps in the method for displaying a texture map according to any one of claims 1 to 13.
CN202111160384.XA 2021-09-30 2021-09-30 Texture map display method and device, storage medium and cloud server Pending CN113902840A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111160384.XA CN113902840A (en) 2021-09-30 2021-09-30 Texture map display method and device, storage medium and cloud server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111160384.XA CN113902840A (en) 2021-09-30 2021-09-30 Texture map display method and device, storage medium and cloud server

Publications (1)

Publication Number Publication Date
CN113902840A true CN113902840A (en) 2022-01-07

Family

ID=79189747

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111160384.XA Pending CN113902840A (en) 2021-09-30 2021-09-30 Texture map display method and device, storage medium and cloud server

Country Status (1)

Country Link
CN (1) CN113902840A (en)

Similar Documents

Publication Publication Date Title
US11909984B2 (en) Video encoding and decoding for cloud gaming
CN111681167B (en) Image quality adjusting method and device, storage medium and electronic equipment
CN1856819B (en) System and method for network transmission of graphical data through a distributed application
CN115908644A (en) Animation processing method and device
CN113244614B (en) Image picture display method, device, equipment and storage medium
US10699361B2 (en) Method and apparatus for enhanced processing of three dimensional (3D) graphics data
CN110609726B (en) Mapping processing method and device, computer readable storage medium and electronic equipment
WO2021008427A1 (en) Image synthesis method and apparatus, electronic device, and storage medium
CN112316433B (en) Game picture rendering method, device, server and storage medium
KR101805550B1 (en) Image data encoding method for presentation virtualization and server therefor
CN111464828A (en) Virtual special effect display method, device, terminal and storage medium
JP2011090663A (en) Image processing apparatus and program
CN112714357A (en) Video playing method, video playing device, electronic equipment and storage medium
CN115089966A (en) Video rendering method and system applied to cloud game and related equipment
CN110858388B (en) Method and device for enhancing video image quality
CN112843700B (en) Terrain image generation method and device, computer equipment and storage medium
WO2021142361A1 (en) In-tree geometry quantization of point clouds
CN109925715B (en) Virtual water area generation method and device and terminal
CN113902840A (en) Texture map display method and device, storage medium and cloud server
CN115908672A (en) Three-dimensional scene rendering acceleration method, system, medium, device and terminal
CN114217758A (en) Image display method, image display device, electronic equipment and computer readable storage medium
CN116843736A (en) Scene rendering method and device, computing device, storage medium and program product
CN115880416A (en) Three-dimensional model display method and device, server and storage medium
CN115035231A (en) Shadow baking method, shadow baking device, electronic apparatus, and storage medium
JPH10198823A (en) Video generating device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination