Texture mapping processing method and device
By performing virtual texture processing on the target map and filling it to the basic physical page, the rendering instability caused by missing Mipmap with a size smaller than the physical page is solved, and the pre-filtered texture map of the entire resolution of the target map is achieved, improving the rendering quality.
Patent Information
- Application Number
- CN202210654393.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-10
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2042-06-10
AI Technical Summary
In the prior art, the missing Mipmap with a size smaller than the physical page will cause the use of missing map materials for real-time rendering to be distorted, resulting in snowflakes flashing in the corresponding screen and the picture is unstable.
By receiving the map processing instructions for the target map, performing virtual texture processing, obtaining a set of prefiltered texture maps of multiple sizes, and determining the first prefiltered texture map set based on the preset physical page size, filling it into the basic physical page, and recording the offset information of each map.
The problem of missing prefiltered texture mapping with a size smaller than that of physical pages is solved, and the prefiltered texture mapping corresponding to all resolutions of the target map is completed, improving the stability and quality of rendering.
Smart Images

Figure CN115035169B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a texture mapping processing method, a texture mapping processing device, a computing device, and a computer-readable storage medium. Background Art
[0002] With the development of computer technology, scene construction in virtual scenes is a development branch of computer technology. Virtual Texture (VT) is a texture technology solution that allows real-time large-volume rendering of texture data and places the entire texture data into video memory for continuous sampling through virtual mapping. In practical applications, it is also called virtual mapping technology.
[0003] Mipmap is one of the most widely used texture mapping technologies. In order to speed up rendering and reduce image aliasing, the texture will be processed into a series of pre-calculated and optimized pre-filtered texture mappings. Such pre-filtered texture mapping is called Mipmap. There is a problem with virtual texture technology based on software implementation, which is that the missing Mipmap size is smaller than the physical page, which will cause the texture material of the missing size to be distorted during real-time rendering, resulting in snowflakes flickering in the corresponding part of the picture and unstable picture. Therefore, a method is urgently needed to solve the problem of poor quality of rendered virtual textures caused by the loss of pre-filtered texture mappings smaller than the physical page. Summary of the invention
[0004] In view of this, an embodiment of the present application provides a texture mapping processing method. The present application also relates to a texture mapping processing device, a computing device, and a computer-readable storage medium to solve the problems existing in the prior art.
[0005] According to a first aspect of an embodiment of the present application, a texture mapping processing method is provided, comprising:
[0006] receiving a texture processing instruction for a target texture;
[0007] In response to the texture processing instruction, performing virtual texture processing on the target texture to obtain a pre-filtered texture mapping set corresponding to the target texture, wherein the pre-filtered texture mapping set includes pre-filtered texture mappings of multiple sizes;
[0008] Determining a first pre-filtered texture map set in the pre-filtered texture map set based on a preset physical page size;
[0009] The first pre-filtered texture mappings in the first pre-filtered texture mapping set are filled into a basic physical page according to a preset filling rule, and the offset information of each first pre-filtered texture mapping in the basic physical page is recorded.
[0010] According to a second aspect of an embodiment of the present application, a texture mapping processing method is provided, comprising:
[0011] Displaying a texture processing interface to the user based on the user's call request;
[0012] receiving a target texture input by the user based on the texture processing interface, and receiving a texture processing instruction for the target texture;
[0013] In response to the texture processing instruction, performing virtual texture processing on the target texture to obtain a pre-filtered texture mapping set corresponding to the target texture, wherein the pre-filtered texture mapping set includes pre-filtered texture mappings of multiple sizes;
[0014] A first pre-filtered texture mapping set in the pre-filtered texture mapping set is filled into a base physical page, and a second pre-filtered texture mapping set in the pre-filtered texture mapping set is filled into a physical page corresponding to each second pre-filtered texture mapping.
[0015] According to a third aspect of an embodiment of the present application, a texture mapping processing device is provided, comprising:
[0016] A receiving module, configured to receive a texture processing instruction for a target texture;
[0017] A processing module is configured to perform virtual texture processing on the target texture in response to the texture processing instruction to obtain a pre-filtered texture mapping set corresponding to the target texture, wherein the pre-filtered texture mapping set includes pre-filtered texture mappings of multiple sizes;
[0018] A determination module configured to determine a first pre-filtered texture mapping set in the pre-filtered texture mapping set based on a preset physical page size;
[0019] The filling module is configured to fill the first pre-filtered texture mappings in the first pre-filtered texture mapping set into the basic physical page according to a preset filling rule, and record the offset information of each first pre-filtered texture mapping in the basic physical page.
[0020] According to a fourth aspect of an embodiment of the present application, a texture mapping processing device is provided, comprising:
[0021] An interface display module is configured to display a texture processing interface to a user based on a user's call request;
[0022] A receiving module, configured to receive a target texture input by the user based on the texture processing interface, and receive a texture processing instruction for the target texture;
[0023] A processing module is configured to perform virtual texture processing on the target texture in response to the texture processing instruction to obtain a pre-filtered texture mapping set corresponding to the target texture, wherein the pre-filtered texture mapping set includes pre-filtered texture mappings of multiple sizes;
[0024] The filling module is configured to fill the first pre-filtered texture mapping set in the pre-filtered texture mapping set into the basic physical page, and fill the second pre-filtered texture mapping set in the pre-filtered texture mapping set into the physical page corresponding to each second pre-filtered texture mapping.
[0025] According to a fifth aspect of an embodiment of the present application, a computing device is provided, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the texture mapping processing method when executing the computer instructions.
[0026] According to a sixth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores computer instructions, and when the computer instructions are executed by a processor, the steps of the texture mapping processing method are implemented.
[0027] The texture mapping processing method provided in the present application receives a texture processing instruction for a target map; performs virtual texture processing on the target map in response to the texture processing instruction to obtain a pre-filtered texture mapping set corresponding to the target map, wherein the pre-filtered texture mapping set includes pre-filtered texture mappings of multiple sizes; determines a first pre-filtered texture mapping set in the pre-filtered texture mapping set based on a preset physical page size; fills the first pre-filtered texture mapping in the first pre-filtered texture mapping set into a basic physical page according to a preset filling rule, and records the offset information of each first pre-filtered texture mapping in the basic physical page.
[0028] An embodiment of the present application implements the storage of pre-filtered texture mappings whose sizes are smaller than the physical page size into the base physical page, and records the offset information of each pre-filtered texture mapping stored in the base physical page in the base physical page, which is used for subsequent restoration based on the pre-filtered texture mapping stored in the base physical page, thereby solving the problem of lack of pre-filtered texture mappings whose sizes are smaller than the physical page, and completing the pre-filtered texture mappings corresponding to all resolutions corresponding to the target map. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 is a flowchart of a texture mapping processing method provided by an embodiment of the present application;
[0030] Figure 2 is a filling schematic diagram of a basic physical page provided by an embodiment of the present application;
[0031] Figure 3 is a filling schematic diagram of a basic physical page provided by another embodiment of the present application;
[0032] Figure 4 It is a processing flow chart of a texture mapping processing method for game textures in a game scene provided by an embodiment of the present application;
[0033] Figure 5 It is a structural schematic diagram of a texture mapping processing device provided by an embodiment of the present application;
[0034] Figure 6 is a flowchart of another texture mapping processing method provided by an embodiment of the present application;
[0035] Figure 7 is a structural schematic diagram of another texture mapping processing device provided by an embodiment of the present application;
[0036] Figure 8 It is a structural block diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0037] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0038] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to any or all possible combinations of one or more associated listed items.
[0039] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0040] First, the terms involved in one or more embodiments of the present application are explained.
[0041] Virtual texture (VT): is a texture technology solution that allows real-time large-volume rendering of texture data and places the entire texture data into video memory for continuous sampling through virtual mapping.
[0042] Pre-filtered texture map (Mipmap): It is a smaller version of the texture image that is pre-filtered. It represents the different levels of detail (LOD) of the texture and is usually stored in a series of shrinking texture objects. These textures are called mipmap chains, and each level is half the size of the previous level.
[0043] In the present application, a texture mapping processing method is provided. The present application also relates to a texture mapping processing device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0044] Figure 1 A flowchart of a texture mapping processing method provided according to an embodiment of the present application is shown, which specifically includes the following steps:
[0045] Step 102: Receive a texture processing instruction for a target texture.
[0046] In the process of virtual scene production, we will encounter the situation of mapping three-dimensional models and generating corresponding virtual scenes. Virtual scenes include but are not limited to game scenes, animation scenes, movie special effects scenes, VR scenes, etc.
[0047] In virtual scenes, it is common to encounter situations where the virtual lens is zoomed in or out. For example, for the same object, the details of the object are different when the virtual lens is at different distances from the object. When the virtual lens is closer to the object, more details of the object need to be presented. When the virtual lens is farther away from the object, the object may only appear as a black dot. Due to the difference in the distance between the virtual lens and the object, texture filtering will be applied. Therefore, the texture is rendered at different resolutions depending on the distance from the virtual lens.
[0048] Based on this, it is necessary to create a multi-resolution (multi-size) pre-filtered texture map (mipmap) for the map. Mipmap is currently the most effective way to solve the relationship between texture resolution and viewpoint distance. In the method provided by the present application, the map processing instruction specifically refers to an instruction to generate a multi-resolution mipmap for the map, and the target map is the map for which a multi-size pre-filtered texture map needs to be generated.
[0049] In a specific implementation provided in the present application, taking the target texture as texture P as an example, a texture processing instruction for texture P is received, and the texture processing instruction is used to generate multi-size mipmaps of texture P.
[0050] Step 104: In response to the texture processing instruction, virtual texture processing is performed on the target texture to obtain a pre-filtered texture mapping set corresponding to the target texture.
[0051] The pre-filtered texture mapping set includes pre-filtered texture mappings of various sizes.
[0052] Virtual texture (VT) is a texture technology solution that allows real-time large-volume rendering of texture data and places the entire texture data into the video memory for continuous sampling through virtual mapping. By processing the target map with virtual texture, a series of pre-filtered texture mappings can be generated from the target map and stored in corresponding texture objects of continuously reduced sizes to obtain a pre-filtered texture mapping set corresponding to the target map. The pre-filtered texture mapping set can also be called a mipmap chain. The pre-filtered texture mapping set includes mipmaps of each level.
[0053] In a specific implementation provided in the present application, for example, the size of a target map is 512*512 (pixels). By performing virtual texture processing on it, mipmaps of 9 sizes can be generated, that is, 9 levels of mipmaps, and m1-m9 correspond to 9 mipmaps of different sizes respectively. The pre-filtered texture mapping set is (m1, m2, m3, m4, m5, m6, m7, m8, m9), where the size of m1 is 512*512, the size of m2 is 256*256, the size of m3 is 128*128, the size of m4 is 64*64, the size of m5 is 32*32, the size of m6 is 16*16, the size of m7 is 8*8, the size of m8 is 4*4, and the size of m9 is 2*2.
[0054] In actual reference, the size of the target map is various, such as 728*67, 128*502, etc. The sizes of these maps are not square representations. In order to better perform virtual texture processing on the target map, some preprocessing can be performed on these non-square maps. Specifically, in response to the map processing instruction, the virtual texture processing is performed on the target map, including:
[0055] Performing standardization processing on the target map to obtain an initial target map;
[0056] Virtual texturing is performed on the initial target map.
[0057] Among them, standardizing the target map means converting the target map into a square size. For example, a target map with a size of 128*502 can be standardized and converted into an initial target map with a size of 512*512, and then the initial target map with a size of 512*512 can be virtual textured.
[0058] It should be noted that all sizes of pre-filtered texture maps in the pre-filtered texture map set in the present application include edge expansion processing. Expanding the mipmap can ensure that the mipmap can be presented more completely during the application process.
[0059] Step 106: Determine a first pre-filtered texture mapping set in the pre-filtered texture mapping set based on a preset physical page size.
[0060] The physical page is the basic unit for storing mipmap. After the mipmap is generated, the mipmap needs to be filled into the Page for storage.
[0061] In actual applications, the size of the Page is set according to preset conditions. For example, the size of the Page can be set to 128*128, that is, the preset physical page size is 128*128, and a Page of this size can store a mipmap of 128*128 size.
[0062] A first pre-filtered texture mapping set may be determined in the pre-filtered texture mapping set based on a preset physical page size, wherein the first pre-filtered texture mapping in the first pre-filtered texture mapping set specifically refers to a pre-filtered texture mapping having a size smaller than the preset physical page size.
[0063] Specifically, determining a first pre-filtered texture mapping set in the pre-filtered texture mapping set based on a preset physical page size includes:
[0064] Filtering the pre-filtered texture map set based on the preset physical page size;
[0065] A pre-filtered texture map having a size smaller than the preset physical page size is determined as a first pre-filtered texture map.
[0066] In the embodiment provided in the present application, a mipmap whose size is smaller than a preset physical page size can become a first pre-filtered texture mapping, and the preset physical page size is compared and screened with each mipmap in a pre-filtered texture mapping set, so as to obtain a first pre-filtered texture mapping set.
[0067] In a specific implementation provided by the present application, taking the preset physical page size of 128*128 as an example, the pre-filtered texture mapping set is (m1, m2, m3, m4, m5, m6, m7, m8, m9), wherein the size of m1 is 512*512, ... the size of m9 is 2*2. The preset physical page size of 128*128 is compared with each mipmap respectively, and it is determined that the size of m4-m9 is less than 128*128, then the first pre-filtered texture mapping set is (m4, m5, m6, m7, m8, m9).
[0068] The pre-filtered texture mapping set not only has mipmaps smaller than the preset physical page size, but also has a second pre-filtered texture mapping greater than or equal to the preset physical page size. Specifically, the method further includes:
[0069] determining a second pre-filtered texture map set in the pre-filtered texture map set based on the preset physical page size;
[0070] Determining a physical page corresponding to each second pre-filtered texture mapping in the second pre-filtered texture mapping set according to the preset physical page size;
[0071] Each second pre-filtered texture map is segmented based on the virtual texture configuration, and the segmented result is filled into a physical page corresponding to each second pre-filtered texture map.
[0072] Wherein, determining the second pre-filtering texture mapping set in the pre-filtering texture mapping set according to the preset physical page size means classifying the mipmaps whose size is greater than or equal to the preset physical page size as the second pre-filtering texture mapping.
[0073] Filtering the pre-filtered texture map set based on the preset physical page size;
[0074] A pre-filtered texture map having a size greater than or equal to the preset physical page size is determined as a second pre-filtered texture map.
[0075] In the specific implementation provided in the present application, following the above example, the preset physical page size is 128*128, and the size of m1-m3 is determined to be greater than or equal to 128*128, then the second pre-filtered texture mapping set is (m1, m2, m3).
[0076] After determining the second pre-filtered texture mapping set, each second pre-filtered texture mapping needs to be segmented and stored. Here, taking m2 as an example, the size of m2 is 256*256, and the preset physical page size is 128*128, then m2 needs to be stored in 4 physical pages. According to the virtual texture configuration information, m2 is segmented into 4 128*128 sub-pre-filtered texture mappings. They are marked as m2-1, m2-2, m2-3 and m2-4 from left to right and from top to bottom. The size of each sub-pre-filtered texture mapping corresponding to m2 is 128*128. Page1 is allocated to m2-1, and m2-1 is filled into Page1; Page2 is allocated to m2-2, and m2-2 is filled into Page2; Page3 is allocated to m2-3, and m2-3 is filled into Page3; Page4 is allocated to m2-4, and m2-4 is filled into Page4.
[0077] Step 108: fill the first pre-filtered texture mappings in the first pre-filtered texture mapping set into the basic physical page according to a preset filling rule, and record the offset information of each first pre-filtered texture mapping in the basic physical page.
[0078] After obtaining the first pre-filtered texture mapping set, in order to save the first pre-filtered texture mapping whose size is smaller than the Page size, the first pre-filtered texture mapping can be saved in the basic physical page. All sampling rules of the first pre-filtered texture mapping saved in the basic physical page are compatible with the sampling of other Pages and support all sampling methods.
[0079] Specifically, in order to better store the first pre-filtered texture map, the first filtered texture map may be filled into the basic physical page in the order of size using a preset filling rule. The preset filling rule may be to fill in according to the stair path, see Figure 2 , Figure 2 FIG. 2 shows a schematic diagram of filling a basic physical page provided by an embodiment of the present application. Figure 2 As shown, the size of Page is 128*128. First, place 64*64 m4 in the upper left corner of Page, place 32*32 m5 in the upper left corner to the right of m4, place 16*16 m6 in the upper left corner below m5, place 8*8 m7 in the upper left corner to the right of m6, place 4*4 m8 in the upper left corner below m7, and place 2*2 m9 in the upper left corner to the right of m8.
[0080] See also Figure 3 , Figure 3 FIG. 2 shows a schematic diagram of filling another basic physical page provided by an embodiment of the present application. Figure 3As shown, the size of Page is 128*128. First, place 64*64 m4 in the upper left corner of Page, place 32*32 m5 in the upper left corner below m4, place 16*16 m6 in the upper left corner to the right of m5, place 8*8 m7 in the upper left corner below m6, place 4*4 m8 in the upper left corner to the right of m7, and place 2*2 m9 in the upper left corner below m8.
[0081] Figure 2 and Figure 3 Two filling methods of the present application are shown. In actual applications, there may be other regular filling methods, which shall be subject to actual applications.
[0082] After each mipmap is filled into the base physical page, the offset information of each mipmap in the base physical page needs to be recorded. Specifically, the offset information records the offset information between the upper left pixel coordinates of each mipmap and the upper left pixel coordinates of the base physical page. Based on the offset information and size information of each mipmap, the mipmap can be found in the base physical page quickly and accurately.
[0083] Specifically, filling the first pre-filtered texture mapping in the first pre-filtered texture mapping set into the basic physical page according to a preset filling rule includes:
[0084] S1082. Determine a target first preset filter texture mapping in the first preset filter texture mapping set.
[0085] The target first pre-filtered texture map specifically refers to the mipmap currently being filled into the base physical page. In practical applications, the filling order is usually determined according to the size of each pre-filtered texture map, with the larger mipmap being filled first and the smaller mipmap being filled later.
[0086] S1084. Determine, in the basic physical page, target offset information corresponding to the target first preset filtering texture mapping based on a preset filling rule.
[0087] The preset filling rule is the stair path proposed in the present application, that is, determining the horizontal and vertical adjustment directions, and determining the position information of each first pre-filtered texture mapping in the basic physical page in an alternating horizontal and vertical manner. For example, the first mipmap (64*64) is placed in the upper left corner of the basic physical page, and its offset information is (0, 0). The second mipmap (32*32) is placed in the upper left corner on the right side of the first mipmap. It is offset by 64 horizontally and has no vertical offset. The offset information of the second mipmap is (64, 0); the third mipmap (16*16) is placed below the second mipmap, with an offset of 32. The offset information of the third mipmap is (64, 32)... and so on. The target offset information of the target mipmap can be determined.
[0088] S1086. Determine a target filling position of the target first preset filtering texture mapping in the basic physical page according to the target offset information.
[0089] The target filling position of the target mipmap in the basic physical page can be determined according to the target offset information, that is, starting from (0, 0), the position information where the target mipmap needs to be filled in the basic physical page can be determined according to the target offset information.
[0090] For example, the size of the third mipmap is 16*16, and its offset information is (64, 32). Then the target fill position of the third mipmap is (64, 32, 16, 16), which means that the third mipmap occupies the area with coordinates (64, 32), 16 pixels horizontally and 16 pixels vertically.
[0091] S1088. Fill the target first preset filtered texture mapping to the target filling position.
[0092] After the target filling position is determined, the target mipmap can be filled to the target filling position. After the first preset filter texture map corresponding to the target map is completely filled into the basic physical page, the storage of the first preset filter texture map is completed.
[0093] In practical applications, after the mipmap is stored, when the mipmap needs to be adopted, it is also necessary to sample according to the Page. In another specific implementation provided by the present application, the method further includes:
[0094] receiving a sampling request, wherein the sampling request carries a sampling size;
[0095] In a case where the sampling size is smaller than the preset physical page size, determining a target pre-filtering texture mapping corresponding to the sampling size, and acquiring target offset information corresponding to the target pre-filtering texture mapping;
[0096] Retrieve the target pre-filtered texture map in the base physical page based on the target offset information and the sampling size;
[0097] Target map samples are generated based on the target pre-filtered texture map and the target map.
[0098] In practical applications, it is also necessary to sample the target map. Specifically, the sampling size is carried in the sampling request. For example, the sampling size of the mipmap to be sampled can be determined based on the distance between the virtual camera and the target object. When the sampling size of the mipmap is smaller than the preset physical page size, it means that the mipmap to be sampled is stored in the basic physical page. The target mipmap corresponding to the sampling size is determined, and the target offset information corresponding to the target mipmap is obtained.
[0099] After the target offset information is obtained, the target mipmap can be obtained in the basic physical page according to the target offset information and the sampling size, and the target map sample corresponding to the sampling size can be generated based on the target mipmap and the target map.
[0100] Specifically, the target offset information includes the horizontal coordinate and vertical coordinate of the target mipmap's offset from the reference position information. For example, if the sampling size of the target mipmap is 16*16, the corresponding target offset information is (64, 32), indicating that the offset information of the target mipmap from the reference position information (0, 0) in the base physical page is 64 pixels horizontally (in the x direction) and 32 pixels vertically (in the y direction). First, find the target position information (64, 32) of the target mipmap through the target offset information, and then obtain the target mipmap through the sampling size of the target mipmap, which is 16*16. Then, combine the target map to generate a target map sample of 16*16 size.
[0101] In another specific implementation provided in the present application, after obtaining the target map sampling, rendering may be performed based on the target map sampling to obtain a rendering result.
[0102] The texture mapping processing method provided in the present application receives a texture processing instruction for a target map; performs virtual texture processing on the target map in response to the texture processing instruction to obtain a pre-filtered texture mapping set corresponding to the target map, wherein the pre-filtered texture mapping set includes pre-filtered texture mappings of multiple sizes; determines a first pre-filtered texture mapping set in the pre-filtered texture mapping set based on a preset physical page size; fills the first pre-filtered texture mapping in the first pre-filtered texture mapping set into a basic physical page according to a preset filling rule, and records the offset information of each first pre-filtered texture mapping in the basic physical page.
[0103] An embodiment of the present application implements the storage of pre-filtered texture mappings whose sizes are smaller than the physical page size into the base physical page, and records the offset information of each pre-filtered texture mapping stored in the base physical page in the base physical page, which is used for subsequent restoration based on the pre-filtered texture mapping stored in the base physical page, thereby solving the problem of lack of pre-filtered texture mappings whose sizes are smaller than the physical page, and completing the pre-filtered texture mappings corresponding to all resolutions corresponding to the target map.
[0104] The following combination Figure 4 , taking the application of the texture mapping processing method provided by the present application to the game map in the game scene as an example, the texture mapping processing method is further described. Figure 4 A processing flow chart of a texture mapping processing method for a game map in a game scene provided by an embodiment of the present application is shown, which specifically includes the following steps:
[0105] Step 402: Obtain a target game texture, and receive a texture processing instruction for the target game texture.
[0106] Step 404: In response to the texture processing instruction, the target game texture is standardized to obtain an initial target game texture.
[0107] Step 406: Perform virtual texture processing on the initial target game texture to obtain a multi-size mipmap chain corresponding to the target game texture.
[0108] Step 408: determine a mipmap whose size is smaller than the preset Page size as the first mipmap, and determine a mipmap whose size is greater than or equal to the preset Page size as the second mipmap.
[0109] Step 410: Divide each second mipmap based on the virtual texture configuration, and fill the division result into the corresponding Page page.
[0110] Step 412: Determine the offset information of each first mipmap in the base physical page;
[0111] Step 414: Determine the filling position of each first mipmap according to the offset information corresponding to each first mipmap.
[0112] Step 416: Fill each first mipmap to the corresponding filling position, and save the offset information of each first mipmap.
[0113] Corresponding to the above method embodiment, the present application also provides a texture mapping processing device embodiment, Figure 5 FIG. 1 is a schematic diagram showing the structure of a texture mapping processing device provided by an embodiment of the present application. Figure 5 As shown, the device comprises:
[0114] A receiving module 502 is configured to receive a texture processing instruction for a target texture;
[0115] The processing module 504 is configured to perform virtual texture processing on the target texture in response to the texture processing instruction to obtain a pre-filtered texture mapping set corresponding to the target texture, wherein the pre-filtered texture mapping set includes pre-filtered texture mappings of multiple sizes;
[0116] A determination module 506 is configured to determine a first pre-filtered texture mapping set in the pre-filtered texture mapping set based on a preset physical page size;
[0117] The filling module 508 is configured to fill the first pre-filtered texture mappings in the first pre-filtered texture mapping set into the basic physical page according to a preset filling rule, and record the offset information of each first pre-filtered texture mapping in the basic physical page.
[0118] Optionally, the processing module 504 is further configured to:
[0119] Performing standardization processing on the target map to obtain an initial target map;
[0120] Virtual texturing is performed on the initial target map.
[0121] Optionally, the determining module 560 is further configured to:
[0122] Filtering the pre-filtered texture map set based on the preset physical page size;
[0123] A pre-filtered texture map having a size smaller than the preset physical page size is determined as a first pre-filtered texture map.
[0124] Optionally, the filling module 508 is further configured to:
[0125] Determining a target first preset filtered texture map in the first preset filtered texture map set;
[0126] Determining target offset information corresponding to the target first preset filtered texture mapping in the base physical page based on a preset filling rule;
[0127] Determine a target filling position of the target first preset filtering texture mapping in the basic physical page according to the target offset information;
[0128] The target first preset filtered texture map is filled into the target fill position.
[0129] Optionally, the device further comprises:
[0130] A second determination module is configured to determine a second pre-filtered texture mapping set in the pre-filtered texture mapping set based on the preset physical page size;
[0131] a physical page determination module configured to determine a physical page corresponding to each second pre-filtered texture mapping in the second pre-filtered texture mapping set according to the preset physical page size;
[0132] The segmentation module is configured to segment each second pre-filtered texture map based on the virtual texture configuration, and fill the segmentation result into the physical page corresponding to each second pre-filtered texture map.
[0133] Optionally, the second determining module is further configured to:
[0134] Filtering the pre-filtered texture map set based on the preset physical page size;
[0135] A pre-filtered texture map having a size greater than or equal to the preset physical page size is determined as a second pre-filtered texture map.
[0136] Optionally, the device further comprises:
[0137] A request receiving module is configured to receive a sampling request, wherein the sampling request carries a sampling size;
[0138] an offset acquisition module, configured to determine a target pre-filtered texture mapping corresponding to the sampling size and acquire target offset information corresponding to the target pre-filtered texture mapping when the sampling size is smaller than the preset physical page size;
[0139] a texture map acquisition module configured to acquire the target pre-filtered texture map in the base physical page based on the target offset information and the sampling size;
[0140] The sampling generation module is configured to generate a target map sample based on the target pre-filtered texture map and the target map.
[0141] Optionally, the device further comprises:
[0142] The rendering module is configured to perform rendering based on the target map sampling to obtain a rendering result.
[0143] The texture mapping processing device provided by the present application receives a texture processing instruction for a target map; performs virtual texture processing on the target map in response to the texture processing instruction to obtain a pre-filtered texture mapping set corresponding to the target map, wherein the pre-filtered texture mapping set includes pre-filtered texture mappings of multiple sizes; determines a first pre-filtered texture mapping set in the pre-filtered texture mapping set based on a preset physical page size; fills the first pre-filtered texture mapping in the first pre-filtered texture mapping set into a basic physical page according to a preset filling rule, and records the offset information of each first pre-filtered texture mapping in the basic physical page. An embodiment of the present application implements filling pre-filtered texture mappings whose size is smaller than the physical page size into a basic physical page for storage, and records the offset information of each pre-filtered texture mapping stored in the basic physical page in the basic physical page, which is used for subsequent restoration according to the pre-filtered texture mapping stored in the basic physical page, thereby solving the problem of lack of pre-filtered texture mappings whose size is smaller than the physical page, and completing the pre-filtered texture mappings corresponding to all resolutions corresponding to the target map.
[0144] The above is a schematic scheme of a texture mapping processing device of this embodiment. It should be noted that the technical scheme of the texture mapping processing device and the technical scheme of the above-mentioned texture mapping processing method belong to the same concept, and the details not described in detail in the technical scheme of the texture mapping processing device can be referred to the description of the technical scheme of the above-mentioned texture mapping processing method.
[0145] See also Figure 6 , Figure 6 A flowchart of another texture mapping processing method provided by an embodiment of the present application is shown, which specifically includes the following steps:
[0146] Step 602: Displaying a texture processing interface to the user based on the user's call request.
[0147] Step 604: receiving a target texture input by the user based on the texture processing interface, and receiving a texture processing instruction for the target texture.
[0148] Step 606: In response to the texture processing instruction, virtual texture processing is performed on the target texture to obtain a pre-filtered texture mapping set corresponding to the target texture, wherein the pre-filtered texture mapping set includes pre-filtered texture mappings of multiple sizes.
[0149] Step 608: Fill the first pre-filtered texture mapping set in the pre-filtered texture mapping set into the base physical page, and fill the second pre-filtered texture mapping set in the pre-filtered texture mapping set into the physical page corresponding to each second pre-filtered texture mapping.
[0150] Another texture mapping processing method provided by the present application provides a texture processing interface for users, performs virtual texture processing on the target texture input by the user, obtains pre-filtered texture mappings of various sizes, and fills the first pre-filtered mapping set into the basic physical page, and fills the second pre-filtered mapping set into the physical page corresponding to each second pre-filtered mapping, thereby solving the problem of lack of pre-filtered texture mappings whose size is smaller than the physical page, and completing the pre-filtered texture mappings corresponding to all resolutions corresponding to the target texture.
[0151] Corresponding to the above-mentioned another texture mapping processing method embodiment, the present application also provides another texture mapping processing device embodiment, Figure 7 FIG. 1 shows a schematic diagram of the structure of another texture mapping processing device provided by an embodiment of the present application. Figure 7 As shown, the device comprises:
[0152] The interface display module 702 is configured to display a sticker processing interface to the user based on a user's call request;
[0153] The receiving module 704 is configured to receive a target texture input by the user based on the texture processing interface, and receive a texture processing instruction for the target texture;
[0154] The processing module 706 is configured to perform virtual texture processing on the target texture in response to the texture processing instruction to obtain a pre-filtered texture mapping set corresponding to the target texture, wherein the pre-filtered texture mapping set includes pre-filtered texture mappings of multiple sizes;
[0155] The filling module 708 is configured to fill the first pre-filtered texture mapping set in the pre-filtered texture mapping set into the basic physical page, and fill the second pre-filtered texture mapping set in the pre-filtered texture mapping set into the physical page corresponding to each second pre-filtered texture mapping.
[0156] Another texture mapping processing device provided by the present application provides a texture processing interface for users, performs virtual texture processing on the target texture input by the user, obtains pre-filtered texture mappings of various sizes, and fills the first pre-filtered mapping set into the basic physical page, and fills the second pre-filtered mapping set into the physical page corresponding to each second pre-filtered mapping, thereby solving the problem of lack of pre-filtered texture mappings whose size is smaller than the physical page, and completing the pre-filtered texture mappings corresponding to all resolutions corresponding to the target texture.
[0157] The above is a schematic scheme of another texture mapping processing device of this embodiment. It should be noted that the technical scheme of the texture mapping processing device and the technical scheme of the above another texture mapping processing method belong to the same concept, and the details not described in detail in the technical scheme of the texture mapping processing device can be referred to the description of the technical scheme of the above another texture mapping processing method.
[0158] Figure 8 The structure block diagram of a computing device 800 provided according to an embodiment of the present application is shown. The components of the computing device 800 include but are not limited to a memory 810 and a processor 820. The processor 820 is connected to the memory 810 via a bus 830, and the database 850 is used to store data.
[0159] The computing device 800 also includes an access device 840 that enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 840 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0160] In one embodiment of the present application, the above components of the computing device 800 and Figure 8 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 8 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0161] The computing device 800 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 800 may also be a mobile or stationary server.
[0162] When the processor 820 executes the computer instructions, the steps of the texture mapping processing method are implemented.
[0163] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned texture mapping processing method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned texture mapping processing method.
[0164] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the texture mapping processing method as described above.
[0165] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned texture mapping processing method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned texture mapping processing method.
[0166] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0167] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0168] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0169] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0170] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.
Claims
1. A texture mapping processing method, characterized in that: include: receiving a texture processing instruction for a target texture; In response to the texture processing instruction, performing virtual texture processing on the target texture to obtain a pre-filtered texture mapping set corresponding to the target texture, wherein the pre-filtered texture mapping set includes pre-filtered texture mappings of multiple sizes; Determining a first pre-filtered texture map set in the pre-filtered texture map set based on a preset physical page size; Fill the first pre-filtered texture mapping in the first pre-filtered texture mapping set into the basic physical page according to a preset filling rule, and record the offset information of each first pre-filtered texture mapping in the basic physical page, wherein the filling of the first pre-filtered texture mapping in the first pre-filtered texture mapping set into the basic physical page according to the preset filling rule includes: determining a target first preset filtered texture mapping in the first pre-filtered texture mapping set; determining the target offset information corresponding to the target first preset filtered texture mapping in the basic physical page based on the preset filling rule; determining the target filling position of the target first preset filtered texture mapping in the basic physical page according to the target offset information; and filling the target first preset filtered texture mapping into the target filling position.
2. The method according to claim 1, characterized in that In response to the texture processing instruction, performing virtual texture processing on the target texture, comprising: Performing standardization processing on the target map to obtain an initial target map; Virtual texturing is performed on the initial target map.
3. The method according to claim 1, characterized in that Determining a first pre-filtered texture mapping set in the pre-filtered texture mapping set based on a preset physical page size includes: Filtering the pre-filtered texture map set based on the preset physical page size; A pre-filtered texture map having a size smaller than the preset physical page size is determined as a first pre-filtered texture map.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: determining a second pre-filtered texture map set in the pre-filtered texture map set based on the preset physical page size; Determining a physical page corresponding to each second pre-filtered texture mapping in the second pre-filtered texture mapping set according to the preset physical page size; Each second pre-filtered texture map is segmented based on the virtual texture configuration, and the segmented result is filled into a physical page corresponding to each second pre-filtered texture map.
5. The method according to claim 4, characterized in that Determining a second pre-filtered texture mapping set in the pre-filtered texture mapping set based on the preset physical page size includes: Filtering the pre-filtered texture map set based on the preset physical page size; A pre-filtered texture map having a size greater than or equal to the preset physical page size is determined as a second pre-filtered texture map.
6. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: receiving a sampling request, wherein the sampling request carries a sampling size; In a case where the sampling size is smaller than the preset physical page size, determining a target pre-filtering texture mapping corresponding to the sampling size, and acquiring target offset information corresponding to the target pre-filtering texture mapping; Retrieve the target pre-filtered texture map in the base physical page based on the target offset information and the sampling size; Target map samples are generated based on the target pre-filtered texture map and the target map.
7. The method according to claim 6, characterized in that The method further comprises: Rendering is performed based on the target map sampling to obtain a rendering result.
8. A texture mapping processing method, characterized in that: include: Displaying a texture processing interface to the user based on the user's call request; receiving a target texture input by the user based on the texture processing interface, and receiving a texture processing instruction for the target texture; In response to the texture processing instruction, performing virtual texture processing on the target texture to obtain a pre-filtered texture mapping set corresponding to the target texture, wherein the pre-filtered texture mapping set includes pre-filtered texture mappings of multiple sizes; Fill the first pre-filtered texture mapping set in the pre-filtered texture mapping set into the basic physical page, and fill the second pre-filtered texture mapping set in the pre-filtered texture mapping set into the physical page corresponding to each second pre-filtered texture mapping, wherein filling the first pre-filtered texture mapping set in the pre-filtered texture mapping set into the basic physical page, and filling the second pre-filtered texture mapping set in the pre-filtered texture mapping set into the physical page corresponding to each second pre-filtered texture mapping, includes: determining a target first preset filtered texture mapping in the first pre-filtered texture mapping set; determining target offset information corresponding to the target first preset filtered texture mapping in the basic physical page based on a preset filling rule; determining a target filling position of the target first preset filtered texture mapping in the basic physical page according to the target offset information; filling the target first preset filtered texture mapping into the target filling position; splitting each second pre-filtered texture mapping in the second pre-filtered texture mapping set based on a virtual texture configuration, and filling the split result into the corresponding physical page.
9. A texture mapping processing device, characterized in that: include: A receiving module, configured to receive a texture processing instruction for a target texture; A processing module is configured to perform virtual texture processing on the target texture in response to the texture processing instruction to obtain a pre-filtered texture mapping set corresponding to the target texture, wherein the pre-filtered texture mapping set includes pre-filtered texture mappings of multiple sizes; A determination module configured to determine a first pre-filtered texture mapping set in the pre-filtered texture mapping set based on a preset physical page size; A filling module is configured to fill the first pre-filtered texture mapping in the first pre-filtered texture mapping set into the basic physical page according to a preset filling rule, and record the offset information of each first pre-filtered texture mapping in the basic physical page, wherein the filling of the first pre-filtered texture mapping in the first pre-filtered texture mapping set into the basic physical page according to the preset filling rule includes: determining a target first preset filtered texture mapping in the first pre-filtered texture mapping set; determining the target offset information corresponding to the target first preset filtered texture mapping in the basic physical page based on the preset filling rule; determining the target filling position of the target first preset filtered texture mapping in the basic physical page according to the target offset information; and filling the target first preset filtered texture mapping to the target filling position.
10. A texture mapping processing device, characterized in that: include: An interface display module is configured to display a texture processing interface to a user based on a user's call request; A receiving module, configured to receive a target texture input by the user based on the texture processing interface, and receive a texture processing instruction for the target texture; A processing module is configured to perform virtual texture processing on the target texture in response to the texture processing instruction to obtain a pre-filtered texture mapping set corresponding to the target texture, wherein the pre-filtered texture mapping set includes pre-filtered texture mappings of multiple sizes; A filling module is configured to fill the first pre-filtered texture mapping set in the pre-filtered texture mapping set into the basic physical page, and fill the second pre-filtered texture mapping set in the pre-filtered texture mapping set into the physical page corresponding to each second pre-filtered texture mapping, wherein the filling of the first pre-filtered texture mapping set in the pre-filtered texture mapping set into the basic physical page, and the filling of the second pre-filtered texture mapping set in the pre-filtered texture mapping set into the physical page corresponding to each second pre-filtered texture mapping, includes: determining a target first preset filtered texture mapping in the first pre-filtered texture mapping set; determining target offset information corresponding to the target first preset filtered texture mapping in the basic physical page based on a preset filling rule; determining a target filling position of the target first preset filtered texture mapping in the basic physical page according to the target offset information; filling the target first preset filtered texture mapping into the target filling position; splitting each second pre-filtered texture mapping in the second pre-filtered texture mapping set based on a virtual texture configuration, and filling the split result into the corresponding physical page.
11. A computing device comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the computer instructions, the steps of the method according to any one of claims 1 to 7 or 8 are implemented.
12. A computer-readable storage medium storing computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the method described in any one of claims 1 to 7 or 8 are implemented.
Citation Information
Patent Citations
Apparatus and method of image rendering
CN106997612A
Decal rendering method and device of game model, storage medium and electronic equipment
CN113398583A