Graph rendering method and device, electronic equipment, storage medium and program product
By sampling and repeated mapping of the corners and edge areas of the rectangular box sticker in the graphic rendering, the problem of increasing the burden of storage and calculation of large -sized storage graphics is solved, and efficient graphic rendering performance is achieved.
Patent Information
- Application Number
- CN202411623329.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-01-28
AI Technical Summary
During the graphics rendering process, using large-sized maps will significantly increase the storage and computing burden, affecting performance and response speed.
By determining the corner area and marginal non -corner area of the rectangular box map to be sampled, these areas are sampled and repeatedly mapped to the target model, so as to achieve a high -resolution graphic rendering effect.
It reduces the calculation burden of the storage space and the calculation of graphics rendering, and improves performance and response speed.
Smart Images

Figure CN119379836A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of graphics processing technology, and in particular to a graphics rendering method, device, electronic device, storage medium and program product. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.
[0003] In the graphics rendering scheme in the related art, in order to achieve complex visual effects, it is usually necessary to use large-sized textures.
[0004] However, the solution of using large-size textures not only requires a large amount of storage space, which will significantly increase the storage burden of the device, but also significantly increases the computing burden of the device during the graphics rendering process, thereby affecting performance and response speed. Summary of the invention
[0005] In view of this, the purpose of the present disclosure is to provide a graphics rendering method, device, electronic device, storage medium and program product, which at least to a certain extent solve one of the technical problems in the related art.
[0006] Based on the above purpose, the first aspect of the exemplary embodiment of the present disclosure provides a graphics rendering method, including:
[0007] Determine the rectangular frame map to be sampled;
[0008] Determine the corner area and edge non-corner area of the rectangular frame map to be sampled;
[0009] Sampling the edge non-corner area to obtain an edge non-corner area texture map, and repeatedly mapping the edge non-corner area texture map to the target model;
[0010] The corner area is sampled to obtain a corner area texture map, and the corner area texture map is mapped to the target model.
[0011] Based on the same inventive concept, a second aspect of the exemplary embodiment of the present disclosure provides a graphics rendering device, including:
[0012] A to-be-sampled map determination module is configured to determine a to-be-sampled rectangular frame map;
[0013] A to-be-sampled area division module is configured to determine the corner area and edge non-corner area of the to-be-sampled rectangular frame map;
[0014] An edge non-corner area texture map repeated mapping module is configured to sample the edge non-corner area to obtain an edge non-corner area texture map, and repeatedly map the edge non-corner area texture map to a target model;
[0015] The corner area texture map mapping module is configured to sample the corner area to obtain a corner area texture map, and map the corner area texture map to the target model.
[0016] Based on the same inventive concept, a third aspect of the exemplary embodiment of the present disclosure provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect is implemented.
[0017] Based on the same inventive concept, a fourth aspect of the exemplary embodiments of the present disclosure provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method described in the first aspect.
[0018] Based on the same inventive concept, a fifth aspect of the exemplary embodiments of the present disclosure provides a computer program product, including computer program instructions. When the computer program instructions are executed on a computer, the computer executes the method described in the first aspect.
[0019] From the above, it can be seen that the graphics rendering method, device, electronic device, storage medium and program product provided by the embodiments of the present disclosure include: determining a rectangular frame map to be sampled; determining a corner area and an edge non-corner area of the rectangular frame map to be sampled; sampling the edge non-corner area to obtain an edge non-corner area texture map, and repeatedly mapping the edge non-corner area texture map to a target model; sampling the corner area to obtain a corner area texture map, and mapping the corner area texture map to the target model. The present disclosure repeatedly maps the edge non-corner area texture map to the target model, thereby only needing to store and sample maps with lower resolutions, and can achieve the graphics rendering effect that can only be achieved by storing and sampling maps with higher resolutions, thereby reducing the storage space occupied; reducing the computational burden during graphics rendering, and improving performance and response speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 A schematic diagram of an application scenario of a graphics rendering method provided by an exemplary embodiment of the present disclosure;
[0022] Figure 2 A schematic diagram of another application scenario of the graphics rendering method provided by the exemplary embodiment of the present disclosure;
[0023] Figure 3 A flowchart of a graphics rendering method provided by an exemplary embodiment of the present disclosure;
[0024] Figure 4 A schematic diagram of a rectangular frame map to be sampled provided by an exemplary embodiment of the present disclosure;
[0025] Figure 5 A schematic diagram of a partitioned rectangular frame map to be sampled provided by an exemplary embodiment of the present disclosure;
[0026] Figure 6 A schematic diagram of a sampled rectangular frame map provided by an exemplary embodiment of the present disclosure;
[0027] Figure 7 A schematic diagram of a structure of a graphics rendering device provided by an exemplary embodiment of the present disclosure;
[0028] Figure 8 A schematic structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solutions and advantages of the present disclosure more clear, the principles and spirit of the present disclosure will be described with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0030] It should be understood herein that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction rather than having any limiting meaning.
[0031] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connecting" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly. The article "one" or "a" before an element does not exclude the existence of multiple such elements.
[0032] The principle and spirit of the present disclosure are explained in detail below with reference to several representative embodiments of the present disclosure.
[0033] In video games, a skill warning box refers to a user interface (UI) element that helps players better understand and respond to the release of skills in the game through different shapes and animation effects. For example, it helps players predict the attack range of skills so that they can respond accordingly, such as dodging or preparing for a counterattack.
[0034] In specific implementation, the skill warning box can have a variety of shapes, including rectangular, circular, and fan-shaped, etc. The solution provided in the present disclosure is mainly aimed at the rectangular skill warning box.
[0035] In the related art, in the process of rendering a rectangular skill warning box, in order to improve the display effect of the skill warning box, such as improving its resolution to make it look more realistic and refined, it is usually necessary to use a large-size texture.
[0036] However, the inventors of the present disclosure have discovered that the use of large-size textures not only requires a large amount of storage space, which significantly increases the storage burden of the device, but also significantly increases the computing burden of the device during the graphics rendering process, thereby affecting performance and response speed.
[0037] Since it will significantly increase the storage and computing burden of the device, the solution of using large-size textures is obviously not applicable to mobile devices and low-power devices where resource constraints are more prominent.
[0038] In order to solve the above problems, the present disclosure provides a graphics rendering solution, which specifically includes: determining a rectangular box map to be sampled; determining a corner area and an edge non-corner area of the rectangular box map to be sampled; sampling the edge non-corner area to obtain an edge non-corner area texture map, and repeatedly mapping the edge non-corner area texture map to a target model; sampling the corner area to obtain a corner area texture map, and mapping the corner area texture map to the target model.
[0039] The present invention repeatedly maps texture maps of edge non-corner areas to the target model, so that only low-resolution maps need to be stored and sampled to achieve the graphics rendering effect that can only be achieved by storing and sampling high-resolution maps, thereby reducing storage space occupancy; reducing the computational burden during graphics rendering, and improving performance and response speed.
[0040] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure are described in detail below.
[0041] refer to Figure 1 , which is a schematic diagram of an application scenario of the graphics rendering method provided by an exemplary embodiment of the present disclosure.
[0042] This application scenario includes a terminal device 101.
[0043] The terminal device 101 may be an electronic device with data transmission and multimedia input / output functions close to the user side, including but not limited to a desktop computer, a mobile phone, a mobile computer, a tablet computer, a media player, a smart wearable device, a personal digital assistant (PDA) or other electronic devices capable of realizing the above functions. The electronic device may include a processor and a display screen with a touch input function, the display screen is used to present a graphical user interface, the graphical user interface can display an application interface, and the processor is used to process application data, generate a graphical user interface, and control the display of the graphical user interface on the display screen.
[0044] In some exemplary embodiments, the graphics rendering method may be executed on the terminal device 101 .
[0045] When the graphics rendering method runs on the terminal device 101, the terminal device 101 is used to provide graphics rendering services to the user of the terminal device 101. A client is installed in the terminal device 101, and the client provides a graphical user interface. The content displayed by the graphical user interface includes a game scene with virtual objects. The game scene is a virtual scene displayed (or provided) when the application is running on the terminal.
[0046] The user can control the controlled virtual object in the virtual scene through the client. The user can control the controlled virtual object to move in the virtual scene, for example, control the controlled virtual object to navigate or collect virtual resources, etc., and can also control the controlled virtual object to upgrade and develop on the building object created by itself, and can also control the controlled virtual object to fight with virtual objects of other camps. Optionally, the controlled virtual object can have multiple functions, such as not only the function of collecting virtual resources, but also the function of fighting.
[0047] The controlled virtual objects in the virtual scene also include artificial intelligence (AI) set in the virtual environment through training.
[0048] As a specific example, see Figure 2 In the virtual scene 200, when the first virtual character 201 attacks the second virtual character 202, in order to help the player better understand and respond to the skill release in the game, a skill warning box 203 is provided to help the player controlling the second virtual character 202 predict the attack range of the skill of the first virtual character 201 so as to make corresponding responses, such as dodging or preparing to counterattack.
[0049] In specific implementation, the terminal device 101 determines the rectangular frame map to be sampled; determines the corner area and edge non-corner area of the rectangular frame map to be sampled; samples the edge non-corner area to obtain the edge non-corner area texture map, and repeatedly maps the edge non-corner area texture map to the target model; samples the corner area to obtain the corner area texture map, and maps the corner area texture map to the target model. The client displays the rectangular frame mapped to the target model to the user (as a skill warning frame) to help players better understand and respond to the release of skills in the game. For example, it helps players predict the attack range of skills so that they can make corresponding responses, such as dodging or preparing to counterattack.
[0050] Combine the following Figure 1 and Figure 2 The graphics rendering method according to the exemplary embodiment of the present disclosure is described by using the application scenario. It should be noted that the above application scenario is only shown to facilitate understanding of the spirit and principle of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.
[0051] refer to Figure 3 , which is a flow chart of a mapping processing method provided by an exemplary embodiment of the present disclosure.
[0052] The mapping method comprises the following steps:
[0053] Step S310: Determine the rectangular frame map to be sampled.
[0054] In this exemplary embodiment, the to-be-sampled rectangular frame map refers to the state of the rectangular frame map before being rendered onto the model surface, and correspondingly, the sampled rectangular frame map refers to the state of the rectangular frame map after being rendered onto the model surface.
[0055] In specific implementation, the unsampled rectangular frame map refers to the state of the texture map before it is read by the sampler and applied to the surface of the object during the graphics rendering process. The map in this state is the original image data without any transformation or processing. At this stage, the UV coordinates of the map have not been calculated, and the filtering and addressing mode of the texture have not been applied. The unsampled rectangular frame map is the input in the rendering pipeline, waiting to be read by the sampler and converted into a sampled rectangular frame map.
[0056] The sampled rectangle map is the state of the texture map after it has been processed by the sampler and applied to the surface of the object. At this stage, the UV coordinates of the texture have been calculated, and according to the settings of the sampler (such as filtering method and addressing mode), the pixel values of the texture are interpolated or adjusted to fit the geometry of the surface of the object. The sampled rectangle map is the output of the rendering pipeline, which reflects the texture effect that will be displayed on the screen.
[0057] The rectangular frame map to be sampled is the original state of the texture data, and the rectangular frame map after sampling is the final state combined with the surface of the object after being processed by the sampler.
[0058] In this exemplary embodiment, the resolution of the rectangular frame map to be sampled is a first resolution, and the resolution of the rectangular frame map after sampling is a second resolution, wherein the first resolution is lower than the second resolution.
[0059] In a specific implementation, the rectangular frame map to be sampled is a map with a lower resolution, wherein the lower resolution means that the resolution of the rectangular frame map to be sampled is lower than that of the sampled rectangular frame map.
[0060] As a specific example, the resolution of the rectangular frame map to be sampled is 128*128 pixels or 256*256 pixels, and the resolution of the rectangular frame map after sampling is 1024*1024 pixels or 2048*2048 pixels.
[0061] Here, taking the resolution of the rectangular frame map to be sampled as 256*256 pixels as an example, it means that the width and height of the rectangular frame map to be sampled are both 256 pixels.
[0062] In this exemplary embodiment, determining the rectangular frame map to be sampled includes:
[0063] Get the rectangular frame map to be sampled from the local computer.
[0064] In specific implementation, since the resolution of the rectangular frame map to be sampled adopted in the present disclosure is relatively low, the storage space occupied is reduced. Therefore, compared with the related technology, it is more suitable for storage in the terminal device locally, which can reduce the transmission delay.
[0065] Through this exemplary embodiment, only low-resolution textures need to be stored and sampled to achieve the effect that can only be achieved by storing and sampling high-resolution textures. This reduces the storage space occupied; reduces the computational burden during graphics rendering, and improves performance and response speed. Furthermore, it reduces the demand for hardware and can be used in mobile devices and low-power devices.
[0066] Step S320: Determine the corner area and edge non-corner area of the rectangular frame map to be sampled.
[0067] In this exemplary embodiment, the rectangular frame map to be sampled is divided into a plurality of regions;
[0068] The corner region and the edge non-corner region among the plurality of regions are determined.
[0069] As a specific example, see Figure 4 , which is a schematic diagram of an exemplary rectangular frame map to be sampled, refer to Figure 5 , dividing the rectangular frame map to be sampled into a nine-square grid layout.
[0070] Among them, there are nine areas: 1, 2, 3, 4, 5, 6, 7, 8 and 9.
[0071] Based on the layout of the nine-grid, the corner area and the edge non-corner area of the rectangular frame map to be sampled are determined.
[0072] Among them, 1, 3, 7 and 9 are corner areas;
[0073] 1, 2, 3, 4, 6, 7, 8, and 9 are marginal areas;
[0074] 2, 4, 6 and 8 are edge non-corner areas.
[0075] In the above exemplary embodiments, the layout of dividing the rectangular frame map to be sampled into a nine-grid layout is taken as an example for description. However, in some application scenarios, the texture of the rectangular frame map to be sampled is relatively complex. In this case, in order to improve the display effect of the sampled rectangular frame map obtained after executing step S330 and step S340, the following exemplary embodiments are provided, specifically:
[0076] In this exemplary embodiment, dividing the rectangular frame map to be sampled into a plurality of regions includes:
[0077] Determine the minimum repeating unit in the rectangular frame map to be sampled;
[0078] Based on the minimum repeating unit, the rectangular frame map to be sampled is divided into the multiple areas.
[0079] In specific implementation, the minimum repeating unit refers to the minimum repeating unit that constitutes a complex pattern or texture in the rectangular frame map to be sampled. This unit can generate the entire pattern through symmetry operations (such as rotation, reflection, etc.).
[0080] Through the above exemplary embodiments, based on the minimum repeating unit, it can be ensured that the texture of the sampled rectangular frame map obtained after executing step S330 and step S340 can be spliced in the corresponding direction, thereby improving the display effect.
[0081] Step S330: sampling the edge non-corner area to obtain an edge non-corner area texture map, and repeatedly mapping the edge non-corner area texture map to the target model.
[0082] In a specific implementation, the smaller edge non-corner area texture map is repeatedly mapped to the target model along the horizontal direction or the vertical direction to create a larger texture effect without actually having a larger texture map.
[0083] In this exemplary embodiment, sampling the edge non-corner area to obtain an edge non-corner area texture map, and repeatedly mapping the edge non-corner area texture map to the target model includes:
[0084] Determine a first edge non-corner area texture map to be repeatedly mapped along the horizontal direction among the edge non-corner area texture maps;
[0085] Repeating mapping the first edge non-corner area texture map to the target model a first preset number of times in the horizontal direction;
[0086] Determine a second edge non-corner area texture map to be repeatedly mapped along the vertical direction in the edge non-corner area texture map;
[0087] The second edge non-corner area texture map is repeatedly mapped a second preset number of times along the vertical direction to the target model.
[0088] As a specific example, see Figure 6 , among which, compared with Figure 5 The edge non-corner area texture maps corresponding to edge non-corner areas 2 and 8 are repeatedly mapped to the target model 4 times along the horizontal direction; the edge non-corner area texture maps corresponding to edge non-corner areas 4 and 6 are repeatedly mapped to the target model 4 times along the vertical direction.
[0089] Step S340: Sampling the corner area to obtain a corner area texture map, and mapping the corner area texture map to the target model.
[0090] In this exemplary embodiment, sampling the corner area to obtain a corner area texture map, and mapping the corner area texture map to the target model includes:
[0091] Determine a corner gap area formed after repeatedly mapping the edge non-corner area texture map to the target model;
[0092] The corner area texture maps are respectively mapped to the corner gap areas on the target model.
[0093] As a specific example, see Figure 6 , map the corner area texture maps corresponding to corner areas 1, 3, 7 and 9 to the target model.
[0094] During specific implementation, step S330 and step S340 are performed simultaneously.
[0095] Through the above exemplary embodiments, the texture map of the edge non-corner area repeatedly mapped to the target model and the texture map of the corner area mapped to the target model are spliced to form a sampled rectangular frame map.
[0096] Furthermore, the inventors of the present disclosure have discovered that because the GPU does not render pixel by pixel but rather four pixels at a time, defects may occur when the four pixels jump too much left / right / up / down. Figure 6 In the example, pixels at the edge where the corner area 1 and the edge non-corner area 2 meet may have defects such as flickering / error display. To solve this defect, the present disclosure provides the following exemplary embodiments, specifically:
[0097] In this exemplary embodiment, after sampling the corner area to obtain a corner area texture map and mapping the corner area texture map to the target model, the method further includes:
[0098] Determine a change rate between edge pixels of the edge non-corner area texture map and edge pixels of the adjacent corner area texture map after being mapped to the target model;
[0099] In response to determining that the change rate is greater than a preset change rate threshold, edge pixels of the edge non-corner area texture map and / or edge pixels of the corner area texture map are cut off.
[0100] In specific implementation, the DDX and DDY functions are used to calculate the change rate of the variable in the pixel block in the screen space, where DDX is horizontal and DDY is vertical. When the change rate is too large, the content is cut off, that is, it is not displayed at all.
[0101] As a specific example, if the value of DDX or DDY exceeds the change rate threshold of 0.3, it will not be displayed, thereby avoiding the occurrence of flickering defects.
[0102] In specific implementation, after the sampled rectangular frame map is used, the sampled rectangular frame map is not saved locally, and the locally saved is still the to-be-sampled rectangular frame map, which reduces the storage space occupied.
[0103] From the above, it can be seen that the graphics rendering method provided by the embodiment of the present disclosure includes: determining a rectangular frame map to be sampled; determining a corner area and an edge non-corner area of the rectangular frame map to be sampled; sampling the edge non-corner area to obtain an edge non-corner area texture map, and repeatedly mapping the edge non-corner area texture map to a target model; sampling the corner area to obtain a corner area texture map, and mapping the corner area texture map to the target model.
[0104] The present invention repeatedly maps texture maps of edge non-corner areas to the target model, so that only low-resolution maps need to be stored and sampled to achieve the graphics rendering effect that can only be achieved by storing and sampling high-resolution maps, thereby reducing storage space occupancy; reducing the computational burden during graphics rendering, and improving performance and response speed.
[0105] It should be noted that the method of the embodiment of the present disclosure can be performed by a single device, such as a computer or a server. The method of the present embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present disclosure, and the multiple devices will interact with each other to complete the described method.
[0106] It should be noted that the above describes some embodiments of the present disclosure. 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 above 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.
[0107] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a graphics rendering device.
[0108] refer to Figure 7 , which is a structural schematic diagram of a graphics rendering device provided by an exemplary embodiment of the present disclosure.
[0109] The graphics rendering device includes the following modules:
[0110] A to-be-sampled map determining module 910 is configured to determine a to-be-sampled rectangular frame map;
[0111] The to-be-sampled area division module 920 is configured to determine the corner area and the edge non-corner area of the to-be-sampled rectangular frame map;
[0112] The edge non-corner area texture map repeated mapping module 930 is configured to sample the edge non-corner area to obtain an edge non-corner area texture map, and repeatedly map the edge non-corner area texture map to the target model;
[0113] The corner area texture map mapping module 940 is configured to sample the corner area to obtain a corner area texture map, and map the corner area texture map to the target model.
[0114] In this exemplary embodiment, the to-be-sampled area division module 920 is specifically configured as follows:
[0115] Divide the rectangular frame map to be sampled into multiple areas;
[0116] The corner region and the edge non-corner region among the plurality of regions are determined.
[0117] In this exemplary embodiment, the to-be-sampled area division module 920 is specifically configured as follows:
[0118] Determine the minimum repeating unit in the rectangular frame map to be sampled;
[0119] Based on the minimum repeating unit, the rectangular frame map to be sampled is divided into the multiple areas.
[0120] In this exemplary embodiment, the to-be-sampled area division module 920 is specifically configured as follows:
[0121] Divide the rectangular frame map to be sampled into a nine-square grid layout;
[0122] Based on the layout of the nine-grid, the corner area and the edge non-corner area in the rectangular frame map to be sampled are determined.
[0123] In this exemplary embodiment, the edge non-corner area texture map repeated mapping module 930 is specifically configured as follows:
[0124] Determine a first edge non-corner area texture map to be repeatedly mapped along the horizontal direction among the edge non-corner area texture maps;
[0125] Repeating mapping the first edge non-corner area texture map to the target model a first preset number of times in the horizontal direction;
[0126] Determine a second edge non-corner area texture map to be repeatedly mapped along the vertical direction in the edge non-corner area texture map;
[0127] The second edge non-corner area texture map is repeatedly mapped a second preset number of times along the vertical direction to the target model.
[0128] In this exemplary embodiment, the corner area texture map mapping module 940 is specifically configured as follows:
[0129] Determine a corner gap area formed after repeatedly mapping the edge non-corner area texture map to the target model;
[0130] The corner area texture maps are respectively mapped to the corner gap areas on the target model.
[0131] In this exemplary embodiment, the graphics rendering device further includes a graphics optimization module (not shown in the figure):
[0132] Determine a change rate between edge pixels of the edge non-corner area texture map and edge pixels of the adjacent corner area texture map after being mapped to the target model;
[0133] In response to determining that the change rate is greater than a preset change rate threshold, edge pixels of the edge non-corner area texture map and / or edge pixels of the corner area texture map are cut off.
[0134] In this exemplary embodiment, the to-be-sampled map determination module 910 is specifically configured as follows:
[0135] Acquire the rectangular frame map to be sampled from the local computer;
[0136] The resolution of the rectangular frame map to be sampled is a first resolution, and the resolution of the sampled rectangular frame map after the rectangular frame map to be sampled is mapped to the target model is a second resolution, wherein the first resolution is lower than the second resolution.
[0137] For the convenience of description, the above device is described by dividing it into various modules according to its functions. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0138] The device of the above embodiment is used to implement the corresponding graphics rendering method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0139] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the graphics rendering method described in any of the above embodiments is implemented.
[0140] Figure 8 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0141] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0142] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0143] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0144] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0145] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0146] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0147] The electronic device of the above embodiment is used to implement the corresponding graphics rendering method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0148] The memory 1020 stores machine-readable instructions executable by the processor 1010. When the electronic device is running, the processor 1010 communicates with the memory 1020 via the bus 1030, so that the processor 1010 executes the following instructions when running:
[0149] Determine the rectangular frame map to be sampled;
[0150] Determine the corner area and edge non-corner area of the rectangular frame map to be sampled;
[0151] Sampling the edge non-corner area to obtain an edge non-corner area texture map, and repeatedly mapping the edge non-corner area texture map to the target model;
[0152] The corner area is sampled to obtain a corner area texture map, and the corner area texture map is mapped to the target model.
[0153] In a possible implementation manner, in the instruction executed by the processor 1010, the determining of the corner area and the edge non-corner area of the rectangular frame map to be sampled includes:
[0154] Divide the rectangular frame map to be sampled into multiple areas;
[0155] The corner region and the edge non-corner region among the plurality of regions are determined.
[0156] In a possible implementation manner, in the instructions executed by the processor 1010, dividing the rectangular frame map to be sampled into a plurality of regions includes:
[0157] Determine the minimum repeating unit in the rectangular frame map to be sampled;
[0158] Based on the minimum repeating unit, the rectangular frame map to be sampled is divided into the multiple areas.
[0159] In a possible implementation manner, in the instruction executed by the processor 1010, the determining of the corner area and the edge non-corner area of the rectangular frame map to be sampled includes:
[0160] Divide the rectangular frame map to be sampled into a nine-square grid layout;
[0161] Based on the layout of the nine-grid, the corner area and the edge non-corner area in the rectangular frame map to be sampled are determined.
[0162] In a possible implementation manner, in the instructions executed by the processor 1010, sampling the edge non-corner area to obtain an edge non-corner area texture map, and repeatedly mapping the edge non-corner area texture map to the target model includes:
[0163] Determine a first edge non-corner area texture map to be repeatedly mapped along the horizontal direction among the edge non-corner area texture maps;
[0164] Repeating mapping the first edge non-corner area texture map to the target model a first preset number of times in the horizontal direction;
[0165] Determine a second edge non-corner area texture map to be repeatedly mapped along the vertical direction in the edge non-corner area texture map;
[0166] The second edge non-corner area texture map is repeatedly mapped a second preset number of times along the vertical direction to the target model.
[0167] In a possible implementation manner, in the instructions executed by the processor 1010, sampling the corner area to obtain a corner area texture map, and mapping the corner area texture map to the target model includes:
[0168] Determine a corner gap area formed after repeatedly mapping the edge non-corner area texture map to the target model;
[0169] The corner area texture maps are respectively mapped to the corner gap areas on the target model.
[0170] In a possible implementation manner, in the instructions executed by the processor 1010, after sampling the corner area to obtain a corner area texture map and mapping the corner area texture map to the target model, the method further includes:
[0171] Determine a change rate between edge pixels of the edge non-corner area texture map and edge pixels of the adjacent corner area texture map after being mapped to the target model;
[0172] In response to determining that the change rate is greater than a preset change rate threshold, edge pixels of the edge non-corner area texture map and / or edge pixels of the corner area texture map are cut off.
[0173] In a possible implementation manner, in the instruction executed by the processor 1010, the determining of the rectangular frame map to be sampled includes:
[0174] Acquire the rectangular frame map to be sampled from the local computer;
[0175] The resolution of the rectangular frame map to be sampled is a first resolution, and the resolution of the sampled rectangular frame map after the rectangular frame map to be sampled is mapped to the target model is a second resolution, wherein the first resolution is lower than the second resolution.
[0176] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the graphics rendering method described in any of the above embodiments.
[0177] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0178] The above-mentioned non-transitory computer-readable storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)), etc.
[0179] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the graphics rendering method described in any embodiment in the above exemplary method part, and have the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0180] Based on the same inventive concept, corresponding to the graphics rendering method described in any of the above embodiments, the present disclosure also provides a computer program product, which includes computer program instructions. In some embodiments, the computer program instructions can be executed by one or more processors of a computer so that the computer and / or the processor executes the graphics rendering method. Corresponding to the execution subject corresponding to each step in each embodiment of the graphics rendering method, the processor that executes the corresponding step may belong to the corresponding execution subject.
[0181] The computer program product of the above embodiment is used to enable the computer and / or the processor to execute the graphics rendering method described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0182] Those skilled in the art will appreciate that the embodiments of the present disclosure may be implemented as a system, method, or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." In addition, in some embodiments, the present disclosure may also be implemented in the form of a computer program product in one or more computer-readable media, which contains computer-readable program code.
[0183] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive examples) of computer-readable storage media may include, for example: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device.
[0184] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0185] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0186] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0187] It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine, and these computer program instructions are executed by a computer or other programmable data processing device to produce a device that implements the functions / operations specified in the boxes in the flowchart and / or block diagram.
[0188] These computer program instructions may also be stored in a computer-readable medium that enables a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable medium produce a product that includes an instruction device that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.
[0189] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby enabling the instructions executed on the computer or other programmable device to provide a process for implementing the functions / operations specified in the blocks in the flowchart and / or block diagram.
[0190] In addition, although the operations of the disclosed method are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in this particular order, or that all the operations shown must be performed to achieve the desired results. On the contrary, the steps depicted in the flow chart can be performed in a different order. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.
[0191] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0192] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0193] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0194] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.
[0195] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0196] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.
[0197] Although the spirit and principle of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims. The scope of the attached claims conforms to the broadest interpretation, thereby including all such modifications and equivalent structures and functions.
Claims
1. A graphics rendering method, characterized in that: include: Determine the rectangular frame map to be sampled; Determine the corner area and edge non-corner area of the rectangular frame map to be sampled; Sampling the edge non-corner area to obtain an edge non-corner area texture map, and repeatedly mapping the edge non-corner area texture map to a target model; The corner area is sampled to obtain a corner area texture map, and the corner area texture map is mapped to the target model.
2. The method according to claim 1, characterized in that The determining of the corner area and the edge non-corner area of the rectangular frame map to be sampled includes: Divide the rectangular frame map to be sampled into multiple areas; The corner region and the edge non-corner region among the plurality of regions are determined.
3. The method according to claim 2, characterized in that The step of dividing the rectangular frame map to be sampled into a plurality of regions comprises: Determine the minimum repeating unit in the rectangular frame map to be sampled; Based on the minimum repeating unit, the rectangular frame map to be sampled is divided into the multiple areas.
4. The method according to claim 1, characterized in that The determining of the corner area and the edge non-corner area of the rectangular frame map to be sampled includes: Divide the rectangular frame map to be sampled into a nine-square grid layout; Based on the layout of the nine-grid, the corner area and the edge non-corner area in the rectangular frame map to be sampled are determined.
5. The method according to claim 1, characterized in that The step of sampling the edge non-corner area to obtain an edge non-corner area texture map, and repeatedly mapping the edge non-corner area texture map to the target model comprises: Determine a first edge non-corner area texture map to be repeatedly mapped along the horizontal direction among the edge non-corner area texture maps; Repeating mapping the first edge non-corner area texture map to the target model a first preset number of times in the horizontal direction; Determine a second edge non-corner area texture map to be repeatedly mapped along the vertical direction in the edge non-corner area texture map; The second edge non-corner area texture map is repeatedly mapped a second preset number of times along the vertical direction to the target model.
6. The method according to claim 1, characterized in that The step of sampling the corner area to obtain a corner area texture map and mapping the corner area texture map to the target model comprises: Determine a corner gap area formed after repeatedly mapping the edge non-corner area texture map to the target model; The corner area texture maps are respectively mapped to the corner gap areas on the target model.
7. The method according to claim 1, characterized in that After sampling the corner area to obtain a corner area texture map and mapping the corner area texture map to the target model, the method further includes: Determine a change rate between edge pixels of the edge non-corner area texture map and edge pixels of the adjacent corner area texture map after being mapped to the target model; In response to determining that the change rate is greater than a preset change rate threshold, edge pixels of the edge non-corner area texture map and / or edge pixels of the corner area texture map are cut off.
8. The method according to claim 1, characterized in that The step of determining the rectangular frame map to be sampled includes: Acquire the rectangular frame map to be sampled from the local computer; The resolution of the rectangular frame map to be sampled is a first resolution, and the resolution of the sampled rectangular frame map after the rectangular frame map to be sampled is mapped to the target model is a second resolution, wherein the first resolution is lower than the second resolution.
9. A graphics rendering device, characterized in that: include: A to-be-sampled map determination module is configured to determine a to-be-sampled rectangular frame map; A to-be-sampled area division module is configured to determine the corner area and edge non-corner area of the to-be-sampled rectangular frame map; An edge non-corner area texture map repeated mapping module is configured to sample the edge non-corner area to obtain an edge non-corner area texture map, and repeatedly map the edge non-corner area texture map to a target model; The corner area texture map mapping module is configured to sample the corner area to obtain a corner area texture map, and map the corner area texture map to the target model.
10. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 8 is implemented.
11. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The method comprises computer program instructions, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 8.
Citation Information
Cited By
Texture fitting mode, device and equipment and computer readable storage medium
CN121505130A