WO2023185476A1 - 对象渲染方法、装置、电子设备、存储介质及程序产品 - Google Patents

对象渲染方法、装置、电子设备、存储介质及程序产品 Download PDF

Info

Publication number
WO2023185476A1
WO2023185476A1 PCT/CN2023/081615 CN2023081615W WO2023185476A1 WO 2023185476 A1 WO2023185476 A1 WO 2023185476A1 CN 2023081615 W CN2023081615 W CN 2023081615W WO 2023185476 A1 WO2023185476 A1 WO 2023185476A1
Authority
WO
WIPO (PCT)
Prior art keywords
rendering
rendered
target
information
scene
Prior art date
Application number
PCT/CN2023/081615
Other languages
English (en)
French (fr)
Inventor
丛国华
付延生
Original Assignee
北京字跳网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN202210323944.7A external-priority patent/CN116934942A/zh
Priority claimed from CN202210323943.2A external-priority patent/CN116934941A/zh
Application filed by 北京字跳网络技术有限公司 filed Critical 北京字跳网络技术有限公司
Publication of WO2023185476A1 publication Critical patent/WO2023185476A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/10Geometric effects
    • G06T15/20Perspective computation

Definitions

  • the present disclosure relates to the field of scene rendering technology, and in particular, to an object rendering method, device, electronic device, storage medium and program product.
  • Foveated Render takes advantage of this characteristic of the human eye. High-resolution rendering is performed on the area where the human eye is looking, and low-resolution rendering is performed on the area outside the gaze area, in order to increase the rendering speed and save the computing power of the graphics processor (graphics processing unit, GPU).
  • FR is relatively simple to use, but simplicity means roughness.
  • the present disclosure provides an object rendering method, device, electronic device, storage medium and program product.
  • a first aspect of an embodiment of the present disclosure provides an object rendering method, which method includes: obtaining the first position information of a target object in the scene to be rendered on the screen; and indicating the target object and the user's gaze area when the first position information When the intersection of pixels satisfies the preset conditions, the target object is rendered based on the first rendering strategy; where the first rendering strategy is a strategy for performing one rendering of P ⁇ Q pixels, and P and Q are both positive integers.
  • rendering the target object based on the first rendering strategy includes: when the first position information indicates that the target When the intersection of the object and the user's gaze area satisfies the preset condition, the first information of the target object is obtained; when the first information satisfies the target condition, the target object is rendered based on the first rendering strategy.
  • the target condition when the first information includes the first depth value of the target object after rendering, the target condition includes the first depth value being less than or equal to the preset depth threshold; when the first information includes the first depth value of the target object In the case of a size value, the target condition includes that the first size value is greater than or equal to the preset size threshold; in the case where the first information includes gradient information of the map area, the target condition includes that the gradient information of the map area is greater than or equal to the preset size value.
  • the map area is the area of the target object in the map corresponding to the scene to be rendered; when the first information includes the type of the target object, the target condition includes that the type of the target object is a preset type ; In the case where the first information includes the number of triangular faces of the target object, the target condition includes that the number of triangular faces of the target object is greater than or equal to the preset number threshold.
  • the method before rendering the target object based on the first rendering strategy, the method further includes: determining that the rendering strategy set for the target object includes a first rendering strategy and a second rendering strategy; the second rendering strategy is S ⁇ T pixels execute a rendering strategy, P ⁇ Q is less than S ⁇ T, and S and T are both positive integers.
  • rendering the target object based on the first rendering strategy includes: when P ⁇ Q is less than or equal to N ⁇ M, modifying the rendering strategy of the target object from the third rendering strategy to the first rendering strategy, and performs operations on the target object based on the first rendering strategy Rendering, the third rendering strategy is a strategy of performing one rendering for N ⁇ M pixels, where N and M are both positive integers.
  • the method before obtaining the first position information of the target object in the scene to be rendered on the screen, the method also includes: obtaining relevant information of the scene to be rendered; and, based on the relevant information, determining when to render the scene to be rendered.
  • the related information includes feature information of the texture of the scene to be rendered; wherein the feature information includes at least one of the following: gradient information of the texture, and content information of the texture.
  • the feature information includes gradient information of the map; and determining, based on the relevant information, a rendering strategy to be used when rendering the scene to be rendered, including: when the gradient information of the map is within the target gradient range, Determine the rendering strategy corresponding to the target gradient range to be used when rendering the scene to be rendered.
  • the feature information includes content information of the map; and determining a rendering strategy to be used when rendering the scene to be rendered based on the relevant information, including: when the content information of the map indicates that the map is target content. , determine to use the rendering strategy corresponding to the target content when rendering the scene to be rendered; or, when the content information of the map indicates that the map includes a preset object, determine to use the rendering strategy when rendering the scene to be rendered.
  • the preset object adopts the rendering strategy corresponding to the preset object.
  • the feature information also includes gradient information of the map; when the content information of the map indicates that the map is target content, it is determined that the rendering strategy corresponding to the target content is used when rendering the scene to be rendered, Including: when the gradient information of the map is within the target preset gradient range and the map is the target content, determining to use the rendering strategy corresponding to the target content when rendering the scene to be rendered; or, when the map is used
  • the content information indicates that the map includes a preset object
  • it is determined that the rendering strategy corresponding to the preset object is used for the preset object when rendering the scene to be rendered, including: when the gradient information of the map is in the target preset If the gradient range is the gradient range and the map includes the preset object, it is determined that the rendering strategy corresponding to the preset object is used for the preset object when rendering the scene to be rendered.
  • the relevant information includes parameter information of each object in the scene to be rendered; wherein the parameter information includes at least one of the following: the number of triangles of each object, and the rendered depth information of each object. .
  • the parameter information includes the number of triangular faces of each object; and determining the rendering strategy used when rendering the scene to be rendered based on the relevant information includes: determining based on the number of triangular faces of each object.
  • the predetermined conditions include: the number of triangular faces of the object is less than or equal to the triangular face number threshold; when the proportion is within the target proportion range, determine the proportion of the objects to be rendered.
  • the rendering strategy corresponding to the target scale range is used; or, based on the relevant information, the rendering strategy used when rendering the scene to be rendered is determined, including: determining the number of triangles according to the number of each object.
  • the relevant information also includes feature information of the map of the scene to be rendered, where the feature information includes: gradient information of the map; and determining, based on the number of triangles of each object, that the scene to be rendered satisfies predetermined conditions.
  • the proportion of objects including: when the gradient information of the map is within the target preset gradient range, determining the proportion of objects that meet the predetermined conditions in the scene to be rendered based on the number of triangles of each object ; Or, determining the target number range in which the number of triangular faces of the first object is located based on the number of triangular faces of each object, including: when the gradient information of the map is within the target preset gradient range, based on the number of triangular faces of each object.
  • the number of triangular faces of the object determines the target number range within which the number of triangular faces of the first object lies.
  • the parameter information includes the rendered depth information of each object; and based on the relevant information, determining the rendering strategy used when rendering the scene to be rendered includes: according to the rendered depth information of each object , determine the target depth range to which the rendered depth information of the second object belongs; determine the rendering strategy corresponding to the target depth range to be used for the second object when rendering the scene to be rendered; wherein, the second object is in each object any of.
  • the related information also includes feature information of the map of the scene to be rendered, where the feature information includes: gradient information of the map; and determining the rendered depth of the second object based on the rendered depth information of each object.
  • the target depth range to which the information belongs includes: when the gradient information of the map is within the target preset gradient range, determining the target depth to which the rendered depth information of the second object belongs based on the rendered depth information of each object. scope.
  • a second aspect of the embodiment of the present disclosure provides an object rendering device, which includes: an acquisition module and a rendering module; the acquisition module block, used to obtain the first position information of the target object in the scene to be rendered on the screen; the rendering module, used to indicate that the intersection of the target object and the user's gaze area satisfies the target condition in the first position information obtained by the acquisition module
  • the target object is rendered based on the first rendering strategy; where the first rendering strategy is a strategy for performing one rendering of P ⁇ Q pixels, and P and Q are both positive integers.
  • the rendering module is specifically configured to obtain the first information of the target object when the first position information indicates that the intersection of the target object and the user's gaze area satisfies the preset condition; when the first information satisfies the target If conditions exist, the target object is rendered based on the first rendering strategy.
  • the target condition when the first information includes the first depth value of the target object after rendering, the target condition includes the first depth value being less than or equal to the preset depth threshold; when the first information includes the first depth value of the target object In the case of a size value, the target condition includes that the first size value is greater than or equal to the preset size threshold; in the case where the first information includes gradient information of the map area, the target condition includes that the gradient information of the map area is greater than or equal to the preset size value.
  • the map area is the area of the target object in the map corresponding to the scene to be rendered; when the first information includes the type of the target object, the target condition includes that the type of the target object is a preset type ; In the case where the first information includes the number of triangular faces of the target object, the target condition includes that the number of triangular faces of the target object is greater than or equal to the preset number threshold.
  • the device further includes a determining module configured to determine that the rendering strategy set for the target object includes the first rendering strategy and the second rendering before rendering the target object based on the first rendering strategy.
  • Strategy configured to determine that the rendering strategy set for the target object includes the first rendering strategy and the second rendering before rendering the target object based on the first rendering strategy.
  • Strategy is a strategy for performing one rendering of S ⁇ T pixels, P ⁇ Q is less than S ⁇ T, and S and T are both positive integers.
  • the rendering module is specifically configured to modify the rendering strategy of the target object from the third rendering strategy to the first rendering strategy when P ⁇ Q is less than or equal to N ⁇ M, and based on the first rendering strategy
  • the third rendering strategy is a strategy of performing one rendering for N ⁇ M pixels, where N and M are both positive integers.
  • the device further includes a determining module, and the obtaining module is further configured to obtain relevant information of the scene to be rendered before obtaining the first position information of the target object in the scene to be rendered on the screen; the determining module is used Based on the relevant information, determine the rendering strategy used when rendering the scene to be rendered; wherein the rendering strategy includes a strategy of using N ⁇ M pixels to perform one rendering of at least one object in the scene to be rendered, the At least one object includes the target object.
  • the related information includes feature information of the texture of the scene to be rendered; wherein the feature information includes at least one of the following: gradient information of the texture, and content information of the texture.
  • the feature information includes gradient information of the map; the determination module is specifically configured to determine, when the gradient information of the map is within the target gradient range, to use the target gradient range when rendering the scene to be rendered. rendering strategy.
  • the feature information includes content information of the map; the determination module is specifically configured to determine that the target content is used when rendering the scene to be rendered when the content information of the map indicates that the map is target content. The corresponding rendering strategy; or, if the content information of the map indicates that the map includes a preset object, it is determined that the rendering strategy corresponding to the preset object is used for the preset object when rendering the scene to be rendered.
  • the feature information also includes the gradient information of the map; the determination module is specifically configured to determine the target content when the gradient information of the map is within the target preset gradient range and the map is the target content.
  • the rendering strategy corresponding to the target content is used when rendering the scene; or, the determination module is specifically used to determine the target content when the gradient information of the map is within the target preset gradient range and the map includes the preset object.
  • the rendering strategy corresponding to the preset object is used for the preset object.
  • the relevant information includes parameter information of each object in the scene to be rendered; wherein the parameter information includes at least one of the following: the number of triangles of each object, and the rendered depth information of each object. .
  • the parameter information includes the number of triangular faces of each object; the determination module is specifically configured to determine the proportion of objects in the scene to be rendered that meet predetermined conditions according to the number of triangular faces of each object, the The predetermined conditions include: the number of triangular faces of the object is less than or equal to the threshold of the number of triangular faces; if the proportion is within the target proportion range, it is determined to use the rendering strategy corresponding to the target proportion range when rendering the scene to be rendered; or , the determination module is specifically used to determine the target number range in which the number of triangular faces of the first object is based on the number of triangular faces of each object; determine to use the target number range for the first object when rendering the scene to be rendered. For the corresponding rendering strategy, the first object is any one of these objects.
  • the relevant information also includes feature information of the texture of the scene to be rendered, which feature information includes: gradient information of the texture; and the determination module, which is specifically used to determine whether the gradient information of the texture is within the target preset gradient range. case, according to the number of triangular faces of each object quantity to determine the proportion of objects in the scene to be rendered that meet the predetermined condition; or, the determination module is specifically configured to determine the proportion of objects that meet the predetermined condition according to the gradient information of the map when the gradient information of the map is within the target preset gradient range.
  • the number of triangles determines the target number range within which the number of triangles of the first object lies.
  • the parameter information includes the rendered depth information of each object; the determination module is specifically configured to determine the target depth range to which the rendered depth information of the second object belongs based on the rendered depth information of each object. ; Determine to use the rendering strategy corresponding to the target depth range for the second object when rendering the scene to be rendered; wherein the second object is any one of each object.
  • the relevant information also includes feature information of the texture of the scene to be rendered, which feature information includes: gradient information of the texture; and the determination module, which is specifically used to determine whether the gradient information of the texture is within the target preset gradient range.
  • the target depth range to which the rendered depth information of the second object belongs is determined based on the rendered depth information of each object.
  • a third aspect of the embodiment of the present disclosure provides an electronic device.
  • the electronic device includes a processor, a memory, and a computer program stored on the memory and executable on the processor.
  • the computer program is executed by the processor Implement the object rendering method as described in the first aspect.
  • a fourth aspect of the embodiments of the present disclosure provides a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program.
  • the object rendering method as described in the first aspect is implemented.
  • a fifth aspect of the embodiments of the present disclosure provides a computer program product, wherein the computer program product includes a computer program.
  • the processor is caused to execute the computer program to implement the following steps: An object rendering method as described in one aspect.
  • a sixth aspect of the embodiments of the present disclosure provides a chip.
  • the chip includes a processor and a communication interface.
  • the communication interface is coupled to the processor.
  • the processor is used to run program instructions to implement the objects described in the first aspect. Rendering method.
  • the technical solution provided by the embodiment of the present disclosure has the following advantages:
  • the first position information of the target object in the scene to be rendered is obtained on the screen; the first position information indicates the target object
  • the target object is rendered based on the first rendering strategy (that is, a strategy in which P ⁇ Q pixels are rendered once).
  • the same rendering strategy can be implemented for target objects whose intersection with the user's gaze area meets the preset conditions, thereby avoiding the need to optimize the rendering of the scene to be rendered in order to improve rendering efficiency, resulting in torn target objects after rendering.
  • the sense of dissonance can improve user experience.
  • Figure 1 is one of the flow diagrams of an object rendering method provided by an embodiment of the present disclosure
  • Figure 2 is a second schematic flowchart of an object rendering method provided by an embodiment of the present disclosure
  • Figure 3 is a third schematic flowchart of an object rendering method provided by an embodiment of the present disclosure.
  • Figure 4 is a schematic flowchart No. 4 of the object rendering method provided by an embodiment of the present disclosure
  • Figure 5 is a structural block diagram of an object rendering device provided by an embodiment of the present disclosure.
  • FIG. 6 is a structural block diagram of an electronic device provided by an embodiment of the present disclosure.
  • first, second, etc. in the description and claims of the present disclosure are used to distinguish similar objects and are not used to describe specific objects. a certain order or sequence. It is to be understood that the figures so used are interchangeable under appropriate circumstances so that embodiments of the present disclosure can be practiced in sequences other than those illustrated or described herein, and that "first,”"second,” etc. are distinguished Objects are usually of one type, and the number of objects is not limited. For example, the first object can be one or multiple.
  • “and/or” in the description and claims indicates at least one of the connected objects, and the character “/" generally indicates that the related objects are in an "or” relationship.
  • the electronic device in the embodiment of the present disclosure may be a mobile electronic device or a non-mobile electronic device.
  • Mobile electronic devices can be mobile phones, tablets, laptops, PDAs, vehicle-mounted electronic devices, wearable devices, ultra-mobile personal computers (UMPC), netbooks or personal digital assistants (PDA) etc.
  • the non-mobile electronic device can be a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc.; the embodiments of the present disclosure are not specifically limited.
  • the wearable device can be a head-mounted device or a wrist-worn device.
  • the head-mounted device can be a head-mounted device with a virtual reality (Virtual Reality, VR) function, an augmented reality (Augmented Reality, AR) function, or a mixed reality (Mixed Reality, MR) function, such as a VR head display, VR glasses , VR helmet, AR glasses, AR helmet, MR glasses, MR helmet, etc.
  • the wristband device can be a smart watch, a smart bracelet, etc.; the details can be determined according to the actual situation, and are not limited in the embodiments of this disclosure.
  • the execution subject of the object rendering method provided by the embodiments of the present disclosure may be the above-mentioned electronic device (including mobile electronic devices and non-mobile electronic devices), or may be a functional module and/or function in the electronic device that can implement the object rendering method.
  • the specific entity can be determined according to actual usage requirements, and is not limited in the embodiment of this disclosure.
  • an embodiment of the present disclosure provides an object rendering method, which may include the following steps 101 to 102.
  • the first position information is used to indicate the position of the target object.
  • the first position information can be used to indicate any of the following: the position of the center point of the target object, the outline position of the target object.
  • the first location information can also be used to indicate other locations on the target object, which is not limited in this embodiment of the disclosure.
  • the first position information indicates that the intersection of the target object and the user's gaze area satisfies the preset condition, render the target object based on the first rendering strategy.
  • the first rendering strategy is a strategy of performing one rendering for P ⁇ Q pixels, and P and Q are both positive integers.
  • P ⁇ Q pixels refer to a pixel area of P rows and Q columns.
  • P ⁇ Q pixels can also indicate the resolution of the object after rendering. The larger P ⁇ Q , the smaller the resolution of the object after rendering, the smaller P ⁇ Q, the greater the resolution of the object after rendering.
  • P ⁇ Q can be 1 ⁇ 1, 1 ⁇ 2, 2 ⁇ 1, 2 ⁇ 2, 1 ⁇ 3, 3 ⁇ 1, 2 ⁇ 3, 3 ⁇ 3, 1 ⁇ 4, 4 ⁇ 1, 2 ⁇ 4 , 4 ⁇ 2, 3 ⁇ 4, 4 ⁇ 3, 4 ⁇ 4, 5 ⁇ 5, 6 ⁇ 6, 8 ⁇ 8, etc.
  • the details can be determined according to the actual situation, and are not limited in the embodiments of the present disclosure.
  • the rendering strategy may be VRS, or other rendering strategies that can improve the rendering speed.
  • the details may be determined according to the actual situation, and are not limited in the embodiment of the present disclosure.
  • the user's gaze area may be determined through an eye tracking method, for example, the user's gaze point is determined through an eye tracking method, and the gaze area is determined with the user's gaze point as the center of the circle and the first length as the radius.
  • the eye tracking method can be determined according to the actual situation and is not limited here.
  • the user's gaze area may be a preset area, that is, the user's gaze area is a fixed area on the screen.
  • the first position information is used to indicate the position of the center point of the target object.
  • the above step 101 may be to first obtain the outline information of the target object, and then determine the third position where the center point of the target object is located based on the outline information of the target object. a location information.
  • the method of obtaining the outline information of the target object can refer to related technologies, and is not limited here.
  • the first position information is used to indicate the position of the center point of the target object.
  • the above step 101 may also be a method of determining the bounding box to obtain the first position information of the center point of the target object.
  • the shape of the bounding box can be determined according to actual usage requirements and is not limited here.
  • the bounding box is a cube
  • the preset condition may be that the center point of the target object is located in the user's gaze area.
  • the first position information is used to indicate the outline position of the target object, that is, the first information is the outline information of the target object.
  • the above step 101 may be to obtain the outline information of the target object.
  • the preset condition may be that the proportion of the intersection of the target object and the user's gaze area in the target object is greater than or equal to the preset proportion threshold.
  • the preset proportion threshold can be 0, or can be any value less than 1.
  • the specific preset proportion threshold can be determined according to the actual situation, and is not limited here.
  • the first position information of the target object in the scene to be rendered on the screen is obtained; when the first position information indicates that the intersection of the target object and the user's gaze area satisfies the preset condition, based on the first
  • the rendering strategy renders the target object, which can implement the same rendering strategy for the target object whose intersection with the user's gaze area meets the preset conditions, thereby avoiding the optimization of the rendering scene to improve rendering efficiency, resulting in the rendering of The target object appears to be torn apart, which can improve the user experience.
  • the object rendering method provided by the embodiment of the present disclosure may also include the following step 103.
  • the fourth rendering strategy may include at least one rendering strategy, and the resolution of the target object rendered through any one of the fourth rendering strategies is lower than the resolution of the target object rendered through the first rendering strategy.
  • the fourth rendering strategy can be the rendering strategy determined by analyzing the scene to be rendered before step 101, or it can be a preset rendering strategy, or it can be the default rendering strategy before the scene to be rendered, which can be determined according to the actual situation. , no limitation is made here.
  • step 102 can be specifically implemented through the following steps 102a to 102b.
  • the first location information indicates that the intersection of the target object and the user's gaze area satisfies the preset condition, obtain the first information of the target object.
  • the first information includes at least one of the following: the first depth value of the target object after rendering, the first size value of the target object, gradient information of the mapping area, the type of the target object, and the number of triangles of the target object.
  • the first information may also include other information, and the specific information may be determined according to the actual situation, and is not limited here.
  • the map area is the area of the target object in the map corresponding to the scene to be rendered.
  • the target condition includes the first depth value being less than or equal to the preset depth threshold.
  • the description of the first depth value may refer to the description of the depth information after rendering of each object in the following step 201d, which is not limited here.
  • the preset depth threshold can be determined according to actual conditions and is not limited here.
  • the target condition includes the first size value being greater than or equal to the preset size threshold.
  • the preset size threshold can be determined according to actual conditions and is not limited here.
  • the first size value is used to indicate the size of the screen area that the target object will probably occupy after being projected onto the screen.
  • the first size value can be obtained through the method of bounding box judgment; the outline information of the target object can also be determined first, and the target object can be determined based on the target object.
  • the first size value can be obtained through the outline information; the first size value can also be obtained through other methods, and the details can be determined according to the actual situation, and are not limited here.
  • the size of the object is small, it is usually not the object that the user pays attention to and does not need to be displayed in high definition. Therefore, if the first size value is small, even if the resolution of the rendered target object is low or there are multiple Resolution, etc., will not affect the user experience, so flexible rendering of target objects can be achieved.
  • the target condition includes that the gradient information of the map area is greater than or equal to the preset gradient threshold, and the map area is the target object corresponding to the scene to be rendered. area in the map.
  • the description of the gradient information of the map area may refer to the relevant description of the gradient information of the map in the following step 201b, which is not limited here.
  • the preset gradient threshold can be determined according to actual conditions and is not limited here.
  • the gradient information of the object is small, it means that the content of the object changes relatively slowly, and it is usually not the object that the user pays attention to, and there is no need for high-definition display. Therefore, if the gradient information of the map area is small, even if the rendered target Even if the resolution of the object is low or there are multiple resolutions, it will not affect the user experience, so flexible rendering of the target object can be achieved.
  • the target condition includes that the type of the target object is a preset type.
  • the types of objects can include people, animals, plants, buildings, etc.
  • the details can be determined according to the actual situation and are not limited here.
  • the preset type can also be determined according to the actual situation and is not limited here.
  • the preset type is the type that the user is concerned about and needs to be displayed in high definition. Objects that are not of the type that the user is concerned about do not need to be displayed in high definition. Therefore, if the type of the target object is not the preset type, even if the resolution of the rendered target object is Lower or multiple resolutions will not affect the user experience, so flexible rendering of target objects can be achieved.
  • the target condition includes that the number of triangular faces of the target object is greater than or equal to a preset number threshold.
  • the preset quantity threshold can be determined according to the actual situation and is not limited here.
  • the description of the number of triangular faces of the target object may refer to the relevant description of the number of triangular faces of each object in the following step 201b, which is not limited here.
  • the number of triangular faces of an object when the number of triangular faces of an object is small, it is usually not the object that the user pays attention to and does not require high-definition display. Therefore, if the number of triangular faces of the target object is small, even if the resolution of the rendered target object is low Or the existence of multiple resolutions, etc., will not affect the user experience, so flexible rendering of target objects can be achieved.
  • first information can be set to make the rendering of the target object more reasonable.
  • the object rendering method provided by the embodiment of the present disclosure may also include the following step 104.
  • the first position information indicates that the intersection of the target object and the user's gaze area satisfies the preset condition, but the first information does not satisfy the target condition, render the target object based on the fourth rendering strategy.
  • the object rendering method provided by the embodiment of the present disclosure may also include the following step 105.
  • the rendering strategy set for the target object includes a first rendering strategy and a second rendering strategy.
  • the second rendering strategy is a strategy of performing one rendering for S ⁇ T pixels, P ⁇ Q is less than S ⁇ T, and S and T are both positive integers.
  • the first rendering strategy and the second rendering strategy may be rendering strategies set according to the method related to the background art.
  • the rendering strategy set for the target object may also include other rendering strategies, which are not limited here.
  • the embodiments of the present disclosure can avoid the inconsistent feeling of tearing in the rendered target object, and can improve the user experience.
  • step 102 can be specifically implemented through the following steps 102c and 102d.
  • the object rendering method provided by the embodiment of the present disclosure may also include rendering the target object based on a third rendering strategy when P ⁇ Q is greater than N ⁇ M.
  • N ⁇ M For the description of N ⁇ M, please refer to the relevant description of P ⁇ Q in step 102, which will not be described again here.
  • the third rendering strategy is the rendering strategy set for the target object before step 101. If P ⁇ Q is less than or equal to N ⁇ M, after rendering the first object through the first rendering strategy, the target object can be The resolution is higher, thus improving the user experience; if P ⁇ Q is greater than N ⁇ M, the first object can be rendered with a third rendering strategy so that the resolution of the target object is higher, thereby improving the user experience.
  • the object rendering method provided by the embodiment of the present disclosure may also include the following steps 201 to 202.
  • the relevant information may be information about objects in the scene to be rendered, or information about textures of the scene to be rendered.
  • the specific information may be determined according to the actual situation and is not limited here.
  • the rendering strategy includes a strategy of using N ⁇ M pixels to perform one rendering of at least one object in the scene to be rendered (ie, the third rendering strategy.
  • the third rendering strategy is based on the relevant information of the scene to be rendered. Determined), the at least one object includes the target object (that is, it is determined based on the relevant information of the scene to be rendered that the third rendering strategy is used for the target object when rendering the scene to be rendered).
  • the strategy of using N ⁇ M pixels to perform one rendering for all objects in the entire scene to be rendered can also be used for some objects in the scene to be rendered.
  • the strategy of performing one rendering with N ⁇ M pixels can also be used to perform one rendering with different numbers of pixels for different objects in the scene to be rendered (that is, the strategy of using N1 ⁇ M1 pixels for some objects to perform one rendering, and the strategy of using N1 ⁇ M1 pixels for some objects,
  • the object uses N2 ⁇ M2 pixels to perform one rendering strategy, where N1 and N2 are different, and M1 and M2 are different).
  • the details can be determined according to actual usage conditions, and are not limited in the embodiments of the present disclosure.
  • the rendering strategy of the scene to be rendered can be determined before the scene to be rendered is rendered. Therefore, the process of steps 201 to 202 in the embodiment of the present disclosure can be implemented in the loading phase of the application program. This can simplify the process of judging the rendering strategy of the scene to be rendered during the rendering process, and will not compete with the rendering task for computing resources in the device. In this way, the rendering speed can be improved.
  • the present disclosure it is possible to flexibly determine whether to use at least one pixel to perform a rendering strategy for at least one object in the scene to be rendered based on the relevant information of the scene to be rendered, so that it is possible to flexibly improve rendering according to the actual situation of the scene to be rendered.
  • the purpose of speed is to save the computing power of the graphics processor and reduce the load pressure of the graphics processor.
  • the related information includes feature information of the texture of the scene to be rendered; wherein the feature information includes at least one of the following: gradient information of the texture, and content information of the texture.
  • step 201 can be specifically implemented through the following steps 201a to 201b.
  • Texture is a link in the production process of 3D film, television animation and games, that is, using image processing software (Adobe Photoshop, PS) and other graphic software to make material planes, which are overlaid on the three-dimensional model created using 3D production software such as Maya ( Maya) and 3DMax.
  • image processing software Adobe Photoshop, PS
  • other graphic software to make material planes, which are overlaid on the three-dimensional model created using 3D production software such as Maya ( Maya) and 3DMax.
  • the process above is called mapping.
  • the texture can reflect the surface reflection and surface color of the object in the scene to be rendered.
  • the texture can reflect the reflection and surface color of the object's surface in the game scene.
  • the texture of the scene to be rendered can be obtained through a hook method at the system layer.
  • the hook method may be to call an existing hook code (hook tool), or may be a hook code obtained by modifying the relevant code.
  • the details may be determined according to the actual situation, and are not limited in the embodiments of the present disclosure.
  • OpenGL ES OpenGL for Embedded Systems
  • the texture of the scene to be rendered is obtained through the hook method at the system layer.
  • the idea of hook is used to transparently optimize the application program, so that the application program designer can add new functions to the application program without changing the existing functions of the application program.
  • the feature information includes the gradient information of the map.
  • the map can be input into a pre-trained machine learning gradient model to output the gradient information of the map.
  • the gray value of the map in the x direction can also be directly calculated through digital image processing methods.
  • the gradient information of the degree and the gradient information of the grayscale in the y direction are then obtained.
  • the gradient information of the map is then obtained.
  • the gradient information of the grayscale in the x direction of the map can be the sum of the absolute values of the differences between the grayscale values of consecutive pixels in each row
  • the gradient information of the grayscale in the y direction can be the sum of the absolute values of the differences between the grayscale values of consecutive pixels in each column.
  • the sum of the absolute values of the differences between the gray values of consecutive pixels, the gradient information of the gray level in the x direction of the map and the gradient information of the gray level in the y direction can also be calculated by other algorithms, and the details can be determined according to the actual situation. This There are no restrictions anywhere.
  • the gradient information of the map can be the sum of the gradient information of the gray scale in the x direction and the gradient information of the gray scale in the y direction, or it can be the sum of the squares of the gradient information of the gray scale in the x direction and the gradient information of the gray scale in the y direction.
  • the arithmetic square root and the gradient information of the texture can also be calculated through other formulas. The details can be determined according to the actual situation and are not limited here.
  • the machine learning gradient model can be obtained by training the machine learning model based on gradient sample data.
  • the machine learning model can be a basic model established based on any machine learning algorithm.
  • the gradient sample data includes a large number of gradient samples, and each gradient sample includes The texture and the gradient corresponding to the texture.
  • the specific training process of the machine learning gradient model can refer to existing related technologies, and is not limited here.
  • the machine learning gradient model is combined to maximize the capabilities of the graphics processor and squeeze out more computing power without interfering with the rendering process.
  • the gradient information of the map is used to characterize the gradient change of the map. Normally, the smaller the gradient information of the map, the gentler the gradient change of the map, and the larger the gradient information of the map, the more dramatic the gradient change of the map.
  • the gradient information of the texture is small.
  • the content of the texture changes not obviously, the gradient information of the texture is small.
  • you can use a multi-pixel rendering strategy i.e., rendering strategy to perform one rendering on at least one object in the scene to be rendered corresponding to the map to increase the rendering speed, save the computing power of the graphics processor, and reduce the cost of rendering. GPU workload.
  • the feature information includes gradient information of the map; the above step 202 can be specifically implemented through the following step 202a.
  • the target gradient range can be determined according to actual usage requirements, and the rendering strategy corresponding to the target gradient range can be determined according to actual conditions, which are not limited in the embodiments of the present disclosure.
  • multiple gradient ranges can be set (the target gradient range is any one of the multiple gradient ranges), different gradient ranges correspond to different rendering strategies, and different rendering strategies correspond to different N ⁇ M.
  • the multiple gradient ranges are a first gradient range, a second gradient range, and a third gradient range
  • any one of the gradient information in the first gradient range is smaller than any one of the gradient information in the second gradient range
  • Any gradient information in the second gradient range is smaller than any gradient information in the third gradient range.
  • the N ⁇ M corresponding to the first gradient range is 4 ⁇ 4, and the N ⁇ M corresponding to the second gradient range is 2 ⁇ 2.
  • the N ⁇ M corresponding to the third gradient range is 1 ⁇ 1. If the gradient information of the map is within the first gradient range, then determine the strategy of using 4 ⁇ 4 pixels to perform one rendering when rendering the scene to be rendered. If the gradient information of the map is within the second gradient range, then determine the strategy of rendering the scene to be rendered. When the scene to be rendered is rendered, a strategy of 2 ⁇ 2 pixels is used to perform one rendering. If the gradient information of the texture is within the third gradient range, it is determined that the scene to be rendered is rendered using 1 ⁇ 1 pixels. One-time rendering strategy.
  • the rendering strategy used when rendering the scene to be rendered is determined based on the gradient information of the map of the scene to be rendered, and whether to perform a rendering strategy for multiple pixels in the scene to be rendered can be flexibly determined.
  • the feature information can be the content information of the texture.
  • the texture can be input into a pre-trained machine learning recognition model and the content information recognized from the texture can be output.
  • the content in the texture can also be identified through an object recognition algorithm. information, and then determine the rendering strategy to be used when rendering the scene to be rendered based on the identified content information.
  • the machine learning recognition model can be obtained by training the machine learning model based on the recognition sample data.
  • the machine learning model can be a basic model established based on any machine learning algorithm.
  • the recognition sample data includes a large number of recognition samples, and each recognition sample includes The sticker and the content information corresponding to the sticker.
  • the specific training process of the machine learning recognition model can refer to existing related technologies, and is not limited here.
  • the machine learning recognition model is combined to maximize the capabilities of the graphics processor and squeeze out more computing power without interfering with the rendering process.
  • the object recognition algorithm can be determined according to actual conditions, and is not limited in the embodiments of this disclosure.
  • the characteristic information includes the content information of the map; the above step 202 can be specifically implemented through the following step 202b or step 202c.
  • the rendering strategy corresponding to the target content When the content information of the texture indicates that the texture is the target content, the rendering strategy corresponding to the target content.
  • the target content is any one of at least one preset content.
  • Different preset contents can be set to correspond to different rendering strategies, and different rendering strategies correspond to different N ⁇ M; different preset contents can also be set to correspond to the same rendering strategy; the specifics can be determined according to the actual situation, and are not limited here. .
  • the rendering strategy corresponding to the target content is adopted for the target content, except for at least one preset content.
  • the content uses other rendering strategies.
  • each preset content can be grass, leaves, stones and other content that is not of concern.
  • the specific content can be determined according to the actual situation, and is not limited in the embodiment of the present disclosure.
  • the rendering strategy corresponding to each preset content may be a rendering strategy other than the strategy of performing one rendering of 1 ⁇ 1 pixels (that is, the M ⁇ N of the rendering strategy corresponding to the target content is not 1 ⁇ 1).
  • a rendering optimization strategy that is, a strategy of executing multiple pixels for one rendering
  • the rendering strategy corresponding to the target content is used when rendering the scene to be rendered. If the content information of the texture indicates that the texture is not any of the at least one preset content, a strategy of using 1 ⁇ 1 pixels to perform one rendering is determined when rendering the scene to be rendered.
  • different preset content is set to correspond to different rendering strategies.
  • the first preset content is grass, and the N ⁇ M corresponding to grass is 4 ⁇ 4.
  • the second preset content is stone, and the N ⁇ M corresponding to stone is 2 ⁇ 4.
  • N ⁇ M is 1 ⁇ 1. That is to say, if the content information of the texture indicates that the texture is grass, then the strategy of using 4 ⁇ 4 pixels to perform one rendering is determined when rendering the scene to be rendered. If the content information of the texture indicates that the texture is stone. , then determine the strategy of using 2 ⁇ 4 pixels to perform one rendering when rendering the scene to be rendered. If the content information of the texture indicates that the texture is not grass or stone, then determine the time to render the scene to be rendered. A strategy of performing one rendering using 1 ⁇ 1 pixels is used.
  • each preset content may be content including characters, animals, and other objects of interest.
  • the specific content may be determined according to the actual situation, and is not limited in this embodiment of the disclosure.
  • the rendering strategy corresponding to each preset content can execute a rendering strategy for 1 ⁇ 1 pixels (that is, the M ⁇ N of the rendering strategy corresponding to the target content is 1 ⁇ 1). In this way, when rendering the scene to be rendered, the focused target content can be rendered once using a 1 ⁇ 1 pixel strategy. This will not reduce the resolution of the focused content and can improve the user experience.
  • the content information of the map indicates that the map is target content (the target content is any one of at least one preset content), it is determined that 1 ⁇ 1 pixels are used to perform a rendering when rendering the scene to be rendered.
  • strategy if the content information of the texture indicates that the texture is not any of the at least one preset content, it is determined that the strategy to render the scene to be rendered is other than the strategy of performing one rendering of 1 ⁇ 1 pixels.
  • the rendering strategy (for example, the strategy of performing one rendering for 2 ⁇ 2 pixels).
  • the N ⁇ M of the rendering strategy corresponding to each preset content is set to 1 ⁇ 1
  • the N ⁇ M of the rendering strategy corresponding to content other than at least one preset content is set to 4 ⁇ 4. That is to say, if the content information of the texture indicates the target content of the texture (the target content is any one of the at least one preset content), it is determined that 1 ⁇ 1 pixels are used when rendering the scene to be rendered. A strategy of executing one rendering. If the content information of the texture indicates that the texture is not any preset content, then determine the strategy of using 4 ⁇ 4 pixels to execute one rendering when rendering the scene to be rendered.
  • the content information of the texture indicating that the texture is the target content is considered from the perspective of the entire texture.
  • the entire texture is the target content
  • the corresponding rendering strategy when the entire texture is not any preset content (at least any one of the preset contents), determines to use other rendering strategies when rendering the scene to be rendered, so that the scene to be rendered can be flexibly determined.
  • the rendering strategy used when rendering the scene, and then when rendering the scene to be rendered, using the strategy of performing multi-pixel rendering at once can improve the rendering speed.
  • the preset object is any one of at least one preset object.
  • Different preset objects can be set to correspond to different rendering strategies, and different rendering strategies correspond to different N ⁇ M; different preset objects can also be set. Corresponds to the same rendering strategy; the specifics can be determined according to the actual It is determined by actual circumstances and is not limited here.
  • each preset object may be an object of no concern, such as grass, stones, or large trees.
  • the details may be determined according to the actual situation, and are not limited in this embodiment of the disclosure.
  • the rendering strategy corresponding to each preset object can be a rendering strategy other than the strategy of performing one rendering of 1 ⁇ 1 pixels (that is, the M ⁇ N of the rendering strategy corresponding to the preset object is not 1 ⁇ 1). In this way, it can When rendering the scene to be rendered, a rendering optimization strategy (that is, a strategy of executing multiple pixels for one rendering) is used for preset objects that are not concerned, in order to increase the rendering speed, save the computing power of the graphics processor, and reduce the computing power of the graphics processor. workload.
  • the rendering strategy corresponding to the preset object is adopted for the preset object, and the at least one preset object is removed.
  • Objects outside the object use a 1 ⁇ 1 pixel rendering strategy.
  • the first preset object is grass, and the N ⁇ M corresponding to grass is 4 ⁇ 4.
  • the second preset object is stone, and the N ⁇ M corresponding to stone is 2 ⁇ 4. That is to say, if the content information of the map indicates that the map includes grass and stones, then it is determined that when rendering the scene to be rendered, a rendering strategy of 4 ⁇ 4 pixels will be used for the grass and 2 ⁇ 4 for the stones.
  • the strategy of performing one rendering for every pixel is used, and the strategy of performing one rendering for every pixel is used for objects other than grass and stones.
  • each preset object may also be an object of concern such as a person or an animal, and the details may be determined according to the actual situation, which is not limited in the embodiment of the present disclosure.
  • the rendering strategy corresponding to each preset object can execute a rendering strategy for 1 ⁇ 1 pixels (that is, the M ⁇ N of the rendering strategy corresponding to the preset object is 1 ⁇ 1), so that when rendering the scene to be rendered, , using a 1 ⁇ 1 pixel rendering strategy for the preset object of interest, which will not reduce the resolution of the object of interest and can improve the user experience.
  • the content information of the map indicates that the map includes a preset object (any one of at least one preset object), it is determined that 1 ⁇ 1 pixels are used for the preset object when rendering the scene to be rendered.
  • the N ⁇ M of the rendering strategy corresponding to each preset object is set to 1 ⁇ 1
  • the N ⁇ M of the rendering strategy corresponding to objects other than at least one preset object is set to 4 ⁇ 4. That is to say, if the content information of the map indicates that the map includes a preset object, then determine the strategy of using 1 ⁇ 1 pixels to perform one rendering on the preset object when rendering the scene to be rendered, and perform a rendering on the preset object. Objects in the rendering scene other than the at least one preset object are rendered once using a strategy of 4 ⁇ 4 pixels.
  • the content information of the map indicates that the map includes a preset object, which is considered from the perspective of a part of the map.
  • a part of the map is a preset object
  • the object adopts the rendering strategy corresponding to the preset object, and adopts other rendering strategies for objects in the scene to be rendered other than the preset object (if the content information of the map indicates that the map does not include any preset object (at least When any one of the preset objects), determine the use of other rendering strategies when rendering the scene to be rendered).
  • the rendering strategy used when rendering the scene to be rendered can be flexibly determined. Different objects (different local areas) can use different rendering strategies, and then when the scene to be rendered is rendered, multiple pixels can be used to render the local area at once. strategies that can increase rendering speed.
  • the feature information also includes gradient information of the texture.
  • the above step 202b can be specifically implemented through the following step 202b1.
  • the rendering strategy corresponding to the target content is used when rendering the scene to be rendered.
  • the description of the target preset gradient range may refer to the relevant description of the target gradient range in step 202a, and will not be described again here. It can be understood that different gradient ranges can correspond to different rendering strategies when the map is the target content, and the specifics can be determined according to actual usage requirements.
  • a preset gradient range is set, that is, a range in which any value in the target preset gradient range is less than or equal to the gradient threshold. That is to say, if the gradient information of the map is within the target preset gradient range, then consider the case where the map is the target content and determine the target content.
  • the rendering strategy corresponding to the target content is used; if the gradient information of the map is not within the target preset gradient range, there is no need to consider whether the map is the target content, and it is determined to use the preset method when rendering the scene to be rendered.
  • the default rendering strategy can be determined according to the actual situation and is not limited here.
  • multiple preset gradient ranges are set, and the target preset gradient range is one of the multiple preset gradient ranges.
  • three preset gradient ranges are set, the first preset gradient range, and the second preset gradient range.
  • the gradient range i.e., the target preset gradient range
  • the third preset gradient range any gradient information in the first preset gradient range is smaller than any gradient information in the second preset gradient range
  • any gradient information in the second preset gradient range is smaller than any gradient information in the third preset gradient range. any gradient information.
  • the rendering strategy corresponding to the first preset gradient range is used when rendering the scene to be rendered; when the gradient information of the map is within the second preset gradient range, And when the texture is the target content, it is determined to use the rendering strategy corresponding to the target content when rendering the scene to be rendered, otherwise it is determined to use the preset rendering strategy when rendering the scene to be rendered; when the gradient information of the texture is in When the third gradient range is preset, it can be determined that the preset rendering strategy is used when rendering the scene to be rendered.
  • a suitable rendering strategy can be better determined for the scene to be rendered and the rendering speed can be improved.
  • the feature information also includes gradient information of the texture.
  • the above step 202c can be specifically implemented through the following step 202c1.
  • step 202c For the specific description of step 202c1, reference may be made to the above-mentioned related descriptions of step 202c and step 202b1, which will not be described again here.
  • a suitable rendering strategy can be better determined for the scene to be rendered and the rendering speed can be improved.
  • the relevant information includes parameter information of each object in the scene to be rendered; wherein the parameter information includes at least one of the following: the number of triangles of each object, and the rendered depth information of each object. .
  • step 201 can be specifically implemented through the following steps 201c to 201d.
  • the parameter information includes the number of triangular faces of each object.
  • the number of triangular faces of each object can be analyzed according to the vertex upload function of each object in the scene to be rendered (for example, the vertex upload function of hookOpenGLES). ; Determine the number of triangular faces of each object as relevant information.
  • the number of triangular faces of each object can also be obtained through other methods. The specific number can be determined according to the actual situation and is not limited here. Then, based on the number of triangles of each object, the rendering strategy used when rendering the scene to be rendered can be determined.
  • the parameter information includes the rendered depth information of each object.
  • the scene to be rendered can be pre-rendered (simulated rendering) to obtain the rendered depth information of each object in the scene to be rendered.
  • depth information you can also save the rendered depth information of each object in the scene to be rendered after previously rendering the scene to be rendered.
  • Depth information is used to obtain the rendered depth information of each object in the scene to be rendered; the rendered depth information of each object can also be obtained through other methods. The details can be determined according to the actual situation and are not limited here. Then, based on the rendered depth information of each object, the rendering strategy used when rendering the scene to be rendered can be determined.
  • Depth information after rendering of each object based on the depth information after rendering of each object, determine the rendering strategy used when rendering the scene to be rendered.
  • the number of triangles of each object and the depth information after rendering of each object can also be combined to determine the rendering strategy used when rendering the scene to be rendered.
  • each The rendering strategy determined by the number of triangles of the object is related to The rendering strategy determined based on the rendered depth information of each object is the same or the product of N and M corresponding to the rendering strategy determined based on the number of triangles of each object, and the rendering strategy determined based on the rendered depth information of each object If the corresponding products of N and M are the same, the final rendering strategy is a rendering strategy determined based on the number of triangles of each object (or a rendering strategy determined based on the depth information after rendering of each object).
  • the rendering strategy may be the rendering strategy in which the product of N and M is the smallest, or the rendering strategy in which the product of N and M is the largest. The details may be determined according to the actual situation, and are not limited in the embodiments of the present disclosure.
  • the parameter information of each object in the scene to be rendered is determined as the relevant information, and the relevant information is the number of triangles of each object, and/or the depth information of each object after rendering, In this way, appropriate relevant information can be determined based on the actual situation, and then an appropriate rendering strategy can be determined.
  • the parameter information includes the number of triangular faces of each object; the above step 202 can be specifically implemented through the following steps 202d to 202e.
  • the predetermined condition includes: the number of triangular faces of the object is less than or equal to a threshold of the number of triangular faces.
  • the threshold value of the number of triangular faces can be determined according to actual usage requirements, and is not limited in the embodiment of the present disclosure.
  • the proportion of objects in the scene to be rendered that meet the predetermined conditions is the ratio of the number of objects in the scene to be rendered that meet the predetermined conditions to the total number of objects in the scene to be rendered.
  • the target proportion range can be determined according to actual usage requirements, and the rendering strategy corresponding to the target proportion range can be determined according to actual conditions, which are not limited in the embodiments of the present disclosure.
  • the target proportion range is any one of the multiple proportion ranges
  • different proportion ranges correspond to different rendering strategies
  • different rendering strategies correspond to different N ⁇ M.
  • any one proportion value in the first proportion range is greater than any one proportion value in the second proportion range (
  • the value in the proportion range is smaller, which means that the scene to be rendered corresponding to the proportion range has more objects that are not focused on and fewer objects that are focused on. In this case, more pixels of the scene to be rendered corresponding to the proportion range can be rendered once. strategy
  • any proportion value in the second proportion range is greater than any proportion value in the third proportion range
  • the N ⁇ M corresponding to the first proportion range is 4 ⁇ 4
  • the N ⁇ M corresponding to the second proportion range is 2 ⁇ 2
  • the N ⁇ M corresponding to the third ratio range is 1 ⁇ 1.
  • the proportion is within the first proportion range, it is determined that the scene to be rendered is rendered using a 4 ⁇ 4 pixels rendering strategy. If the proportion is within the second proportion range, it is determined that the scene to be rendered is rendered. When rendering the scene, use the strategy of using 2 ⁇ 2 pixels to perform one rendering. If the ratio is within the third ratio range, then determine the strategy of using 1 ⁇ 1 pixels to perform one rendering when rendering the scene to be rendered. Strategy.
  • the rendering strategy of the entire scene to be rendered is determined based on the number of triangles of each object, which can achieve the purpose of flexibly determining the rendering strategy of the scene to be rendered.
  • the parameter information includes the number of triangular faces of each object; the above step 202 can be specifically implemented through the following steps 202f to 202g.
  • the first object is any one of each object.
  • the target quantity range can be determined according to actual usage requirements, and the rendering strategy corresponding to the target quantity range can be determined according to actual conditions, which are not limited in the embodiments of the present disclosure.
  • the target quantity range is any one of the multiple quantity ranges
  • different quantity ranges The range corresponds to different rendering strategies, and different rendering strategies correspond to different N ⁇ M.
  • the number range of the number of triangular faces of each object is determined according to the number of triangular faces of each object, and then the rendering method corresponding to the number range of the number of triangular faces of each object is determined when rendering the scene to be rendered.
  • the multiple quantity ranges include a first quantity range, a second quantity range, a third quantity range, a fourth quantity range and a fifth quantity range.
  • any value in the first quantity range is smaller than any value in the second quantity range (the value in the quantity range is smaller, indicating that the object whose number of triangles falls within this quantity range is less concerned, and can be rendered during rendering.
  • the strategy of using more pixels to perform one rendering) any value in the second quantity range is smaller than any value in the third quantity range, and any value in the third quantity range is smaller than the fourth quantity range.
  • any value, any value in the fourth quantity range is less than any value in the fifth quantity range; the N ⁇ M of the rendering strategy corresponding to the first quantity range is 4 ⁇ 4, and the rendering strategy corresponding to the second quantity range
  • the N ⁇ M of the rendering strategy corresponding to the third quantity range is 4 ⁇ 2
  • the N ⁇ M of the rendering strategy corresponding to the third quantity range is 2 ⁇ 2
  • the N ⁇ M of the rendering strategy corresponding to the fourth quantity range is 1 ⁇ 2
  • the rendering corresponding to the fifth quantity range The N ⁇ M of the strategy is 1 ⁇ 1.
  • the scene to be rendered includes three objects: Object 1, Object 2 and Object 3.
  • the number of triangular faces of Object 1 is within the first number range
  • the number of triangular faces of Object 2 is within the fifth number range
  • the number of triangular faces of Object 3 is within the fifth number range. If the number of triangles is within the fourth number range, it can be determined that when rendering the scene to be rendered, object 1 uses a strategy of 4 ⁇ 4 pixels to perform one rendering, and object 2 uses a strategy of 1 ⁇ 1 pixels to perform one rendering.
  • Object 3 uses a 1 ⁇ 2 pixel strategy to perform one rendering.
  • the rendering strategy of each object is determined according to the number of three faces of each object, so that the scene to be rendered can be rendered more precisely and optimized, and the rendering speed can be better improved.
  • the parameter information includes the rendered depth information of each object; the above step 202 can be specifically implemented through the following steps 202h to 202i.
  • the second object is any one of each object.
  • the target depth range can be determined according to actual usage requirements, and the rendering strategy corresponding to the target depth range can be determined according to actual conditions, which are not limited in the embodiments of the present disclosure.
  • the greater the depth information of the object after rendering the farther the object is from the lens and the less important it is.
  • multiple depth ranges can be set (the target depth range is any one of the multiple depth ranges), different depth ranges correspond to different rendering strategies, and different rendering strategies correspond to different N ⁇ M.
  • the depth range of the rendered depth information of each object is determined based on the rendered depth information of each object, and then the depth of the rendered depth information used for each object is determined when rendering the scene to be rendered.
  • the rendering strategy corresponding to the range is determined based on the rendered depth information of each object, and then the depth of the rendered depth information used for each object is determined when rendering the scene to be rendered.
  • the multiple depth ranges include a first depth range, a second depth range, a third depth range and a fourth depth range.
  • any value in the first depth range is greater than any value in the second depth range (the value in the depth range is larger, indicating that the rendered depth information is less focused on the objects in this depth range.
  • any value in the second depth range is greater than any value in the third depth range
  • any value in the third depth range is greater than the fourth depth range
  • Any value of; the N ⁇ M of the rendering strategy corresponding to the first depth range is 4 ⁇ 4, the N ⁇ M of the rendering strategy corresponding to the second depth range is 4 ⁇ 2, and the N ⁇ M of the rendering strategy corresponding to the third depth range is N ⁇ M is 2 ⁇ 2, and the N ⁇ M of the rendering strategy corresponding to the fourth depth range is 1 ⁇ 1.
  • the scene to be rendered includes four objects: object 4, object 5, object 6 and object 7. Among them, the rendered depth information of object 4 is in the first depth range, and the rendered depth information of object 5 is in the third depth range.
  • the rendered depth information of object 6 is within the fourth depth range, and the rendered depth information of object 7 is within the third depth range, then it can be determined that when rendering the scene to be rendered, object 4 uses 4 ⁇ 4 pixels.
  • object 5 uses a strategy of 2 ⁇ 2 pixels to perform one rendering
  • object 6 uses a strategy of 1 ⁇ 1 pixels to perform one rendering
  • object 7 uses a strategy of 2 ⁇ 2 pixels to perform one rendering.
  • the rendering strategy of each object is determined based on the depth information after rendering of each object. In this way, the scene to be rendered can be rendered more precisely and optimized, and the rendering speed can be better improved.
  • the relevant information includes gradient information of the texture of the scene to be rendered and parameter information of each object in the scene to be rendered.
  • the relevant information includes the gradient information of the texture and the number of triangles of each object.
  • the above step 202d can be performed by The following step 202d1 is implemented.
  • the target to be determined is determined based on the number of triangles of each object.
  • the proportion of objects in the rendering scene that meet the predetermined condition is determined, and if the proportion is within the target proportion range, the rendering strategy corresponding to the target proportion range is determined to be used when rendering the scene to be rendered.
  • step 202d For the specific description of step 202d1, reference may be made to the above-mentioned related descriptions of steps 202d, 202e and the above-mentioned step 202b1, which will not be described again here.
  • a suitable rendering strategy can be better determined for the scene to be rendered and the rendering speed can be improved.
  • the relevant information includes the gradient information of the texture and the number of triangles of each object.
  • the above step 202f can be implemented specifically through the following step 202f1.
  • the target preset gradient range determines the target number range in which the number of triangular faces of the first object is located based on the number of triangular faces of each object.
  • the first gradient information of the map is within the target preset gradient range. If it is within the target preset gradient range, the first gradient information is determined based on the number of triangles of each object. The target number range within which the number of triangles of the object lies, and determine the rendering strategy corresponding to the target number range for the first object when rendering the scene to be rendered.
  • step 202f1 For the specific description of step 202f1, reference may be made to the above-mentioned related descriptions of steps 202f, 202g and the above-mentioned step 202b1, which will not be described again here.
  • a suitable rendering strategy can be better determined for the scene to be rendered and the rendering speed can be improved.
  • the relevant information includes the gradient information of the texture and the rendered depth information of each object.
  • the above step 202h can be specifically implemented through the following step 202h1.
  • step 202h1 For the specific description of step 202h1, please refer to the above-mentioned related descriptions of steps 202h, 202i and the above-mentioned step 202b1, which will not be described again here.
  • a suitable rendering strategy can be better determined for the scene to be rendered and the rendering speed can be improved.
  • Figure 5 is a structural block diagram of an object rendering device according to an embodiment of the present disclosure. As shown in Figure 5, it includes: an acquisition module 501 and a rendering module 502; the acquisition module 501 is used to obtain the target object in the scene to be rendered. The first position information in the screen; the rendering module 502 is configured to render the object based on the first rendering strategy when the first position information obtained by the acquisition module 501 indicates that the intersection of the target object and the user's gaze area satisfies the target condition.
  • the target object is rendered; among them, the first rendering strategy is a strategy of rendering P ⁇ Q pixels once, and P and Q are both positive integers.
  • the rendering module 502 is specifically configured to obtain the first information of the target object when the first position information indicates that the intersection of the target object and the user's gaze area satisfies the preset condition; when the first information satisfies the preset condition In the case of target conditions, the target object is rendered based on the first rendering strategy.
  • the target condition includes the first depth value being less than is greater than or equal to the preset depth threshold; when the first information includes the first size value of the target object, the target condition includes the first size value being greater than or equal to the preset size threshold; when the first information includes the gradient of the map area In the case of information, the target condition includes that the gradient information of the map area is greater than or equal to the preset gradient threshold, and the map area is the area of the target object in the map corresponding to the scene to be rendered; when the first information includes the target object In the case of the type of the target object, the target condition includes that the type of the target object is a preset type; in the case where the first information includes the number of triangular faces of the target object, the target condition includes that the number of triangular faces of the target object is greater than or equal to Preset quantity threshold.
  • the device further includes a determining module configured to determine that the rendering strategy set for the target object includes the first rendering strategy and the second rendering before rendering the target object based on the first rendering strategy.
  • Strategy configured to determine that the rendering strategy set for the target object includes the first rendering strategy and the second rendering before rendering the target object based on the first rendering strategy.
  • Strategy is a strategy for performing one rendering of S ⁇ T pixels, P ⁇ Q is less than S ⁇ T, and S and T are both positive integers.
  • the rendering module 502 is specifically configured to modify the rendering strategy of the target object from the third rendering strategy to the first rendering strategy when P ⁇ Q is less than or equal to N ⁇ M, and based on the first rendering
  • the third rendering strategy is a strategy for rendering N ⁇ M pixels once, and N and M are both positive integers.
  • the device also includes a determination module.
  • the acquisition module 501 is also configured to acquire relevant information of the scene to be rendered before acquiring the first position information of the target object in the scene to be rendered on the screen; the determination module, Used to determine the rendering strategy used when rendering the scene to be rendered based on the relevant information; wherein the rendering strategy includes a strategy of using N ⁇ M pixels to perform one rendering of at least one object in the scene to be rendered, The at least one object includes the target object.
  • the related information includes feature information of the texture of the scene to be rendered; wherein the feature information includes at least one of the following: gradient information of the texture, and content information of the texture.
  • the feature information includes gradient information of the map; the determination module is specifically configured to determine, when the gradient information of the map is within the target gradient range, to use the target gradient range when rendering the scene to be rendered. rendering strategy.
  • the feature information includes content information of the map; the determination module is specifically configured to determine that the target content is used when rendering the scene to be rendered when the content information of the map indicates that the map is target content. The corresponding rendering strategy; or, if the content information of the map indicates that the map includes a preset object, it is determined that the rendering strategy corresponding to the preset object is used for the preset object when rendering the scene to be rendered.
  • the feature information also includes the gradient information of the map; the determination module is specifically configured to determine the target content when the gradient information of the map is within the target preset gradient range and the map is the target content.
  • the rendering strategy corresponding to the target content is used when rendering the scene; or, the determination module is specifically used to determine the target content when the gradient information of the map is within the target preset gradient range and the map includes the preset object.
  • the rendering strategy corresponding to the preset object is used for the preset object.
  • the relevant information includes parameter information of each object in the scene to be rendered; wherein the parameter information includes at least one of the following: the number of triangles of each object, and the rendered depth information of each object. .
  • the parameter information includes the number of triangular faces of each object; the determination module is specifically configured to determine the proportion of objects in the scene to be rendered that meet predetermined conditions according to the number of triangular faces of each object, the The predetermined conditions include: the number of triangular faces of the object is less than or equal to the threshold of the number of triangular faces; if the proportion is within the target proportion range, it is determined to use the rendering strategy corresponding to the target proportion range when rendering the scene to be rendered; or , the determination module is specifically used to determine the target number range in which the number of triangular faces of the first object is based on the number of triangular faces of each object; determine to use the target number range for the first object when rendering the scene to be rendered. For the corresponding rendering strategy, the first object is any one of these objects.
  • the relevant information also includes feature information of the texture of the scene to be rendered, which feature information includes: gradient information of the texture; and the determination module, which is specifically used to determine whether the gradient information of the texture is within the target preset gradient range.
  • the determination module is specifically used to calculate the gradient information of the map in the target preset gradient.
  • the parameter information includes the rendered depth information of each object; the determination module is specifically configured to determine the target depth range to which the rendered depth information of the second object belongs based on the rendered depth information of each object. ; Determine to use the rendering strategy corresponding to the target depth range for the second object when rendering the scene to be rendered; wherein the second object is any one of each object.
  • the related information also includes feature information of the map of the scene to be rendered, where the feature information includes: gradient information of the map;
  • the determination module is specifically configured to determine the target depth range to which the rendered depth information of the second object belongs based on the rendered depth information of each object when the gradient information of the map is within the target preset gradient range.
  • each module can implement the object rendering method provided in the above method embodiment, and can achieve the same technical effect. To avoid duplication, the details will not be described here.
  • FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. It is used to illustrate an electronic device that implements any object rendering method in the embodiment of the present disclosure. It should not be understood as a specific limitation of the embodiment of the present disclosure.
  • the electronic device 600 may include a processor (eg, central processing unit, graphics processor, etc.) 601, which may be loaded into a random access memory according to a program stored in a read-only memory (ROM) 602 or from a storage device 608.
  • the program in the memory (RAM) 603 executes various appropriate actions and processes.
  • various programs and data required for the operation of the electronic device 600 are also stored.
  • the processor 601, ROM 602 and RAM 603 are connected to each other through a bus 604.
  • An input/output (I/O) interface 605 is also connected to bus 604.
  • I/O interface 605 input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speakers, vibration
  • An output device 607 such as a computer
  • a storage device 608 including a magnetic tape, a hard disk, etc.
  • Communication device 609 may allow electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data.
  • electronic device 600 is shown with various means, it should be understood that implementation or availability of all illustrated means is not required. More or fewer means may alternatively be implemented or provided.
  • embodiments of the present disclosure include a computer program product including a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the method illustrated in the flowchart.
  • the computer program may be downloaded and installed from the network via communication device 609, or from storage device 608, or from ROM 602.
  • the processor 601 When the computer program is executed by the processor 601, the functions defined in any object rendering method provided by the embodiments of the present disclosure can be executed.
  • the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
  • the computer-readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of computer readable storage media may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard drive, random access memory (RAM), read only memory (ROM), removable Programmd read-only memory (EPROM or flash memory), fiber optics, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wire, optical cable, RF (radio frequency), etc., or any suitable combination of the above.
  • the client and server can communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and can communicate with digital data in any form or medium.
  • Data communications e.g., communications network
  • communications networks include local area networks (“LAN”), wide area networks (“WAN”), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or developed in the future network of.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; it may also exist independently without being assembled into the electronic device.
  • the computer-readable medium carries one or more programs.
  • the electronic device When the one or more programs are executed by the electronic device, the electronic device: obtains the first position information of the target object in the scene to be rendered on the screen; When the first position information indicates that the intersection of the target object and the user's gaze area meets the preset conditions, the target object is rendered based on the first rendering strategy; wherein the first rendering strategy performs one rendering for P ⁇ Q pixels. strategy, P and Q are both positive integers.
  • calculations for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof.
  • Machine program code the above-mentioned programming languages include but are not limited to object-oriented programming languages, such as Java, Smalltalk, C++, and also include conventional procedural programming languages, such as "C" language or similar programming languages.
  • the program code may execute entirely on the computer, partly on the computer, as a stand-alone software package, partly on the computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer can be connected to the computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (such as an Internet service provider) through the Internet. ).
  • LAN local area network
  • WAN wide area network
  • Internet service provider such as an Internet service provider
  • each block in the flowchart or block diagram may represent a module, segment, or portion of code that contains one or more logic functions that implement the specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown one after another may actually execute substantially in parallel, or they may sometimes execute in the reverse order, depending on the functionality involved.
  • each block of the block diagram and/or flowchart illustration, and combinations of blocks in the block diagram and/or flowchart illustration can be implemented by special purpose hardware-based systems that perform the specified functions or operations. , or can be implemented using a combination of specialized hardware and computer instructions.
  • the units involved in the embodiments of the present disclosure can be implemented in software or hardware. Among them, the name of a unit does not constitute a limitation on the unit itself under certain circumstances.
  • FPGAs Field Programmable Gate Arrays
  • ASICs Application Specific Integrated Circuits
  • ASSPs Application Specific Standard Products
  • SOCs Systems on Chips
  • CPLD Complex Programmable Logical device
  • computer-readable media may be tangible media that may contain or store a program for use by or in connection with an instruction execution system, apparatus, or device.
  • the computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium.
  • Computer-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any suitable combination of the foregoing.
  • Computer readable storage media would include electrical connections based on one or more wires, laptop disks, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory
  • CD-ROM portable compact disk read-only memory
  • magnetic storage device or any suitable combination of the above.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Geometry (AREA)
  • Computer Graphics (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

本公开涉及一种对象渲染方法、装置、电子设备、存储介质及程序产品,能够避免因为了提高渲染效率对待渲染场景进行优化渲染,导致渲染后的目标对象出现被撕裂的违和感,可以提高用户体验。该方法包括:获取待渲染场景中的目标对象在屏幕中的第一位置信息;在第一位置信息指示该目标对象与用户注视区域的交集满足预设条件的情况下,基于第一渲染策略对该目标对象进行渲染;其中,第一渲染策略为P×Q个像素点执行一次渲染的策略,P、Q均为正整数。

Description

对象渲染方法、装置、电子设备、存储介质及程序产品
优先权信息
本申请要求:于2022年03月29日提交的、申请名称为“对象渲染方法、装置、电子设备、存储介质及程序产品”的、中国专利申请号“202210323943.2”,以及于2022年03月29日提交的、申请名称为“渲染策略确定方法、装置、电子设备、介质及程序产品”的、中国专利申请号“202210323944.7”的优先权,该两件申请的内容通过引用结合在本申请中。
技术领域
本公开涉及场景渲染技术领域,尤其涉及一种对象渲染方法、装置、电子设备、存储介质及程序产品。
背景技术
由于人眼的构造导致人眼注视区域的清晰度最高,而越往注释区域外围的区域的清晰度越来越低,而注视点渲染(Foveated Render,FR)是利用人眼这一特点,对人眼注视区域进行高分辨率渲染,对注视区域以外的区域进行低分辨率渲染,以达到提高渲染速度,节约图形处理器(graphics processing unit,GPU)算力的目的。
然而,FR的优点是使用相对简单,但简单意味着粗暴,通常情况下经过FR后的画面中同一对象会出现不同的分辨率,比如一面墙在靠近显示边界附近是模糊的,而在中心部分是十分清晰的。如此,经过FR会给用户一种对象被撕裂的违和感,使得用户体验较差。
发明内容
为了解决上述技术问题或者至少部分地解决上述技术问题,本公开提供了一种对象渲染方法、装置、电子设备、存储介质及程序产品。
本公开实施例的第一方面,提供一种对象渲染方法,该方法包括:获取待渲染场景中的目标对象在屏幕中的第一位置信息;在第一位置信息指示该目标对象与用户注视区域的交集满足预设条件的情况下,基于第一渲染策略对该目标对象进行渲染;其中,第一渲染策略为P×Q个像素点执行一次渲染的策略,P、Q均为正整数。
可选地,该在第一位置信息指示该目标对象与用户注视区域的交集满足预设条件的情况下,基于第一渲染策略对该目标对象进行渲染,包括:在第一位置信息指示该目标对象与用户注视区域的交集满足该预设条件的情况下,获取该目标对象的第一信息;在第一信息满足目标条件的情况下,基于第一渲染策略对该目标对象进行渲染。
可选地,在第一信息包括该目标对象渲染后的第一深度值的情况下,该目标条件包括第一深度值小于或等于预设深度阈值;在第一信息包括该目标对象的第一尺寸值的情况下,该目标条件包括第一尺寸值大于或等于预设尺寸阈值;在第一信息包括贴图区域的梯度信息的情况下,该目标条件包括该贴图区域的梯度信息大于或等于预设梯度阈值,该贴图区域为该目标对象在该待渲染场景对应的贴图中的区域;在第一信息包括该目标对象的类型的情况下,该目标条件包括该目标对象的类型为预设类型;在第一信息包括该目标对象的三角面数量的情况下,该目标条件包括该目标对象的三角面数量大于或等于预设数量阈值。
可选地,该基于第一渲染策略对该目标对象进行渲染之前,该方法还包括:确定对该目标对象设定的渲染策略包括第一渲染策略和第二渲染策略;第二渲染策略为S×T个像素点执行一次渲染的策略,P×Q小于S×T,S、T均为正整数。
可选地,该基于第一渲染策略对该目标对象进行渲染,包括:在P×Q小于或等于N×M的情况下,将该目标对象的渲染策略由第三渲染策略修改为第一渲染策略,并基于第一渲染策略对该目标对象进行 渲染,第三渲染策略为N×M个像素点执行一次渲染的策略,N、M均为正整数。
可选地,该获取待渲染场景中的目标对象在屏幕中的第一位置信息之前,该方法还包括:获取待渲染场景的相关信息;根据该相关信息,确定对该待渲染场景进行渲染时采用的渲染策略;其中,该渲染策略包括对该待渲染场景中的至少一个对象采用N×M个像素点执行一次渲染的策略,该至少一个对象包括该目标对象。
可选地,该相关信息包括该待渲染场景的贴图的特征信息;其中,该特征信息包括以下至少一项:该贴图的梯度信息,该贴图的内容信息。
可选地,该特征信息包括该贴图的梯度信息;该根据该相关信息,确定对该待渲染场景进行渲染时采用的渲染策略,包括:在该贴图的梯度信息在目标梯度范围的情况下,确定对该待渲染场景进行渲染时采用该目标梯度范围对应的渲染策略。
可选地,该特征信息包括该贴图的内容信息;该根据该相关信息,确定对该待渲染场景进行渲染时采用的渲染策略,包括:在该贴图的内容信息指示该贴图为目标内容的情况下,确定对该待渲染场景进行渲染时采用该目标内容对应的渲染策略;或者,在该贴图的内容信息指示该贴图包括预设对象的情况下,确定对该待渲染场景进行渲染时对该预设对象采用该预设对象对应的渲染策略。
可选地,该特征信息还包括该贴图的梯度信息;该在该贴图的内容信息指示该贴图为目标内容的情况下,确定对该待渲染场景进行渲染时采用该目标内容对应的渲染策略,包括:在该贴图的梯度信息在目标预设梯度范围,且该贴图为该目标内容的情况下,确定对该待渲染场景进行渲染时采用该目标内容对应的渲染策略;或者,该在该贴图的内容信息指示该贴图包括预设对象的情况下,确定对该待渲染场景进行渲染时对该预设对象采用该预设对象对应的渲染策略,包括:在该贴图的梯度信息在目标预设梯度范围,且该贴图包括该预设对象的情况下,确定对该待渲染场景进行渲染时对该预设对象采用该预设对象对应的渲染策略。
可选地,该相关信息包括该待渲染场景中的每个对象的参数信息;其中,该参数信息包括以下至少一项:该每个对象的三角面数量,该每个对象渲染后的深度信息。
可选地,该参数信息包括该每个对象的三角面数量;该根据该相关信息,确定对该待渲染场景进行渲染时采用的渲染策略,包括:根据该每个对象的三角面数量,确定该待渲染场景中满足预定条件的对象的占比,该预定条件包括:对象的三角面数量小于或等于三角面数量阈值;在该占比在目标比例范围内的情况下,确定对该待渲染场景进行渲染时采用该目标比例范围对应的渲染策略;或者,该根据该相关信息,确定对该待渲染场景进行渲染时采用的渲染策略,包括:根据该每个对象的三角面数量,确定第一对象的三角面数量所在的目标数量范围;确定对该待渲染场景进行渲染时对第一对象采用该目标数量范围对应的渲染策略,第一对象为该每个对象中的任一个。
可选地,该相关信息还包括该待渲染场景的贴图的特征信息,该特征信息包括:该贴图的梯度信息;该根据该每个对象的三角面数量,确定该待渲染场景中满足预定条件的对象的占比,包括:在该贴图的梯度信息在目标预设梯度范围的情况下,根据该每个对象的三角面数量,确定该待渲染场景中满足该预定条件的对象的该占比;或者,该根据该每个对象的三角面数量,确定第一对象的三角面数量所在的目标数量范围,包括:在该贴图的梯度信息在目标预设梯度范围的情况下,根据该每个对象的三角面数量,确定第一对象的三角面数量所在的该目标数量范围。
可选地,该参数信息包括该每个对象渲染后的深度信息;该根据该相关信息,确定对该待渲染场景进行渲染时采用的渲染策略,包括:根据该每个对象渲染后的深度信息,确定第二对象渲染后的深度信息所属的目标深度范围;确定对该待渲染场景进行渲染时对第二对象采用该目标深度范围对应的渲染策略;其中,第二对象为该每个对象中的任一个。
可选地,该相关信息还包括该待渲染场景的贴图的特征信息,该特征信息包括:该贴图的梯度信息;该根据该每个对象渲染后的深度信息,确定第二对象渲染后的深度信息所属的目标深度范围,包括:在该贴图的梯度信息在目标预设梯度范围的情况下,根据该每个对象渲染后的深度信息,确定第二对象渲染后的深度信息所属的该目标深度范围。
本公开实施例的第二方面,提供一种对象渲染装置,该装置包括:获取模块和渲染模块;该获取模 块,用于获取待渲染场景中的目标对象在屏幕中的第一位置信息;该渲染模块,用于在该获取模块获取的第一位置信息指示该目标对象与用户注视区域的交集满足目标条件的情况下,基于第一渲染策略对该目标对象进行渲染;其中,第一渲染策略为P×Q个像素点执行一次渲染的策略,P、Q均为正整数。
可选地,该渲染模块,具体用于在第一位置信息指示该目标对象与用户注视区域的交集满足该预设条件的情况下,获取该目标对象的第一信息;在第一信息满足目标条件的情况下,基于第一渲染策略对该目标对象进行渲染。
可选地,在第一信息包括该目标对象渲染后的第一深度值的情况下,该目标条件包括第一深度值小于或等于预设深度阈值;在第一信息包括该目标对象的第一尺寸值的情况下,该目标条件包括第一尺寸值大于或等于预设尺寸阈值;在第一信息包括贴图区域的梯度信息的情况下,该目标条件包括该贴图区域的梯度信息大于或等于预设梯度阈值,该贴图区域为该目标对象在该待渲染场景对应的贴图中的区域;在第一信息包括该目标对象的类型的情况下,该目标条件包括该目标对象的类型为预设类型;在第一信息包括该目标对象的三角面数量的情况下,该目标条件包括该目标对象的三角面数量大于或等于预设数量阈值。
可选地,该装置还包括确定模块,该确定模块,用于在基于第一渲染策略对该目标对象进行渲染之前,确定对该目标对象设定的渲染策略包括第一渲染策略和第二渲染策略;第二渲染策略为S×T个像素点执行一次渲染的策略,P×Q小于S×T,S、T均为正整数。
可选地,该渲染模块,具体用于在P×Q小于或等于N×M的情况下,将该目标对象的渲染策略由第三渲染策略修改为第一渲染策略,并基于第一渲染策略对该目标对象进行渲染,第三渲染策略为N×M个像素点执行一次渲染的策略,N、M均为正整数。
可选地,该装置还包括确定模块,该获取模块,还用于在获取待渲染场景中的目标对象在屏幕中的第一位置信息之前,获取待渲染场景的相关信息;该确定模块,用于根据该相关信息,确定对该待渲染场景进行渲染时采用的渲染策略;其中,该渲染策略包括对该待渲染场景中的至少一个对象采用N×M个像素点执行一次渲染的策略,该至少一个对象包括该目标对象。
可选地,该相关信息包括该待渲染场景的贴图的特征信息;其中,该特征信息包括以下至少一项:该贴图的梯度信息,该贴图的内容信息。
可选地,该特征信息包括该贴图的梯度信息;该确定模块,具体用于在该贴图的梯度信息在目标梯度范围的情况下,确定对该待渲染场景进行渲染时采用该目标梯度范围对应的渲染策略。
可选地,该特征信息包括该贴图的内容信息;该确定模块,具体用于在该贴图的内容信息指示该贴图为目标内容的情况下,确定对该待渲染场景进行渲染时采用该目标内容对应的渲染策略;或者,在该贴图的内容信息指示该贴图包括预设对象的情况下,确定对该待渲染场景进行渲染时对该预设对象采用该预设对象对应的渲染策略。
可选地,该特征信息还包括该贴图的梯度信息;该确定模块,具体用于在该贴图的梯度信息在目标预设梯度范围,且该贴图为该目标内容的情况下,确定对该待渲染场景进行渲染时采用该目标内容对应的渲染策略;或者,该确定模块,具体用于在该贴图的梯度信息在目标预设梯度范围,且该贴图包括该预设对象的情况下,确定对该待渲染场景进行渲染时对该预设对象采用该预设对象对应的渲染策略。
可选地,该相关信息包括该待渲染场景中的每个对象的参数信息;其中,该参数信息包括以下至少一项:该每个对象的三角面数量,该每个对象渲染后的深度信息。
可选地,该参数信息包括该每个对象的三角面数量;该确定模块,具体用于根据该每个对象的三角面数量,确定该待渲染场景中满足预定条件的对象的占比,该预定条件包括:对象的三角面数量小于或等于三角面数量阈值;在该占比在目标比例范围内的情况下,确定对该待渲染场景进行渲染时采用该目标比例范围对应的渲染策略;或者,该确定模块,具体用于根据该每个对象的三角面数量,确定第一对象的三角面数量所在的目标数量范围;确定对该待渲染场景进行渲染时对第一对象采用该目标数量范围对应的渲染策略,第一对象为该每个对象中的任一个。
可选地,该相关信息还包括该待渲染场景的贴图的特征信息,该特征信息包括:该贴图的梯度信息;该确定模块,具体用于在该贴图的梯度信息在目标预设梯度范围的情况下,根据该每个对象的三角面数 量,确定该待渲染场景中满足该预定条件的对象的该占比;或者,该确定模块,具体用于在该贴图的梯度信息在目标预设梯度范围的情况下,根据该每个对象的三角面数量,确定第一对象的三角面数量所在的该目标数量范围。
可选地,该参数信息包括该每个对象渲染后的深度信息;该确定模块,具体用于根据该每个对象渲染后的深度信息,确定第二对象渲染后的深度信息所属的目标深度范围;确定对该待渲染场景进行渲染时对第二对象采用该目标深度范围对应的渲染策略;其中,第二对象为该每个对象中的任一个。
可选地,该相关信息还包括该待渲染场景的贴图的特征信息,该特征信息包括:该贴图的梯度信息;该确定模块,具体用于在该贴图的梯度信息在目标预设梯度范围的情况下,根据该每个对象渲染后的深度信息,确定第二对象渲染后的深度信息所属的该目标深度范围。
本公开实施例的第三方面,提供一种电子设备,该电子设备包括处理器、存储器及存储在该存储器上并可在该处理器上运行的计算机程序,该计算机程序被该处理器执行时实现如第一方面所述的对象渲染方法。
本公开实施例的第四方面,提供一种计算机可读存储介质,该计算机可读存储介质上存储计算机程序,该计算机程序被处理器执行时实现如第一方面所述的对象渲染方法。
本公开实施例的第五方面,提供了一种计算机程序产品,其中,该计算机程序产品包括计算机程序,当该计算机程序产品在处理器上运行时,使得处理器执行该计算机程序,实现如第一方面所述的对象渲染方法。
本公开实施例的第六方面,提供了一种芯片,该芯片包括处理器和通信接口,该通信接口和该处理器耦合,该处理器用于运行程序指令,实现如第一方面所述的对象渲染方法。
本公开实施例提供的技术方案与现有技术相比具有如下优点:本公开实施例中,获取待渲染场景中的目标对象在屏幕中的第一位置信息;在第一位置信息指示该目标对象与用户注视区域的交集满足预设条件的情况下,基于第一渲染策略(即P×Q个像素点执行一次渲染的策略)对该目标对象进行渲染。如此,可以实现对与用户注视区域的交集满足预设条件的目标对象执行相同的渲染策略,从而可以避免因为了提高渲染效率对待渲染场景进行优化渲染,导致渲染后的目标对象出现被撕裂的违和感,可以提高用户体验。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本公开实施例提供的对象渲染方法的流程示意图之一;
图2为本公开实施例提供的对象渲染方法的流程示意图之二;
图3为本公开实施例提供的对象渲染方法的流程示意图之三;
图4为本公开实施例提供的对象渲染方法的流程示意图之四;
图5为本公开实施例提供的一种对象渲染装置的结构框图;
图6为本公开实施例提供的一种电子设备的结构框图。
具体实施方式
为了能够更清楚地理解本公开的上述目的、特征和优点,下面将对本公开的方案进行进一步描述。需要说明的是,在不冲突的情况下,本公开的实施例及实施例中的特征可以相互组合。
在下面的描述中阐述了很多具体细节以便于充分理解本公开,但本公开还可以采用其他不同于在此描述的方式来实施;显然,说明书中的实施例只是本公开的一部分实施例,而不是全部的实施例。
本公开的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特 定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本公开的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。
本公开实施例中的电子设备可以为移动电子设备,也可以为非移动电子设备。移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等;非移动电子设备可以为个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等;本公开实施例不作具体限定。
其中,可穿戴设备可以为头戴设备或腕带设备等。其中,头戴设备可以为具有虚拟现实(Virtual Reality,VR)功能、增强现实(Augmented Reality,AR)功能、或混合现实(Mixed Reality,MR)功能的头戴设备,例如VR头显、VR眼镜、VR头盔、AR眼镜、AR头盔、MR眼镜、MR头盔等;腕带设备可以为智能手表、智能手环等;具体可以根据实际情况确定,本公开实施例不做限定。
本公开实施例提供的对象渲染方法的执行主体可以为上述的电子设备(包括移动电子设备和非移动电子设备),也可以为该电子设备中能够实现该对象渲染方法的功能模块和/或功能实体,具体的可以根据实际使用需求确定,本公开实施例不作限定。
下面结合附图,通过具体的实施例及其应用场景对本公开实施例提供的对象渲染方法进行详细地说明。
如图1所示,本公开实施例提供一种对象渲染方法,该方法可以包括下述的步骤101至步骤102。
101、获取待渲染场景中的目标对象在屏幕中的第一位置信息。
其中,第一位置信息用于指示目标对象的位置,可选地,第一位置信息可以用于指示以下任一项:目标对象的中心点所在的位置,目标对象的轮廓位置。第一位置信息还可以用于指示目标对象上的其他位置,本公开实施例不做限定。
102、在第一位置信息指示该目标对象与用户注视区域的交集满足预设条件的情况下,基于第一渲染策略对该目标对象进行渲染。
其中,第一渲染策略为P×Q个像素点执行一次渲染的策略,P、Q均为正整数。
需要说明的是,本公开实施例中,P×Q个像素点是指一个P行Q列的像素区域,P×Q个像素点也可以指示渲染之后的对象的分辨率,P×Q越大,渲染之后的对象的分辨率越小,P×Q越小,渲染之后的对象的分辨率越大。
其中,P×Q可以为1×1、1×2、2×1、2×2、1×3、3×1、2×3、3×3、1×4、4×1、2×4、4×2、3×4、4×3、4×4、5×5、6×6、8×8等,具体可以根据实际情况确定,本公开实施例不做限定。
其中,本公开实施例中,渲染策略可以为VRS,也可以为其他可以提高渲染速度的渲染策略,具体可以根据实际情况确定,本公开实施例不做限定。
可选地,用户注视区域可以为通过眼球追踪方法确定的,例如通过眼球追踪方法确定用户注视点,并以用户注视点为圆心,第一长度为半径确定注视区域。其中,眼球追踪方法可以根据实际情况确定,此处不做限定。
可选地,用户注视区域可以为预设的区域,即用户注视区域为屏幕上的固定区域。
可选地,第一位置信息用于指示目标对象的中心点所在的位置,上述步骤101可以为先获取目标对象的轮廓信息,然后根据目标对象的轮廓信息,确定目标对象的中心点所在的第一位置信息。其中,获取目标对象的轮廓信息的方法可以参考相关技术,此处不做限定。
可选地,第一位置信息用于指示目标对象的中心点所在的位置,上述步骤101也可以为通过包围盒判断的方法,获取目标对象的中心点所在的第一位置信息。其中,包围盒的形状可以根据实际使用需求确定,此处不做限定。
例如,包围盒为立方体,则可以通过包围盒判断的方法获取目标对象的轮廓上的至少8个点,然后可以通过该至少8个点确定中心点所在的位置(坐标),以得到第一位置信息。
可以理解,若第一位置信息用于指示目标对象的中心点所在的位置,则预设条件可以为目标对象的中心点位于用户注视区域。
可选地,第一位置信息用于指示目标对象的轮廓位置,即第一信息为目标对象的轮廓信息,上述步骤101可以为获取目标对象的轮廓信息。
可以理解,若第一位置信息用于指示目标对象的轮廓位置,则预设条件可以为目标对象与用户注视区域的交集在目标对象中的占比大于或等于预设比例阈值。其中,预设比例阈值可以为0,可以为小于1的任意值具体预设比例阈值可以根据实际情况确定,此处不做限定。
本公开实施例中,通过获取待渲染场景中的目标对象在屏幕中的第一位置信息;在第一位置信息指示该目标对象与用户注视区域的交集满足预设条件的情况下,基于第一渲染策略对该目标对象进行渲染,可以实现对与用户注视区域的交集满足预设条件的目标对象执行相同的渲染策略,从而可以避免因为了提高渲染效率对待渲染场景进行优化渲染,导致渲染后的目标对象出现被撕裂的违和感,可以提高用户体验。
可选地,本公开实施例提供的对象渲染方法还可以包括下述步骤103。
103、在第一位置信息指示该目标对象与用户注视区域的交集不满足预设条件的情况下,基于第四渲染策略对该目标对象进行渲染。
其中,第四渲染策略可以包括至少一种渲染策略,通过第四渲染策略中的任一种渲染策略渲染的目标对象的分辨率,低于通过第一渲染策略渲染的目标对象的分辨率。,第四渲染策略可以为在步骤101之前通过对待渲染场景进行分析确定的渲染策略,也可以为预设的渲染策略,也可以为待渲染场景之前的默认的渲染策略,具体可以根据实际情况确定,此处不做限定。
可选地,结合图1,如图2所示,上述步骤102具体可以通过下述步骤102a至步骤102b实现。
102a、在第一位置信息指示该目标对象与用户注视区域的交集满足该预设条件的情况下,获取该目标对象的第一信息。
可选地,第一信息包括以下至少一项:目标对象渲染后的第一深度值,所述目标对象的第一尺寸值,贴图区域的梯度信息,目标对象的类型,目标对象的三角面数量。第一信息还可以包括其他信息,具体可以根据实际情况确定,此处不做限定。
其中,该贴图区域为该目标对象在该待渲染场景对应的贴图中的区域。
102b、在第一信息满足目标条件的情况下,基于第一渲染策略对该目标对象进行渲染。
本公开实施例中,可以根据第一信息是否满足目标条件更好地确定是否基于第一渲染策略对该目标对象进行渲染。
可选地,在第一信息包括该目标对象渲染后的第一深度值的情况下,该目标条件包括第一深度值小于或等于预设深度阈值。
其中,对第一深度值的描述可以参考下述步骤201d中对每个对象渲染后的深度信息的相关描述,此处不做限定。预设深度阈值可以根据实际情况确定,此处不做限定。
本公开实施例中,由于深度值较大的对象,最终在屏幕上的显示尺寸较小,通常不是用户关注的对象,无需高清显示,因此,若第一深度值较大,即使渲染后的目标对象的分辨率较低或存在多种分辨率等,也不会影响用户体验,因此可以实现对目标对象的灵活渲染。
可选地,在第一信息包括该目标对象的第一尺寸值的情况下,该目标条件包括第一尺寸值大于或等于预设尺寸阈值。
其中,预设尺寸阈值可以根据实际情况确定,此处不做限定。
其中,第一尺寸值用于指示目标对象投影到屏幕后大概会占用的屏幕区域的尺寸,可以通过包围盒判断的方法获取第一尺寸值;也可以先确定目标对象的轮廓信息,根据目标对象的轮廓信息获取第一尺寸值;还可以通过其他方法获取第一尺寸值,具体可以根据实际情况确定,此处不做限定。
本公开实施例,因为若对象的尺寸较小,通常也不是用户关注的物体,无需高清显示,因此,若第一尺寸值较小,即使渲染后的目标对象的分辨率较低或存在多种分辨率等,也不会影响用户体验,因此可以实现对目标对象的灵活渲染。
可选地,在第一信息包括贴图区域的梯度信息的情况下,该目标条件包括该贴图区域的梯度信息大于或等于预设梯度阈值,该贴图区域为该目标对象在该待渲染场景对应的贴图中的区域。
其中,对贴图区域的梯度信息的描述可以参考下述步骤201b中对贴图的梯度信息的相关描述,此处不做限定。
其中,预设梯度阈值可以根据实际情况确定,此处不做限定。
本公开实施例,因为若对象的梯度信息较小,说明对象的内容变化较平缓,通常也不是用户关注的物体,无需高清显示,因此,若贴图区域的梯度信息较小,即使渲染后的目标对象的分辨率较低或存在多种分辨率等,也不会影响用户体验,因此可以实现对目标对象的灵活渲染。
可选地,在第一信息包括该目标对象的类型的情况下,该目标条件包括该目标对象的类型为预设类型。
其中,对象的类型可以包括人物类、动物类、植物类、建筑物类等,具体可以根据实际情况确定,此处不做限定。预设类型也可以根据实际情况确定,此处不做限定。
本公开实施例中,预设类型为用户关注的类型,需要高清显示,非用户关注类型的对象无需高清显示,因此,若目标对象的类型不是预设类型,即使渲染后的目标对象的分辨率较低或存在多种分辨率等,也不会影响用户体验,因此可以实现对目标对象的灵活渲染。
可选地,在第一信息包括该目标对象的三角面数量的情况下,该目标条件包括该目标对象的三角面数量大于或等于预设数量阈值。
其中,预设数量阈值可以根据实际情况确定,此处不做限定。
其中,对目标对象的三角面数量的描述可以参考下述步骤201b中对每个对象的三角面数量的相关描述,此处不做限定。
本公开实施例中,对象的三角面数量较少时,通常也不是用户关注的物体,无需高清显示,因此,若目标对象的三角面数量较少,即使渲染后的目标对象的分辨率较低或存在多种分辨率等,也不会影响用户体验,因此可以实现对目标对象的灵活渲染。
本公开实施例中,可以通过设定多种第一信息,从而使得对目标对象的渲染更合理。
可以理解,结合上述步骤102a至步骤102b,在上述步骤102之后,本公开实施例提供的对象渲染方法还可以包括下述步骤104。
104、在第一位置信息指示该目标对象与用户注视区域的交集满足预设条件,但第一信息不满足目标条件的情况下,基于第四渲染策略对该目标对象进行渲染。
其中,对第四渲染策略的描述可以参考上述对步骤103中的第四渲染策略的相关描述,此处不再赘述。
可选地,在上述步骤102之前,本公开实施例提供的对象渲染方法还可以包括下述步骤105。
105、确定对该目标对象设定的渲染策略包括第一渲染策略和第二渲染策略。
其中,第二渲染策略为S×T个像素点执行一次渲染的策略,P×Q小于S×T,S、T均为正整数。
其中,对S×T的描述可以参考上述步骤102中对P×Q的相关描述,此处不再赘述。
可选地,第一渲染策略和第二渲染策略可以为依据背景技术涉及的方法设置的渲染策略。
其中,对该目标对象设定的渲染策略除了包括第一渲染策略和第二渲染策略,还可以包括其他渲染策略,此处不做限定。
可以理解,若按照第一渲染策略和第二渲染策略对目标对象进行渲染,则渲染后的目标对象会出现撕裂的违和感。因此,本公开实施例可以避免渲染后的目标对象出现撕裂的违和感,可以提高用户体验。
可选地,结合图1,如图3所示,上述步骤102具体可以通过下述步骤102c和102d实现。
102c、在第一位置信息指示该目标对象与用户注视区域的交集满足该预设条件,且P×Q小于或等于N×M的情况下,将目标对象的渲染策略由第三渲染策略修改为第一渲染策略。
102d、基于第一渲染策略对该目标对象进行渲染。
可选地,本公开实施例提供的对象渲染方法还可以包括在P×Q大于N×M的情况下,基于第三渲染策略对该目标对象进行渲染。
其中,对N×M的描述可以参考上述步骤102中对P×Q的相关描述,此处不再赘述。
可以理解,第三渲染策略为在步骤101之前为目标对象设定的渲染策略,若P×Q小于或等于N×M,则通过第一渲染策略对第一对象进行渲染之后可以使得目标对象的分辨率更高,从而提高用户体验;若P×Q大于N×M,则通过第三渲染策略对第一对象进行渲染之后可以使得目标对象的分辨率更高,从而提高用户体验。
可选地,结合图3,如图4所示,在上述步骤101之前,本公开实施例提供的对象渲染方法还可以包括下述步骤201至步骤202。
201、获取待渲染场景的相关信息。
本公开实施例中,相关信息可以为待渲染场景中的对象的信息,也可以为待渲染场景的贴图的信息,具体可以根据实际情况确定,此处不做限定。
202、根据该相关信息,确定对该待渲染场景进行渲染时采用的渲染策略。
其中,该渲染策略包括对该待渲染场景中的至少一个对象采用N×M个像素点执行一次渲染的策略(即第三渲染策略,此时,第三渲染策略是根据待渲染场景的相关信息确定的),该至少一个对象包括该目标对象(即根据待渲染场景的相关信息确定在对待渲染场景进行渲染时对目标对象采用第三渲染策略)。
可以理解,可以根据相关信息,确定对该待渲染场景进行渲染时,对整个待渲染场景中的全部对象采用N×M个像素点执行一次渲染的策略,也可以对待渲染场景中的部分对象采用N×M个像素点执行一次渲染的策略,也可以对待渲染场景中的不同对象采用不同数量的像素点执行一次渲染的策略(即部分对象采用N1×M1个像素点执行一次渲染的策略,部分对象采用N2×M2个像素点执行一次渲染的策略,其中,N1、N2不同,M1、M2不同),具体可以根据实际使用情况确定,本公开实施例不做限定。
需要说明的是,本公开实施例中,可以在对待渲染场景进行渲染之前,确定对待渲染场景的渲染策略,因此本公开实施例上述步骤201至步骤202的过程可以在应用程序的加载阶段实施,从而可以简化在渲染过程中对待渲染场景的渲染策略的判断过程,进而不会和渲染任务抢占设备中的计算资源,如此,可以提高渲染速度。
本公开实施例中,可以根据待渲染场景的相关信息,灵活确定是否对待渲染场景中的至少一个对象采用至少一个像素执行一次渲染的策略,从而可以根据待渲染场景的实际情况,灵活实现提高渲染速度的目的,进而节省图形处理器的算力,降低图形处理器的负载压力。
可选地,该相关信息包括该待渲染场景的贴图的特征信息;其中,该特征信息包括以下至少一项:该贴图的梯度信息,该贴图的内容信息。
示例性地,上述步骤201具体可以通过下述步骤201a至步骤201b实现。
201a、获取该待渲染场景的贴图。
贴图是3D影视动画以及游戏制作过程中的一个环节,即:用图像处理软件(Adobe Photoshop,PS)等平面软件制作材质平面图,覆于利用玛雅(Maya)、3DMax等3D制作软件建立的立体模型上的过程,称为贴图。
其中,贴图可以反映待渲染场景中的对象的表面反射和表面颜色,例如当待渲染场景为游戏场景时,贴图可以反映游戏场景中对象表面的反射和表面颜色。
本公开实施例中,可以在系统层通过钩子(hook)的方法获取待渲染场景的贴图。
hook的方法可以是调用已有的hook方式的代码(hook工具),也可以是修改相关代码获得的hook方式的代码,具体可以根据实际情况确定,本公开实施例不做限定。
示例性地,在系统层通过hook接入到OpenGL ES(OpenGL for Embedded Systems)的加载(load)贴图的函数中,则可以获取应用程序给OpenGL ES的所有贴图。
示例性地,当应用程序通过调用系统接口将应用程序APK里面保存的待渲染场景的贴图送到图形处理器的过程中,在系统层通过hook的方法获取待渲染场景的贴图。
本公开实施例中,利用hook的思想,对应用程序进行了透明的优化,使得应用程序设计者可以在不改变应用程序已有的功能的同时,为应用程序增加新的功能。
201b、将该贴图的特征信息确定为该相关信息。
可选地,该特征信息包括该贴图的梯度信息,可以通过将贴图输入预先训练好的机器学习梯度模型中,输出贴图的梯度信息,也可以通过数字图像处理方法直接计算贴图的x方向的灰度的梯度信息和y方向的灰度的梯度信息,然后得到该贴图的梯度信息。
可选地,贴图的x方向的灰度的梯度信息可以为每一行中的连续像素点的灰度值的差值的绝对值之和,y方向的灰度的梯度信息可以为每一列中的连续像素点的灰度值的差值的绝对值之和,贴图的x方向的灰度的梯度信息和y方向的灰度的梯度信息还可以通过其他算法计算,具体可以根据实际情况确定,此处不做限定。贴图的梯度信息可以为x方向的灰度的梯度信息和y方向的灰度的梯度信息之和,也可以为x方向的灰度的梯度信息与y方向的灰度的梯度信息的平方和的算术平方根,贴图的梯度信息还可以通过其他的公式计算,具体可以根据实际情况确定,此处不做限定。
其中,机器学习梯度模型可以是基于梯度样本数据对机器学习模型进行训练得到的,机器学习模型可以为基于任意机器学习算法建立的基础模型,梯度样本数据包括大量的梯度样本,每个梯度样本包括贴图和贴图对应的梯度。机器学习梯度模型具体的训练过程可以参考现有相关技术,此处不做限定。
本公开实施例中,结合机器学习梯度模型,在不干扰渲染流程的前提下,最大的发挥图形处理器的能力,挤出更多算力。
其中,该贴图的梯度信息用于表征该贴图的梯度变化情况。通常情况下,贴图的梯度信息越小,说明贴图的梯度变化越平缓,贴图的梯度信息越大,说明贴图的梯度变化越剧烈。当贴图的颜色变化不明显时,贴图的梯度信息较小,当贴图的内容变化不明显时,贴图的梯度信息较小。当贴图的梯度信息较小时,可以对贴图对应的待渲染场景中的至少一个对象采用多像素点执行一次渲染的策略(即渲染策略),以提高渲染速度,节约图形处理器的算力,降低图形处理器的工作负载。
可选地,该特征信息包括该贴图的梯度信息;上述步骤202具体可以通过下述步骤202a实现。
202a、在该贴图的梯度信息在目标梯度范围的情况下,确定对该待渲染场景进行渲染时采用该目标梯度范围对应的渲染策略。
其中,目标梯度范围可以根据实际使用需求确定,目标梯度范围对应的渲染策略可以根据实际情况确定,本公开实施例不做限定。
可以理解,可以设定多个梯度范围(目标梯度范围为该多个梯度范围中的任一个),不同的梯度范围对应不同的渲染策略,不同的渲染策略对应不同的N×M。
示例性地,若该多个梯度范围为第一梯度范围、第二梯度范围和第三梯度范围,其中,第一梯度范围中的任意一个梯度信息小于第二梯度范围中的任意一个梯度信息,第二梯度范围中的任意一个梯度信息小于第三梯度范围中的任意一个梯度信息,第一梯度范围对应的N×M为4×4,第二梯度范围对应的N×M为2×2,第三梯度范围对应的N×M为1×1。若贴图的梯度信息在第一梯度范围内,则确定对该待渲染场景进行渲染时采用4×4个像素点执行一次渲染的策略,若贴图的梯度信息在第二梯度范围内,则确定对该待渲染场景进行渲染时采用2×2个像素点执行一次渲染的策略,若贴图的梯度信息在第三梯度范围内,则确定对该待渲染场景进行渲染时采用1×1个像素点执行一次渲染的策略。
本公开实施例中,根据待渲染场景的贴图的梯度信息,确定对待渲染场景进行渲染时采用的渲染策略,可以灵活确定是否对待渲染场景执行多个像素点执行一次渲染的策略。
可选地,该特征信息可以为贴图的内容信息,可以将贴图输入预先训练好的机器学习识别模型中,输出从贴图中识别出的内容信息,也可以通过对象识别算法来识别贴图中的内容信息,然后根据识别出的内容信息,确定对待渲染场景进行渲染时采用的渲染策略。
其中,机器学习识别模型可以是基于识别样本数据对机器学习模型进行训练得到的,机器学习模型可以为基于任意机器学习算法建立的基础模型,识别样本数据包括大量的识别样本,每个识别样本包括贴图和贴图对应的内容信息。机器学习识别模型具体的训练过程可以参考现有相关技术,此处不做限定。
本公开实施例中,结合机器学习识别模型,在不干扰渲染流程的前提下,最大的发挥图形处理器的能力,挤出更多算力。
其中,对象识别算法可以根据实际情况确定,本公开实施例不做限定。
可选地,该特征信息包括该贴图的内容信息;上述步骤202具体可以通过下述步骤202b或步骤202c实现。
202b、在该贴图的内容信息指示该贴图为目标内容的情况下,该目标内容对应的渲染策略。
可选地,目标内容为至少一个预设内容中的任一个。可以设置不同的预设内容对应不同的渲染策略,不同的渲染策略对应不同的N×M;也可以设置不同的预设内容对应相同的渲染策略;具体可以根据实际情况确定,此处不做限定。
可以理解,在该贴图的内容信息指示该贴图为目标内容的情况下,确定对该待渲染场景进行渲染时,对目标内容采用目标内容对应的渲染策略,对该除至少一个预设内容之外的内容采用其他的渲染策略。
可选地,每个预设内容可以为草地、树叶、石头等其他不被关注的内容,具体可以根据实际情况确定,本公开实施例不做限定。每个预设内容对应的渲染策略可以为除1×1个像素点执行一次渲染的策略之外的渲染策略(即目标内容对应的渲染策略的M×N不是1×1)。如此,可以在对待渲染场景进行渲染时,对不被关注的目标内容采用渲染优化策略(即多像素点执行一次渲染的策略),以提高渲染速度,节约图形处理器的算力,降低图形处理器的工作负载。
可以理解,若该贴图的内容信息指示该贴图为目标内容(目标内容为至少一个预设内容中的任一个)时,确定对该待渲染场景进行渲染时采用该目标内容对应的渲染策略,若该贴图的内容信息指示该贴图不为该至少一个预设内容中的任一个时,确定对该待渲染场景进行渲染时采用1×1个像素点执行一次渲染的策略。
示例性地,设置不同的预设内容对应不同的渲染策略,第一预设内容为草地,草地对应的N×M为4×4,第二预设内容为石头,石头对应的N×M为2×4,在贴图的内容信息指示是除第一目标内容和第二目标内容之外的内容时,N×M为1×1。也就是说,若该贴图的内容信息指示该贴图为草地,则确定对该待渲染场景进行渲染时采用4×4个像素点执行一次渲染的策略,若该贴图的内容信息指示该贴图为石头,则确定对该待渲染场景进行渲染时采用2×4个像素点执行一次渲染的策略,若该贴图的内容信息指示该贴图不是草地,也不是石头,则确定对该待渲染场景进行渲染时采用1×1个像素点执行一次渲染的策略。
可选地,每个预设内容可以为包括人物、动物等其他被关注对象的内容,具体可以根据实际情况确定,本公开实施例不做限定。每个预设内容对应的渲染策略可以为1×1个像素点执行一次渲染的策略(即目标内容对应的渲染策略的M×N是1×1)。如此可以在对待渲染场景进行渲染时,对被关注的目标内容采用1×1个像素点执行一次渲染的策略,如此不会降低被关注内容的分辨率,可以提高用户体验。
可以理解,若该贴图的内容信息指示该贴图为目标内容(目标内容为至少一个预设内容中的任一个)时,确定对该待渲染场景进行渲染时采用1×1个像素点执行一次渲染的策略,若该贴图的内容信息指示该贴图不为该至少一个预设内容中的任一个时,确定对该待渲染场景进行渲染时采用除1×1个像素点执行一次渲染的策略之外的渲染策略(例如2×2个像素点执行一次渲染的策略)。
示例性地,设置每个预设内容对应的渲染策略的N×M为1×1,除至少一个预设内容之外的内容对应的渲染策略的N×M为4×4。也就是说,若该贴图的内容信息指示该贴图为的目标内容(目标内容为该至少一个预设内容中的任一个),则确定对该待渲染场景进行渲染时采用1×1个像素点执行一次渲染的策略,若该贴图的内容信息指示该贴图不为任一个预设内容,则确定对该待渲染场景进行渲染时采用4×4个像素点执行一次渲染的策略。
本公开实施例中,该贴图的内容信息指示该贴图为目标内容,是从贴图的整体的角度考虑的,当贴图的整体为目标内容时,确定对该待渲染场景进行渲染时采用该目标内容对应的渲染策略,当贴图的整体不为任一预设内容(至少一个预设内容中的任一个)时,确定对该待渲染场景进行渲染时采用其他渲染策略,如此可以灵活确定对该待渲染场景进行渲染时采用的渲染策略,进而当对该待渲染场景进行渲染时采用多像素执行一次渲染的策略,可以提高渲染速度。
202c、在该贴图的内容信息指示该贴图包括预设对象的情况下,确定对该待渲染场景进行渲染时对该预设对象采用该预设对象对应的渲染策略。
可选地,预设对象为至少一个预设对象中的任一个,可以设置不同的预设对象对应不同的渲染策略,不同的渲染策略对应不同的N×M;也可以设置不同的预设对象对应相同的渲染策略;具体可以根据实 际情况确定,此处不做限定。
可选地,每个预设对象可以为草地、石头、大树等不被关注的对象,具体可以根据实际情况确定,本公开实施例不做限定。每个预设对象对应的渲染策略可以为除1×1个像素点执行一次渲染的策略之外的渲染策略(即预设对象对应的渲染策略的M×N不是1×1),如此,可以在对待渲染场景进行渲染时,对不被关注的预设对象采用渲染优化策略(即多像素点执行一次渲染的策略),以提高渲染速度,节约图形处理器的算力,降低图形处理器的工作负载。
可以理解,若该贴图的内容信息指示该贴图包括预设对象,确定对该待渲染场景进行渲染时,对该预设对象采用该预设对象对应的渲染策略,对除该至少一个预设对象之外的对象采用1×1个像素点执行一次渲染的策略。
示例性地,设置不同的预设对象对应不同的渲染策略,第一预设对象为草地,草地对应的N×M为4×4,第二预设对象为石头,石头对应的N×M为2×4。也就是说,若该贴图的内容信息指示该贴图包括草地和石头,则确定对该待渲染场景进行渲染时,对草地采用4×4个像素点执行一次渲染的策略,对石头采用2×4个像素点执行一次渲染的策略,对草地和石头之外的对象采用1×1个像素点执行一次渲染的策略。
可选地,每个预设对象也可以为人物、动物等被关注的对象,具体可以根据实际情况确定,本公开实施例不做限定。每个预设对象对应的渲染策略可以为1×1个像素点执行一次渲染的策略(即预设对象对应的渲染策略的M×N是1×1),如此可以在对待渲染场景进行渲染时,对被关注的预设对象采用1×1个像素点执行一次渲染的策略,如此不会降低被关注对象的分辨率,可以提高用户体验。
可以理解,若该贴图的内容信息指示该贴图包括预设对象(为至少一个预设对象中的任一个)时,确定对该待渲染场景进行渲染时对预设对象采用1×1个像素点执行一次渲染的策略,并对(该待渲染场景中)除该至少一个预设对象之外的对象采用除1×1个像素点执行一次渲染的策略之外的渲染策略(例如2×2个像素点执行一次渲染的策略)。
示例性地,设置每个预设对象对应的渲染策略的N×M为1×1,除至少一个预设对象之外的对象对应的渲染策略的N×M为4×4。也就是说,若该贴图的内容信息指示该贴图包括预设对象,则确定对该待渲染场景进行渲染时对该预设对象采用1×1个像素点执行一次渲染的策略,并对该待渲染场景中除该至少一个预设对象之外的对象采用4×4个像素点执行一次渲染的策略。
本公开实施例中,该贴图的内容信息指示该贴图包括预设对象,是从贴图的局部的角度考虑的,当贴图的局部为预设对象时,确定对该待渲染场景进行渲染时对预设对象采用该预设对象对应的渲染策略,并对该待渲染场景中除预设对象之外的对象采用其他渲染策略(若该贴图的内容信息指示该贴图不包括任一预设对象(至少一个预设对象中的任一个)时,确定对该待渲染场景进行渲染时采用其他渲染策略)。如此可以灵活确定对该待渲染场景进行渲染时采用的渲染策略,不同对象(不同局部区域)可以采用不同的渲染策略,进而当对该待渲染场景进行渲染时可以对局部采用多像素执行一次渲染的策略,可以提高渲染速度。
可选地,该特征信息还包括该贴图的梯度信息,上述步骤202b具体可以通过下述的步骤202b1实现。
202b1、在该贴图的梯度信息在目标预设梯度范围,且该贴图为目标内容的情况下,确定对该待渲染场景进行渲染时采用该目标内容对应的渲染策略。
可以理解,本公开实施例中,可以先判断该贴图的梯度信息,是否在目标预设梯度范围内,若在目标预设梯度范围内,则若该贴图为目标内容的情况下,确定对该待渲染场景进行渲染时采用该目标内容对应的渲染策略。
其中,对目标预设梯度范围的描述可以参考上述步骤202a中对目标梯度范围的相关描述,此处不在赘述。可以理解,不同的梯度范围,在该贴图为目标内容时,可以对应不同的渲染策略,具体可以根据实际使用需求确定。
示例性地,设置一个预设梯度范围,即目标预设梯度范围中的任一个值均小于或等于梯度阈值的范围。也就是说,若贴图的梯度信息在目标预设梯度范围,则考虑在该贴图为目标内容的情况下,确定对 该待渲染场景进行渲染时采用该目标内容对应的渲染策略;若贴图的梯度信息不在目标预设梯度范围,则无需考虑该贴图是否为目标内容,均确定对该待渲染场景进行渲染时采用预设渲染策略,预设渲染策略可以根据实际情况确定,此处不做限定。
示例性地,设置多个预设梯度范围,目标预设梯度范围为该多个预设梯度范围中的一个,例如,设置三个预设梯度范围,第一预设梯度范围,第二预设梯度范围(即目标预设梯度范围)和第三预设梯度范围。其中,第一预设梯度范围中的任意一个梯度信息均小于第二预设梯度范围中的任意一个梯度信息,第二预设梯度范围中的任意一个梯度信息均小于第三预设梯度范围中的任意一个梯度信息。当贴图的梯度信息在第一预设梯度范围时,可以确定对该待渲染场景进行渲染时采用第一预设梯度范围对应的渲染策略;当贴图的梯度信息在第二预设梯度范围时,且该贴图为目标内容的情况下,确定对该待渲染场景进行渲染时采用该目标内容对应的渲染策略,否则确定对该待渲染场景进行渲染时采用预设渲染策略;当贴图的梯度信息在第三预设梯度范围时,可以确定对该待渲染场景进行渲染时采用预设渲染策略。
本公开实施例中,结合贴图的梯度信息和贴图的内容信息,可以更好地为待渲染场景确定合适的渲染策略,提高渲染速度。
可选地,该特征信息还包括该贴图的梯度信息,上述步骤202c具体可以通过下述的步骤202c1实现。
202c1、在该贴图的梯度信息在目标预设梯度范围,且该贴图包括预设对象的情况下,确定对该待渲染场景进行渲染时对该预设对象采用该预设对象对应的渲染策略。
其中,对步骤202c1的具体描述可以参考上述对步骤202c以及对上述步骤202b1的相关描述,此处不再赘述。
本公开实施例中,结合贴图的梯度信息和贴图的内容信息,可以更好地为待渲染场景确定合适的渲染策略,提高渲染速度。
可选地,该相关信息包括该待渲染场景中的每个对象的参数信息;其中,该参数信息包括以下至少一项:该每个对象的三角面数量,该每个对象渲染后的深度信息。
示例性地,上述步骤201具体可以通过下述步骤201c至步骤201d实现。
201c、获取该待渲染场景中的每个对象的参数信息。
201d、将该每个对象的参数信息确定为该相关信息。
可选地,该参数信息包括该每个对象的三角面数量,可以根据该待渲染场景中的每个对象的顶点上传函数(例如,hookOpenGLES的顶点上传函数),分析每个对象的三角面数量;将每个对象的三角面数量确定为该相关信息,也可以通过其他方法获取每个对象的三角面数量,具体可以根据实际情况确定,此处不做限定。进而可以根据每个对象的三角面数量,确定对待渲染场景进行渲染时采用的渲染策略。
可选地,该参数信息包括该每个对象渲染后的深度信息,可以在对待渲染场景进行渲染之前,对待渲染场景进行预渲染(模拟渲染),以得到待渲染场景中的每个对象渲染后的深度信息;也可以在之前对待渲染场景进行渲染后,保存了待渲染场景中的每个对象渲染后的深度信息,此时可以通过获取之前保存的待渲染场景中的每个对象渲染后的深度信息,以实现获取待渲染场景中的每个对象渲染后的深度信息;还可以通过其他方法获取每个对象渲染后的深度信息,具体可以根据实际情况确定,此处不做限定。进而可以根据每个对象渲染后的深度信息,确定对待渲染场景进行渲染时采用的渲染策略。
可选地,可以在对待渲染场景初次进行渲染之前,不确定渲染策略,默认使用1×1个像素点执行一次渲染的策略;也可以对待渲染场景初次进行渲染之前,通过预渲染的方式获取每个对象渲染后的深度信息,根据每个对象渲染后的深度信息,确定对该待渲染场景进行渲染时采用的渲染策略。然后根据确定的渲染策略对待渲染场景进行渲染之后,保存每个对象渲染后的深度信息;进而下次再对待渲染场景进行渲染之前,可以获取之前保存的每个对象渲染后的深度信息,然后根据每个对象渲染后的深度信息,确定对该待渲染场景进行渲染时采用的渲染策略,然后根据确定的渲染策略对待渲染场景进行渲染之后,更新每个对象渲染后的深度信息。
需要说明的是,本公开实施例中,还可以结合每个对象的三角面数量和每个对象渲染后的深度信息,确定对待渲染场景进行渲染时采用的渲染策略,此时,若根据每个对象的三角面数量确定的渲染策略与 根据每个对象渲染后的深度信息确定的渲染策略相同或者在根据每个对象的三角面数量确定的渲染策略对应的N和M的乘积,与根据每个对象渲染后的深度信息确定的渲染策略对应的N和M的乘积相同,则最终确定的渲染策略为根据每个对象的三角面数量确定的渲染策略(或根据每个对象渲染后的深度信息确定的渲染策略)。若根据每个对象的三角面数量确定的渲染策略对应的N和M的乘积,与根据每个对象渲染后的深度信息确定的渲染策略对应的N和M的乘积不相同,则,最终确定的渲染策略可以为N和M的乘积最小的渲染策略,或N和M的乘积最大的渲染策略,具体可以根据实际情况确定,本公开实施例不做限定。
本公开实施例中,将该待渲染场景中的每个对象的参数信息确定为该相关信息,该相关信息为每个对象的三角面数量,和/或,每个对象渲染后的深度信息,从而可以根据实际情况确定合适的相关信息,进而确定合适的渲染策略。
可选地,该参数信息包括该每个对象的三角面数量;上述步骤202具体可以通过下述步骤202d至步骤202e实现。
202d、根据该每个对象的三角面数量,确定该待渲染场景中满足预定条件的对象的占比。
其中,该预定条件包括:对象的三角面数量小于或等于三角面数量阈值。
可以理解,对象的三角面数量越小说明对象越简单、越不重要,可能越不是被关注的对象;反之,对象的三角面数量越大说明对象越复杂,越重要,可能越是被关注的对象。三角面数量小于或等于三角面数量阈值的对象是简单对象,三角面数量大于三角面数量阈值的对象是复杂对象。
其中,三角面数量阈值可以根据实际使用需求确定,本公开实施例不做限定。
其中,该待渲染场景中满足预定条件的对象的占比,即为该待渲染场景中满足预定条件的对象的数量与该待渲染场景中的对象的总数量的比值。
202e、在该占比在目标比例范围内的情况下,确定对该待渲染场景进行渲染时采用该目标比例范围对应的渲染策略。
其中,目标比例范围可以根据实际使用需求确定,目标比例范围对应的渲染策略可以根据实际情况确定,本公开实施例不做限定。
可以理解,可以设置多个比例范围(目标比例范围为该多个比例范围中的任一个),不同的比例范围对应不同的渲染策略,不同的渲染策略对应不同的N×M。
示例性地,若该多个比例范围为第一比例范围、第二比例范围和第三比例范围,其中,第一比例范围中的任意一个比例值大于第二比例范围中的任意一个比例值(比例范围中的值较小,说明比例范围对应的待渲染场景的不被关注的对象更多,被关注的对象更少,则可以对该比例范围对应的待渲染场景进行更多像素执行一次渲染的策略),第二比例范围中的任意一个比例值大于第三比例范围中的任意一个比例值,第一比例范围对应的N×M为4×4,第二比例范围对应的N×M为2×2,第三比例范围对应的N×M为1×1。若该占比在第一比例范围内,则确定对该待渲染场景进行渲染时采用4×4个像素点执行一次渲染的策略,若该占比在第二比例范围内,则确定对该待渲染场景进行渲染时采用2×2个像素点执行一次渲染的策略,若该占比在第三比例范围内,则确定对该待渲染场景进行渲染时采用1×1个像素点执行一次渲染的策略。
本公开实施例中,根据每个对象的三角面数量确定整个待渲染场景的渲染策略,可以实现灵活确定该待渲染场景的渲染策略的目的。
可选地,该参数信息包括该每个对象的三角面数量;上述步骤202具体可以通过下述步骤202f至步骤202g实现。
202f、根据该每个对象的三角面数量,确定第一对象的三角面数量所在的目标数量范围。
202g、确定对该待渲染场景进行渲染时对第一对象采用该目标数量范围对应的渲染策略。
其中,第一对象为该每个对象中的任一个。
其中,目标数量范围可以根据实际使用需求确定,目标数量范围对应的渲染策略可以根据实际情况确定,本公开实施例不做限定。
可以理解,可以设置多个数量范围(目标数量范围为该多个数量范围中的任一个),不同的数量范 围对应不同的渲染策略,不同的渲染策略对应不同的N×M。
可以理解,根据每个对象的三角面数量确定每个对象的三角面数量所在的数量范围,然后确定对待渲染场景进行渲染时,对每个对象采用的其三角面数量所在的数量范围对应的渲染策略。
示例性地,若该多个数量范围包括第一数量范围,第二数量范围,第三数量范围,第四数量范围和第五数量范围。其中,第一数量范围中的任意一个值均小于第二数量范围中的任意一个值(数量范围中的值较小,说明三角面数量落在该数量范围的对象越不被关注,渲染时可以采用更多像素点执行一次渲染的策略),第二数量范围中的任意一个值均小于第三数量范围中的任意一个值,第三数量范围中的任意一个值均小于第四数量范围中的任意一个值,第四数量范围中的任意一个值均小于第五数量范围中的任意一个值;第一数量范围对应的渲染策略的N×M为4×4,第二数量范围对应的渲染策略的N×M为4×2,第三数量范围对应的渲染策略的N×M为2×2,第四数量范围对应的渲染策略的N×M为1×2,第五数量范围对应的渲染策略的N×M为1×1。假设待渲染场景中包括对象1、对象2和对象3共三个对象,其中,对象1的三角面数量在第一数量范围内,对象2的三角面数量在第五数量范围内,对象3的三角面数量在第四数量范围内,则可以确定对待渲染场景进行渲染时,对象1采用4×4个像素点执行一次渲染的策略,对象2采用1×1个像素点执行一次渲染的策略,对象3采用1×2个像素点执行一次渲染的策略。
本公开实施例中,根据每个对象的三家面数量确定每个对象的渲染策略,如此可以对待渲染场景进行更精细的优化渲染,可以更好地提高渲染速度。
可选地,该参数信息包括该每个对象渲染后的深度信息;上述步骤202具体可以通过下述步骤202h至步骤202i实现。
202h、根据该每个对象渲染后的深度信息,确定第二对象渲染后的深度信息所属的目标深度范围。
202i、确定对该待渲染场景进行渲染时对第二对象采用该目标深度范围对应的渲染策略。
其中,第二对象为该每个对象中的任一个。
其中,目标深度范围可以根据实际使用需求确定,目标深度范围对应的渲染策略可以根据实际情况确定,本公开实施例不做限定。
可以理解,对象渲染后的深度信息越大说明对象离镜头越远、越不重要,在屏幕上的尺寸就会越小,可能越不是被关注的对象;反之,对象渲染后的深度信息越小说明对象离镜头越近、越重要,在屏幕上的尺寸就会越大,可能越是被关注的对象。
可以理解,可以设置多个深度范围(目标深度范围为该多个深度范围中的任一个),不同的深度范围对应不同的渲染策略,不同的渲染策略对应不同的N×M。
可以理解,根据每个对象渲染后的深度信息确定每个对象渲染后的深度信息所在的深度范围,然后确定对待渲染场景进行渲染时,对每个对象采用的其渲染后的深度信息所在的深度范围对应的渲染策略。
示例性地,若该多个深度范围包括第一深度范围,第二深度范围,第三深度范围和第四深度范围。其中,第一深度范围中的任意一个值均大于第二深度范围中的任意一个值(深度范围中的值较大,说明渲染后的深度信息在该深度范围的对象越不被关注,渲染时可以采用更多像素点执行一次渲染的策略),第二深度范围中的任意一个值均大于第三深度范围中的任意一个值,第三深度范围中的任意一个值均大于第四深度范围中的任意一个值;第一深度范围对应的渲染策略的N×M为4×4,第二深度范围对应的渲染策略的N×M为4×2,第三深度范围对应的渲染策略的N×M为2×2,第四深度范围对应的渲染策略的N×M为1×1。假设待渲染场景中包括对象4、对象5、对象6和对象7共四个对象,其中,对象4渲染后的深度信息在第一深度范围内,对象5渲染后的深度信息在第三深度范围内,对象6渲染后的深度信息在第四深度范围内,对象7渲染后的深度信息在第三深度范围内,则可以确定对待渲染场景进行渲染时,对象4采用4×4个像素点执行一次渲染的策略,对象5采用2×2个像素点执行一次渲染的策略,对象6采用1×1个像素点执行一次渲染的策略,对象7采用2×2个像素点执行一次渲染的策略。
本公开实施例中,根据每个对象渲染后的深度信息确定每个对象的渲染策略,如此可以对待渲染场景进行更精细的优化渲染,可以更好地提高渲染速度。
可选地,相关信息包括该待渲染场景的贴图的梯度信息和该待渲染场景中的每个对象的参数信息。
示例性地,相关信息包括贴图的梯度信息和每个对象的三角面数量,上述步骤202d具体可以通过 下述步骤202d1实现。
202d1、在该贴图的梯度信息在目标预设梯度范围的情况下,根据该每个对象的三角面数量,确定该待渲染场景中满足该预定条件的对象的占比。
可以理解,本公开实施例中,可以先判断该贴图的梯度信息,是否在目标预设梯度范围内,若在目标预设梯度范围内,则根据该每个对象的三角面数量,确定该待渲染场景中满足该预定条件的对象的占比,并在该占比在目标比例范围内的情况下,确定对该待渲染场景进行渲染时采用该目标比例范围对应的渲染策略。
其中,对步骤202d1的具体描述可以参考上述对步骤202d、202e以及对上述步骤202b1的相关描述,此处不再赘述。
本公开实施例中,结合贴图的梯度信息和每个对象的三角面数量,可以更好地为待渲染场景确定合适的渲染策略,提高渲染速度。
示例性地,相关信息包括贴图的梯度信息和每个对象的三角面数量,上述步骤202f具体可以通过下述步骤202f1实现。
202f1、在该贴图的梯度信息在目标预设梯度范围的情况下,根据该每个对象的三角面数量,确定第一对象的三角面数量所在的该目标数量范围。
可以理解,本公开实施例中,可以先判断该贴图的梯度信息,是否在目标预设梯度范围内,若在目标预设梯度范围内,则根据该每个对象的三角面数量,确定第一对象的三角面数量所在的该目标数量范围,并确定对该待渲染场景进行渲染时对第一对象采用该目标数量范围对应的渲染策略。
其中,对步骤202f1的具体描述可以参考上述对步骤202f、202g以及对上述步骤202b1的相关描述,此处不再赘述。
本公开实施例中,结合贴图的梯度信息和每个对象的三角面数量,可以更好地为待渲染场景确定合适的渲染策略,提高渲染速度。
示例性地,相关信息包括贴图的梯度信息和每个对象渲染后的深度信息,上述步骤202h具体可以通过下述步骤202h1实现。
202h1、在该贴图的梯度信息在目标预设梯度范围的情况下,根据该每个对象渲染后的深度信息,确定第二对象渲染后的深度信息所属的该目标深度范围。
可以理解,本公开实施例中,可以先判断该贴图的梯度信息,是否在目标预设梯度范围内,若在该贴图的梯度信息在目标预设梯度范围的情况下,根据该每个对象渲染后的深度信息,确定第二对象渲染后的深度信息所属的该目标深度范围,并确定对该待渲染场景进行渲染时对第二对象采用该目标深度范围对应的渲染策略。
其中,对步骤202h1的具体描述可以参考上述对步骤202h、202i以及对上述步骤202b1的相关描述,此处不再赘述。
本公开实施例中,结合贴图的梯度信息和每个对象渲染后的深度信息,可以更好地为待渲染场景确定合适的渲染策略,提高渲染速度。
需要说明的是,本公开上述方法实施例中的任意两个示例之间还可以再次相结合,以更好地确定对待渲染场景进行渲染时的渲染策略,具体可以根据实际使用需求确定,此处不予赘述。
图5为本公开实施例示出的一种对象渲染装置的结构框图,如图5所示,包括:获取模块501和渲染模块502;该获取模块501,用于获取待渲染场景中的目标对象在屏幕中的第一位置信息;该渲染模块502,用于在该获取模块501获取的第一位置信息指示该目标对象与用户注视区域的交集满足目标条件的情况下,基于第一渲染策略对该目标对象进行渲染;其中,第一渲染策略为P×Q个像素点执行一次渲染的策略,P、Q均为正整数。
可选地,该渲染模块502,具体用于在第一位置信息指示该目标对象与用户注视区域的交集满足该预设条件的情况下,获取该目标对象的第一信息;在第一信息满足目标条件的情况下,基于第一渲染策略对该目标对象进行渲染。
可选地,在第一信息包括该目标对象渲染后的第一深度值的情况下,该目标条件包括第一深度值小 于或等于预设深度阈值;在第一信息包括该目标对象的第一尺寸值的情况下,该目标条件包括第一尺寸值大于或等于预设尺寸阈值;在第一信息包括贴图区域的梯度信息的情况下,该目标条件包括该贴图区域的梯度信息大于或等于预设梯度阈值,该贴图区域为该目标对象在该待渲染场景对应的贴图中的区域;在第一信息包括该目标对象的类型的情况下,该目标条件包括该目标对象的类型为预设类型;在第一信息包括该目标对象的三角面数量的情况下,该目标条件包括该目标对象的三角面数量大于或等于预设数量阈值。
可选地,该装置还包括确定模块,该确定模块,用于在基于第一渲染策略对该目标对象进行渲染之前,确定对该目标对象设定的渲染策略包括第一渲染策略和第二渲染策略;第二渲染策略为S×T个像素点执行一次渲染的策略,P×Q小于S×T,S、T均为正整数。
可选地,该渲染模块502,具体用于在P×Q小于或等于N×M的情况下,将该目标对象的渲染策略由第三渲染策略修改为第一渲染策略,并基于第一渲染策略对该目标对象进行渲染,第三渲染策略为N×M个像素点执行一次渲染的策略,N、M均为正整数。
可选地,该装置还包括确定模块,该获取模块501,还用于在获取待渲染场景中的目标对象在屏幕中的第一位置信息之前,获取待渲染场景的相关信息;该确定模块,用于根据该相关信息,确定对该待渲染场景进行渲染时采用的渲染策略;其中,该渲染策略包括对该待渲染场景中的至少一个对象采用N×M个像素点执行一次渲染的策略,该至少一个对象包括该目标对象。
可选地,该相关信息包括该待渲染场景的贴图的特征信息;其中,该特征信息包括以下至少一项:该贴图的梯度信息,该贴图的内容信息。
可选地,该特征信息包括该贴图的梯度信息;该确定模块,具体用于在该贴图的梯度信息在目标梯度范围的情况下,确定对该待渲染场景进行渲染时采用该目标梯度范围对应的渲染策略。
可选地,该特征信息包括该贴图的内容信息;该确定模块,具体用于在该贴图的内容信息指示该贴图为目标内容的情况下,确定对该待渲染场景进行渲染时采用该目标内容对应的渲染策略;或者,在该贴图的内容信息指示该贴图包括预设对象的情况下,确定对该待渲染场景进行渲染时对该预设对象采用该预设对象对应的渲染策略。
可选地,该特征信息还包括该贴图的梯度信息;该确定模块,具体用于在该贴图的梯度信息在目标预设梯度范围,且该贴图为该目标内容的情况下,确定对该待渲染场景进行渲染时采用该目标内容对应的渲染策略;或者,该确定模块,具体用于在该贴图的梯度信息在目标预设梯度范围,且该贴图包括该预设对象的情况下,确定对该待渲染场景进行渲染时对该预设对象采用该预设对象对应的渲染策略。
可选地,该相关信息包括该待渲染场景中的每个对象的参数信息;其中,该参数信息包括以下至少一项:该每个对象的三角面数量,该每个对象渲染后的深度信息。
可选地,该参数信息包括该每个对象的三角面数量;该确定模块,具体用于根据该每个对象的三角面数量,确定该待渲染场景中满足预定条件的对象的占比,该预定条件包括:对象的三角面数量小于或等于三角面数量阈值;在该占比在目标比例范围内的情况下,确定对该待渲染场景进行渲染时采用该目标比例范围对应的渲染策略;或者,该确定模块,具体用于根据该每个对象的三角面数量,确定第一对象的三角面数量所在的目标数量范围;确定对该待渲染场景进行渲染时对第一对象采用该目标数量范围对应的渲染策略,第一对象为该每个对象中的任一个。
可选地,该相关信息还包括该待渲染场景的贴图的特征信息,该特征信息包括:该贴图的梯度信息;该确定模块,具体用于在该贴图的梯度信息在目标预设梯度范围的情况下,根据该每个对象的三角面数量,确定该待渲染场景中满足该预定条件的对象的该占比;或者,该确定模块,具体用于在该贴图的梯度信息在目标预设梯度范围的情况下,根据该每个对象的三角面数量,确定第一对象的三角面数量所在的该目标数量范围。
可选地,该参数信息包括该每个对象渲染后的深度信息;该确定模块,具体用于根据该每个对象渲染后的深度信息,确定第二对象渲染后的深度信息所属的目标深度范围;确定对该待渲染场景进行渲染时对第二对象采用该目标深度范围对应的渲染策略;其中,第二对象为该每个对象中的任一个。
可选地,该相关信息还包括该待渲染场景的贴图的特征信息,该特征信息包括:该贴图的梯度信息; 该确定模块,具体用于在该贴图的梯度信息在目标预设梯度范围的情况下,根据该每个对象渲染后的深度信息,确定第二对象渲染后的深度信息所属的该目标深度范围。
本公开实施例中,各模块可以实现上述方法实施例提供的对象渲染方法,且能达到相同的技术效果,为避免重复,这里不再赘述。
图6为本公开实施例提供的一种电子设备的结构示意图,用于对实现本公开实施例中任意对象渲染方法的电子设备进行示例性说明,不应理解为对本公开实施例的具体限定。
如图6所示,电子设备600可以包括处理器(例如中央处理器、图形处理器等)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储装置608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有电子设备600操作所需的各种程序和数据。处理器601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。
通常,以下装置可以连接至I/O接口605:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置606;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置607;包括例如磁带、硬盘等的存储装置608;以及通信装置609。通信装置609可以允许电子设备600与其他设备进行无线或有线通信以交换数据。虽然示出了具有各种装置的电子设备600,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置609从网络上被下载和安装,或者从存储装置608被安装,或者从ROM 602被安装。在该计算机程序被处理器601执行时,可以执行本公开实施例提供的任意对象渲染方法中限定的功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务端可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:获取待渲染场景中的目标对象在屏幕中的第一位置信息;在第一位置信息指示该目标对象与用户注视区域的交集满足预设条件的情况下,基于第一渲染策略对该目标对象进行渲染;其中,第一渲染策略为P×Q个像素点执行一次渲染的策略,P、Q均为正整数。
在本公开实施例中,可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算 机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言,诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言,诸如“C”语言或类似的程序设计语言。程序代码可以完全地在计算机上执行、部分地在计算机上执行、作为一个独立的软件包执行、部分在计算机上部分在远程计算机上执行、或者完全在远程计算机或服务端上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,计算机可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。计算机可读介质可以是计算机可读信号介质或计算机可读储存介质。计算机可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。计算机可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。

Claims (19)

  1. 一种对象渲染方法,其特征在于,所述方法包括:
    获取待渲染场景中的目标对象在屏幕中的第一位置信息;
    在所述第一位置信息指示所述目标对象与用户注视区域的交集满足预设条件的情况下,基于第一渲染策略对所述目标对象进行渲染;
    其中,第一渲染策略为P×Q个像素点执行一次渲染的策略,P、Q均为正整数。
  2. 根据权利要求1所述的方法,其特征在于,所述在所述第一位置信息指示所述目标对象与用户注视区域的交集满足预设条件的情况下,基于第一渲染策略对所述目标对象进行渲染,包括:
    在所述第一位置信息指示所述目标对象与用户注视区域的交集满足所述预设条件的情况下,获取所述目标对象的第一信息;
    在所述第一信息满足目标条件的情况下,基于第一渲染策略对所述目标对象进行渲染。
  3. 根据权利要求2所述的方法,其特征在于,在所述第一信息包括所述目标对象渲染后的第一深度值的情况下,所述目标条件包括所述第一深度值小于或等于预设深度阈值;
    在所述第一信息包括所述目标对象的第一尺寸值的情况下,所述目标条件包括所述第一尺寸值大于或等于预设尺寸阈值;
    在所述第一信息包括贴图区域的梯度信息的情况下,所述目标条件包括所述贴图区域的梯度信息大于或等于预设梯度阈值,所述贴图区域为所述目标对象在所述待渲染场景对应的贴图中的区域;
    在所述第一信息包括所述目标对象的类型的情况下,所述目标条件包括所述目标对象的类型为预设类型;
    在所述第一信息包括所述目标对象的三角面数量的情况下,所述目标条件包括所述目标对象的三角面数量大于或等于预设数量阈值。
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述基于第一渲染策略对所述目标对象进行渲染之前,所述方法还包括:
    确定对所述目标对象设定的渲染策略包括第一渲染策略和第二渲染策略;
    所述第二渲染策略为S×T个像素点执行一次渲染的策略,P×Q小于S×T,S、T均为正整数。
  5. 根据权利要求1至3中任一项所述的方法,其特征在于,所述基于第一渲染策略对所述目标对象进行渲染,包括:
    在P×Q小于或等于N×M的情况下,将所述目标对象的渲染策略由第三渲染策略修改为所述第一渲染策略,并基于所述第一渲染策略对所述目标对象进行渲染;
    其中,所述第三渲染策略为N×M个像素点执行一次渲染的策略,N、M均为正整数。
  6. 根据权利要求5所述的方法,其特征在于,所述获取待渲染场景中的目标对象在屏幕中的第一位置信息之前,所述方法还包括:
    获取待渲染场景的相关信息;
    根据所述相关信息,确定对所述待渲染场景进行渲染时采用的渲染策略;
    其中,所述渲染策略包括对所述待渲染场景中的至少一个对象采用N×M个像素点执行一次渲染的策略,所述至少一个对象包括所述目标对象。
  7. 根据权利要求6所述的方法,其特征在于,所述相关信息包括所述待渲染场景的贴图的特征信息;
    其中,所述特征信息包括以下至少一项:所述贴图的梯度信息,所述贴图的内容信息。
  8. 根据权利要求7所述的方法,其特征在于,所述特征信息包括所述贴图的梯度信息;
    所述根据所述相关信息,确定对所述待渲染场景进行渲染时采用的渲染策略,包括:
    在所述贴图的梯度信息在目标梯度范围的情况下,确定对所述待渲染场景进行渲染时采用所述目标梯度范围对应的渲染策略。
  9. 根据权利要求7所述的方法,其特征在于,所述特征信息包括所述贴图的内容信息;
    所述根据所述相关信息,确定对所述待渲染场景进行渲染时采用的渲染策略,包括:
    在所述贴图的内容信息指示所述贴图为目标内容的情况下,确定对所述待渲染场景进行渲染时采用所述目标内容对应的渲染策略;
    或者,
    在所述贴图的内容信息指示所述贴图包括预设对象的情况下,确定对所述待渲染场景进行渲染时对所述预设对象采用所述预设对象对应的渲染策略。
  10. 根据权利要求9所述的方法,其特征在于,所述特征信息还包括所述贴图的梯度信息;
    所述在所述贴图的内容信息指示所述贴图为目标内容的情况下,确定对所述待渲染场景进行渲染时采用所述目标内容对应的渲染策略,包括:
    在所述贴图的梯度信息在目标预设梯度范围,且所述贴图为所述目标内容的情况下,确定对所述待渲染场景进行渲染时采用所述目标内容对应的渲染策略;
    或者,
    所述在所述贴图的内容信息指示所述贴图包括预设对象的情况下,确定对所述待渲染场景进行渲染时对所述预设对象采用所述预设对象对应的渲染策略,包括:
    在所述贴图的梯度信息在目标预设梯度范围,且所述贴图包括所述预设对象的情况下,确定对所述待渲染场景进行渲染时对所述预设对象采用所述预设对象对应的渲染策略。
  11. 根据权利要求6所述的方法,其特征在于,所述相关信息包括所述待渲染场景中的每个对象的参数信息;
    其中,所述参数信息包括以下至少一项:所述每个对象的三角面数量,所述每个对象渲染后的深度信息。
  12. 根据权利要求11所述的方法,其特征在于,所述参数信息包括所述每个对象的三角面数量;
    所述根据所述相关信息,确定对所述待渲染场景进行渲染时采用的渲染策略,包括:
    根据所述每个对象的三角面数量,确定所述待渲染场景中满足预定条件的对象的占比,所述预定条件包括:对象的三角面数量小于或等于三角面数量阈值;
    在所述占比在目标比例范围内的情况下,确定对所述待渲染场景进行渲染时采用所述目标比例范围对应的渲染策略;
    或者,
    所述根据所述相关信息,确定对所述待渲染场景进行渲染时采用的渲染策略,包括:
    根据所述每个对象的三角面数量,确定第一对象的三角面数量所在的目标数量范围;
    确定对所述待渲染场景进行渲染时对所述第一对象采用所述目标数量范围对应的渲染策略,所述第一对象为所述每个对象中的任一个。
  13. 根据权利要求12所述的方法,其特征在于,所述相关信息还包括所述待渲染场景的贴图的特征信息,所述特征信息包括:所述贴图的梯度信息;
    所述根据所述每个对象的三角面数量,确定所述待渲染场景中满足预定条件的对象的占比,包括:
    在所述贴图的梯度信息在目标预设梯度范围的情况下,根据所述每个对象的三角面数量,确定所述待渲染场景中满足所述预定条件的对象的所述占比;
    或者,
    所述根据所述每个对象的三角面数量,确定第一对象的三角面数量所在的目标数量范围,包括:
    在所述贴图的梯度信息在目标预设梯度范围的情况下,根据所述每个对象的三角面数量,确定所述第一对象的三角面数量所在的所述目标数量范围。
  14. 根据权利要求11所述的方法,其特征在于,所述参数信息包括所述每个对象渲染后的深度信息;
    所述根据所述相关信息,确定对所述待渲染场景进行渲染时采用的渲染策略,包括:
    根据所述每个对象渲染后的深度信息,确定第二对象渲染后的深度信息所属的目标深度范围;
    确定对所述待渲染场景进行渲染时对所述第二对象采用所述目标深度范围对应的渲染策略;
    其中,所述第二对象为所述每个对象中的任一个。
  15. 根据权利要求14所述的方法,其特征在于,所述相关信息还包括所述待渲染场景的贴图的特征 信息,所述特征信息包括:所述贴图的梯度信息;
    所述根据所述每个对象渲染后的深度信息,确定第二对象渲染后的深度信息所属的目标深度范围,包括:
    在所述贴图的梯度信息在目标预设梯度范围的情况下,根据所述每个对象渲染后的深度信息,确定所述第二对象渲染后的深度信息所属的所述目标深度范围。
  16. 一种对象渲染装置,其特征在于,包括:获取模块和渲染模块;
    所述获取模块,用于获取待渲染场景中的目标对象在屏幕中的第一位置信息;
    所述渲染模块,用于在所述获取模块获取的所述第一位置信息指示所述目标对象与用户注视区域的交集满足目标条件的情况下,基于第一渲染策略对所述目标对象进行渲染;
    其中,第一渲染策略为P×Q个像素点执行一次渲染的策略,P、Q均为正整数。
  17. 一种电子设备,其特征在于,包括:存储器和处理器,存储器用于存储计算机程序;处理器用于在调用计算机程序时执行权利要求1至15中任一项所述的对象渲染方法。
  18. 一种计算机可读存储介质,其特征在于,其上存储有计算机程序,计算机程序被处理器执行时实现权利要求1至15中任一项所述的对象渲染方法。
  19. 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序,所述计算机程序被处理器执行时实现权利要求1至15中任一项所述的对象渲染方法。
PCT/CN2023/081615 2022-03-29 2023-03-15 对象渲染方法、装置、电子设备、存储介质及程序产品 WO2023185476A1 (zh)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202210323944.7A CN116934942A (zh) 2022-03-29 2022-03-29 渲染策略确定方法、装置、电子设备、介质及程序产品
CN202210323944.7 2022-03-29
CN202210323943.2A CN116934941A (zh) 2022-03-29 2022-03-29 对象渲染方法、装置、电子设备、存储介质及程序产品
CN202210323943.2 2022-03-29

Publications (1)

Publication Number Publication Date
WO2023185476A1 true WO2023185476A1 (zh) 2023-10-05

Family

ID=88199050

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/081615 WO2023185476A1 (zh) 2022-03-29 2023-03-15 对象渲染方法、装置、电子设备、存储介质及程序产品

Country Status (1)

Country Link
WO (1) WO2023185476A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107958478A (zh) * 2017-12-15 2018-04-24 歌尔科技有限公司 虚拟现实场景中物体的渲染方法和虚拟现实头戴设备
CN108470368A (zh) * 2018-03-14 2018-08-31 北京奇艺世纪科技有限公司 一种虚拟场景中渲染对象的确定方法、装置及电子设备
CN110267025A (zh) * 2019-07-03 2019-09-20 京东方科技集团股份有限公司 虚拟3d显示的渲染方法、装置以及其显示方法、系统
CN111352670A (zh) * 2020-03-10 2020-06-30 简吉波 虚拟现实场景加载方法、装置、虚拟现实系统及设备
US20210397251A1 (en) * 2020-06-17 2021-12-23 Varjo Technologies Oy Display apparatus and method incorporating gaze-dependent display control

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107958478A (zh) * 2017-12-15 2018-04-24 歌尔科技有限公司 虚拟现实场景中物体的渲染方法和虚拟现实头戴设备
CN108470368A (zh) * 2018-03-14 2018-08-31 北京奇艺世纪科技有限公司 一种虚拟场景中渲染对象的确定方法、装置及电子设备
CN110267025A (zh) * 2019-07-03 2019-09-20 京东方科技集团股份有限公司 虚拟3d显示的渲染方法、装置以及其显示方法、系统
CN111352670A (zh) * 2020-03-10 2020-06-30 简吉波 虚拟现实场景加载方法、装置、虚拟现实系统及设备
US20210397251A1 (en) * 2020-06-17 2021-12-23 Varjo Technologies Oy Display apparatus and method incorporating gaze-dependent display control

Similar Documents

Publication Publication Date Title
CN105574924B (zh) 渲染方法、渲染设备和电子设备
US10986330B2 (en) Method and system for 360 degree head-mounted display monitoring between software program modules using video or image texture sharing
EP3121786B1 (en) Graphics pipeline method and apparatus
WO2021008627A1 (zh) 游戏角色渲染方法、装置、电子设备及计算机可读介质
EP2289000B1 (en) System, method, and computer program product for a tessellation engine using a geometry shader
EP3171336B1 (en) Graphic processing apparatus and method of performing graphics pipeline
WO2021146930A1 (zh) 显示处理方法、显示处理装置、电子设备及存储介质
US11120591B2 (en) Variable rasterization rate
TWI596569B (zh) 促進針對在計算裝置上之部分被遮蔽圖形影像之動態且有效的預啓用裁剪之技術
US10657706B2 (en) 3D rendering method and apparatus
CN112766215B (zh) 人脸图像处理方法、装置、电子设备及存储介质
WO2023207001A1 (zh) 图像渲染方法、装置、电子设备及存储介质
WO2023221926A1 (zh) 图像渲染处理方法、装置、设备及介质
WO2024146337A1 (zh) 一种阴影渲染方法、装置、设备及介质
TW201810026A (zh) 用於在計算環境中資料之邏輯處理的暫存器檔案之延伸
WO2023185476A1 (zh) 对象渲染方法、装置、电子设备、存储介质及程序产品
CN116091329B (zh) 图像处理方法、装置、设备及存储介质
CN113744379B (zh) 图像生成方法、装置和电子设备
US20180095754A1 (en) Graphics processing apparatus and method of executing instructions
TWI616844B (zh) 當複合物件在圖形影像中無法產生可見改變時促進圖形處理單元中此等物件之淘汰的技術
CN116934941A (zh) 对象渲染方法、装置、电子设备、存储介质及程序产品
CN116934942A (zh) 渲染策略确定方法、装置、电子设备、介质及程序产品
US12039660B1 (en) Rendering three-dimensional content based on a viewport
KR100691846B1 (ko) 3차원 그래픽 데이터 처리 방법 및 장치
CN115994967A (zh) 特效处理方法及设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23777851

Country of ref document: EP

Kind code of ref document: A1