Method, device and storage medium for performing rendering operation, and electronic device
By obtaining the texture offset value of the deformation sampling operation and dynamically adjusting the shading rate configuration of the rendering operation, the problem of low rendering efficiency under fixed configuration is solved, and a balance between efficiency and quality is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2023-06-20
- Publication Date
- 2026-07-21
AI Technical Summary
In existing rendering operations, fixed shading rate configurations cannot balance visual quality loss and performance gain, resulting in low rendering efficiency.
By obtaining the texture offset value corresponding to the deformation sampling operation, the shading rate configuration of the rendering operation is dynamically adjusted to balance the loss of visual quality and the gain of performance, thereby achieving automatic and dynamic adjustment of the shading rate configuration of the rendered object.
It improves the execution efficiency of rendering operations, achieving a balance between visual quality loss and performance gain.
Smart Images

Figure CN119169119B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and more specifically, to a method, apparatus, storage medium, and electronic device for performing rendering operations. Background Technology
[0002] In rendering operations, a fixed shading rate configuration is typically used for rendering different materials. However, a fixed shading rate configuration cannot achieve the optimal balance between visual quality loss and performance gain, leading to low rendering efficiency. Therefore, the rendering operation suffers from low execution efficiency.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This application provides a method, apparatus, storage medium, and electronic device for executing rendering operations, in order to at least solve the technical problem of low execution efficiency of rendering operations.
[0005] According to one aspect of the embodiments of this application, a method for executing a rendering operation is provided, comprising: performing a rendering operation on a target object according to a first shading rate configuration, wherein the first shading rate configuration is used to indicate that the number of pixels applied when performing the rendering operation is a first number; when a deformation sampling operation is obtained on the target object, obtaining a texture offset value corresponding to the deformation sampling operation, wherein the texture offset value is used to indicate the texture change of the target object caused by the deformation sampling operation; adjusting the first shading rate configuration using the texture offset value to obtain a second shading rate configuration, and performing the rendering operation on the target object according to the second shading rate configuration, wherein the second shading rate configuration is used to indicate that the number of pixels applied when performing the rendering operation is a second number.
[0006] According to another aspect of the embodiments of this application, an execution apparatus for rendering operations is also provided, comprising: a first rendering unit, configured to perform a rendering operation on a target object according to a first shading rate configuration, wherein the first shading rate configuration is configured to indicate that the number of pixels applied when performing the rendering operation is a first number; an offset unit, configured to obtain a texture offset value corresponding to the deformation sampling operation when a deformation sampling operation is obtained on the target object, wherein the texture offset value is configured to indicate the texture change of the target object caused by the deformation sampling operation; and a second rendering unit, configured to adjust the first shading rate configuration using the texture offset value to obtain a second shading rate configuration, and perform the rendering operation on the target object according to the second shading rate configuration, wherein the second shading rate configuration is configured to indicate that the number of pixels applied when performing the rendering operation is a second number.
[0007] As an optional solution, the second rendering unit includes: a first adjustment module, configured to adjust the first quantity using the texture offset value to obtain the second quantity; or, a second adjustment module, configured to adjust the first shading rate profile matched with the first shading rate configuration using the texture offset value to obtain the second shading rate profile, wherein the first shading rate profile includes at least one first pixel quantity, the at least one first pixel quantity includes the first quantity, the second shading rate profile includes at least one second pixel quantity, and the at least one second pixel quantity includes the second quantity; and a first determination module, configured to determine the second quantity from the at least one second pixel quantity.
[0008] As an optional solution, the above-mentioned apparatus further includes: a second determining module, configured to determine a preferred shading rate direction of the target object based on the texture details corresponding to the target object before determining the second quantity from the at least one second pixel quantity, wherein the preferred shading rate direction is used to represent the configuration tendency of the texture details for different pixel quantities; the first determining module includes: a first determining submodule, configured to determine the second quantity that matches the preferred shading rate direction from the at least one second pixel quantity.
[0009] As an optional solution, the above-mentioned apparatus further includes: a second determining submodule, used to determine, during the process of performing the rendering operation on the target object according to the first shading rate configuration, the first number that matches the preferred direction of the shading rate from the at least one number of first pixels.
[0010] As an optional solution, the second determining module includes: a first convolution submodule, used to convolve the material texture brightness image corresponding to the target object in at least two directions to obtain different image brightness gradient maps in the at least two directions; a second statistical submodule, used to count the number of target pixels that meet the rich detail condition on the different image brightness gradient maps, and determine the detail index value of the target object in the at least two directions, wherein the detail index value is positively correlated with the number of target pixels, and the detail index value is used to represent the texture detail of the target object in different directions; and a third determining submodule, used to determine the target direction with the largest detail index value in the at least two directions as the preferred direction for shading rate.
[0011] As an optional solution, the above-mentioned apparatus further includes: a third determining module, configured to determine an overall index value of the target object based on the texture details corresponding to the target object before performing the rendering operation on the target object according to the first shading rate configuration, wherein the overall index value is used to represent the overall texture detail level of the target object; and a fourth determining module, configured to determine the first quantity that matches the overall index value from a plurality of candidate quantities before performing the rendering operation on the target object according to the first shading rate configuration; or, to determine the first shading rate level that matches the overall index value from a plurality of candidate shading rate levels.
[0012] As an optional solution, the third determining module includes: a second convolution submodule, used to convolve the material texture brightness image corresponding to the target object to obtain a target image brightness gradient map; and a second statistics submodule, used to count the number of all target pixels that meet the rich detail condition on the target image brightness gradient map and determine the overall index value, wherein the overall index value is positively correlated with the number of all target pixels.
[0013] As an optional solution, the aforementioned offset unit includes: a first acquisition module, configured to acquire a first offset value corresponding to the magnified sampling operation when the aforementioned deformation sampling operation is a magnified sampling operation; or, configured to acquire a second offset value corresponding to the magnified sampling operation when the aforementioned deformation sampling operation is a magnified sampling operation, wherein the aforementioned first offset value is greater than the aforementioned second offset value; the aforementioned first adjustment module includes: a first summation submodule, configured to sum the aforementioned first offset value and the aforementioned first quantity to obtain a first summation result, and determine the aforementioned first summation result as the aforementioned second quantity; the aforementioned second adjustment module includes: a second summation submodule, configured to sum the aforementioned first offset value and the aforementioned first shading rate level to obtain a second summation result, and use the aforementioned second summation result to upgrade the aforementioned first shading rate level to the aforementioned second shading rate level, wherein the level of the shading rate level is positively correlated with the number of pixels applied when performing the aforementioned rendering operation.
[0014] As an optional solution, the above-mentioned device further includes: a second acquisition module, used to acquire, before acquiring the texture offset value corresponding to the deformation sampling operation, the projected pixel area of the target object's bounding box after projection onto the display area, and the hemispherical area of the bounding box; a division module, used to divide the projected pixel area and the hemispherical area before acquiring the texture offset value corresponding to the deformation sampling operation to obtain the actual texture area required when performing the rendering operation on the target object; and a fifth determination module, used to determine, before acquiring the texture offset value corresponding to the deformation sampling operation, if the standard texture area of the target object is acquired and the actual texture area is greater than the standard texture area, that the deformation sampling operation is an enlarged sampling operation; or, if the standard texture area is acquired and the actual texture area is less than the standard texture area, that the deformation sampling operation is a reduced sampling operation.
[0015] As an optional solution, the aforementioned offset unit includes at least one of the following: a third acquisition module, configured to acquire the texture offset value when the aforementioned deformation sampling operation performed on the aforementioned target object is acquired and the aforementioned target object is located in a first target list, wherein objects in the aforementioned first target list are allowed to adaptively adjust their corresponding shading rate configurations; a fourth acquisition module, configured to acquire the texture offset value when the aforementioned deformation sampling operation performed on the aforementioned target object is acquired and the aforementioned target object is not located in a second target list, wherein objects in the aforementioned second target list are prohibited from adaptively adjusting their corresponding shading rate configurations.
[0016] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the execution method as described above for rendering operations.
[0017] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-described rendering operation execution method through the computer program.
[0018] In this embodiment, a rendering operation is performed on the target object according to a first shading rate configuration, wherein the first shading rate configuration indicates that the number of pixels used when performing the rendering operation is a first number; when a deformation sampling operation is obtained on the target object, a texture offset value corresponding to the deformation sampling operation is obtained, wherein the texture offset value indicates the texture change of the target object caused by the deformation sampling operation; the first shading rate configuration is adjusted using the texture offset value to obtain a second shading rate configuration, and the rendering operation is performed on the target object according to the second shading rate configuration, wherein the second shading rate configuration indicates that the number of pixels used when performing the rendering operation is a second number. First, the base shading rate configuration (first shading rate configuration) of the rendered object (target object) is obtained by determining the texture detail level of the target object. Then, when the target object undergoes a deformation operation, the texture change caused by the deformation sampling operation is obtained, and this texture change is used as a texture offset value to adjust the base shading rate configuration. This results in a new shading rate configuration (second shading rate configuration) that balances visual quality loss and performance gain. This achieves the goal of automatically and dynamically adjusting the shading rate configuration of the rendered object, thereby improving the execution efficiency of the rendering operation and solving the technical problem of low execution efficiency of the rendering operation. Attached Figure Description
[0019] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0020] Figure 1 This is a schematic diagram of an application environment for an optional rendering operation execution method according to an embodiment of this application;
[0021] Figure 2 This is a schematic diagram of the flow of an optional rendering operation execution method according to an embodiment of this application;
[0022] Figure 3 This is a schematic diagram of an optional rendering operation execution method according to an embodiment of this application;
[0023] Figure 4 This is a schematic diagram of another optional rendering operation execution method according to an embodiment of this application;
[0024] Figure 5 This is a schematic diagram of another optional rendering operation execution method according to an embodiment of this application;
[0025] Figure 6 This is a schematic diagram of another optional rendering operation execution method according to an embodiment of this application;
[0026] Figure 7 This is a schematic diagram of another optional rendering operation execution method according to an embodiment of this application;
[0027] Figure 8 This is a schematic diagram of another optional rendering operation execution method according to an embodiment of this application;
[0028] Figure 9 This is a schematic diagram of another optional rendering operation execution method according to an embodiment of this application;
[0029] Figure 10 This is a schematic diagram of another optional rendering operation execution method according to an embodiment of this application;
[0030] Figure 11 This is a schematic diagram of another optional rendering operation execution method according to an embodiment of this application;
[0031] Figure 12 This is a schematic diagram of another optional rendering operation execution method according to an embodiment of this application;
[0032] Figure 13 This is a schematic diagram of an execution device for an optional rendering operation according to an embodiment of this application;
[0033] Figure 14 This is a schematic diagram of the structure of an optional electronic device according to an embodiment of this application. Detailed Implementation
[0034] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0035] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0036] According to one aspect of the embodiments of this application, a method for executing a rendering operation is provided. Optionally, as an optional implementation, the above-described method for executing a rendering operation may be applied to, but is not limited to, [examples of other methods]. Figure 1 The environment shown may include, but is not limited to, user equipment 102 and server 112. User equipment 102 may include, but is not limited to, a display 104, a processor 106 and a memory 108. Server 112 includes a database 114 and a processing engine 116.
[0037] The specific process can be summarized in the following steps:
[0038] In step S102, the user device 102 displays the game screen of the target object rendered according to the first shading rate configuration on the display 104 through the processor 106, and the user device 102 performs a deformation sampling operation on the target object.
[0039] Steps S104-S106: Send the operation information of the deformation sampling operation to the server 112 via network 110;
[0040] In steps S108-S110, server 112 obtains the texture offset value corresponding to the deformation sampling operation (operation information) through processing engine 116, and further uses the texture offset value to adjust the first shading rate configuration to obtain the second shading rate configuration.
[0041] In steps S112-S116, the second shading rate configuration is sent to the user device 102 via the network 110. The user device 102 displays the game screen that performs rendering operations on the target object according to the second shading rate configuration on the display 104 via the processor 106, and stores the second shading rate configuration in the memory 108.
[0042] remove Figure 1Beyond the examples shown, the above steps can be performed independently by the user equipment or the server, or collaboratively by both, such as by user equipment 102 performing steps S108-S110, thereby reducing the processing load on server 112. User equipment 102 includes, but is not limited to, handheld devices (such as mobile phones), laptops, tablets, desktop computers, in-vehicle devices, smart TVs, etc. This application does not limit the specific implementation of user equipment 102. Server 112 can be a single server, a server cluster consisting of multiple servers, or a cloud server.
[0043] Alternatively, as an alternative implementation method, such as Figure 2 As shown, the rendering operation can be performed by an electronic device, such as... Figure 1 The user equipment or server shown includes the following specific steps:
[0044] S202, Rendering operation is performed on the target object according to the first shading rate configuration, wherein the first shading rate configuration is used to indicate that the number of pixels applied when performing the rendering operation is a first number;
[0045] S204, if a deformation sampling operation is obtained on the target object, obtain the texture offset value corresponding to the deformation sampling operation, wherein the texture offset value is used to represent the texture change of the target object caused by the deformation sampling operation;
[0046] S206, the first shading rate configuration is adjusted using the texture offset value to obtain the second shading rate configuration, and the rendering operation is performed on the target object according to the second shading rate configuration, wherein the second shading rate configuration is used to indicate that the number of pixels applied when performing the rendering operation is the second number.
[0047] Optionally, in this embodiment, the above-mentioned rendering operation execution method can be applied to, but is not limited to, the screen rendering scene of a virtual game. In a virtual game, whether it is a background element or a prop element, it needs to be rendered as an object to be rendered. The execution of the rendering operation needs to be according to the corresponding shading rate configuration. An excessively high shading rate configuration (an excessively high shading rate configuration corresponds to fewer rendering operations) will improve performance gain, but there will be some loss in visual quality. Conversely, an excessively low shading rate configuration (an excessively low shading rate configuration corresponds to more rendering operations) will improve visual quality, but there will be some loss in performance gain. This embodiment aims to maintain a balance between visual quality loss and performance gain, thereby improving the execution efficiency of the rendering operation.
[0048] Optionally, in this embodiment, the shading rate can be, but is not limited to, the number of pixel shader operations called for each pixel when the graphics card renders an image. A higher shading rate can improve the accuracy of the rendered image, but it places higher demands on the graphics card, leading to performance loss. Conversely, a lower shading rate will improve performance at the expense of image quality. The color rate configuration can be, but is not limited to, representing the number of pixels used when performing rendering operations. The number of pixels used when performing rendering operations can be, but is not limited to, positively proportional to the efficiency of performing rendering operations.
[0049] To further illustrate, optionally assume that the target object 302 to be rendered has 8 pixels distributed on it, and then, according to... Figure 3 The first shading rate configuration 304 shown applies 1 (1x1) pixels when rendering the target object 302. Therefore, according to the first shading rate configuration 304, 8 rendering operations are required for the 8 pixels distributed on the target object 302; while based on Figure 3 The scenario shown continues as follows: Figure 4 The second shading rate configuration 402 shown applies 4 (2x2) pixels when performing rendering operations on the target object 302. Therefore, according to the first shading rate configuration 304, only 2 rendering operations are needed for the 8 pixels distributed on the target object 302. The execution efficiency of 2 rendering operations is naturally higher than that of 8 rendering operations.
[0050] This shows that the larger the number of pixels used in rendering operations, the higher the efficiency of the rendering operations and the greater the performance gain, but there will be some loss in visual quality; conversely, the smaller the number of pixels used in rendering operations, the lower the efficiency of the rendering operations and the higher the visual quality, but there will be some loss in performance gain. That is, the number of pixels used in rendering operations and the efficiency of rendering operations can be, but are not limited to, in a positive proportion.
[0051] Optionally, in this embodiment, the shading rate configuration can be, but is not limited to, a variable shading rate configuration and a fixed shading rate configuration. A variable shading rate configuration can be understood as a shading rate configuration that allows dynamic changes. For example, if a deformation sampling operation is performed on the target object, the first shading rate configuration of the target object is adjusted to a second shading rate configuration based on the change in the texture offset value corresponding to the deformation sampling operation. Thus, the shading rate configuration of the target object can be understood as a variable shading rate configuration. A fixed shading rate configuration can be understood as a shading rate configuration that prohibits dynamic changes but allows static adjustments. For example, assuming the shading rate configuration of a whitelisted object is a fixed shading rate configuration, even if a deformation sampling operation is performed on the target object, dynamic adjustments to the shading rate configuration of the whitelisted object will be prohibited, but static adjustments can be made, such as manually adjusting the shading rate configuration of the whitelisted object in the background.
[0052] Optionally, in this embodiment, the first quantity is negatively correlated with the texture detail level of the target object. For a rendered object (target object) with high texture detail, using too many pixels in a single rendering operation will cause a significant loss in image quality (visual quality). However, for a rendered object with low texture detail, increasing the number of pixels used in a single rendering operation has little impact on image quality. In other words, texture detail level can usually approximate the sensitivity of the rendered object to the number of pixels. Therefore, setting the first quantity to be negatively correlated with the texture detail level of the target object allows rendered objects with high sensitivity to pixel count to be configured with fewer pixels, or to perform more rendering operations, while rendered objects with low sensitivity to pixel count are configured with more pixels, or to perform fewer rendering operations, in order to maintain a balance between visual quality loss and performance gain.
[0053] To further illustrate, the first shading rate configuration can be, but is not limited to, understood as the base shading rate configuration calculated based on the texture detail level of the target object, such as... Figure 5 The similarity between each pixel (one grid represents one pixel) on the target object 502 shown is as follows: the lower the similarity, the more detailed the texture of the target object is, that is, the higher the level of detail of the texture of the target object; conversely, the higher the similarity, the coarser the texture of the target object is, that is, the lower the level of detail of the texture of the target object.
[0054] It should be noted that, firstly, the base shading rate configuration (first shading rate configuration) of the rendered object (target object) is obtained by determining the texture detail level of the target object. Then, when the target object undergoes a deformation operation, the texture change caused by the deformation sampling operation is obtained, and this texture change is used as a texture offset value to adjust the above base shading rate configuration, resulting in a new shading rate configuration (second shading rate configuration) that balances visual quality loss and performance gain. This achieves the goal of automatically and dynamically adjusting the shading rate configuration of the rendered object, thereby improving the execution efficiency of the rendering operation.
[0055] To further illustrate, optional examples include... Figure 6 As shown, the game screen 1 displays a rendering operation performed on the target object 602 according to the first shading rate configuration 604. The first shading rate configuration 604 indicates that the number of pixels applied during a (single) rendering operation is "1x1" (the first quantity), and this first quantity is negatively correlated with the texture detail level corresponding to the target object 602. When a deformation sampling operation 606 is performed on the target object 602, the texture offset value corresponding to the deformation sampling operation 606 is obtained. This texture offset value represents the texture change of the target object 602 caused by the deformation sampling operation 606. The first shading rate configuration 604 is then adjusted using the texture offset value. The second shading rate configuration 608 is obtained, and the game screen 2 is displayed that the target object 602 is rendered according to the second shading rate configuration 608. The second shading rate configuration 608 is used to indicate that the number of pixels applied when performing (single) rendering operation is "2X2" (second quantity). Assuming that there are 8 pixels distributed on the target object 302, the first shading rate configuration 604 with a "1X1" pixel quantity will perform 8 rendering operations, while the second shading rate configuration 608 with a "2X2" pixel quantity only needs to perform 2 rendering operations. This is not only more efficient, but also has little impact on the image quality, balancing the loss of visual quality and the gain of performance.
[0056] According to the embodiments provided in this application, a rendering operation is performed on a target object according to a first shading rate configuration, wherein the first shading rate configuration is used to indicate that the number of pixels used when performing the rendering operation is a first number, and the first number is negatively correlated with the texture detail level corresponding to the target object; when a deformation sampling operation is performed on the target object, a texture offset value corresponding to the deformation sampling operation is obtained, wherein the texture offset value is used to indicate the texture change of the target object caused by the deformation sampling operation; the first shading rate configuration is adjusted using the texture offset value to obtain a second shading rate configuration, and a rendering operation is performed on the target object according to the second shading rate configuration, wherein the second shading rate configuration is used to indicate that the number of pixels used when performing the rendering operation is a second number. First, the base shading rate configuration (first shading rate configuration) of the rendered object (target object) is obtained by determining the texture detail level of the target object. Then, when the target object undergoes a deformation operation, the texture change caused by the deformation sampling operation is obtained, and this texture change is used as a texture offset value to adjust the base shading rate configuration to obtain a new shading rate configuration (second shading rate configuration) that balances visual quality loss and performance gain. This achieves the goal of automatically and dynamically adjusting the shading rate configuration of the rendered object, thereby improving the execution efficiency of the rendering operation.
[0057] As an optional approach, the first shading rate configuration is adjusted using texture offset values to obtain a second shading rate configuration, including:
[0058] The first quantity is adjusted using the texture offset value to obtain the second quantity; or,
[0059] S1-1, Adjust the first shading rate profile matching the first shading rate configuration using the texture offset value to obtain the second shading rate profile, wherein the first shading rate profile includes at least one first pixel quantity, the at least one first pixel quantity includes a first quantity, and the second shading rate profile includes at least one second pixel quantity, the at least one second pixel quantity includes a second quantity.
[0060] S1-2, determine the second quantity from at least one second pixel quantity.
[0061] Optionally, in this embodiment, adjusting the first shading rate configuration using the texture offset value can be understood, but is not limited to, adjusting the first quantity using the texture offset value to obtain the second quantity, such as... Figure 7 As shown, the number of pixels in target object 702 before adjustment is less than the number of pixels in target object 704 after adjustment, resulting in the second shading rate setting.
[0062] Optionally, in this embodiment, adjusting the first shading rate configuration using the texture offset value can be understood as adjusting the first shading rate level matched by the first shading rate configuration using the texture offset value. Different shading rate levels can correspond to different numbers of pixels, such as level 1 corresponding to 1x1 pixels, level 2 corresponding to 2x2 pixels, level 3 corresponding to 2x4 pixels, etc. Thus, assuming the first shading rate level is level 1, it is adjusted to level 2 (the second shading rate level) by the texture offset value.
[0063] It should be noted that the difference between directly adjusting the quantity and adjusting the shading rate setting can be understood as follows: directly adjusting the quantity means changing the quantity of one (pixel) to another different quantity, while adjusting the shading rate setting means changing one shading rate setting 1 to another different shading rate setting 2. However, the quantities corresponding to shading rate setting 1 and shading rate setting 2 can be the same or different, which is more complex and can more flexibly meet actual needs.
[0064] To further illustrate, the number of pixels corresponding to the color rate setting 1 can be 1x1, while the number of pixels corresponding to the color rate setting 2 can be 1x1 or 2x2. That is, the same color rate setting can correspond to at least one or more pixel numbers, and different color rate settings can include different or the same number of pixels.
[0065] Through the embodiments provided in this application, a second quantity is obtained by adjusting a first quantity using a texture offset value; or, a second shading rate profile is obtained by adjusting a first shading rate profile matching a first shading rate configuration using a texture offset value. The first shading rate profile includes at least one first pixel quantity, and the at least one first pixel quantity includes a first quantity. The second shading rate profile includes at least one second pixel quantity, and the at least one second pixel quantity includes a second quantity. The second quantity is determined from the at least one second pixel quantity, thereby achieving the purpose of more flexibly meeting actual needs and realizing the technical effect of improving the adjustment flexibility of the shading rate configuration.
[0066] As an alternative approach, before determining the second number from at least one second pixel number, the method further includes: determining the preferred shading rate direction of the target object based on the texture details corresponding to the target object, wherein the preferred shading rate direction is used to represent the configuration tendency of the texture details for different pixel numbers;
[0067] Determining a second quantity from at least one second pixel quantity includes: determining a second quantity from at least one second pixel quantity that matches the preferred direction of the shading rate.
[0068] Optionally, in this embodiment, the preferred shading rate direction is used to represent the configuration tendency of texture details for different pixel numbers. Thus, when there are multiple pixel numbers corresponding to a shading rate setting, the preferred shading rate direction can be used to determine a unique pixel number as the number of pixels applied in a single rendering operation, thereby improving the accuracy of shading rate configuration.
[0069] To illustrate further, the number of pixels corresponding to the optional shading rate setting 2 is either 1X1 or 2X2, but the preferred direction of the shading rate is more inclined to be 1X1, and thus the number of pixels 1X1 is used as the number of pixels applied in a single rendering operation.
[0070] Through the embodiments provided in this application, a preferred shading rate direction for the target object is determined based on the texture details corresponding to the target object. The preferred shading rate direction is used to represent the configuration tendency of the texture details for different pixel numbers. A second number matching the preferred shading rate direction is determined from at least one second pixel number, thereby achieving the purpose of using the preferred shading rate direction to determine a unique pixel number as the number of pixels applied in a single rendering operation, thus realizing the technical effect of improving the accuracy of shading rate configuration.
[0071] As an optional approach, during the rendering operation on the target object according to the first shading rate configuration, the method further includes:
[0072] Determine a first number from at least one first pixel number that matches the preferred direction of the shading rate.
[0073] Optionally, in this embodiment, the preferred shading rate direction is used to represent the configuration tendency of texture details for different pixel numbers. Thus, when there are multiple pixel numbers corresponding to a shading rate setting, the preferred shading rate direction can be used to determine a unique pixel number as the number of pixels applied in a single rendering operation, thereby improving the accuracy of shading rate configuration.
[0074] It should be noted that, in order to improve the accuracy of the shading rate configuration, a unique number of pixels is determined from the multiple pixel counts corresponding to the base shading rate configuration (first shading rate configuration) using the preferred shading rate direction, and this number is used as the number of pixels applied in a single rendering operation.
[0075] Through the embodiments provided in this application, a first number matching the preferred shading rate direction is determined from at least one first number of pixels, thereby achieving the purpose of using the preferred shading rate direction to determine a unique number of pixels as the number of pixels applied in a single rendering operation, thus achieving the technical effect of improving the accuracy of shading rate configuration.
[0076] As an optional approach, based on the texture details corresponding to the target object, the preferred direction of the shading rate of the target object is determined, including:
[0077] S2-1, Convolve the material texture brightness image corresponding to the target object in at least two directions to obtain different image brightness gradient maps in at least two directions;
[0078] S2-2, count the number of target pixels that meet the rich detail condition on the brightness gradient map of different images, and determine the detail index value of the target object in at least two directions. The detail index value is positively correlated with the number of target pixels. The detail index value is used to represent the texture detail of the target object in different directions.
[0079] S2-3, determine the target direction with the largest detail index value among at least two directions as the preferred direction for shading rate.
[0080] Optionally, in this embodiment, the method of convolving the material texture brightness image corresponding to the target object in at least two directions can be implemented using, but is not limited to, the Sobel operator. For example, convolving the material texture brightness image with the horizontal Sobel operator yields a horizontal image brightness gradient map. The Sobel operator can be used, but is not limited to, to obtain the first-order gradient of a digital image, by weighting the difference between the gray values of the four neighborhoods (top, bottom, left, and right) of each pixel in the image, reaching an extreme value at the edge to detect the edge. Furthermore, the convolution method can also be implemented using, but is not limited to, convolutional layers in a neural network model; this is merely an example and not a limitation.
[0081] Optionally, in this embodiment, the material texture brightness image can be, but is not limited to, an image that quantitatively or qualitatively describes the texture by extracting the texture feature parameters of the target object through image processing technology.
[0082] Optionally, in this embodiment, the image brightness gradient map can be, but is not limited to, obtained by convolution operation to solve the image gradient of the material texture brightness image to describe the details of the target object, wherein the image gradient is used to describe image changes.
[0083] Optionally, in this embodiment, the determination of whether each pixel on the image brightness gradient map meets the rich detail condition may, but is not limited to, depend on comparing the brightness gradient value of the pixel with the product of the current pixel brightness value and the gradient sensitivity ratio. If the product is greater than the value, it may, but is not limited to, be considered to meet the rich detail condition; otherwise, it may, be considered not to meet the rich detail condition.
[0084] Optionally, in this embodiment, the detail index value is positively correlated with the number of target pixels. The detail index value is used to represent the texture detail of the target object in different directions. For example, the more target pixels there are in the first direction, the higher the detail index value in the first direction, and thus the higher the texture detail of the target object in the first direction; similarly, the fewer target pixels there are in the second direction, the lower the detail index value in the second direction, and thus the lower the texture detail of the target object in the second direction.
[0085] It should be noted that, in order to improve the accuracy of the preferred direction of the shading rate, the gradient of the image is solved to obtain the detail index values of the target object in at least two directions, and the preferred direction of the shading rate is selected based on the magnitude of the detail index values.
[0086] The embodiments provided in this application involve convolving the material texture brightness image corresponding to the target object in at least two directions to obtain different image brightness gradient maps in at least two directions; counting the number of target pixels that meet the rich detail condition on different image brightness gradient maps to determine the detail index values of the target object in at least two directions, wherein the detail index value is positively correlated with the number of target pixels, and the detail index value is used to represent the degree of texture detail of the target object in different directions; the target direction with the largest detail index value in at least two directions is determined as the preferred direction for shading rate, thereby achieving the purpose of selecting the preferred direction for shading rate based on the magnitude of the detail index value, and thus achieving the technical effect of improving the accuracy of the preferred direction for shading rate.
[0087] As an optional approach, the method further includes the following before performing rendering operations on the target object according to the first shading rate configuration:
[0088] S3-1, Determine the overall index value of the target object based on the texture details corresponding to the target object, wherein the overall index value is used to represent the overall texture detail level of the target object;
[0089] S3-2, determine the first quantity that matches the overall index value from multiple candidate quantities; or, determine the first color rate level that matches the overall index value from multiple candidate color rate levels.
[0090] It should be noted that, in order to improve the efficiency of obtaining the base shading rate configuration (first shading rate configuration), the texture detail of the target object in different directions will be ignored. Instead, the overall index value used to represent the overall texture detail of the target object will be directly obtained, and the base shading rate configuration will be obtained by further utilizing the overall index value.
[0091] Through the embodiments provided in this application, the overall index value of the target object is determined based on the texture details corresponding to the target object, wherein the overall index value is used to represent the overall texture detail level of the target object; a first quantity matching the overall index value is determined from multiple candidate quantities; or, a first shading rate level matching the overall index value is determined from multiple candidate shading rate levels, thereby achieving the technical effect of improving the acquisition efficiency of the basic shading rate configuration (first shading rate configuration).
[0092] As an optional approach, the overall index values of the target object are determined based on the texture details corresponding to the target object, including:
[0093] S4-1, Convolve the brightness image of the material texture corresponding to the target object to obtain the brightness gradient map of the target image;
[0094] S4-2, count the total number of all target pixels that meet the rich detail condition on the brightness gradient map of the target image, and determine the overall index value. The overall index value is positively correlated with the total number of target pixels.
[0095] Optionally, in this embodiment, the material texture brightness image can be, but is not limited to, an image that quantitatively or qualitatively describes the texture by extracting the texture feature parameters of the target object through image processing technology.
[0096] Optionally, in this embodiment, the image brightness gradient map can be, but is not limited to, obtained by convolution operation to solve the image gradient of the material texture brightness image to describe the details of the target object, wherein the image gradient is used to describe image changes.
[0097] Optionally, in this embodiment, the determination of whether each pixel on the image brightness gradient map meets the rich detail condition may, but is not limited to, depend on comparing the brightness gradient value of the pixel with the product of the current pixel brightness value and the gradient sensitivity ratio. If the product is greater than the value, it may, but is not limited to, be considered to meet the rich detail condition; otherwise, it may, be considered not to meet the rich detail condition.
[0098] Optionally, in this embodiment, the detail index value is positively correlated with the number of target pixels. The detail index value is used to represent the texture detail of the target object in different directions. For example, the more target pixels there are in the first direction, the higher the detail index value in the first direction, and thus the higher the texture detail of the target object in the first direction; similarly, the fewer target pixels there are in the second direction, the lower the detail index value in the second direction, and thus the lower the texture detail of the target object in the second direction.
[0099] Through the embodiments provided in this application, the brightness image of the material texture corresponding to the target object is convolved to obtain the brightness gradient map of the target image; the number of all target pixels that meet the rich detail condition on the brightness gradient map of the target image is counted to determine the overall index value, wherein the overall index value is positively correlated with the number of all target pixels, thereby achieving the purpose of selecting the preferred direction of shading rate based on the magnitude of the detail index value, thereby achieving the technical effect of improving the accuracy of the preferred direction of shading rate.
[0100] As an optional approach, the texture offset value corresponding to the deformation sampling operation is obtained, including:
[0101] When the deformation sampling operation is a magnification sampling operation, obtain the first offset value corresponding to the magnification sampling operation; or, when the deformation sampling operation is a reduction sampling operation, obtain the second offset value corresponding to the reduction sampling operation, wherein the first offset value is greater than the second offset value.
[0102] The first quantity is adjusted using the texture offset value to obtain the second quantity, including: summing the first offset value and the first quantity to obtain a first summation result, and determining the first summation result as the second quantity;
[0103] The first shading rate profile, which matches the first shading rate configuration, is adjusted using the texture offset value to obtain the second shading rate profile. This includes: summing the first offset value and the first shading rate profile to obtain a second summing result, and using the second summing result to upgrade the first shading rate profile to the second shading rate profile. The level of the shading rate profile is positively correlated with the number of pixels used when performing the rendering operation.
[0104] Optionally, in this embodiment, automatic dynamic adjustment of the shading rate configuration may be performed only when the deformation sampling operation is an enlarged sampling operation, while automatic dynamic adjustment is not performed when the deformation sampling operation is a reduced sampling operation. That is, the second offset value may be, but is not limited to, 0.
[0105] It should be noted that when the material texture is sampled at a higher level, the color values of the material texels sampled from adjacent fragments become similar. This is the optimal time for the visually lossless application of the variable shading rate function. Thus, when the morph sampling operation is a higher sampling operation, more offset values are obtained to sum up and obtain a higher shading rate level. A higher shading rate level corresponds to more pixels used in a single rendering operation, which means fewer rendering operations. Conversely, when the morph sampling operation is a lower sampling operation, fewer offset values are obtained to sum up and obtain a lower shading rate level. A lower shading rate level corresponds to fewer pixels used in a single rendering operation, which means more rendering operations.
[0106] Through the embodiments provided in this application, when the deformation sampling operation is a magnification sampling operation, a first offset value corresponding to the magnification sampling operation is obtained; or, when the deformation sampling operation is a reduction sampling operation, a second offset value corresponding to the reduction sampling operation is obtained, wherein the first offset value is greater than the second offset value; the first offset value and a first quantity are summed to obtain a first summation result, and the first summation result is determined as a second quantity; the first offset value and a first shading rate level are summed to obtain a second summation result, and the first shading rate level is upgraded to a second shading rate level using the second summation result, wherein the level of the shading rate level is positively correlated with the number of pixels applied when performing the rendering operation, thereby achieving the purpose of determining the optimal time for visually lossless application of the variable shading rate function, thereby achieving the technical effect of improving the execution efficiency of the rendering operation.
[0107] As an optional approach, before obtaining the texture offset value corresponding to the deformation sampling operation, the method further includes:
[0108] S5-1, obtain the projected pixel area of the bounding box of the target object after it is projected onto the display area, and the hemispherical area of the bounding box;
[0109] S5-2, divide the projected pixel area and the hemisphere area to obtain the actual texture area required when performing rendering operations on the target object;
[0110] S5-3, if the standard texture area of the target object is obtained and the actual texture area is greater than the standard texture area, determine the deformation sampling operation as an enlarged sampling operation; or, if the standard texture area is obtained and the actual texture area is less than the standard texture area, determine the deformation sampling operation as a reduced sampling operation.
[0111] Optionally, in this embodiment, the standard texture area of the target object can be understood as, but is not limited to, the initial texture area set by the target object during the creation phase.
[0112] It should be noted that, in order to accurately determine whether the deformation sampling operation is a magnification sampling operation or a reduction sampling operation, the result of dividing the projected pixel area of the target object's sphere bounding box after it is projected onto the display area by the hemispherical area of the sphere bounding box is used as the actual texture area required when the target object performs the rendering operation. Then, the actual texture area is compared with the standard texture area of the target object.
[0113] The embodiments provided in this application obtain the projected pixel area of the bounding box of the target object after it is projected onto the display area, and the hemispherical area of the bounding box; the projected pixel area and the hemispherical area are divided to obtain the actual texture area required when performing rendering operations on the target object; if the standard texture area of the target object is obtained and the actual texture area is greater than the standard texture area, the deformation sampling operation is determined to be an amplification sampling operation; or, if the standard texture area is obtained and the actual texture area is less than the standard texture area, the deformation sampling operation is determined to be a reduction sampling operation, thereby achieving the goal of accurately determining whether the deformation sampling operation is an amplification sampling operation or a reduction sampling operation, and thus realizing the technical effect of improving the accuracy of deformation sampling operations.
[0114] As an optional approach, if the deformation sampling operation performed on the target object is obtained, the texture offset value corresponding to the deformation sampling operation is obtained, including at least one of the following:
[0115] S6-1, when a deformation sampling operation is performed on the target object and the target object is in the first target list, obtain the texture offset value, wherein the objects in the first target list are allowed to adaptively adjust the corresponding shading rate configuration;
[0116] S6-2, when a deformation sampling operation is performed on the target object and the target object is not in the second target list, obtain the texture offset value. Among them, objects in the second target list are prohibited from adaptively adjusting their corresponding shading rate configurations.
[0117] It should be noted that, to improve the flexibility of shading rate configuration adjustments, adaptive dynamic adjustment of the shading rate configuration is only performed when a deformable sampling operation is performed on the target object, and the target object is either in the whitelist (first target list) or not in the blacklist (second target list). For target objects in the blacklist, the shading rate configuration of whitelist objects can be manually adjusted in the background, but is not limited to this.
[0118] Through the embodiments provided in this application, when a deformation sampling operation is performed on a target object and the target object is in a first target list, a texture offset value is obtained, wherein objects in the first target list are allowed to adaptively adjust their corresponding shading rate configuration; when a deformation sampling operation is performed on a target object and the target object is not in a second target list, a texture offset value is obtained, wherein objects in the second target list are prohibited from adaptively adjusting their corresponding shading rate configuration, thereby achieving the purpose of adaptive dynamic adjustment of shading rate configuration through the cooperation between whitelist and blacklist, thus realizing the technical effect of improving the adjustment flexibility of shading rate configuration.
[0119] As an alternative approach, for ease of understanding, the above rendering operation method is applied to a virtual game scene. Specifically, when setting the shading rate (ShadingRate) per-draw unit using Variable Rate Shading (VRS), a method is proposed that, based on the material (including shaders, textures, etc.), image algorithms are applied offline to analyze material texture detail indicators. Based on this, the material shading rate grade and preferred direction are automatically set. During runtime, based on the application of material texture filtering, the geometry shading rate grade offset is dynamically calculated. Finally, the material shading rate grade is adjusted according to the geometry shading rate grade offset to become the rendering shading rate grade. Then, based on the preferred direction, the rendering shading rate of the rendered object is mapped to obtain the rendering shading rate. This achieves an automatic and dynamic adjustment method for the rendering object's shading rate, obtaining the optimal balance between visual quality loss and performance gain.
[0120] It should be noted that the related technology, which controls the shading rate per-draw unit using variable shading rate, uses fixed shading rates for materials. This approach has two major problems: 1) During game development, there are numerous materials, and it is extremely labor-intensive for artists to set the shading rate for each one individually. Furthermore, judging the richness or simplicity of material details based on visual, non-quantitative standards and then setting the shading rate is subjective and prone to inappropriate shading rate settings, introducing obvious visual differences (mosaic distortion). 2) During game runtime, the rendering details of materials applied to geometry change in the scene. If this characteristic is not utilized to dynamically adjust the shading rate, the effectiveness of the variable shading rate function will be limited.
[0121] Optionally, this embodiment addresses the problems of existing variable shading rate implementation schemes that control shading rate per-draw unit. This embodiment proposes a method based on analyzing material texture detail indicators using image algorithms offline, automatically setting the material shading rate level and preferred direction; and dynamically calculating the geometry shading rate level offset based on the application of material texture filtering during runtime. Finally, the material shading rate level is adjusted using the geometry shading rate level offset value to obtain the rendering shading rate level, which, combined with the preferred direction of the material shading rate, maps to obtain the rendering shading rate of the rendered object. This achieves an automatic and dynamic adjustment method for the rendering object's shading rate, obtaining the optimal balance between visual quality loss and performance gain.
[0122] To further illustrate, alternatively, for example... Figure 8As shown, the overall detail index of the material is obtained using the image gradient, and the shading rate grade (SRG) of the rendered object is determined based on the overall detail index. The shading rate grades are optionally 0-5, represented as 1x1, 1x1, 1x2 / 2x1, 2x2, 2x4 / 4x2, and 4x4 shading rate configurations, respectively. The image gradient describes the magnitude of image changes. When the material texture is magnified and sampled, the geometric shading rate grade offset (SRGO, optional offsets of 0 and 1) is calculated. The rendering shading rate level is obtained by combining the material shading rate grade and the geometric shading rate grade offset. Furthermore, the rendering shading rate level is combined with the shading rate preferred direction (SRPD, optional H) determined based on the material's horizontal detail index and overall detail index. V (Vertical) represents the preferred direction of the shading rate as horizontal and vertical, respectively. The actual shading rate is obtained (second shading rate configuration). For example, when the shading rate setting is 3, the corresponding shading rates are 1X2 / 2X1. If the preferred direction of the shading rate is V, then 1X2 is selected; otherwise, 2X1 is selected.
[0123] Optionally based on Figure 8 The scenario shown continues as follows Figure 9 As shown, during the offline phase, image analysis algorithms are used to calculate the image gradient of the material texture as a detail indicator. Based on this, the material shading rate level and preferred shading rate direction are automatically set. During the runtime phase, based on the relevant information of the geometry in the game scene, the application of material texture filtering is inferred, and the geometry shading rate level offset is dynamically calculated. The final rendering shading rate of the rendered object is adjusted by the geometry shading rate level offset value against the material shading rate level, combined with the preferred shading rate direction mapping, to achieve an automatic and dynamic adjustment method for the rendering object's shading rate. When the rendered object is rendered, and the material and geometry are used to construct the rendering instruction list, the shading rate parameter will be configured as the rendering shading rate. When the rendering logic module executes specific rendering instructions, the shading rate of the mesh (primitive) is set using glShadingRate before calling glDrawArray.
[0124] Optionally, in this embodiment, for materials with rich details, a reduction in the shading rate will cause a significant loss of image quality, while for materials with simple details, a reduction in the shading rate has little impact on image quality. The texture within a material approximates the material's detail to a certain extent, and they are directly proportional. Image algorithms can be applied to quantitatively evaluate the horizontal, vertical, and comprehensive detail indices of the material texture in the offline stage. Based on the comprehensive detail index, the material shading rate level is calculated, and then the preferred direction of the material shading rate is determined by the relationship between the horizontal and vertical indices of the material texture.
[0125] Optionally, in this embodiment, the image gradient describes the magnitude of image changes. Gradient calculation is the most direct method for quantitatively evaluating the detail of an image. Specifically, it can be achieved using the Sobel operator. The material texture brightness image is convolved with the Sobel operator in the X direction to obtain a horizontal image brightness gradient map, GradientImageX. A gradient sensitivity ratio (empirical value) is set, and then the brightness gradient value of each pixel is compared with the current pixel brightness value multiplied by the gradient sensitivity ratio. If the value is greater, it is marked as 1, indicating that the pixel contains rich detail; otherwise, it is marked as 0, resulting in a detail description map, DetailImagex. The number of pixels with rich detail, DetailPixelsx, and the total number of pixels in the material texture map, TotalPixels, are counted to obtain the horizontal detail index of the material: Detailx = DetailPixelsx / TotalPixels. Similarly, the vertical detail index of the material is Detaily = DetailPixelsy / TotalPixels. The overall detail description map of the material texture, DetailImage, can be obtained by bitwise ORing DetailImagex and DetailImagey pixel by pixel. The number of pixels with rich detail, DetailPixels, is counted to obtain the overall detail index of the material: Detail = DetailPixels / TotalPixels.
[0126] Optionally, in this embodiment, based on the overall detail index of the material, its various intervals are mapped to shading rate levels. The smaller the overall detail index of the material, the simpler the details, and the larger the shading rate level; conversely, the larger the overall detail index of the material, the richer the details, and the smaller the shading rate level. Based on the horizontal and vertical detail indices of the material, the preferred direction of the shading rate can be determined. When Detailx > Detaily, the shading rate direction is vertical; otherwise, it is horizontal.
[0127] Optionally, in this embodiment, the variable shading rate (VCR) function is applied to materials with simple details. Some materials have a certain level of detail, and from a material perspective alone, the VCR function is not suitable. However, when the material is applied to geometry, the sampling and filtering algorithm of the material texture changes as the distance from the player's viewpoint changes. In some cases, the VCR function becomes suitable. When the material texture is magnified and sampled, the texel color values of adjacent fragments become similar, making it the optimal time for visually lossless application of the VCR function. Furthermore, applying the VCR function to nearby rendered objects, where the screen ratio is large and the number of pixels is high, will result in significant performance optimization.
[0128] Optionally, in this embodiment, as Figure 10 As shown, the dynamic shading rate offset of the geometry is implemented based on the principle that when the material texture is magnified and sampled, the color values of the material texels sampled in adjacent segments become similar, which is the best time for the visually lossless application of the variable shading rate function. Specifically, the pixel area projected onto the screen by the bounding box of the geometry is divided by the hemispherical area of the bounding box to obtain the texture area required per unit area for rendering the geometry. This value is then compared with the standard value of the material texture texel area per unit area designed by the artist. If the texture area required per unit area of the bounding box is greater than the standard value of the material texture texel area, the material texture sampling direction is inferred to be mainly magnified, and the shading rate offset is set to 1; otherwise, the shading rate offset is set to 0.
[0129] Optionally, in this embodiment, as Figure 11 As shown, the variable shading rate manager adjusts the material shading rate based on the geometry shading rate offset value to obtain the drawing shading rate level. This is then combined with the preferred direction mapping of the material shading rate to calculate the drawing shading rate. The drawing shading rate level is obtained by adding the geometry shading rate offset value to the material shading rate. The drawing shading rate can have, but is not limited to, 0-5 levels, mapped to 1x1, 1x1, 1x2 / 2x1, 2x2, 2x4 / 4x2, and 4x4 shading rates respectively. When two shading rate configurations exist within the same level, the preferred shading rate is selected based on the preferred direction of the material shading rate. For example, if the shading rate level is 2, corresponding to shading rates 1x2 / 2x1, and the preferred direction is V, then 1x2 is selected; otherwise, 2x1 is selected.
[0130] Optionally, in this embodiment, the rendering logic module is as follows: Figure 12 As shown, the rendering logic module needs to access the shading rate setting API. When OpenGL (ES) is loaded, the glShadingRate API pointer is retrieved. Before glDrawArray is called, the current shading rate configuration is changed through glShadingRate.
[0131] The embodiments provided in this application propose a method for automatically and dynamically adjusting the shading rate of Variable Rate Shading (VRS) in per-draw applications. This method involves analyzing the material's texture detail using image algorithms offline, based on elements such as shaders and textures. Based on this analysis, the material's shading rate grade and preferred direction are automatically set. During runtime, the geometry's shading rate grade offset is dynamically calculated according to the material's texture filtering application. Finally, the material's shading rate grade is adjusted based on the geometry's shading rate grade offset to become the rendering shading rate grade. Then, the rendering shading rate of the rendered object is mapped and calculated based on the preferred direction of the material's shading rate. This achieves an optimal balance between visual quality loss and performance gain.
[0132] It is understood that in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0133] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0134] According to another aspect of the embodiments of this application, an execution apparatus for rendering operations is also provided for implementing the above-described rendering operation execution method. For example... Figure 13 As shown, the device includes:
[0135] The first rendering unit 1302 is used to perform rendering operations on the target object according to the first shading rate configuration, wherein the first shading rate configuration is used to indicate that the number of pixels applied when performing the rendering operation is a first number;
[0136] Offset unit 1304 is used to obtain the texture offset value corresponding to the deformation sampling operation when the deformation sampling operation performed on the target object is obtained, wherein the texture offset value is used to represent the texture change of the target object caused by the deformation sampling operation;
[0137] The second rendering unit 1306 is used to adjust the first shading rate configuration using the texture offset value to obtain the second shading rate configuration, and to perform rendering operations on the target object according to the second shading rate configuration, wherein the second shading rate configuration is used to indicate that the number of pixels applied when performing the rendering operation is the second number.
[0138] For specific embodiments, please refer to the example shown in the above-described rendering operation execution device, which will not be repeated here.
[0139] As an optional solution, the second rendering unit 1306 includes:
[0140] The first adjustment module is used to adjust the first quantity using the texture offset value to obtain the second quantity; or,
[0141] The second adjustment module is used to adjust the first shading rate profile matched with the first shading rate configuration using the texture offset value to obtain the second shading rate profile. The first shading rate profile includes at least one first pixel quantity, and the at least one first pixel quantity includes a first quantity. The second shading rate profile includes at least one second pixel quantity, and the at least one second pixel quantity includes a second quantity.
[0142] A first determining module is configured to determine a second quantity from at least one second pixel quantity.
[0143] For specific implementation examples, please refer to the examples shown in the above rendering operation execution method, which will not be repeated here.
[0144] As an optional solution, the apparatus further includes: a second determining module, configured to determine a preferred shading rate direction of the target object based on the texture details corresponding to the target object before determining the second quantity from at least one second pixel quantity, wherein the preferred shading rate direction is used to represent the configuration tendency of the texture details for different pixel quantities;
[0145] The first determining module includes: a first determining submodule, configured to determine a second number from at least one second pixel number that matches the preferred direction of the shading rate.
[0146] For specific implementation examples, please refer to the examples shown in the above rendering operation execution method, which will not be repeated here.
[0147] As an optional solution, the device also includes:
[0148] The second determining submodule is used to determine, during the rendering operation of the target object according to the first shading rate configuration, a first number matching the preferred direction of the shading rate from at least one first number of pixels.
[0149] For specific implementation examples, please refer to the examples shown in the above rendering operation execution method, which will not be repeated here.
[0150] As an optional solution, the second determining module includes:
[0151] The first convolutional submodule is used to convolve the material texture brightness image corresponding to the target object in at least two directions to obtain different image brightness gradient maps in at least two directions.
[0152] The second statistical submodule is used to count the number of target pixels that meet the rich detail condition on different image brightness gradient maps, and to determine the detail index values of the target object in at least two directions. The detail index values are positively correlated with the number of target pixels, and the detail index values are used to represent the degree of texture detail of the target object in different directions.
[0153] The third determination submodule is used to determine the target direction with the largest detail index value among at least two directions as the preferred direction for shading rate.
[0154] For specific implementation examples, please refer to the examples shown in the above rendering operation execution method, which will not be repeated here.
[0155] As an optional solution, the device also includes:
[0156] The third determining module is used to determine the overall index value of the target object based on the texture details corresponding to the target object before performing the rendering operation on the target object according to the first shading rate configuration. The overall index value is used to represent the overall texture detail level of the target object.
[0157] The fourth determining module is used to determine, from multiple candidate quantities, a first quantity that matches the overall index value before performing rendering operations on the target object according to the first shading rate configuration; or, to determine from multiple candidate shading rate levels a first shading rate level that matches the overall index value.
[0158] For specific implementation examples, please refer to the examples shown in the above rendering operation execution method, which will not be repeated here.
[0159] As an optional solution, the third determining module includes:
[0160] The second convolution submodule is used to convolve the brightness image of the material texture corresponding to the target object to obtain the brightness gradient map of the target image.
[0161] The second statistical submodule is used to count the total number of target pixels that meet the rich detail condition on the brightness gradient map of the target image and determine the overall index value. The overall index value is positively correlated with the total number of target pixels.
[0162] For specific implementation examples, please refer to the examples shown in the above rendering operation execution method, which will not be repeated here.
[0163] As an optional solution, offset unit 1304 includes:
[0164] The first acquisition module is used to acquire a first offset value corresponding to the magnification sampling operation when the deformation sampling operation is a magnification sampling operation; or, when the deformation sampling operation is a reduction sampling operation, acquire a second offset value corresponding to the reduction sampling operation, wherein the first offset value is greater than the second offset value.
[0165] The first adjustment module includes: a first summation submodule, used to sum the first offset value and the first quantity to obtain a first summation result, and to determine the first summation result as the second quantity;
[0166] The second adjustment module includes a second summation submodule, which is used to sum the first offset value and the first shading rate level to obtain a second summation result, and use the second summation result to upgrade the first shading rate level to a second shading rate level, wherein the level of the shading rate level is positively correlated with the number of pixels applied when performing the rendering operation.
[0167] For specific implementation examples, please refer to the examples shown in the above rendering operation execution method, which will not be repeated here.
[0168] As an optional solution, the device also includes:
[0169] The second acquisition module is used to acquire the projected pixel area of the target object's bounding box after it is projected onto the display area, and the hemispherical area of the bounding box, before acquiring the texture offset value corresponding to the deformation sampling operation.
[0170] The division module is used to divide the projected pixel area and the hemisphere area before obtaining the texture offset value corresponding to the deformation sampling operation, so as to obtain the actual texture area required when performing rendering operation on the target object.
[0171] The fifth determining module is used to determine the deformation sampling operation as an enlarged sampling operation if the standard texture area of the target object is obtained and the actual texture area is greater than the standard texture area before obtaining the texture offset value corresponding to the deformation sampling operation; or, if the standard texture area is obtained and the actual texture area is less than the standard texture area, determine the deformation sampling operation as a reduced sampling operation.
[0172] For specific implementation examples, please refer to the examples shown in the above rendering operation execution method, which will not be repeated here.
[0173] As an alternative, offset unit 1304 includes at least one of the following:
[0174] The third acquisition module is used to acquire texture offset values when a deformation sampling operation is performed on the target object and the target object is in the first target list. The objects in the first target list are allowed to adaptively adjust their corresponding shading rate configurations.
[0175] The fourth acquisition module is used to acquire texture offset values when a deformation sampling operation is performed on the target object and the target object is not in the second target list. Among them, objects in the second target list are prohibited from adaptively adjusting their corresponding shading rate configurations.
[0176] For specific implementation examples, please refer to the examples shown in the above rendering operation execution method, which will not be repeated here.
[0177] According to another aspect of the embodiments of this application, an electronic device for implementing the above-described rendering operation execution method is also provided. This electronic device may, but is not limited to, […]. Figure 1 The user equipment 102 or server 112 shown in the figure, in this embodiment, is taken as an example of an electronic device, namely user equipment 102. Further, as shown in the figure... Figure 14 As shown, the electronic device includes a memory 1402 and a processor 1404. The memory 1402 stores a computer program, and the processor 1404 is configured to execute the steps of any of the above method embodiments via the computer program.
[0178] Optionally, in this embodiment, the aforementioned electronic device may be located in at least one of a plurality of network devices in a computer network.
[0179] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0180] S1, Render the target object according to the first shading rate configuration, wherein the first shading rate configuration is used to indicate that the number of pixels applied when performing the rendering operation is a first number;
[0181] S2, if the deformation sampling operation performed on the target object is obtained, obtain the texture offset value corresponding to the deformation sampling operation, wherein the texture offset value is used to represent the texture change of the target object caused by the deformation sampling operation;
[0182] S3, adjust the first shading rate configuration using the texture offset value to obtain the second shading rate configuration, and perform rendering operation on the target object according to the second shading rate configuration, wherein the second shading rate configuration is used to indicate that the number of pixels applied when performing the rendering operation is the second number.
[0183] Alternatively, as those skilled in the art will understand, Figure 14 The structure shown is for illustrative purposes only. Figure 14 This does not limit the structure of the aforementioned electronic devices. For example, the electronic device may also include components that are more... Figure 14 The more or fewer components shown (such as network interfaces, etc.), or having the same Figure 14 The different configurations shown.
[0184] The memory 1402 can be used to store software programs and modules, such as the program instructions / modules corresponding to the rendering operation execution method and apparatus in this embodiment. The processor 1404 executes various functional applications and data processing by running the software programs and modules stored in the memory 1402, thereby implementing the rendering operation execution method described above. The memory 1402 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1402 may further include memory remotely located relative to the processor 1404, and these remote memories can be connected to electronic devices via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Specifically, the memory 1402 may be used, but is not limited to, to store information such as a first shading rate configuration, texture offset values, and a second shading rate configuration. As an example, such as... Figure 14 As shown, the memory 1402 may include, but is not limited to, the first rendering unit 1302, the offset unit 1304, and the second rendering unit 1306 in the execution device for the rendering operation described above. Furthermore, it may include, but is not limited to, other module units in the execution device for the rendering operation described above, which will not be elaborated upon in this example.
[0185] Optionally, the transmission device 1406 described above is used to receive or send data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 1406 includes a Network Interface Controller (NIC), which can be connected to other network devices and a router via a network cable to communicate with the Internet or a local area network. In another example, the transmission device 1406 is a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0186] In addition, the aforementioned electronic device also includes: a display 1408 for displaying information such as the first shading rate configuration, texture offset value, and second shading rate configuration; and a connection bus 1410 for connecting various module components in the aforementioned electronic device.
[0187] In other embodiments, the aforementioned user equipment or server can be a node in a distributed system, wherein the distributed system can be a blockchain system, which is a distributed system formed by connecting multiple nodes through network communication. The nodes can form a peer-to-peer (P2P) network, and any form of computing device, such as a server, user equipment, or other electronic device, can become a node in the blockchain system by joining this peer-to-peer network.
[0188] According to one aspect of this application, a computer program product is provided, comprising a computer program / instructions containing program code for performing the methods shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via a communication component, and / or installed from a removable medium. When the computer program is executed by a central processing unit, it performs various functions provided in embodiments of this application.
[0189] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0190] It should be noted that the computer system of the electronic device is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0191] A computer system includes a Central Processing Unit (CPU), which performs various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) or loaded from RAM. ROM also stores various programs and data required for system operation. The CPU, ROM, and RAM are interconnected via a bus. Input / output interfaces (I / O interfaces) are also connected to the bus.
[0192] The following components are connected to the input / output interface: input sections including keyboards, mice, etc.; output sections including cathode ray tubes (CRTs), liquid crystal displays (LCDs), and speakers; storage sections including hard drives; and communication sections including network interface cards such as LAN cards and modems. The communication section performs communication processing via a network such as the Internet. Drives are also connected to the input / output interface as needed. Removable media, such as disks, optical discs, magneto-optical discs, semiconductor memories, etc., are installed on the drive as needed so that computer programs read from them can be installed into the storage section as required.
[0193] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication component, and / or installed from a removable medium. When the computer program is executed by a central processing unit, it performs various functions defined in the system of this application.
[0194] According to one aspect of this application, a computer-readable storage medium is provided, wherein a processor of a computer device reads computer instructions from the computer-readable storage medium, and executes the computer instructions to cause the computer device to perform the methods provided in the various alternative implementations described above.
[0195] Optionally, in this embodiment, the computer-readable storage medium described above may be configured to store a computer program for performing the following steps:
[0196] S1, Render the target object according to the first shading rate configuration, wherein the first shading rate configuration is used to indicate that the number of pixels applied when performing the rendering operation is a first number;
[0197] S2, if the deformation sampling operation performed on the target object is obtained, obtain the texture offset value corresponding to the deformation sampling operation, wherein the texture offset value is used to represent the texture change of the target object caused by the deformation sampling operation;
[0198] S3, adjust the first shading rate configuration using the texture offset value to obtain the second shading rate configuration, and perform rendering operation on the target object according to the second shading rate configuration, wherein the second shading rate configuration is used to indicate that the number of pixels applied when performing the rendering operation is the second number.
[0199] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware of an electronic device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0200] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0201] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0202] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0203] In the several embodiments provided in this application, it should be understood that the disclosed user equipment can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.
[0204] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0205] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0206] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for executing a rendering operation, characterized in that, include: A rendering operation is performed on the target object according to a first shading rate configuration, wherein the first shading rate configuration is used to indicate that the number of pixels applied when performing the rendering operation is a first number; If a deformation sampling operation is performed on the target object, the texture offset value corresponding to the deformation sampling operation is obtained, wherein the texture offset value is used to represent the texture change of the target object caused by the deformation sampling operation; The first shading rate configuration is adjusted using the texture offset value to obtain a second shading rate configuration, and the rendering operation is performed on the target object according to the second shading rate configuration, wherein the second shading rate configuration is used to indicate that the number of pixels applied when performing the rendering operation is a second number; The step of adjusting the first shading rate configuration using the texture offset value to obtain a second shading rate configuration includes: adjusting the first quantity using the texture offset value to obtain the second quantity; or, adjusting a first shading rate range matched by the first shading rate configuration using the texture offset value to obtain a second shading rate range, wherein the first shading rate range includes at least one first pixel quantity, the at least one first pixel quantity includes the first quantity, the second shading rate range includes at least one second pixel quantity, the at least one second pixel quantity includes the second quantity; and determining the second quantity from the at least one second pixel quantity. Before determining the second quantity from the at least one second pixel quantity, the method further includes: determining a preferred shading rate direction for the target object based on the texture details corresponding to the target object, wherein the preferred shading rate direction is used to represent the configuration tendency of the texture details for different pixel quantities; determining the second quantity from the at least one second pixel quantity includes: determining a second quantity that matches the preferred shading rate direction from the at least one second pixel quantity.
2. The method according to claim 1, characterized in that, During the rendering operation of the target object according to the first shading rate configuration, the method further includes: The first number that matches the preferred direction of the shading rate is determined from the at least one number of first pixels.
3. The method according to claim 1, characterized in that, The step of determining the preferred shading rate direction of the target object based on the texture details corresponding to the target object includes: Convolve the material texture brightness image corresponding to the target object in at least two directions to obtain different image brightness gradient maps in the at least two directions; The number of target pixels that meet the rich detail condition on the brightness gradient maps of different images is counted, and the detail index values of the target object in at least two directions are determined. The detail index values are positively correlated with the number of target pixels, and the detail index values are used to represent the texture detail of the target object in different directions. The target direction with the largest detail index value among the at least two directions is determined as the preferred direction for the shading rate.
4. The method according to claim 1, characterized in that, Before performing the rendering operation on the target object according to the first shading rate configuration, the method further includes: Based on the texture details corresponding to the target object, the overall index value of the target object is determined, wherein the overall index value is used to represent the overall texture detail level of the target object; The first quantity that matches the overall index value is determined from a plurality of candidate quantities; or, the first chromaticity level that matches the overall index value is determined from a plurality of candidate chromaticity levels.
5. The method according to claim 4, characterized in that, The step of determining the overall index value of the target object based on the texture details corresponding to the target object includes: Convolve the brightness image of the material texture corresponding to the target object to obtain the brightness gradient map of the target image; The total number of all target pixels that meet the rich detail condition on the brightness gradient map of the target image is counted to determine the overall index value, wherein the overall index value is positively correlated with the total number of target pixels.
6. The method according to claim 1, characterized in that, The step of obtaining the texture offset value corresponding to the deformation sampling operation includes: When the deformation sampling operation is a magnification sampling operation, a first offset value corresponding to the magnification sampling operation is obtained; or, when the deformation sampling operation is a reduction sampling operation, a second offset value corresponding to the reduction sampling operation is obtained, wherein the first offset value is greater than the second offset value. The step of adjusting the first quantity using the texture offset value to obtain the second quantity includes: summing the first offset value and the first quantity to obtain a first summation result, and determining the first summation result as the second quantity; The step of adjusting the first shading rate profile matched with the first shading rate configuration using the texture offset value to obtain the second shading rate profile includes: summing the first offset value and the first shading rate profile to obtain a second summation result, and using the second summation result to upgrade the first shading rate profile to the second shading rate profile, wherein the level of the shading rate profile is positively correlated with the number of pixels applied when performing the rendering operation.
7. The method according to claim 6, characterized in that, Before obtaining the texture offset value corresponding to the deformation sampling operation, the method further includes: Obtain the projected pixel area of the bounding box of the target object after it is projected onto the display area, and the hemispherical area of the bounding box; Divide the projected pixel area and the hemisphere area to obtain the actual texture area required when performing the rendering operation on the target object; If the standard texture area of the target object is obtained and the actual texture area is greater than the standard texture area, the deformation sampling operation is determined to be an enlarged sampling operation; or, if the standard texture area is obtained and the actual texture area is less than the standard texture area, the deformation sampling operation is determined to be a reduced sampling operation.
8. The method according to any one of claims 1 to 7, characterized in that, When a deformation sampling operation is performed on the target object, obtaining the texture offset value corresponding to the deformation sampling operation includes at least one of the following: If the deformation sampling operation performed on the target object is obtained and the target object is in the first target list, the texture offset value is obtained, wherein the objects in the first target list are allowed to adaptively adjust the corresponding shading rate configuration; If the deformation sampling operation performed on the target object is obtained and the target object is not in the second target list, the texture offset value is obtained, wherein objects in the second target list are prohibited from adaptively adjusting their corresponding shading rate configurations.
9. A device for executing rendering operations, characterized in that, include: A first rendering unit is configured to perform a rendering operation on a target object according to a first shading rate configuration, wherein the first shading rate configuration is configured to indicate that the number of pixels applied when performing the rendering operation is a first number; An offset unit is used to obtain a texture offset value corresponding to a deformation sampling operation when a deformation sampling operation is performed on the target object, wherein the texture offset value is used to represent the texture change of the target object caused by the deformation sampling operation; The second rendering unit is used to adjust the first shading rate configuration using the texture offset value to obtain a second shading rate configuration, and to perform the rendering operation on the target object according to the second shading rate configuration, wherein the second shading rate configuration is used to indicate that the number of pixels applied when performing the rendering operation is a second number; The second rendering unit includes: a first adjustment module, configured to adjust the first quantity using the texture offset value to obtain the second quantity; or, a second adjustment module, configured to adjust a first shading rate profile matching the first shading rate configuration using the texture offset value to obtain a second shading rate profile, wherein the first shading rate profile includes at least one first pixel quantity, the at least one first pixel quantity includes the first quantity, the second shading rate profile includes at least one second pixel quantity, the at least one second pixel quantity includes the second quantity; and a first determination module, configured to determine the second quantity from the at least one second pixel quantity. The apparatus further includes: a second determining module, configured to determine a preferred shading rate direction for the target object based on texture details corresponding to the target object before determining the second quantity from the at least one number of second pixels, wherein the preferred shading rate direction is used to represent the configuration tendency of the texture details for different numbers of pixels; the first determining module includes: a first determining submodule, configured to determine the second quantity that matches the preferred shading rate direction from the at least one number of second pixels.
10. The apparatus according to claim 9, characterized in that, The apparatus further includes a second determining submodule, configured to determine, during the process of performing a rendering operation on the target object according to the first shading rate configuration, a first number from the at least one first pixel number that matches the preferred direction of the shading rate.
11. The apparatus according to claim 9, characterized in that, The second determining module includes: The first convolution submodule is used to convolve the material texture brightness image corresponding to the target object in at least two directions to obtain different image brightness gradient maps in the at least two directions. The second statistical submodule is used to count the number of target pixels that meet the rich detail condition on the brightness gradient maps of different images, and to determine the detail index values of the target object in at least two directions. The detail index values are positively correlated with the number of target pixels, and the detail index values are used to represent the degree of texture detail of the target object in different directions. The third determining submodule is used to determine the target direction with the largest detail index value among the at least two directions as the preferred direction for the shading rate.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program is executed by an electronic device to perform the method according to any one of claims 1 to 8.
13. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method described in any one of claims 1 to 8.
14. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 8 through the computer program.