Special effect rendering method, device and equipment, medium and product
By abstracting the special effects rendering chain into a directed acyclic graph and selecting the rendering chain with the least texture space for rendering, the problem of excessive memory resource consumption in special effects rendering is solved, and the rendering stability is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2026-03-31
AI Technical Summary
In existing rendering systems, special effects rendering operations consume excessive memory resources, leading to resource waste and stability issues.
The special effects rendering chain is abstracted as a directed acyclic graph. By determining the initial directed acyclic graph, the reference rendering chain with the least texture space is selected for rendering, and the rendering chain is optimized to reduce texture space occupation.
By optimizing the rendering pipeline, memory usage was reduced and the stability of special effects rendering was improved.
Smart Images

Figure CN121767522A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a special effects rendering method, apparatus, device, medium and product. Background Technology
[0002] Special effects rendering refers to the process of transforming a created special effects model or scene into a final image or animation by simulating visual effects such as lighting, shadows, materials, and textures.
[0003] In existing rendering system designs, each special effects rendering operation corresponds to zero or at least one input texture and one output texture, thus each special effects rendering operation occupies at least one texture space. However, a special effects rendering requirement usually involves multiple special effects rendering operations, resulting in excessive memory resource consumption. Summary of the Invention
[0004] This invention provides a special effects rendering method, apparatus, device, medium, and product to solve the problem of excessive memory resource consumption in special effects rendering and improve the stability of special effects rendering.
[0005] In a first aspect, embodiments of the present invention provide a special effects rendering method, the method comprising:
[0006] Based on the initial rendering chain of the special effects, an initial directed acyclic graph corresponding to the initial rendering chain is determined; wherein, the initial directed acyclic graph contains the rendering processing nodes in the initial rendering chain, and the rendering processing nodes in the initial rendering chain correspond to the special effects rendering operations of the special effects.
[0007] Based on the initial directed acyclic graph, at least one reference rendering link and the number of textures corresponding to the at least one reference rendering link are determined; wherein, the at least one reference rendering link includes rendering links with various numbers of textures corresponding to the initial directed acyclic graph, and the number of textures corresponding to the reference rendering link represents the minimum amount of texture space required during the execution of the reference rendering link.
[0008] Based on the number of textures corresponding to the at least one reference rendering link, a target rendering link is determined from the at least one reference rendering link, and the special effect is rendered based on the target rendering link.
[0009] Secondly, embodiments of the present invention also provide a special effects rendering apparatus, the apparatus comprising:
[0010] The initial directed acyclic graph (DAG) determination module is used to determine the initial directed acyclic graph corresponding to the initial rendering link based on the initial rendering link of the special effect; wherein, the initial directed acyclic graph includes the rendering processing nodes in the initial rendering link, and the rendering processing nodes in the initial rendering link correspond to the special effect rendering operation of the special effect.
[0011] The texture quantity determination module is used to determine at least one reference rendering link and the texture quantity corresponding to the at least one reference rendering link based on the initial directed acyclic graph; wherein, the at least one reference rendering link includes rendering links with various texture quantities corresponding to the initial directed acyclic graph, and the texture quantity corresponding to the reference rendering link represents the minimum amount of texture space required during the execution of the reference rendering link.
[0012] The special effects rendering module is used to determine the target rendering link from the at least one reference rendering link based on the number of textures corresponding to the at least one reference rendering link, and to render the special effects based on the target rendering link.
[0013] Thirdly, embodiments of the present invention also provide an electronic device, the electronic device comprising:
[0014] At least one processor; and
[0015] A memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the special effects rendering method according to any embodiment of the present invention.
[0017] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer instructions, which are used to cause a processor to execute and implement the special effects rendering method described in any embodiment of the present invention.
[0018] Fifthly, embodiments of the present invention also provide a computer program product, including a computer program that, when executed by a processor, implements the special effects rendering method described in any embodiment of the present invention.
[0019] The technical solution of this invention abstracts the rendering chain of special effects into a directed acyclic graph (DAG). Based on the DAG, at least one reference rendering chain corresponding to the special effects and the number of textures corresponding to the at least one reference rendering chain are determined. Based on the number of textures corresponding to the at least one reference rendering chain, a target rendering chain is determined from the at least one reference rendering chain. The special effects are then rendered based on the target rendering chain. This solves the problem of excessive memory consumption for special effects rendering caused by a single fixed rendering chain. From the perspective of optimizing the rendering chain of special effects rendering, it achieves the goal of allocating less texture space for special effects rendering, thereby helping to improve the stability of special effects rendering. Attached Figure Description
[0020] The above and other features, advantages, and aspects of the various embodiments of the present invention will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0021] Figure 1 A flowchart illustrating a special effects rendering method provided in one embodiment of the present invention;
[0022] Figure 2 This is a schematic diagram of an initial directed acyclic graph provided in one embodiment of the present invention;
[0023] Figure 3 A flowchart illustrating a method for determining the number of textures according to an embodiment of the present invention;
[0024] Figure 4 A flowchart illustrating another special effects rendering method provided in an embodiment of the present invention;
[0025] Figure 5 This is a schematic diagram of a rendering processing sub-graph provided in one embodiment of the present invention;
[0026] Figure 6 A schematic diagram illustrating the number of textures in a reference rendering chain provided in one embodiment of the present invention;
[0027] Figure 7 This is a schematic diagram of the structure of a special effects rendering device provided in one embodiment of the present invention;
[0028] Figure 8 This is a schematic diagram of the structure of an electronic device provided in one embodiment of the present invention. Detailed Implementation
[0029] Embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. While some embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the invention. It should be understood that the accompanying drawings and embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the invention.
[0030] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0031] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0032] It should be noted that the concepts of "first" and "second" mentioned in this invention are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0033] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0034] The names of the messages or information exchanged between the multiple devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0035] Figure 1 This is a flowchart illustrating a special effects rendering method according to an embodiment of the present invention. This embodiment is applicable to the rendering of multimedia data with special effects. For example, the multimedia data can be images, videos, or text, etc. The method can be executed by a special effects rendering device, which can be implemented in hardware and / or software. The special effects rendering device can be configured in an electronic device, typically a mobile terminal or tablet computer. Figure 1 As shown, the method includes:
[0036] S110. Based on the initial rendering link of the special effects, determine the initial directed acyclic graph corresponding to the initial rendering link.
[0037] Specifically, special effects are used to characterize the special effects achieved after performing a series of special effects rendering operations on multimedia data, such as visual effects, auditory effects, or physical effects.
[0038] In this embodiment, the initial directed acyclic graph includes the rendering processing nodes in the initial rendering chain, and the rendering processing nodes in the initial rendering chain correspond to the special effects rendering operations. Specifically, the graph nodes in the initial directed acyclic graph are rendering processing nodes.
[0039] Specifically, the initial rendering link represents the link structure consisting of rendering processing nodes, connections, and rendering order corresponding to a series of special effects rendering operations. The initial directed acyclic graph represents the topology consisting of rendering processing nodes and data flow directions corresponding to a series of special effects rendering operations. Among them, the data flow direction between rendering processing nodes represents the output texture of the current rendering processing node flowing to the next rendering processing node as the input texture of the next rendering processing node.
[0040] For example, the rendering types corresponding to a series of special effects rendering operations include, but are not limited to, filter rendering, sticker rendering, pose transformation, special effects blending, and mask rendering, etc. The rendering type of special effects rendering operations is not limited here, and can be customized according to actual needs.
[0041] In an optional embodiment, the method further includes: in response to an add operation of a special effects rendering operation, adding a rendering processing node corresponding to the special effects rendering operation to an initial directed acyclic graph according to the add position corresponding to the add operation.
[0042] Specifically, when the addition position is the starting position in the initial directed acyclic graph (DAG), the input texture of the rendering node corresponding to the starting position in the initial DAG is used as the output texture of the rendering node corresponding to the special effects rendering operation; when the addition position is the middle position in the initial DAG, the output texture of the previous rendering node corresponding to the middle position in the initial DAG is used as the input texture of the rendering node corresponding to the special effects rendering operation, and the input texture of the next rendering node corresponding to the middle position in the initial DAG is used as the output texture of the rendering node corresponding to the special effects rendering operation; when the addition position is the end position in the initial DAG, the output texture of the rendering node corresponding to the end position in the initial DAG is used as the input texture of the rendering node corresponding to the special effects rendering operation, and the output texture of the rendering node corresponding to the special effects rendering operation is used as the output texture of the initial DAG.
[0043] In the initial directed acyclic graph, for adjacent first and second rendering processing nodes, the rendering order of the first rendering processing node is before that of the second rendering processing node. Accordingly, the output texture of the first rendering processing node and the input texture of the second rendering processing node are the same texture. This can be understood as the output texture of the first rendering processing node and the input texture of the second rendering processing node occupying the same texture space.
[0044] Figure 2 This is a schematic diagram of an initial directed acyclic graph provided in one embodiment of the present invention. Specifically, Figure 2 The boxes in the diagram represent rendering processing nodes, and the arrows indicate the data flow. For example, Figure 2 In this context, "Effect" can represent filter rendering, "Mask" represents mask rendering, "Blend" represents effect blending, and "TRS" represents pose transformation. The numbers are used to distinguish multiple different effect rendering operations corresponding to the same rendering type.
[0045] In the initial directed acyclic graph (DAG), the number of unidirectional links is greater than or equal to the number of starting rendering nodes. A starting rendering node is defined as a rendering node in the initial DAG that does not exist before or adjacent to a given rendering node. There can be one or more starting rendering nodes. A terminating rendering node is defined as a rendering node in the initial DAG that does not exist after a given rendering node and is adjacent to that rendering node; its number is always one. Specifically, a unidirectional link represents a link in the initial DAG from the starting rendering node to the terminating rendering node.
[0046] by Figure 2 For example, "Effect0", "Effect6", "Effect8", "Effect12", and "Effect14" are all starting rendering nodes, while "Blend4" is the ending rendering node. Figure 2 There are 6 unidirectional links in the middle.
[0047] S120. Based on the initial directed acyclic graph, determine at least one reference rendering link and the number of textures corresponding to the at least one reference rendering link.
[0048] In this embodiment, the at least one reference rendering link includes rendering links corresponding to various texture numbers in the initial directed acyclic graph.
[0049] In an optional embodiment, determining at least one reference rendering link and the number of textures corresponding to the at least one reference rendering link based on the initial directed acyclic graph includes: determining at least one reference rendering link based on the initial directed acyclic graph; for each reference rendering link, obtaining the amount of newly added textures in the texture space corresponding to at least one rendering processing node in the reference rendering link, and using the summation result corresponding to at least one newly added texture as the number of textures corresponding to the reference rendering link.
[0050] In an optional embodiment, determining at least one reference rendering link based on the initial directed acyclic graph includes: traversing the initial directed acyclic graph using a preset traversal algorithm to obtain at least one reference rendering link.
[0051] For example, the preset traversal algorithms include, but are not limited to, backtracking, topological sorting, or enumeration. The preset traversal algorithm is not limited here; it can be customized according to actual needs. The basic idea of the backtracking algorithm is: starting from a certain state (initial state) of the problem, search for all possible "states" that can be reached from this state. When a path reaches its "end" (cannot move forward further), backtrack one or more steps, starting from another possible "state," and continue searching until all "paths" (states) have been explored.
[0052] In this embodiment, the number of textures corresponding to the reference rendering chain represents the minimum amount of texture space required during the execution of the reference rendering chain. Specifically, texture space represents the memory space allocated from memory resources for rendering textures during the execution of special effects rendering operations.
[0053] Specifically, the newly added texture quantity represents the number of texture spaces that need to be created when the rendering processing node is executed during the execution of the reference rendering chain. The texture quantity corresponding to the reference rendering chain represents the cumulative number of newly added textures corresponding to each rendering processing node in the reference rendering chain.
[0054] In an optional embodiment, obtaining the amount of new textures in the texture space corresponding to at least one rendering processing node in the reference rendering chain includes: taking the first rendering processing node in the reference rendering chain as the current rendering processing node; obtaining the texture usage corresponding to the current rendering processing node and obtaining the texture allocable amount corresponding to the texture space pool; wherein, the texture allocable amount represents the number of texture spaces in the idle state; if the texture usage is greater than the texture allocable amount, taking the difference between the texture usage and the texture allocable amount as the amount of new textures corresponding to the current rendering processing node; taking the next rendering processing node in the reference rendering chain corresponding to the current rendering processing node as the current rendering processing node, and returning to execute the step of obtaining the texture usage corresponding to the current rendering processing node, until the current rendering processing node is the last special effects rendering node in the reference rendering chain.
[0055] In an optional embodiment, obtaining the texture usage corresponding to the current rendering processing node includes: setting the texture usage corresponding to the current rendering processing node to one.
[0056] In another optional embodiment, obtaining the texture usage corresponding to the current rendering processing node includes: obtaining the temporary texture amount corresponding to the current rendering processing node; determining the texture usage corresponding to the current rendering processing node based on the temporary texture amount; wherein, the temporary texture amount represents the amount of texture space that the current rendering processing node needs to temporarily occupy during the rendering process.
[0057] Specifically, temporary textures are different from the input and output textures of the rendering processing node. Temporary textures are textures temporarily used during the execution of special effects rendering operations corresponding to the current rendering processing node. The amount of temporary textures can also be used to represent the amount of texture space occupied by the temporary textures corresponding to the current rendering processing node.
[0058] In this embodiment, the temporary texture amount can be preset according to the actual special effects rendering operation. Specifically, determining the texture usage corresponding to the current rendering processing node based on the temporary texture amount includes: incrementing the temporary texture amount by one to obtain the texture usage corresponding to the current rendering processing node.
[0059] If we only consider the reuse of texture space occupied by input and output textures in the rendering processing node, the number of reusable texture spaces will be too small during the execution of special effects rendering operations, and the difference in the number of textures corresponding to different reference rendering links will not be significant. The advantage of considering temporary texture quantities is twofold: firstly, it can increase the reusability of texture space, further reducing memory resource consumption; secondly, it can improve the difference in the number of textures corresponding to different reference rendering links, ensuring the selection effect of subsequent target rendering links.
[0060] Specifically, the texture space pool is used to define at least one texture space corresponding to a reference rendering chain. Each texture space has either a bound state or an idle state. The bound state indicates that the texture space is bound to one or more rendering processing nodes in the reference rendering chain, while the idle state indicates that the texture space is not bound to any rendering processing node in the reference rendering chain. In this embodiment, the texture allocability represents the number of idle texture spaces.
[0061] Based on the above embodiments, optionally, after obtaining the texture allocable amount corresponding to the texture space pool, the method further includes: when the texture usage is greater than the texture allocable amount, creating an idle texture space in the texture space pool according to the newly added texture amount; binding the texture space in the texture space pool to the current rendering processing node according to the texture usage; and updating the reuse state of the texture space bound to the current rendering processing node in the texture space pool from the space state to the bound state.
[0062] For example, assuming the amount of textures used is 5 and the amount of new textures is 2, then 2 idle texture spaces are created in the texture space pool, and the 5 texture spaces in the texture space pool are bound to the current rendering processing node, and the reuse status of these 5 texture spaces is updated from the space state to the bound state.
[0063] Based on the above embodiments, optionally, obtaining the amount of new texture in the texture space corresponding to at least one rendering processing node in the reference rendering chain further includes: setting the amount of new texture in the texture space corresponding to the current rendering processing node to zero when the amount of texture usage is less than or equal to the amount of texture that can be allocated.
[0064] In an optional embodiment, after obtaining the texture usage corresponding to the current rendering processing node, the method further includes: if the texture usage is less than or equal to the texture allocable amount, binding the texture space in the texture space pool with the current rendering processing node according to the texture usage, and updating the reuse state of the texture space in the texture space pool bound to the current rendering processing node from the space state to the binding state.
[0065] For example, assuming the texture usage is 5 and the texture allocation is 6, then the number of new textures is 0. The texture spaces in the texture space pool with 5 spatial states are bound to the current rendering processing node, and the reuse status of these 5 texture spaces is updated from spatial state to bound state.
[0066] Figure 3 This is a flowchart illustrating a method for determining the number of textures according to an embodiment of the present invention. Specifically, according to a reference rendering chain, rendering processing node i is obtained sequentially, where rendering processing node i can be used to represent the rendering processing node of the i-th rendering order in the reference rendering chain. Texture space is allocated to rendering processing node i to obtain the texture usage P corresponding to rendering processing node i. It is determined whether the texture usage P is greater than the texture allocable amount Q corresponding to the texture space pool. If not, according to the texture usage P, the step of binding the idle texture space with rendering processing node i is performed. If so, the texture number N is added to (PQ), where (PQ) represents the newly added texture amount corresponding to rendering processing node i. According to the newly added texture amount, an idle texture space is created in the texture space pool, and according to the texture usage P, the step of binding the idle texture space with rendering processing node i is performed. Determine if i is equal to R, where R represents the total number of rendering processing nodes in the reference rendering chain. If yes, output the number of textures N corresponding to the reference rendering chain. If no, take the rendering processing node i+1 in the reference rendering chain as the rendering processing node i, and return to the step of allocating texture space for the rendering processing node i to obtain the texture usage P corresponding to the rendering processing node i.
[0067] Based on the above embodiments, optionally, before taking the next rendering processing node corresponding to the current rendering processing node in the reference rendering chain as the current rendering processing node, the method further includes: when there is no associated rendering processing node corresponding to the current rendering processing node in the reference rendering chain, obtaining other texture spaces besides the texture space bound to the output texture of the current rendering processing node, and updating the reuse state of the other texture spaces in the texture space pool from the bound state to the idle state; when there is an associated rendering processing node corresponding to the current rendering processing node in the reference rendering chain, obtaining other texture spaces besides the texture spaces bound to the input texture and output texture of the current rendering processing node respectively, and updating the reuse state of the other texture spaces in the texture space pool from the bound state to the idle state.
[0068] In this embodiment, the associated rendering processing node refers to a rendering processing node in the reference rendering chain that is rendered after the current rendering processing node and shares the same input texture with the current rendering processing node.
[0069] In one alternative embodiment, the texture space other than the texture space bound to the output texture of the current rendering processing node includes the texture space bound to the input texture of the current rendering processing node; or, the texture space other than the texture space bound to the output texture of the current rendering processing node includes the texture space bound to the input texture of the current rendering processing node and the texture space bound to the temporary texture of the current rendering processing node.
[0070] by Figure 2For example, assuming "Effect4", "Effect5", and "Effect10" are rendered sequentially in the reference rendering chain, if the current rendering node is "Effect4", since there is no associated rendering node sharing the input texture with "Effect4", before making "Effect5" the current rendering node, the reuse state of all texture spaces except those bound to the output texture of "Effect4" is updated from the bound state to the idle state. If the current rendering node is "Effect5", since "Effect10" is the associated rendering node corresponding to "Effect5", the reuse state of all texture spaces except those bound to the input and output textures of "Effect5" is updated from the bound state to the idle state. If the current rendering processing node is "Effect10", although "Effect5" and "Effect10" share the same input texture, the rendering order of "Effect5" is before that of "Effect10". Therefore, "Effect5" is not an associated rendering processing node of "Effect10". In other words, there is no associated rendering processing node corresponding to "Effect10" in the reference rendering chain. Therefore, the reuse status of texture spaces other than the texture space bound to the output texture of "Effect10" is updated from the bound state to the idle state.
[0071] S130. Determine a target rendering link from the at least one reference rendering link based on the number of textures corresponding to the at least one reference rendering link, and render the special effect based on the target rendering link.
[0072] In an optional embodiment, determining the target rendering link from the at least one reference rendering link based on the number of textures corresponding to the at least one reference rendering link includes: selecting the reference rendering link with the fewest textures as the target rendering link.
[0073] In another alternative embodiment, determining the target rendering link from the at least one reference rendering link based on the number of textures corresponding to the at least one reference rendering link includes: randomly selecting any reference rendering link whose number of textures is less than a threshold as the target rendering link.
[0074] For example, the quantity threshold can be 5 or 10. There is no limit to the quantity threshold here, and it can be customized according to actual needs.
[0075] The advantage of setting a quantity threshold is that it can avoid excessive waste of memory resources and reduce the error rate caused by excessive reuse of texture space, thereby further improving the stability of special effects rendering.
[0076] The technical solution of this embodiment abstracts the rendering chain of special effects into a directed acyclic graph (DAG). Based on the DAG, it determines at least one reference rendering chain corresponding to the special effects and the number of textures corresponding to the at least one reference rendering chain. Based on the number of textures corresponding to the at least one reference rendering chain, it determines the target rendering chain from the at least one reference rendering chain and renders the special effects based on the target rendering chain. This solves the problem of excessive memory consumption for special effects rendering caused by a single fixed rendering chain. From the perspective of optimizing the rendering chain of special effects rendering, it achieves the goal of allocating less texture space for special effects rendering, thereby helping to improve the stability of special effects rendering.
[0077] Figure 4 This is a flowchart of another special effects rendering method provided in one embodiment of the present invention. This embodiment further refines the step of "determining at least one reference rendering link based on the initial directed acyclic graph" in the above embodiment. In this embodiment, determining at least one reference rendering link based on the initial directed acyclic graph includes: obtaining at least two rendering processing subgraphs in the initial directed acyclic graph; determining a target directed acyclic graph based on the at least two rendering processing subgraphs; and determining at least one reference rendering link based on the target directed acyclic graph.
[0078] like Figure 4 As shown, the method includes:
[0079] S210. Based on the initial rendering link of the special effects, determine the initial directed acyclic graph corresponding to the initial rendering link.
[0080] S210 in this embodiment is the same as that in the above embodiment. Figure 1 The S110 shown is the same or similar, and will not be described again in this embodiment.
[0081] S220. Obtain at least two rendering subgraphs from the initial directed acyclic graph.
[0082] In this embodiment, the rendering subgraph contains at least one rendering node, and the out-degree of the last rendering node in the rendering subgraph is not one, or the in-degree of the next rendering node in the initial directed acyclic graph corresponding to the last rendering node in the rendering subgraph is greater than one.
[0083] In the initial directed acyclic graph, in-degree represents the number of edges with a node as the head, and out-degree represents the number of edges with a node as the tail. In this embodiment, in-degree represents the number of input textures corresponding to the rendering processing node, and out-degree represents the number of output textures corresponding to the rendering processing node. The multiple input textures each correspond to a different texture, while the multiple output textures each correspond to the same texture.
[0084] In an optional embodiment, obtaining at least two rendering subgraphs in the initial directed acyclic graph includes: obtaining a set of rendering nodes corresponding to the initial directed acyclic graph; for each target rendering node, adding the target rendering node to the initial subgraph and obtaining the next rendering node in the initial directed acyclic graph corresponding to the last rendering node in the initial subgraph; if the next rendering node is not in the set of rendering nodes, adding the next rendering node to the initial subgraph; returning to the step of obtaining the next rendering node in the initial directed acyclic graph corresponding to the last rendering node in the initial subgraph, until the next rendering node is in the set of rendering nodes, and then using the initial subgraph as the rendering subgraph corresponding to the target rendering node.
[0085] In this embodiment, the set of rendering nodes includes at least one target rendering processing node, wherein the in-degree of the target rendering processing node is not one or the out-degree of the previous rendering processing node corresponding to the target rendering processing node is not one.
[0086] Specifically, the next rendering processing node is represented in the initial directed acyclic graph as the rendering processing node that is located after the last rendering processing node in the initial processing subgraph and adjacent to the last rendering processing node.
[0087] by Figure 2 For example, the set of rendering nodes includes “Effect0”, “Effect6”, “Effect8”, “Effect12” and “Effect14” with an in-degree of zero, “Blend0”, “Blend1”, “Blend2”, “Blend4” and “Matee1” with an in-degree of two, and “Effect5” and “Effect10” with an out-degree of two for the previous rendering node.
[0088] Taking "Effect8" as an example, the next rendering node corresponding to "Effect8" is "Effect9". Since "Effect9" is not in the rendering node set, it is added to the initial processing subgraph corresponding to "Effect8". The next rendering node corresponding to "Effect9" in the initial processing subgraph is "Blend0". Since "Blend0" is in the rendering node set, the rendering processing subgraph corresponding to "Effect8" contains both "Effect8" and "Effect9".
[0089] S230. Based on the at least two rendering subgraphs, determine a target directed acyclic graph, and based on the target directed acyclic graph, determine at least one reference rendering link.
[0090] In this embodiment, the graph nodes of the target directed acyclic graph are the rendering processing subgraphs. Figure 5 This is a schematic diagram of a rendering processing sub-graph provided in one embodiment of the present invention. Figure 5 by Figure 2 For example, Figure 5 The dashed box in the image represents the rendering sub-image.
[0091] In one optional embodiment, determining at least one reference rendering link based on the target directed acyclic graph includes: traversing the target directed acyclic graph using a preset traversal algorithm to obtain at least one reference rendering link.
[0092] Specifically, the algorithm principle of the preset traversal algorithm corresponding to the reference rendering link is to treat each rendering subgraph as a whole or as a node, and traverse to obtain all feasible rendering links. Accordingly, the reference rendering link includes the rendering order corresponding to the rendering subgraph; specifically, the rendering order of two adjacent rendering nodes in the rendering subgraph is adjacent.
[0093] by Figure 5 For example, the rendering subgraphs corresponding to "Effect6" and "Effect8" are respectively designated as rendering subgraph A and rendering subgraph B. Assuming that in the reference rendering chain, the rendering order of rendering subgraph B is after the rendering order of rendering subgraph A, correspondingly, the rendering order of "Effect8" and "Effect9" in rendering subgraph B is after the rendering order of "TRS0" in rendering subgraph A.
[0094] S240. For each reference rendering link, obtain the amount of new texture in the texture space corresponding to at least one rendering processing node in the reference rendering link, and use the summation result corresponding to at least one new texture as the number of textures corresponding to the reference rendering link.
[0095] In this embodiment, S240 is the same as in the above embodiment. Figure 1 The S120 shown is the same or similar, and will not be described again in this embodiment.
[0096] Figure 6 This is a schematic diagram illustrating the number of textures in a reference rendering chain according to an embodiment of the present invention. Figure 6 by Figure 2 Taking the example where each rendering node in the process has a temporary texture size of zero. Specifically, Figure 6The circles and numbers in the diagram represent the rendering order of each rendering subgraph in the reference rendering chain. Different colored arrows indicate the texture space occupied by different rendering textures. Taking the rendering subgraph corresponding to the 0th rendering order as an example, when the current rendering node is "Effect0", the texture space corresponding to the black arrow is created in the texture space pool and bound to the output texture corresponding to "Effect0"; when the current rendering node is "Effect1", since there is no idle texture space in the texture space pool, the texture space corresponding to the red arrow is created in the texture space pool and bound to the output texture corresponding to "Effect1". The output texture corresponding to "1" is bound; before "Effect2" is used as the current rendering node, all texture spaces except the texture space bound to the output texture corresponding to "Effect1" are released, that is, the texture space corresponding to the black arrow is released. When the current rendering node is "Effect2", since there is an idle texture space corresponding to the black arrow in the texture space pool, the texture space corresponding to the black arrow is bound to the output texture corresponding to "Effect2"; before "Effect3" is used as the current rendering node, all texture spaces except the texture space bound to the output texture corresponding to "Effect2" are released, that is, the texture space corresponding to the red arrow is released. When the current rendering node is "Effect3", since there is an idle texture space corresponding to the red arrow in the texture space pool, the texture space corresponding to the red arrow is bound to the output texture corresponding to "Effect3", and so on.
[0097] Taking the rendering subgraph corresponding to the first rendering order as an example, after each rendering node in the rendering subgraph corresponding to the 0th rendering order has been traversed, there are idle texture spaces corresponding to the black arrows in the texture space pool. When the current rendering node is "Effect8", the texture space corresponding to the black arrow is bound to the output texture corresponding to "Effect8"; when the current rendering node is "Effect9", since there are no idle texture spaces in the texture space pool, the texture space corresponding to the green arrow is created in the texture space pool and bound to the output texture corresponding to "Effect9"; before "Effect6" in the rendering subgraph corresponding to the second rendering order is used as the current rendering node, all texture spaces except the texture space bound to the output texture corresponding to "Effect9" are released, that is, the texture space corresponding to the black arrow is released.
[0098] therefore Figure 6 The number of textures in the reference rendering chain shown is... Figure 6 The number of colors corresponding to the colored arrows is 4 in total.
[0099] S250. Determine a target rendering link from the at least one reference rendering link based on the number of textures corresponding to the at least one reference rendering link, and render the special effect based on the target rendering link.
[0100] The specific implementation of S250 in this embodiment is the same as that in the above embodiment. Figure 1 The S130 shown is the same or similar, and will not be described again in this embodiment.
[0101] The technical solution of this embodiment obtains at least two rendering subgraphs in an initial directed acyclic graph, determines a target directed acyclic graph based on the at least two rendering subgraphs, and determines at least one reference rendering link based on the target directed acyclic graph. The graph nodes of the target directed acyclic graph are rendering subgraphs, each containing at least one rendering node. The out-degree of the last rendering node in the rendering subgraph is not one, or the in-degree of the next rendering node corresponding to the last rendering node in the rendering subgraph in the initial directed acyclic graph is greater than one. This solves the problem of excessive data volume in the reference rendering link, reduces the computational load of filtering the target rendering link, and thus improves the execution efficiency of special effects rendering.
[0102] Figure 7 This is a schematic diagram of a special effects rendering device provided in one embodiment of the present invention. Figure 7 As shown, the device includes: an initial directed acyclic graph determination module 310, a texture quantity determination module 320, and a special effects rendering module 330.
[0103] The initial directed acyclic graph determination module 310 is used to determine the initial directed acyclic graph corresponding to the initial rendering link based on the initial rendering link of the special effect; wherein the initial directed acyclic graph includes the rendering processing nodes in the initial rendering link, and the rendering processing nodes in the initial rendering link correspond to the special effect rendering operation of the special effect.
[0104] The texture quantity determination module 320 is used to determine at least one reference rendering link and the texture quantity corresponding to the at least one reference rendering link based on the initial directed acyclic graph; wherein, the at least one reference rendering link includes rendering links with various texture quantities corresponding to the initial directed acyclic graph, and the texture quantity corresponding to the reference rendering link represents the minimum amount of texture space required during the execution of the reference rendering link.
[0105] The special effects rendering module 330 is used to determine a target rendering link from the at least one reference rendering link based on the number of textures corresponding to the at least one reference rendering link, and to render the special effects based on the target rendering link.
[0106] The technical solution of this embodiment abstracts the rendering chain of special effects into a directed acyclic graph (DAG). Based on the DAG, it determines at least one reference rendering chain corresponding to the special effects and the number of textures corresponding to the at least one reference rendering chain. Based on the number of textures corresponding to the at least one reference rendering chain, it determines the target rendering chain from the at least one reference rendering chain and renders the special effects based on the target rendering chain. This solves the problem of excessive memory consumption for special effects rendering caused by a single fixed rendering chain. From the perspective of optimizing the rendering chain of special effects rendering, it achieves the goal of allocating less texture space for special effects rendering, thereby helping to improve the stability of special effects rendering.
[0107] In an optional embodiment, the texture quantity determination module 320 includes:
[0108] A reference rendering link determination unit is used to determine at least one reference rendering link based on the initial directed acyclic graph.
[0109] A new texture quantity determination unit is added, which is used to obtain the new texture quantity of the texture space corresponding to at least one rendering processing node in the reference rendering link for each reference rendering link, and use the summation result corresponding to at least one new texture quantity as the texture quantity corresponding to the reference rendering link.
[0110] In an optional embodiment, a new texture amount determination unit is added, including:
[0111] The first current rendering processing node determination subunit is used to determine the first rendering processing node in the reference rendering chain as the current rendering processing node.
[0112] The texture usage acquisition subunit is used to acquire the texture usage corresponding to the current rendering processing node and the texture allocable amount corresponding to the texture space pool; wherein, the texture allocable amount represents the number of texture spaces in the idle state;
[0113] A new texture quantity determination subunit is added, which is used to take the difference between the texture usage and the texture allocability as the new texture quantity corresponding to the current rendering processing node when the texture usage is greater than the texture allocability.
[0114] The second current rendering processing node determination subunit is used to take the next rendering processing node corresponding to the current rendering processing node in the reference rendering chain as the current rendering processing node, and return to execute the step of obtaining the texture usage corresponding to the current rendering processing node until the current rendering processing node is the last special effects rendering node in the reference rendering chain.
[0115] In one optional embodiment, the texture usage acquisition subunit is specifically used for:
[0116] Obtain the amount of temporary texture corresponding to the current rendering node;
[0117] Based on the temporary texture amount, determine the texture usage corresponding to the current rendering processing node;
[0118] The temporary texture amount refers to the amount of texture space that the current rendering node needs to temporarily occupy during the rendering process.
[0119] In an optional embodiment, the device further includes:
[0120] The first reuse state update module is used to, before taking the next rendering processing node corresponding to the current rendering processing node in the reference rendering link as the current rendering processing node, when there is no associated rendering processing node corresponding to the current rendering processing node in the reference rendering link, obtain other texture spaces other than the texture space bound to the output texture of the current rendering processing node, and update the reuse state of the other texture spaces in the texture space pool from the bound state to the idle state.
[0121] When there is an associated rendering processing node in the reference rendering chain that corresponds to the current rendering processing node, obtain other texture spaces besides the texture spaces that are respectively bound to the input texture and output texture of the current rendering processing node, and update the reuse status of the other texture spaces in the texture space pool from the bound state to the idle state.
[0122] The associated rendering processing node refers to a rendering processing node in the reference rendering chain that is rendered after the current rendering processing node and shares the same input texture with the current rendering processing node.
[0123] In an optional embodiment, the device further includes:
[0124] The second reuse state update module is used to create an idle texture space in the texture space pool according to the newly added texture amount after obtaining the texture allocable amount corresponding to the texture space pool and when the texture usage is greater than the texture allocable amount.
[0125] Based on the texture usage, the texture space in the texture space pool is bound to the current rendering processing node.
[0126] Update the reuse state of the texture space in the texture space pool that is bound to the current rendering processing node from the space state to the binding state.
[0127] In one optional embodiment, the reference rendering link determination unit includes:
[0128] A rendering processing subgraph acquisition subunit is used to acquire at least two rendering processing subgraphs in the initial directed acyclic graph;
[0129] A reference rendering link determination subunit is used to determine a target directed acyclic graph based on the at least two rendering processing subgraphs, and to determine at least one reference rendering link based on the target directed acyclic graph.
[0130] Wherein, the graph nodes of the target directed acyclic graph are the rendering processing subgraphs, the rendering processing subgraphs contain at least one rendering processing node, the out-degree of the last rendering processing node in the rendering processing subgraph is not one, or the in-degree of the next rendering processing node in the initial directed acyclic graph corresponding to the last rendering processing node in the rendering processing subgraph is greater than one.
[0131] In one optional embodiment, the rendering process of the subgraph to obtain sub-units is specifically used for:
[0132] Obtain the set of rendering nodes corresponding to the initial directed acyclic graph; wherein the set of rendering nodes contains at least one target rendering processing node, and the in-degree of the target rendering processing node is not one or the out-degree of the previous rendering processing node corresponding to the target rendering processing node is not one.
[0133] For each target rendering processing node, the target rendering processing node is added to the initial processing subgraph, and the next rendering processing node corresponding to the last rendering processing node in the initial directed acyclic graph is obtained.
[0134] If the next rendering processing node is not in the set of rendering nodes, the next rendering processing node is added to the initial processing subgraph;
[0135] Return to the step of obtaining the next rendering processing node corresponding to the last rendering processing node in the initial processing subgraph of the initial directed acyclic graph, until the next rendering processing node is in the rendering node set, and use the initial processing subgraph as the rendering processing subgraph corresponding to the target rendering processing node.
[0136] The special effects rendering apparatus provided in the embodiments of the present invention can execute the special effects rendering method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0137] The following is for reference. Figure 8The diagram illustrates a structural schematic of an electronic device (e.g., a terminal device or a server) 400 suitable for implementing embodiments of the present invention. The terminal device in the embodiments of the present invention may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 8 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0138] like Figure 8 As shown, electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 401, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 402 or a program loaded from storage device 406 into random access memory (RAM) 403. RAM 403 also stores various programs and data required for the operation of electronic device 400. Processing device 401, ROM 402, and RAM 403 are interconnected via bus 404. Input / output (I / O) interface 405 is also connected to bus 404.
[0139] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 406 including, for example, magnetic tapes, hard disks, etc.; and communication devices 409. Communication device 409 allows electronic device 400 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 8 An electronic device 400 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0140] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 409, or installed from a storage device 406, or installed from a ROM 402. When the computer program is executed by the processing device 401, it performs the functions defined in the methods of the embodiments of the present invention.
[0141] It should be noted that the computer-readable medium described above in this invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, 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 thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0142] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0143] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0144] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: acquire at least two Internet Protocol (IP) addresses; send a node evaluation request including the at least two IP addresses to a node evaluation device, wherein the node evaluation device selects an IP address from the at least two IP addresses and returns it; and receive the IP address returned by the node evaluation device; wherein the acquired IP address indicates an edge node in a content delivery network.
[0145] Alternatively, the aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: receive a node evaluation request including at least two Internet Protocol (IP) addresses; select an IP address from the at least two IP addresses; and return the selected IP address; wherein the received IP address indicates an edge node in the content delivery network.
[0146] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0147] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0148] The units described in the embodiments of the present invention can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0149] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0150] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0151] According to one or more embodiments of the present invention, Example 1 provides a special effects rendering method, including:
[0152] Based on the initial rendering chain of the special effects, an initial directed acyclic graph corresponding to the initial rendering chain is determined; wherein, the initial directed acyclic graph contains the rendering processing nodes in the initial rendering chain, and the rendering processing nodes in the initial rendering chain correspond to the special effects rendering operations of the special effects.
[0153] Based on the initial directed acyclic graph, at least one reference rendering link and the number of textures corresponding to the at least one reference rendering link are determined; wherein, the at least one reference rendering link includes rendering links with various numbers of textures corresponding to the initial directed acyclic graph, and the number of textures corresponding to the reference rendering link represents the minimum amount of texture space required during the execution of the reference rendering link.
[0154] Based on the number of textures corresponding to the at least one reference rendering link, a target rendering link is determined from the at least one reference rendering link, and the special effect is rendered based on the target rendering link.
[0155] According to one or more embodiments of the present invention, Example 2, based on the method of Example 1, the step of determining at least one reference rendering link and the number of textures corresponding to the at least one reference rendering link based on the initial directed acyclic graph includes:
[0156] Based on the initial directed acyclic graph, at least one reference rendering link is determined;
[0157] For each reference rendering link, obtain the amount of new textures in the texture space corresponding to at least one rendering processing node in the reference rendering link, and use the summation result corresponding to at least one new texture amount as the number of textures corresponding to the reference rendering link.
[0158] According to one or more embodiments of the present invention, Example 3, based on the method described in Example 2, includes obtaining the amount of new texture in the texture space corresponding to at least one rendering processing node in the reference rendering chain, comprising:
[0159] The first rendering node in the reference rendering chain is taken as the current rendering node;
[0160] Obtain the texture usage corresponding to the current rendering node, and obtain the texture allocable amount corresponding to the texture space pool; wherein, the texture allocable amount represents the number of texture spaces in the idle state;
[0161] If the amount of texture used is greater than the amount of texture that can be allocated, the difference between the amount of texture used and the amount of texture that can be allocated is taken as the amount of new texture corresponding to the current rendering processing node.
[0162] Take the next rendering node in the reference rendering chain that corresponds to the current rendering node as the current rendering node, and return to execute the step of obtaining the texture usage corresponding to the current rendering node, until the current rendering node is the last special effects rendering node in the reference rendering chain.
[0163] According to one or more embodiments of the present invention, Example 4, based on the method described in Example 3, includes obtaining the texture usage corresponding to the current rendering processing node, which includes:
[0164] Obtain the amount of temporary texture corresponding to the current rendering node;
[0165] Based on the temporary texture amount, determine the texture usage corresponding to the current rendering processing node;
[0166] The temporary texture amount refers to the amount of texture space that the current rendering node needs to temporarily occupy during the rendering process.
[0167] According to one or more embodiments of the present invention, Example 5, based on the method described in Example 3, further includes, before designating the next rendering processing node in the reference rendering chain corresponding to the current rendering processing node as the current rendering processing node:
[0168] When there is no associated rendering processing node corresponding to the current rendering processing node in the reference rendering chain, obtain other texture spaces besides the texture space bound to the output texture of the current rendering processing node, and update the reuse status of the other texture spaces in the texture space pool from the bound state to the idle state.
[0169] When there is an associated rendering processing node in the reference rendering chain that corresponds to the current rendering processing node, obtain other texture spaces besides the texture spaces that are respectively bound to the input texture and output texture of the current rendering processing node, and update the reuse status of the other texture spaces in the texture space pool from the bound state to the idle state.
[0170] The associated rendering processing node refers to a rendering processing node in the reference rendering chain that is rendered after the current rendering processing node and shares the same input texture with the current rendering processing node.
[0171] According to one or more embodiments of the present invention, Example 6, based on the method described in Example 3, further includes, after obtaining the texture allocable amount corresponding to the texture space pool:
[0172] If the amount of texture used is greater than the amount of texture that can be allocated, an idle texture space is created in the texture space pool according to the amount of newly added texture.
[0173] Based on the texture usage, the texture space in the texture space pool is bound to the current rendering processing node.
[0174] Update the reuse state of the texture space in the texture space pool that is bound to the current rendering processing node from the space state to the binding state.
[0175] According to one or more embodiments of the present invention, Example 7 describes the method of Example 2, wherein determining at least one reference rendering link based on the initial directed acyclic graph includes:
[0176] Obtain at least two rendering subgraphs from the initial directed acyclic graph;
[0177] Based on the at least two rendering subgraphs, a target directed acyclic graph is determined, and based on the target directed acyclic graph, at least one reference rendering link is determined.
[0178] Wherein, the graph nodes of the target directed acyclic graph are the rendering processing subgraphs, the rendering processing subgraphs contain at least one rendering processing node, the out-degree of the last rendering processing node in the rendering processing subgraph is not one, or the in-degree of the next rendering processing node in the initial directed acyclic graph corresponding to the last rendering processing node in the rendering processing subgraph is greater than one.
[0179] According to one or more embodiments of the present invention, Example 8, based on the method described in Example 7, includes obtaining at least two rendering subgraphs in the initial directed acyclic graph, comprising:
[0180] Obtain the set of rendering nodes corresponding to the initial directed acyclic graph; wherein the set of rendering nodes contains at least one target rendering processing node, and the in-degree of the target rendering processing node is not one or the out-degree of the previous rendering processing node corresponding to the target rendering processing node is not one.
[0181] For each target rendering processing node, the target rendering processing node is added to the initial processing subgraph, and the next rendering processing node corresponding to the last rendering processing node in the initial directed acyclic graph is obtained.
[0182] If the next rendering processing node is not in the set of rendering nodes, the next rendering processing node is added to the initial processing subgraph;
[0183] Return to the step of obtaining the next rendering processing node corresponding to the last rendering processing node in the initial processing subgraph of the initial directed acyclic graph, until the next rendering processing node is in the rendering node set, and use the initial processing subgraph as the rendering processing subgraph corresponding to the target rendering processing node.
[0184] According to one or more embodiments of the present invention, Example 9 provides a special effects rendering apparatus, comprising:
[0185] The initial directed acyclic graph (DAG) determination module is used to determine the initial directed acyclic graph corresponding to the initial rendering link based on the initial rendering link of the special effect; wherein, the initial directed acyclic graph includes the rendering processing nodes in the initial rendering link, and the rendering processing nodes in the initial rendering link correspond to the special effect rendering operation of the special effect.
[0186] The texture quantity determination module is used to determine at least one reference rendering link and the texture quantity corresponding to the at least one reference rendering link based on the initial directed acyclic graph; wherein, the at least one reference rendering link includes rendering links with various texture quantities corresponding to the initial directed acyclic graph, and the texture quantity corresponding to the reference rendering link represents the minimum amount of texture space required during the execution of the reference rendering link.
[0187] The rendering module is used to determine a target rendering link from the at least one reference rendering link based on the number of textures corresponding to the at least one reference rendering link, and to render the special effect based on the target rendering link.
[0188] According to one or more embodiments of the present invention, Example 10 provides an electronic device, comprising:
[0189] At least one processor;
[0190] and a memory communicatively connected to the at least one processor;
[0191] The memory stores a computer program that can be executed by the at least one processor, which is then executed by the at least one processor to enable the at least one processor to perform any of the special effects rendering methods described in Examples 1-8.
[0192] According to one or more embodiments of the present invention, Example 11 provides a computer-readable storage medium storing computer operations for causing a processor to execute the special effects rendering method described in any one of Examples 1-8.
[0193] According to one or more embodiments of the present invention, Example 12 provides a computer program product including a computer program that, when executed by a processor, implements the special effects rendering method according to any one of Examples 1-8.
[0194] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this invention.
[0195] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a chained order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the invention. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0196] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method of special effect rendering, characterized by, The method comprises the following steps: determining an initial rendering link according to a special effect, and determining an initial directed acyclic graph corresponding to the initial rendering link; wherein the initial directed acyclic graph contains rendering processing nodes in the initial rendering link, and the rendering processing nodes in the initial rendering link correspond to special effect rendering operations of the special effect; determining at least one reference rendering link and a texture quantity corresponding to the at least one reference rendering link according to the initial directed acyclic graph; wherein the at least one reference rendering link comprises rendering links of the initial directed acyclic graph corresponding to various different texture quantities, and the texture quantity corresponding to the reference rendering link represents a minimum texture space quantity required to be occupied during execution of the reference rendering link; determining a target rendering link from the at least one reference rendering link according to the texture quantity corresponding to the at least one reference rendering link, and rendering the special effect according to the target rendering link.
2. The method of claim 1, wherein, The step of determining at least one reference rendering link and a texture quantity corresponding to the at least one reference rendering link according to the initial directed acyclic graph comprises: determining at least one reference rendering link according to the initial directed acyclic graph; for each reference rendering link, obtaining at least one added texture quantity of a texture space corresponding to at least one rendering processing node in the reference rendering link, and taking a sum result of the at least one added texture quantity as the texture quantity corresponding to the reference rendering link.
3. The method of claim 2, wherein, The step of obtaining at least one added texture quantity of a texture space corresponding to at least one rendering processing node in the reference rendering link comprises: taking a first rendering processing node in the reference rendering link as a current rendering processing node; obtaining a texture usage quantity corresponding to the current rendering processing node, and obtaining a texture allocatable quantity corresponding to a texture space pool; wherein the texture allocatable quantity represents a quantity of idle state texture spaces; in a case where the texture usage quantity is greater than the texture allocatable quantity, taking a difference quantity corresponding to the texture usage quantity and the texture allocatable quantity as an added texture quantity corresponding to the current rendering processing node; taking a next rendering processing node corresponding to the current rendering processing node in the reference rendering link as a current rendering processing node, returning to the step of obtaining the texture usage quantity corresponding to the current rendering processing node, until the current rendering processing node is a last special effect rendering node in the reference rendering link.
4. The method of claim 3, wherein, The step of obtaining the texture usage quantity corresponding to the current rendering processing node comprises: obtaining a temporary texture quantity corresponding to the current rendering processing node; determining the texture usage quantity corresponding to the current rendering processing node according to the temporary texture quantity; wherein the temporary texture quantity represents a quantity of texture spaces required to be temporarily occupied in a process of executing rendering processing by the current rendering processing node.
5. The method of claim 3, wherein, Before taking the next rendering processing node corresponding to the current rendering processing node in the reference rendering link as the current rendering processing node, the method further comprises: when there is no associated rendering processing node corresponding to the current rendering processing node in the reference rendering link, obtaining other texture space except the texture space bound with the output texture of the current rendering processing node, and updating the multiplexing state of the other texture space in the texture space pool from the bound state to the idle state; when there is no associated rendering processing node corresponding to the current rendering processing node in the reference rendering link, obtaining other texture space except the texture space bound with the output texture of the current rendering processing node, and updating the multiplexing state of the other texture space in the texture space pool from the bound state to the idle state; wherein the associated rendering processing node represents a rendering processing node in the reference rendering link, which is located after the current rendering processing node in the rendering order and shares the same input texture with the current rendering processing node.
6. The method of claim 3, wherein, After obtaining the texture allocatable amount corresponding to the texture space pool, the method further comprises: in the case that the texture usage amount is greater than the texture allocatable amount, creating the texture space in the idle state in the texture space pool according to the new texture amount; binding the texture space in the space state in the texture space pool with the current rendering processing node according to the texture usage amount; updating the multiplexing state of the texture space bound with the current rendering processing node in the texture space pool from the space state to the bound state.
7. The method of claim 2, wherein, The method further comprises: obtaining at least two rendering processing subgraphs in the initial directed acyclic graph; determining a target directed acyclic graph according to the at least two rendering processing subgraphs, and determining at least one reference rendering link according to the target directed acyclic graph; wherein the graph node of the target directed acyclic graph is the rendering processing subgraph, the rendering processing subgraph contains at least one rendering processing node, and the out-degree of the last rendering processing node in the rendering processing subgraph is not one or the in-degree of the next rendering processing node corresponding to the last rendering processing node in the rendering processing subgraph in the initial directed acyclic graph is greater than one.
8. The method of claim 7, wherein, The method further comprises: obtaining a rendering node set corresponding to the initial directed acyclic graph; wherein the rendering node set contains at least one target rendering processing node, the in-degree of the target rendering processing node is not one, or the out-degree of the previous rendering processing node corresponding to the target rendering processing node is not one; for each target rendering processing node, adding the target rendering processing node to an initial processing subgraph, and obtaining the next rendering processing node corresponding to the last rendering processing node in the initial processing subgraph in the initial directed acyclic graph; in the case that the next rendering processing node is not in the rendering node set, adding the next rendering processing node to the initial processing subgraph; When the next rendering processing node is in the rendering node set, the initial processing subgraph is taken as a rendering processing subgraph corresponding to the target rendering processing node.
9. A special effect rendering apparatus characterized by comprising: Comprise: An initial directed acyclic graph determination module is configured to determine an initial directed acyclic graph corresponding to an initial rendering link of a special effect effect according to the initial rendering link; wherein the initial directed acyclic graph contains rendering processing nodes in the initial rendering link, and the rendering processing nodes in the initial rendering link correspond to special effect rendering operations of the special effect effect; A texture number determination module is configured to determine at least one reference rendering link and a texture number corresponding to the at least one reference rendering link according to the initial directed acyclic graph; wherein the at least one reference rendering link includes rendering links of the initial directed acyclic graph corresponding to various different texture numbers, and the texture number corresponding to the reference rendering link represents the number of the least texture space required in the execution process of the reference rendering link; A special effect effect rendering module is configured to determine a target rendering link from the at least one reference rendering link according to the texture number corresponding to the at least one reference rendering link, and render the special effect effect according to the target rendering link.
10. An electronic device, comprising: The electronic device comprises: At least one processor; and The memory is in communication connection with the at least one processor; wherein The memory stores a computer program which can be executed by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the special effect rendering method in any one of claims 1-8.
11. A computer readable storage medium, characterized in that, The computer readable storage medium stores computer instructions, and the computer instructions are used to enable the processor to execute the special effect rendering method in any one of claims 1-8 when executed.
12. A computer program product comprising a computer program which, when executed by a processor, implements the special effect rendering method according to any one of claims 1-8.