A material rendering method and apparatus
By finding, updating, and adjusting materials with the same identifier but different content or location in the material list, the resource consumption of the material rendering process is reduced, achieving efficient material list updating and rendering.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-03
- Publication Date
- 2026-03-31
AI Technical Summary
In existing technologies, after each selection of a material list, the electronic device needs to render all the materials contained in the selected material list, resulting in high processing resource consumption.
The process involves searching for materials in the second material list that have the same material identifier as those in the first material list. If no material is found, it is removed and rendering is stopped. If a material is found, its content is updated to be different or its position is adjusted and then rendered, until the first material list and the second material list are the same.
This reduces the consumption of processing resources during the material rendering process. Only the adjusted materials are rendered, and other already rendered materials are not rendered again. The result is the same as directly rendering the second material list.
Smart Images

Figure CN115292525B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method and apparatus for rendering materials. Background Technology
[0002] Adding images, music, stickers, filters, and other materials to multimedia objects such as videos or images enables editing of these objects. The materials used during editing can be recorded in a material list, and electronic devices can edit multimedia objects by rendering the materials included in the material list.
[0003] During the editing process of multimedia objects, the media in the media list can be added, deleted, modified, or replaced, thus updating the media list. Existing technology can record the media list obtained after each update, allowing users to select from the recorded list. The electronic device can then render the media selected by the user, enabling the editing of the multimedia object.
[0004] However, if the electronic device needs to render all the materials in the selected material list every time a material list is selected, it will consume a lot of processing resources. Summary of the Invention
[0005] The purpose of this invention is to provide a material rendering method and apparatus to reduce the consumption of processing resources during the material rendering process. The specific technical solution is as follows:
[0006] In a first aspect, embodiments of the present invention provide a material rendering method, the method comprising:
[0007] The second material is located in the second material list, and the material identifier of the second material is the same as the material identifier of the first material in the first material list. The initial first material is located at the beginning of the first material list, and the materials in the first material list have been rendered.
[0008] If no second material is found, the first material is removed from the list of first materials and rendering of the first material is canceled. If there is a material after the first material, the next material after the first material is taken as the new first material, and the process returns to the step of finding the second material.
[0009] If a second material is found, and the content of the first material is different from that of the second material, the first material is updated to the second material, the rendering of the first material is stopped, and the second material is rendered. If the first order and the second order are different, the third material is inserted into the first order position in the first material list, and the third material is rendered. The first order is the order of the first material in the first material list before the third material is inserted. The second order is the order of the second material in the second material list. The third material is the material located in the first order position in the second material list.
[0010] If there is a material in the first material list that is after the first order, take the material in the first material list that is in the next order after the first order as the new first material, and return to the step of finding the second material;
[0011] If there are no materials in the first material list that are after the first order, and the total number of materials in the first material list is less than the total number of materials in the second material list, then add the material in the second material list that is after the current first order to the last material in the first material list, and render the material added to the first material list.
[0012] Secondly, embodiments of the present invention provide a material rendering apparatus, the apparatus comprising:
[0013] The material search module is used to find the second material, which is located in the second material list and has the same material identifier as the first material in the first material list. The initial first material is located at the beginning of the first material list, and the materials in the first material list have been rendered.
[0014] The material removal module is used to remove the first material from the first material list and cancel the rendering of the first material if the material search module does not find the second material. If there is a material after the first material, the next material of the first material is used as the new first material, and the execution of the material search module is triggered.
[0015] The first material rendering module is used to update the first material to the second material if the content of the first material is different from the content of the second material, de-render the first material, and render the second material if the first order is different from the second order. Furthermore, if the first order is different from the second order, the third material is inserted into the first order position in the first material list and rendered. The first order is the order of the first material in the first material list before inserting the third material; the second order is the order of the second material in the second material list; and the third material is the material located in the first order position in the second material list.
[0016] The material update module is used to, if there is a material in the first material list that is located after the first order, take the material in the first material list that is located in the next order after the first order as the new first material, and return to trigger the execution of the material search module;
[0017] The second material rendering module is used to add the material in the second material list that is currently in the first order to the last material in the first material list if there is no material in the first material list after the first order and the total number of materials in the first material list is less than the total number of materials in the second material list, and then render the material added to the first material list.
[0018] Thirdly, embodiments of the present invention provide an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0019] Memory, used to store computer programs;
[0020] The processor, when executing a program stored in memory, implements the above-mentioned methods and steps for rendering the material.
[0021] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-described method steps for rendering source material.
[0022] Fifthly, embodiments of the present invention also provide a computer program product containing instructions that, when run on a computer, cause the computer to perform the above-described material rendering method steps.
[0023] Beneficial effects of the embodiments of the present invention:
[0024] In the solution provided by this embodiment of the invention, there exists a first material list containing materials that have already been rendered. When it is necessary to render materials contained in a second material list based on the first material list, the second material is first searched in the second material list. If the second material is not found, it means that the first material no longer needs to be rendered, and the first material can be deleted from the first material list, and rendering of the first material is canceled. If the second material is found, and the content of the first material is different from the content of the second material, the first material is updated to the second material, rendering of the first material is canceled, and then the second material is rendered. Furthermore, if the first order is different from the second order, it means that the material in the second material list that is the same as the first material is not located at the first order position. The third material at the first order position in the second material list can be inserted into the first order position in the first material list, thereby ensuring that the materials at the first order position in the first and second material lists are the same, and the third material is rendered. The above process is repeated, and if there are no materials in the first material list that are after the first order position, the materials in the second material list that are after the first order position are added to the first material list, and the materials in the first material list are rendered.
[0025] In the above process, by comparing the first material list and the second material list, the first material list is updated to be the same as the second material list. During the comparison, materials in the first material list that differ from those in the second material list are adjusted. These adjustments include deleting or updating materials in the first material list or inserting materials into the first material list. The adjusted materials are then rendered, while the unadjusted materials were already rendered. Therefore, the rendering result after the material list comparison is completed is the same as rendering all materials directly in the second material list. Furthermore, only the adjusted materials are rendered during this process; other materials are not re-rendered. Therefore, compared to directly rendering all materials in the second material list, this embodiment of the invention can reduce the processing resources consumed in the material rendering process. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 This is a schematic diagram of the structure of the first type of material list provided in an embodiment of the present invention;
[0028] Figure 2A flowchart illustrating the first material rendering method provided in an embodiment of the present invention;
[0029] Figure 3 This is a schematic diagram of the structure of the second type of material list provided in an embodiment of the present invention;
[0030] Figure 4 This is a flowchart illustrating the second material rendering method provided in an embodiment of the present invention;
[0031] Figure 5A This is a schematic diagram of the first type of material rendering process provided in an embodiment of the present invention;
[0032] Figure 5B This is a schematic diagram of the second type of material rendering process provided in an embodiment of the present invention;
[0033] Figure 5C This is a schematic diagram of the third type of material rendering process provided in an embodiment of the present invention;
[0034] Figure 5D This is a schematic diagram of the fourth type of material rendering process provided in an embodiment of the present invention;
[0035] Figure 5E This is a schematic diagram of the fifth type of material rendering process provided in an embodiment of the present invention;
[0036] Figure 5F This is a schematic diagram of the sixth type of material rendering process provided in an embodiment of the present invention;
[0037] Figure 5G This is a schematic diagram of the seventh type of material rendering process provided in an embodiment of the present invention;
[0038] Figure 5H This is a schematic diagram of the rendering process for the eighth type of material provided in an embodiment of the present invention;
[0039] Figure 5I This is a schematic diagram of the rendering process of the ninth type of material provided in an embodiment of the present invention;
[0040] Figure 5J This is a schematic diagram of the rendering process for the tenth type of material provided in an embodiment of the present invention;
[0041] Figure 5K This is a schematic diagram of the eleventh type of material rendering process provided in an embodiment of the present invention;
[0042] Figure 5L This is a schematic diagram of the eleventh type of material rendering process provided in an embodiment of the present invention;
[0043] Figure 6 A flowchart illustrating the third material rendering method provided in this embodiment of the invention;
[0044] Figure 7 A flowchart illustrating the fourth material rendering method provided in this embodiment of the invention;
[0045] Figure 8 A flowchart illustrating the fifth material rendering method provided in this embodiment of the invention;
[0046] Figure 9 This is a schematic diagram of the structure of a material rendering device provided in an embodiment of the present invention;
[0047] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0048] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0049] In the process of rendering materials using existing technologies, there is a problem of excessive consumption of processing resources. In order to solve the above problem, this invention provides a material rendering method and apparatus.
[0050] This invention provides a material rendering method, the method comprising:
[0051] The second material is located in the second material list, and the material identifier of the second material is the same as the material identifier of the first material in the first material list. The initial first material is located at the beginning of the first material list, and the materials in the first material list have been rendered.
[0052] If no second material is found, the first material is removed from the list of first materials and rendering of the first material is canceled. If there is a material after the first material, the next material after the first material is taken as the new first material, and the process of finding the second material is returned.
[0053] If a second material is found, and the content of the first material is different from that of the second material, the first material is updated to the second material, the rendering of the first material is stopped, and the second material is rendered. If the first order and the second order are different, the third material is inserted into the first order position in the first material list, and the third material is rendered. The first order refers to the order of the first material in the first material list before the third material is inserted. The second order refers to the order of the second material in the second material list. The third material is the material located in the first order position in the second material list.
[0054] If there is a material in the first material list that is after the first order, take the material in the first material list that is in the next order after the first order as the new first material, and return to execute the above steps to find the second material;
[0055] If there are no materials in the first material list that are after the first order, and the total number of materials in the first material list is less than the total number of materials in the second material list, then add the material in the second material list that is after the current first order to the last material in the first material list, and render the material added to the first material list.
[0056] As can be seen from the above, in the process described, by comparing the first material list and the second material list, the first material list is updated to be the same as the second material list. Furthermore, during the comparison, materials in the first material list that differ from those in the second material list are adjusted. These adjustments include deleting or updating materials in the first material list or inserting materials into the first material list. The adjusted materials are then rendered, while the other unadjusted materials have already been rendered. Therefore, the rendering result after the material list comparison is completed is the same as the result of directly rendering all materials contained in the second material list. Moreover, only the adjusted materials are rendered during this process; other materials are not re-rendered. Therefore, compared to directly rendering all materials in the second material list, this embodiment of the invention can reduce the processing resources consumed in the material rendering process.
[0057] First, a description of the list of materials in the existing technology is provided; see [link to relevant documentation]. Figure 1 This is a schematic diagram of the structure of the first material list provided in an embodiment of the present invention.
[0058] Figure 1 The example shown includes two material lists, material list O and material list P.
[0059] The resource list O contains resource 1, resource 2, resource 3, resource 4, resource 5, resource 6... resource n, and the resource list P contains resource 1, resource 7, resource 5, resource 2, resource 6, resource 4, resource 8... resource m. Resource list O contains n resources, and resource list P contains m resources.
[0060] In this list, the materials in material list O have been rendered, and material list P is the list of materials that need to be rendered.
[0061] The following describes the process of rendering materials in the embodiments of the present invention.
[0062] See Figure 2This is a flowchart illustrating the first material rendering method provided in an embodiment of the present invention. The method includes the following steps S201-S205.
[0063] S201: Find the second material.
[0064] The second material is located in the second material list, and the material identifier of the second material is the same as the material identifier of the first material in the first material list. The initial first material is located at the beginning of the first material list, and the materials in the first material list have been rendered.
[0065] The second resource list is the list of resources currently to be rendered.
[0066] Specifically, the above list of materials includes music, videos, images, stickers, filters, and other materials.
[0067] See Figure 3 This is a structural diagram of the second type of material list provided in an embodiment of the present invention.
[0068] As shown in the image, the list of materials contains materials 1 through n. Specifically, material 1 is music M1, material 2 is video V1, material 3 is image P1, material 4 is music M2, material 5 is filter F1, material 6 is image P2, and material n is video Vm.
[0069] If the second material is not found, proceed to step S202; if the second material is found, proceed to step S203.
[0070] In one embodiment of the present invention, the second material list can be traversed, and a material with the same material identifier as the first material can be found in the second material list based on the material identifier of the current first material, and used as the second material.
[0071] In another embodiment of the present invention, it can also be described below. Figure 6 The step S201A shown above implements the above step S201, which will not be described in detail here.
[0072] S202: Remove the first material from the first material list and unrender the first material. If there is a material following the first material, then the next material after the first material will be used as the new first material.
[0073] Specifically, since the second material list does not contain a second material (meaning it does not contain a material with the same material identifier as the first material), there is no need to render the first material. Therefore, the first material can be removed from the first material list, and rendering of the first material can be stopped. Furthermore, after the first material is removed, other materials that were originally after the removed first material in the first material list can be shifted one position forward. If there are materials that are after the first material, the next material that was originally after the removed first material will be used as the new first material, and the process will return to step S201 to begin processing the next material.
[0074] However, if there is no material following the first material, it means that the processing of all materials in the first material list has been completed, and step S205 is executed.
[0075] S203: If the content of the first material is different from the content of the second material, update the first material to the second material, unrender the first material, and render the second material. If the first order is different from the second order, insert the third material into the first order position in the list of first materials and render the third material.
[0076] The first order refers to the order of the first material in the first material list before the third material is inserted. The second order refers to the order of the second material in the second material list. The third material refers to the material in the second material list that is located in the first order.
[0077] Specifically, when the second material is found, by comparing the configuration information of the first and second materials, it can be determined whether their contents are the same. The configuration information represents the material's configuration. If the configuration information of the first and second materials is the same, it can be determined that not only are their material identifiers the same, but their contents are also the same, thus confirming that the first and second materials are identical. However, if the configuration information of the first and second materials is different, it can be determined that although their material identifiers are the same, their contents are different. In this case, the first material in the first material list can be updated to the second material in the second material list, making the first material in the first material list and the second material in the second material list identical.
[0078] For example, if both media lists contain image R as media, and image R has the same media identifier in both lists, but the configured size or rotation angle of image R differs between the two lists, then the content of the two media will be different. Similarly, if both media lists contain video V as media, and video V has the same identifier in both lists, but the configured playback speed of video V differs between the two lists, then the content of the two media will be different.
[0079] After the first asset is updated, the original first asset in the first asset list no longer needs to be rendered, so rendering of the first asset can be deactivated. The second asset, which was originally in the second asset list, needs to be rendered, which means rendering the updated first asset to ensure consistency between the rendered asset and the assets in the second asset list. After rendering the updated first asset, the rendering result can be displayed on the monitor of the electronic device.
[0080] Furthermore, if the first and second sequences are different, it means that although the first material in the first material list is the same as the second material in the second material list, their positions in the two lists are different. In other words, the third material in the second material list at the first sequence position is different from the first material. Therefore, rendering the first material will produce a different rendering result than rendering the third material in the second material list. To address this, the third material can be inserted into the first sequence position of the first material list, and the updated third material can be rendered to make the materials in the first sequence positions of the first and second material lists identical. This will ensure that the rendering result matches the second material list to be rendered. After rendering the third material, the rendering result can be displayed on the monitor of the electronic device.
[0081] For details on how to insert the third material into the first material list, please refer to the following text. Figure 4 The steps S203A-S203C shown are implemented, and will not be described in detail here.
[0082] Furthermore, if the first and second sequences are the same, it means that the first material in the first material list is the same as the second material in the second material list, and the two materials are also in the same position in the two material lists. Therefore, the rendering result obtained by rendering the first material in the first material list is the same as the rendering result obtained by rendering the second material in the second material list, and no processing is required for the first material.
[0083] Then, if there is a material in the first material list that is located after the first sequence, then step S204 is executed; otherwise, step S205 is executed.
[0084] S204: Take the material located in the next order after the first order in the above first material list as the new first material.
[0085] Each execution of S201-S203 compares one material from the first material list and the second material list, ensuring that the material at the first sequence point in both lists is identical, and rendering of the material at the first sequence point is completed. If there are other materials in the first material list that are located after the first sequence point, step S204 can be executed to take the material at the next sequence point as the new first material, return to step S201, and continue the process of comparing and rendering materials for the next time.
[0086] Specifically, after the new first material is determined, the first order is updated to the order of the new first material in the first material list, that is, the first order is 1 more than the original first order.
[0087] In addition, if there are no other materials in the first material list after the first sequence, it means that the processing of each material in the first material list has been completed, and step S205 continues.
[0088] S205: If the total number of materials in the first material list is less than the total number of materials in the second material list, then add the material in the second material list that is after the current first order to the last material in the first material list, and render the material added to the first material list.
[0089] After repeatedly executing steps S201-S204, if the total number of materials contained in the first material list and the second material list is the same, then the first material list and the second material list are identical, and the process can end without executing step S205. However, if the total number of materials contained in the first material list is less than the total number of materials contained in the second material list, it means that the second material list still contains some materials that are not contained in the first material list. Therefore, these materials from the second material list need to be added to the first material list.
[0090] Specifically, the current first order is the order of the last material in the first material list. For example, if the last material in the first material list is the seventh material in the first material list, then the material in the second material list that is after the seventh material will be added after the seventh material in the first material list.
[0091] Furthermore, the order in which the materials added to the first material list are arranged is the same as the order in which they are arranged in the second material list. This ensures that the first and second material lists are identical after adding materials. After adding materials to the first material list, rendering those materials will display the rendering result on the electronic device's screen. Since the first and second material lists are identical after adding these materials, it can be determined that the rendering result for the first material list is the same as the rendering result for the second material list, therefore, there is no need to re-render the second material list.
[0092] As can be seen from the above, in the process described, by comparing the first material list and the second material list, the first material list is updated to be the same as the second material list. Furthermore, during the comparison, materials in the first material list that differ from those in the second material list are adjusted. These adjustments include deleting or updating materials in the first material list or inserting materials into the first material list. The adjusted materials are then rendered, while the other unadjusted materials have already been rendered. Therefore, the rendering result after the material list comparison is completed is the same as the result of directly rendering all materials contained in the second material list. Moreover, only the adjusted materials are rendered during this process; other materials are not re-rendered. Therefore, compared to directly rendering all materials in the second material list, this embodiment of the invention can reduce the processing resources consumed in the material rendering process.
[0093] Specifically, the material rendering process in this embodiment of the invention can be divided into two different processes: a material list comparison process, which involves adjusting the materials in the first material list so that the first material list is identical to the second material list after comparison; and a process of rendering the adjusted materials in the first material list. Existing technologies also employ methods for comparing material lists; the following section will focus on... Figure 1 Taking the comparison of material list O and material list P as an example, this describes the material list comparison process in the prior art. The material list comparison process in the prior art consists of two stages.
[0094] Phase 1:
[0095] Take the material at the very beginning of the material list O as the material to be compared, and the index of the current material K is i; search for the material in the material list P whose material identifier is the same as that of material K, that is, search for material K in the material list P; if the material can be found, record the index of the found material in the material list P as j; determine whether the content of material K and the found material is the same, if they are different, update material K in the material list O to the found material.
[0096] Determine if index j and index i are the same. If they are different, move material K from the position corresponding to index i to the position corresponding to index j in material list O, so that the material at the position corresponding to index j in material list O and material list P are the same. If they are the same, it means that material K is located at index i in both material list O and material list P, and there is no need to move material K.
[0097] If the material K is not found in the material list P, then delete the material K from the material list O.
[0098] Continue to use the next material in the material list O that was originally after material K as the new material K, and repeat the above process until there are no uncompared materials in the material list O.
[0099] In theory, in the first stage mentioned above, taking the case with the most comparisons as the calculation method, each material in material list O needs to be compared with each material in material list P once, which would require a total of n×m comparisons.
[0100] Phase Two:
[0101] The material at the very beginning of the material list P is taken as the material to be compared, and the index of the current material J is l;
[0102] Search for the material in material list O whose identifier is the same as that of material J, that is, search for material J in material list O;
[0103] If the material can be found, then the next material in the material list P that was originally after material J will be used as the new material J, and the above process will be repeated.
[0104] If the material is not found in the material list O, insert material J at the position corresponding to index l in the material list O, and continue to use the next material in the material list P that was originally after material J as the new material J, and repeat the above process.
[0105] In theory, in the second stage, taking the case with the most comparisons, each material in material list P needs to be compared with each material in material list O once, which requires a total of n×m comparisons.
[0106] After comparing the material lists in the two stages described above, material list O is the same as material list P.
[0107] Combining the two stages mentioned above, a total of 2×n×m comparisons are required during the process of comparing the material lists.
[0108] In this embodiment of the invention, it is not necessary to compare each material in the second material list with each material in the first material list individually. That is, this embodiment differs from the first stage of the prior art and does not require a second stage. Therefore, compared to the prior art, this embodiment can save half the number of comparisons. If there are n materials in the first material list and m materials in the second material list, then comparing the material lists using this embodiment requires a maximum of n×m comparisons. Compared to the prior art, the number of material comparisons is significantly reduced, and the processing resources required for material rendering are also saved during the material list comparison process.
[0109] See Figure 4 This is a flowchart illustrating the second material rendering method provided in this embodiment of the invention, which is consistent with the aforementioned... Figure 2 Compared to the embodiment shown, step S203 can be implemented by the following steps S203A-S203C.
[0110] S203A: If the content of the first material is different from the content of the second material, update the first material to the second material, unrender the first material, and render the second material. If the first order is different from the second order, determine whether there is a fourth material in the list of the first materials whose material identifier is the same as the material identifier of the third material.
[0111] Specifically, in order to ensure that the materials in the first material list are consistent with those in the second material list, the first material list needs to be adjusted so that the material in the first position of the adjusted first material list is the third material.
[0112] Therefore, it is first necessary to determine whether there exists a fourth material in the first material list that has the same material identifier as the third material. Specifically, we can iterate through the first material list and, based on the current material identifier of the third material, search for a material in the first material list whose identifier is the same as that of the third material, and use it as the fourth material.
[0113] If the aforementioned fourth material exists, proceed to step S203B; if the aforementioned fourth material does not exist, proceed to step S203C.
[0114] S203B: If the content of the third material is different from the content of the fourth material, update the fourth material to the third material. If the fourth order is different from the first order mentioned above, move the third material to the first order position in the first material list mentioned above and render the third material.
[0115] The fourth order mentioned above refers to the order of the fourth material in the first material list mentioned above.
[0116] Specifically, when the fourth material is found, by comparing the configuration information of the third and fourth materials, it can be determined whether their contents are the same. The configuration information represents the material's configuration. If the configuration information of the third and fourth materials is the same, it can be determined that not only are their material identifiers the same, but their contents are also the same, thus confirming that the third and fourth materials are identical. However, if the configuration information of the third and fourth materials is different, it can be determined that although their material identifiers are the same, their contents are different. In this case, the fourth material in the first material list can be updated to the third material in the second material list, making the fourth material in the first material list identical to the third material in the second material list.
[0117] After the fourth material is updated, the original fourth material in the first material list no longer needs to be rendered, so rendering of the fourth material can be stopped. The third material, which was originally in the second material list, needs to be rendered, so the third material needs to be rendered, which means rendering the updated fourth material, to ensure that the rendered material is consistent with the material in the second material list to be rendered. After rendering the third material, the rendering result can be displayed on the monitor of the electronic device.
[0118] Furthermore, although the fourth material in the current first material list is the same as the third material in the second material list, their positions in the two material lists may differ. Therefore, rendering the fourth material will produce a different rendering result than rendering the third material in the second material list. To address this, the fourth material can be moved and inserted into the first position of the first material list, making the materials in the first position identical to those in the second material list. This ensures the rendering result matches the second material list to be rendered. Then, step S204 is executed.
[0119] Furthermore, after moving and inserting the fourth material into the first position, each material originally located in the first to fourth positions of the first material list is shifted one position to the right.
[0120] S203C: Insert the third material mentioned above at the first position in the first material list above, and render the third material.
[0121] Specifically, if there is no fourth material with the same material identifier as the third material in the first material list, the third material can be inserted into the first position in the first material list and rendered so that the materials in the first position in both the first and second material lists are the third material, and step S204 can be continued.
[0122] In addition, after inserting the third material at the first position in the first material list, the materials originally located at the first position in the first material list, as well as the materials located after the first position, are shifted one position to the right.
[0123] As can be seen from the above, if a fourth material exists in the first material list, it can be adjusted so that the material at the first position in the first material list is the same as the material at the first position in the second material list. If a fourth material does not exist in the first material list, a third material can be inserted into the first position of the first material list, similarly making the material at the first position in the first material list the same as the material at the first position in the second material list. Therefore, the rendering result obtained by rendering the material at the first position in the first material list is equivalent to the rendering result obtained by rendering the material at the first position in the second material list.
[0124] The following is based on Figures 5A-5L The illustrated embodiment is used as an example to describe the material rendering process in this embodiment of the invention.
[0125] See Figure 5A This is a schematic diagram of the first material rendering process provided in an embodiment of the present invention.
[0126] As shown in the diagram, material list M contains material 1, material 2, material 3, material 4, material 5, and material 6 in sequential order, while material list N contains material 1, material 7, material 5, material 2, material 6, material 4, and material 8 in sequential order. Material lists M and N are the material lists being compared, with material list M serving as the first material list and material list N as the second material list. Materials with the same number in both material lists have the same material identifier. Specifically, material 1 in material list M has the same material identifier as material 1 in material list N; material 2 in material list M has the same material identifier as material 2 in material list N; material 4 in material list M has the same material identifier as material 4 in material list N; material 5 in material list M has the same material identifier as material 5 in material list N; and material 6 in material list M has the same material identifier as material 6 in material list N. Furthermore, in this embodiment, it is assumed that the content of materials with the same material identifier in material lists M and N is the same. Figure 5A The material list shown will then begin the material list comparison process according to this embodiment of the invention.
[0127] See Figure 5B This is a schematic diagram of the second type of material rendering process provided in an embodiment of the present invention. Figure 5ABased on the material list M and material list N shown above, perform step S201 as described above, taking material 1 in material list M as the first material, and searching for the second material in material list N that has the same material identifier as material 1. Figure 5B The arrow in the diagram indicates that the second material, i.e., material 1, has been found in material list N. Continuing with step S203 as described earlier, the content of material 1 in the first material list is compared with the content of material 1 in the second material list. It is also determined whether the first order of material 1 in material list M is the same as the second order. As shown in the diagram, the first and second orders are the same. Therefore, step S204 as described earlier is executed, and the material located at the next order after the current first order, i.e., material 2, is taken as the new first material. At this point, the identifiers of the materials at the very beginning in material list M and material list N are the same.
[0128] See Figure 5C This is a schematic diagram of the third type of material rendering process provided in an embodiment of the present invention. Figure 5B Based on the material list M and material list N shown above, perform step S201 as described above, taking material 2 in material list M as the first material, and searching for the second material in material list N that has the same material identifier as material 2. Figure 5B The arrow indicates that the second material, i.e., material 2, has been found in material list N. Continuing with step S203 as described earlier, it is determined whether the content of material 2 in the first material list is the same as that in the second material list, and whether the first order of material 2 in material list M is the same as the second order of material 2 in material list N. As shown in the diagram, the first and second orders are different. Therefore, material 7, located in the first order in material list N, is taken as the third material, and the process continues. Figure 4 The specific execution process of the illustrated embodiment can be found in the following description. Figure 5D .
[0129] See Figure 5D This is a schematic diagram of the fourth type of material rendering process provided in an embodiment of the present invention. Figure 5C Based on the material lists M and N shown above, step S203A is executed, which searches for a fourth material in material list M that has the same material identifier as material 7. As shown in the figure, no fourth material is found in material list M, so step S203C is executed. The specific execution process can be found in the following text. Figure 5E .
[0130] See Figure 5E This is a schematic diagram of the fifth type of material rendering process provided in an embodiment of the present invention. Figure 5DBased on the shown material lists M and N, perform step S203C as described above, inserting the third material, namely material 7, at the first position in material list M. As shown in the figure, material 7 is inserted into material list M, and the inserted material 7 is rendered. Materials 2 through 6 are then shifted one position to the right. At this point, the material identifiers of the first two materials in material lists M and N are the same.
[0131] Next, proceed to step S204, taking the material located at the next sequence after the current first sequence, i.e., material 2, as the first material, and continue to step S201, taking material 2 in material list M as the first material, and searching in material list N for the second material with the same material identifier as material 2. Figure 5E The arrow indicates that the second material, i.e., material 2, has been found in material list N. Continue with step S203 as described above, determining whether the content of the first material is the same as the content of the second material, and whether the first order of material 2 in material list M is the same as the second order of material 2 in material list N. As shown in the diagram, the first and second orders are different. Therefore, material 5, which has the first order in material list N, is taken as the third material, and step S203A is continued. The specific execution process can be found in the following text. Figure 5F .
[0132] See Figure 5F This is a schematic diagram of the sixth type of material rendering process provided in an embodiment of the present invention. Figure 5E Based on the material lists M and N shown above, step S203A is executed to search for the fourth material in material list M that has the same material identifier as material 5. As shown in the figure, the fourth material, i.e., material 5, is found in material list M. Then, step S203B is executed to determine whether the content of material 5 in material list M is the same as that of material 5 in material list N, and whether the fourth order of material 5 in material list M is the same as the first order of material 5 in material list N. As shown in the figure, the fourth order of material 5 in material list M is different from the first order. The specific execution process can be found in the following text. Figure 5G .
[0133] See Figure 5G This is a schematic diagram of the seventh type of material rendering process provided in an embodiment of the present invention. Figure 5F Based on the material lists M and N shown, perform step S203B as described above, move material 5 and insert it into the first position of material list M, and render material 5. Materials 2, 3, and 4 are shifted one position to the right in material list M. At this point, the identifiers of the first three materials in material lists M and N are the same.
[0134] Next, proceed to step S204, taking the material located at the next sequence after the current first sequence, i.e., material 2, as the first material, and continue to step S201, taking material 2 in material list M as the first material, and searching in material list N for the second material with the same material identifier as material 2. Figure 5G The arrow in the diagram indicates that the second material, i.e., material 2, has been found in material list N. It is then determined whether the first order of material 2 in material list M is the same as the second order of material 2 in material list N. As shown in the diagram, the first and second orders are the same. At this point, the identifiers of the first four materials in material lists M and N are identical. Step S204 is then executed, and material 3, located in the next order after the current first order, is designated as the first material, and step S201 is continued. The specific execution process can be found in the following text. Figure 5H .
[0135] See Figure 5H This is a schematic diagram of the rendering process of the eighth type of material provided in an embodiment of the present invention. Figure 5G Based on the material lists M and N shown, step S201, as described above, is executed. Material 3 in material list M is used as the first material. A second material with the same identifier as material 3 is searched in material list N. As shown in the figure, no second material is found. Therefore, step S202 is executed to delete material 3 from material list M and unrender material 3. The execution process after deleting material 3 can be seen in the following text. Figure 5I .
[0136] See Figure 5I This is a schematic diagram of the rendering process of the ninth type of material provided in an embodiment of the present invention. Figure 5H Based on the material lists M and N shown, since material 3 has been deleted, material list M no longer contains material 3, and materials 4 and 6, which are located after material 3, are shifted one position forward in turn. The next material after the removed material 3, namely material 4, is taken as the new first material, and step S201 continues.
[0137] Search for the second material in material list N that has the same material identifier as material 4. Figure 5I The arrow indicates that the second material, material 4, has been found in material list N. Continue with step S203 as described earlier, determining if the content of material 2 in material list M is the same as that of material 2 in material list N, and also determining if the first order of material 2 in material list M is the same as the second order of material 2 in material list N. As shown in the diagram, the first and second orders are different. Material 6, which has the first order in material list N, is then taken as the third material, and step S203 continues. The specific execution process can be found below. Figure 5J .
[0138] See Figure 5J This is a schematic diagram of the tenth type of material rendering process provided in an embodiment of the present invention. Figure 5I Based on the material lists M and N shown, execute step S203A as described above. Search for the fourth material in material list M that has the same material identifier as material 6. As shown in the figure, the fourth material, material 6, is found in material list M. Continue executing step S203B to determine if the content of material 6 in material list M is the same as that in material list N, and to determine if the fourth order of material 6 in material list M is the same as the first order of material 6 in material list N. As shown in the figure, the fourth order of material 6 in material list M is different from its first order. The subsequent execution process can be found in the following text. Figure 5K .
[0139] See Figure 5K This is a schematic diagram of the eleventh type of material rendering process provided in an embodiment of the present invention. Figure 5J Based on the material lists M and N shown above, execute step S205 as described earlier, move material 6 to the first position in material list M, render material 6, and move material 4 one position to the right in material list M. At this point, the identifiers of the first five materials in material lists M and N are the same.
[0140] Next, proceed to step S204, taking the material located at the next sequence after the current first sequence, i.e., material 3, as the first material, and continue to step S201, taking material 4 in material list M as the first material, and searching in material list N for the second material with the same material identifier as material 4. Figure 5K The arrow indicates that the second material, material 4, has been found in material list N. Continuing with step S203, we determine if the content of material 4 in material list M is the same as that in material list N, and whether the first order of material 4 in material list M is the same as the second order of material 4 in material list N. As shown in the diagram, the first and second orders are the same. At this point, the identifiers of the first six materials in material list M and material list N are the same. Since there are no other materials in material list M after the first order, and the total number of materials in material list M is less than the total number of materials in material list N, we can continue with step S205, adding material 8 (after the first order) from material list N after the last material in the first material list, i.e., adding material 8 after material 4, and rendering material 8. The material list obtained after adding material 8 to material list M can be seen in the following text. Figure 5L .
[0141] See Figure 5LThis is a schematic diagram of the eleventh type of material rendering process provided in an embodiment of the present invention. As can be seen from the figure, after... Figures 5A-5L In the example shown, after the material rendering is completed, the material list M is the same as the material list N.
[0142] As can be seen from the above embodiments, after executing the embodiments of the present invention, the material list M is the same as the material list N. Rendering the adjusted material based on the material list M is equivalent to rendering the material contained in the material list N.
[0143] See Figure 6 This is a flowchart illustrating the third material rendering method provided in this embodiment of the invention, which is consistent with the aforementioned... Figure 2 Compared to the illustrated embodiment, step S201 can be implemented by step S201A. Furthermore, after executing step S204, the execution returns to step S201A.
[0144] S201A: Search for the second material in the second material list starting from the first material in sequence.
[0145] Specifically, by Figure 2 The illustrated embodiments and Figures 5A-5L As can be seen from the illustrated embodiment, the number of materials with the same material identifier in the first material list and the second material list gradually increases as the embodiment of the present invention is executed cyclically. Furthermore, each time a second material is searched from the second material list, the material identifiers of all materials in the first material list preceding the current first sequence are identical to the material identifiers of the materials in the second material list with the same sequence. In other words, the materials in the second material list preceding the first sequence cannot contain a second material with the same material identifier as the current first material. Therefore, when searching for a second material, the search can be performed only on materials in the second material list starting from the first sequence that have the same material identifier as the first material.
[0146] As can be seen from the above, in this embodiment of the invention, when searching for the second material from the second material list, the second material is searched only within the materials in the second material list starting from the first order. That is, the search process for the second material is completed by comparing each material in the first and second material lists starting from the first order, without needing to compare all materials in the first and second material lists separately. Therefore, the number of material comparisons can be reduced, thereby improving the efficiency of material rendering.
[0147] In addition, as mentioned above Figure 4 Compared to the embodiment shown, step S203A can be achieved through step A.
[0148] Step A: Determine whether there is a fourth material in the first material list that has the same material identifier as the third material.
[0149] Similarly, since the material identifiers of all materials in the first material list preceding the current first order are the same as those of materials in the second material list at the same order, it is impossible for a fourth material to exist in the first material list preceding the first order that has the same material identifier as the third material. Therefore, when searching for the fourth material, one can only look for the fourth material whose material identifier is the same as that of the third material among the materials in the first material list after the first order.
[0150] As can be seen from the above, in this embodiment of the invention, when determining whether a fourth material exists in the first material list, the fourth material is searched only within the materials in the first material list starting from the first position. That is, the search for the fourth material is completed by comparing only the third material with each material in the first material list starting from the first position, without needing to compare the third material with all materials in the first material list separately. Therefore, the number of times materials are compared during the material rendering process can be further reduced, thereby improving the efficiency of material rendering.
[0151] See Figure 7 This is a flowchart illustrating the fourth material rendering method provided in this embodiment of the invention, which is consistent with the aforementioned... Figure 2 Compared to the illustrated embodiment, the step S206 is included before the aforementioned step S201. Furthermore, after performing steps S202 and S204, step S206 is performed.
[0152] S206: Determine whether the total number of materials in the second material list is less than the order number corresponding to the first order.
[0153] Specifically, as described above, with the execution of this embodiment, all materials in the first material list preceding the current first sequence are identical to materials in the second material list at the same sequence. That is, a second material with the same material identifier as the first material can only exist in the second material list from the first sequence onwards. Therefore, if the total number of materials in the second material list is less than the sequence number corresponding to the first sequence, it can be assumed that there is definitely no second material with the same material identifier as the first material in the second material list, and it can be directly determined that no second material was found, and step S202 can be executed directly. Otherwise, a second material with the same identifier as the first material may exist in the second material list, and step S201 can be executed.
[0154] As can be seen from the above, before searching for the second material, the embodiments of the present invention can determine whether the total number of materials contained in the second material list is less than the order number corresponding to the first order. If so, it can be directly determined that the second material does not exist in the second material list, and the first material can be directly removed from the first material list and the rendering of the first material can be canceled. There is no need to search for the second material, thereby improving the efficiency of material rendering.
[0155] In addition, as mentioned above Figure 4 Compared to the illustrated embodiment, before performing the aforementioned step S203A, the following step B is further included, and the aforementioned step S203A is performed... Figure 4 After step S204 in the illustrated embodiment, step B is executed.
[0156] Step B: Determine whether the total number of materials in the first material list is less than the order number corresponding to the first order plus 1.
[0157] Specifically, as described above, with the execution of this embodiment of the invention, all materials in the first material list preceding the current first order are the same as the materials in the same order in the second material list. Furthermore, the execution... Figure 4 The prerequisite for steps S203A-S203C is that the first order of the first material in the first material list is different from the second order of the second material in the second material list. In other words, the second material, which is identical to the first material, is not in the first order in the second material list. Therefore, the third material located at the first order in the second material list must be different from the first material. This means that the fourth material with the same identifier as the third material will not exist before or at the first order in the first material list; it can only exist among the materials after the first order. Therefore, if the total number of materials in the first material list is less than the order number corresponding to the first order plus 1, it can be assumed that the second material list definitely does not contain a fourth material with the same identifier as the third material. Thus, it can be directly determined that the fourth material was not found, and step S203C can be executed directly. Otherwise, the second material list may contain a fourth material with the same identifier as the third material, and step S203A can be executed.
[0158] As can be seen from the above, before searching for the fourth material, the embodiments of the present invention can determine whether the total number of materials contained in the first material list is less than the order number corresponding to the first order plus 1. If so, it can be directly determined that there is no fourth material in the first material list, and the third material can be directly inserted at the first order in the first material list and rendered directly. There is no need to compare materials to find the fourth material, thereby improving the efficiency of material rendering.
[0159] See Figure 8This is a flowchart illustrating the fifth material rendering method provided in this embodiment of the invention. After the materials in the same order in the first material list and the second material list are identical, that is... Figure 2 After steps S201-S205 are completed, for each first target material in the first material list that contains a sub-material list, it can be... Figure 8 The steps S207A-S207E shown compare the first material sublist contained in the first target material and the second material sublist contained in the second target material.
[0160] The second target material is in the same order as the first target material in the first material list.
[0161] Specifically, the material list may contain material sublists, which in turn contain sub-materials. For example, a material sublist may contain images that are sub-materials, and all the images in the material sublist together constitute one material in the material list. To ensure that the rendering result obtained after rendering the materials according to this embodiment is the same as the rendering result of the second material list, in addition to ensuring that the materials in the same order in the first and second material lists are the same, it is also necessary to ensure that the sub-materials in the same order in the first material sublist of the first target material and the second material sublist of the second target material are the same. This can be achieved by comparing the first material sublist and the second material sublist through the following steps S207A-S207E.
[0162] S207A: Find the second sub-material.
[0163] The second sub-material is located in the second sub-material list, and the material identifier of the second sub-material is the same as the material identifier of the first sub-material in the first sub-material list. The initial first sub-material is located at the very beginning of the first sub-material list, and the sub-materials in the first sub-material list have been rendered.
[0164] If the second sub-material is not found, proceed to step S207B; if the second sub-material is found, proceed to step S207C.
[0165] S207B: Remove the first sub-material from the first material sub-list and unrender the first sub-material. If there is a sub-material following the first sub-material, then the next sub-material of the first sub-material is taken as the new first sub-material.
[0166] After taking the next sub-material of the first sub-material as the new first sub-material, return to execute step S207A.
[0167] S207C: If a second sub-material is found, and the content of the first sub-material is different from the content of the second sub-material, the first sub-material is updated to the second sub-material, the rendering of the first sub-material is deactivated, and the second sub-material is rendered. If the order of the first sub-material is different from the order of the second sub-material, the third sub-material is inserted into the first sub-order position in the first material sub-list, and the third sub-material is rendered.
[0168] The first sub-order is the order of the first sub-material in the first material sub-list before inserting the third sub-material. The second sub-order is the order of the second sub-material in the second material sub-list. The third sub-material is the material located in the first sub-order in the second material sub-list.
[0169] If the first material list contains material located after the first sequence, then proceed to step S207D; otherwise, proceed to step S207E.
[0170] S207D: Take the sub-material in the sub-list that is next in the order of the first sub-order as the new first sub-material.
[0171] Return to and execute step S207A above.
[0172] S207E: If the total number of sub-materials in the first sub-list is less than the total number of sub-materials in the second sub-list, then add the sub-materials in the second sub-list that are in the current first sub-order to the last sub-material in the first sub-list, and render the sub-materials added to the first sub-list.
[0173] Specifically, steps S207A-S207E are similar to steps S201-S205, and will not be described again in this embodiment of the invention.
[0174] As can be seen from the above, after comparing the material lists through the embodiments of the present invention, not only are the materials in the same order in the first material list and the second material list the same, but the sub-materials in the same order within each of the two materials in the first material list and the second material sub-list are also the same. Therefore, the rendering result obtained by rendering the first material list can be consistent with the rendering result obtained by rendering the second material list.
[0175] Corresponding to the above-described material rendering method, this embodiment of the invention also provides a material rendering apparatus.
[0176] See Figure 9 This is a schematic diagram of a material rendering device provided in an embodiment of the present invention. The device includes:
[0177] The material search module 901 is used to search for the second material, which is located in the second material list and has the same material identifier as the first material in the first material list. The initial first material is located at the front of the first material list, and the materials in the first material list have been rendered.
[0178] The material removal module 902 is used to remove the first material from the first material list and cancel the rendering of the first material if the material search module 901 does not find the second material. If there is a material after the first material, the next material of the first material is used as the new first material, and the material search module 901 is triggered to execute again.
[0179] The first material rendering module 903 is used to update the first material to the second material if the content of the first material is different from the content of the second material, de-render the first material, and render the second material. Furthermore, if the first order and the second order are different, the third material is inserted into the first order position in the first material list and rendered. The first order is the order of the first material in the first material list before inserting the third material; the second order is the order of the second material in the second material list; and the third material is the material located in the first order position in the second material list.
[0180] The material update module 904 is used to, if there is a material in the first material list that is located after the first order, take the material in the first material list that is located in the next order after the first order as the new first material, and return to trigger the execution of the material search module 901;
[0181] The second material rendering module 905 is used to add the material in the second material list that is currently in the first order to the last material in the first material list if there is no material in the first material list after the first order and the total number of materials in the first material list is less than the total number of materials in the second material list, and then render the material added to the first material list.
[0182] As can be seen from the above, by comparing the first material list and the second material list, the first material list is updated to be the same as the second material list. During the comparison process, materials in the first material list that differ from those in the second material list are adjusted. These adjustments include deleting or updating materials in the first material list or inserting materials into the first material list. The adjusted materials are then rendered, while the other unadjusted materials were already rendered. Therefore, the rendering result after the material list comparison is completed is the same as the result of directly rendering all materials contained in the second material list. Furthermore, only the adjusted materials are rendered during this process; other materials are not re-rendered. Therefore, compared to directly rendering all materials in the second material list, this embodiment of the invention can reduce the processing resources consumed in the material rendering process.
[0183] In one embodiment of the present invention, the first material rendering module 903 is specifically used for:
[0184] If the material search module 901 finds the second material, then if the content of the first material is different from the content of the second material, the first material is updated to the second material, the rendering of the first material is deactivated, and the second material is rendered.
[0185] If the first order is different from the second order, determine whether there is a fourth material in the first material list whose material identifier is the same as that of the third material;
[0186] If the fourth material exists, and the content of the third material is different from the content of the fourth material, the fourth material is updated to the third material, the rendering of the fourth material is deactivated, and if the fourth order is different from the first order, the third material is moved and inserted into the first order position in the first material list, and the third material is rendered. The fourth order is the order of the fourth material in the first material list.
[0187] If the fourth material does not exist, the third material is inserted at the first position in the first material list, and the third material is rendered.
[0188] As can be seen from the above, if a fourth material exists in the first material list, it can be adjusted so that the material at the first position in the first material list is the same as the material at the first position in the second material list. If a fourth material does not exist in the first material list, a third material can be inserted into the first position of the first material list, similarly making the material at the first position in the first material list the same as the material at the first position in the second material list. Therefore, the rendering result obtained by rendering the material at the first position in the first material list is equivalent to the rendering result obtained by rendering the material at the first position in the second material list.
[0189] In one embodiment of the present invention, the material search module 901 is specifically used for:
[0190] Search for the second material in the second material list, starting from the first material in sequence.
[0191] As can be seen from the above, in this embodiment of the invention, when searching for the second material from the second material list, the second material is searched only within the materials in the second material list starting from the first order. That is, the search process for the second material is completed by comparing each material in the first and second material lists starting from the first order, without needing to compare all materials in the first and second material lists separately. Therefore, the number of material comparisons can be reduced, thereby improving the efficiency of material rendering.
[0192] In one embodiment of the present invention, the apparatus further includes:
[0193] The first quantity judgment module is used to determine whether the total number of materials contained in the second material list is less than the order number corresponding to the first order. If not, the material search module 901 is triggered; if so, the material removal module 902 is triggered.
[0194] As can be seen from the above, before searching for the second material, the embodiments of the present invention can determine whether the total number of materials contained in the second material list is less than the order number corresponding to the first order. If so, it can be directly determined that the second material does not exist in the second material list, and the first material can be directly removed from the first material list and the rendering of the first material can be canceled. There is no need to search for the second material, thereby improving the efficiency of material rendering.
[0195] In one embodiment of the present invention, after the materials in the same order in the first material list and the second material list are identical, the apparatus further includes:
[0196] For each first target material in the first material list that contains a sub-material list, the first material sub-list contained in the first target material and the second material sub-list contained in the second target material are compared by the following sub-module, wherein the order of the second target material in the second material list is the same as the order of the first target material in the first material list;
[0197] The sub-material search sub-module is used to find the second sub-material. The second sub-material is located in the second sub-material list, and the material identifier of the second sub-material is the same as the material identifier of the first sub-material in the first sub-material list. The initial first sub-material is located at the front of the first sub-material list, and the sub-materials in the first sub-material list have been rendered.
[0198] The sub-material removal sub-module is used to remove the first sub-material from the first material sub-list and cancel the rendering of the first sub-material if the sub-material search sub-module does not find the second sub-material. If there is a sub-material after the first sub-material, the next sub-material of the first sub-material is taken as the new first sub-material, and the execution of the sub-material search sub-module is triggered.
[0199] The first sub-material rendering submodule is used to update the first sub-material to the second sub-material if the sub-material search submodule finds the second sub-material, and if the content of the first sub-material is different from the content of the second sub-material, then de-render the first sub-material and render the second sub-material. Furthermore, if the first sub-order is different from the second sub-order, the third sub-material is inserted into the first sub-order position in the first material sub-list and rendered. The first sub-order is the order of the first sub-material in the first material sub-list before inserting the third sub-material; the second sub-order is the order of the second sub-material in the second material sub-list; and the third sub-material is the material located in the first sub-order position in the second material sub-list.
[0200] The sub-material update sub-module is used to, if there is a sub-material in the first material sub-list that is located after the first sub-order, take the sub-material in the first material sub-list that is located in the next sub-order after the first sub-order as the new first sub-material, and return to trigger the execution of the sub-material search sub-module;
[0201] The second sub-material rendering submodule is used to add the sub-materials in the second sub-material list that are currently in the first sub-order to the last sub-material in the first sub-material list if there are no sub-materials in the first sub-material list that are after the first sub-order and the total number of sub-materials in the first sub-material list is less than the total number of sub-materials in the second sub-material list, and then render the sub-materials added to the first sub-material list.
[0202] As can be seen from the above, after comparing the material lists through the embodiments of the present invention, not only are the materials in the same order in the first material list and the second material list the same, but the sub-materials in the same order within each of the two materials in the first material list and the second material sub-list are also the same. Therefore, the rendering result obtained by rendering the first material list can be consistent with the rendering result obtained by rendering the second material list.
[0203] This invention also provides an electronic device, such as... Figure 10 As shown, it includes a processor 1001, a communication interface 1002, a memory 1003, and a communication bus 1004, wherein the processor 1001, the communication interface 1002, and the memory 1003 communicate with each other through the communication bus 1004.
[0204] Memory 1003 is used to store computer programs;
[0205] When the processor 1001 executes the program stored in the memory 1003, it implements any of the steps described in the above-described material rendering method.
[0206] When rendering materials using the electronic device provided in this embodiment of the invention, by comparing a first material list and a second material list, the first material list is updated to be the same as the second material list. During the comparison process, materials in the first material list that differ from those in the second material list are adjusted. These adjustments include deleting or updating materials in the first material list or inserting materials into the first material list. The adjusted materials are then rendered, while other unadjusted materials have already been rendered. Therefore, the rendering result after the material list comparison is completed is the same as the result of directly rendering all materials contained in the second material list. Furthermore, only the adjusted materials are rendered during this process; other materials are not re-rendered. Therefore, compared to directly rendering all materials in the second material list, this embodiment of the invention can reduce the processing resources consumed in the material rendering process.
[0207] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0208] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0209] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0210] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0211] In another embodiment of the present invention, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described material rendering methods.
[0212] When the computer program stored in the computer-readable storage medium of the proxy terminal provided in this embodiment of the invention performs material rendering, by comparing a first material list and a second material list, the first material list is updated to be the same as the second material list. During the comparison of the material lists, materials in the first material list that are different from those in the second material list are adjusted. These adjustments include deleting or updating materials in the first material list or inserting materials into the first material list. The adjusted materials are rendered, while other unadjusted materials have already been rendered. Therefore, the result of material rendering after the material list comparison is completed is the same as the result of directly rendering all materials contained in the second material list. Furthermore, only the adjusted materials are rendered during this process; other materials are not re-rendered. Therefore, compared to directly rendering all materials in the second material list, this embodiment of the invention can reduce the processing resources consumed in the material rendering process.
[0213] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform the steps of any of the material rendering methods described in the above embodiments.
[0214] When the computer program provided in this embodiment of the invention performs material rendering, by comparing a first material list and a second material list, the first material list is updated to be the same as the second material list. During the comparison process, materials in the first material list that differ from those in the second material list are adjusted. These adjustments include deleting or updating materials in the first material list or inserting materials into the first material list. The adjusted materials are then rendered, while other unadjusted materials have already been rendered. Therefore, the result of material rendering after the material list comparison is completed is the same as the result of directly rendering all materials contained in the second material list. Furthermore, only the adjusted materials are rendered during this process; other materials are not re-rendered. Therefore, compared to directly rendering all materials in the second material list, this embodiment of the invention can reduce the processing resources consumed in the material rendering process.
[0215] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0216] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0217] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for devices, electronic devices, computer-readable storage media, and computer program products, since they are basically similar to the method embodiments, the descriptions are relatively simple, and relevant parts can be referred to the descriptions of the method embodiments.
[0218] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A material rendering method characterized by, The method comprises: finding a second material, the second material being located in a second material list, and a material identifier of the second material being identical to a material identifier of a first material in a first material list, the initial first material being located at a front end of the first material list, and materials in the first material list having completed rendering; if the second material is not found, removing the first material from the first material list, and canceling rendering of the first material, if there is a material located after the first material, taking a next material of the first material as a new first material, and returning to execute the step of finding the second material; if the second material is found, in a case where content of the first material is different from content of the second material, updating the first material to the second material, canceling rendering of the first material, and rendering the second material, and in a case where a first order is different from a second order, inserting a third material originally located in the second material list into the first material list at the first order, and rendering the third material, the first order being an order of the first material in the first material list before the third material is inserted, the second order being an order of the second material in the second material list, and an order of the third material in the second material list being identical to the first order of the first material in the first material list before the third material is inserted; if there is a material located after the first order in the first material list, taking a material located at a next order of the first order in the first material list as a new first material, and returning to execute the step of finding the second material; if there is no material located after the first order in the first material list, and a total number of materials contained in the first material list is less than a total number of materials contained in the second material list, adding materials located after the current first order in the second material list to the first material list after a last material in the first material list, and rendering the materials added to the first material list.
2. The method of claim 1, wherein, The inserting the third material into the first material list at the first order comprises: judging whether there is a fourth material with a same material identifier as a material identifier of the third material in the first material list; if the fourth material exists, in a case where content of the third material is different from content of the fourth material, updating the fourth material to the third material, canceling rendering of the fourth material, and in a case where a fourth order is different from the first order, moving and inserting the third material into the first material list at the first order, wherein the fourth order is an order of the fourth material in the first material list; if the fourth material does not exist, inserting the third material at the first order in the first material list.
3. The method of claim 1, wherein, The finding the second material comprises: finding the second material in the second material list from a material at the first order.
4. The method of claim 1, wherein, Before the finding the second material, further comprising: judging whether a total number of materials contained in the second material list is less than a number of orders corresponding to the first order; if not, executing the step of finding the second material; if yes, executing the step of removing the first material from the first material list, and canceling rendering of the first material.
5. The method according to any one of claims 1-4, characterized in that, After the materials at the same order in the first material list and the second material list are the same, the method further comprises: For each first target material containing a sub-material list in the first material list, comparing a first material sub-list contained in the first target material with a second material sub-list contained in a second target material, wherein the order of the second target material in the second material list is the same as the order of the first target material in the first material list; finding a second sub-material, the second sub-material being located in the second material sub-list and having the same material identifier as the first sub-material in the first material sub-list, the initial first sub-material being located at the front end of the first material sub-list, and the sub-materials in the first material sub-list having completed rendering; if the second sub-material is not found, removing the first sub-material from the first material sub-list and canceling rendering of the first sub-material, if there is a sub-material located after the first sub-material, taking the next sub-material of the first sub-material as a new first sub-material, and returning to execute the step of finding the second sub-material; if the second sub-material is found, in the case that the content of the first sub-material is different from the content of the second sub-material, updating the first sub-material to the second sub-material, canceling rendering of the first sub-material, and rendering the second sub-material, and in the case that the first sub-order is different from the second sub-order, inserting a third sub-material into the first material sub-list at the first sub-order, rendering the third sub-material, the first sub-order being the order of the first sub-material in the first material sub-list before the third sub-material is inserted, the second sub-order being the order of the second sub-material in the second material sub-list, and the third sub-material being the material located at the first sub-order in the second material sub-list; if there is a sub-material located after the first sub-order in the first material sub-list, taking the sub-material located at the next sub-order of the first sub-order in the first material sub-list as a new first sub-material, and returning to execute the step of finding the second sub-material; if there is no sub-material located after the first sub-order in the first material sub-list and the total number of the sub-materials contained in the first material sub-list is less than the total number of the sub-materials contained in the second material sub-list, adding the sub-materials located after the current first sub-order in the second material sub-list to the first material sub-list after the last sub-material in the first material sub-list, and rendering the sub-materials added to the first material sub-list.
6. A material rendering apparatus characterized by comprising: The device comprises: a material finding module, configured to find a second material, the second material being located in a second material list and having the same material identifier as a first material in a first material list, the initial first material being located at the front end of the first material list, and the materials in the first material list having completed rendering; a material removing module, configured to remove the first material from the first material list and cancel rendering of the first material if the material finding module does not find the second material, and take the next material of the first material as a new first material if there is a material located after the first material, and return to trigger execution of the material finding module. The first material rendering module is configured to: if the second material is found by the material searching module, update the first material to the second material in a case where the content of the first material is different from the content of the second material, cancel rendering of the first material, and render the second material; and in a case where the first sequence is different from the second sequence, insert a third material originally located in the second material list into the first material list at the first sequence, render the third material, the first sequence being the sequence of the first material in the first material list before the third material is inserted, and the second sequence being the sequence of the second material in the second material list, and the sequence of the third material in the second material list being the same as the first sequence of the first material in the first material list before the third material is inserted. The material updating module is configured to: if there is a material located after the first sequence in the first material list, take a material located at a next sequence of the first sequence in the first material list as a new first material, and return to trigger execution of the material searching module. The second material rendering module is configured to: if there is no material located after the first sequence in the first material list and the total number of materials contained in the first material list is less than the total number of materials contained in the second material list, add materials located after the current first sequence in the second material list to the first material list after a last material in the first material list, and render the materials added to the first material list.
7. The apparatus of claim 6, wherein, The first material rendering module is specifically configured to: if the second material is found by the material searching module, update the first material to the second material in a case where the content of the first material is different from the content of the second material, cancel rendering of the first material, and render the second material; in a case where the first sequence is different from the second sequence, determine whether there is a fourth material with a same material identifier as the third material in the first material list; if the fourth material exists, update the fourth material to the third material in a case where the content of the third material is different from the content of the fourth material, cancel rendering of the fourth material, and move and insert the third material into the first material list at the first sequence in a case where a fourth sequence is different from the first sequence, the fourth sequence being the sequence of the fourth material in the first material list; if the fourth material does not exist, insert the third material into the first material list at the first sequence, and render the third material.
8. The apparatus of claim 6, wherein, The material searching module is specifically configured to: search for the second material in the materials in the second material list from the first sequence.
9. An electronic device, comprising: The apparatus includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus. The memory is configured to store a computer program. The processor is configured to execute the program stored in the memory to implement the method steps in any one of claims 1-5.
10. A computer-readable storage medium, characterized in that, The computer program is stored in the computer readable storage medium, and the computer program is executed by the processor to implement the method steps in any one of claims 1-5.
Citation Information
Patent Citations
Rendering method and device
CN105631923A
Multiplex pixel distribution for multi-machine rendering
EP3770863A1