Rendering method and device for three-dimensional scene, equipment and storage medium
By showcasing the online rendering effects of 3D scenes in real time and generating high-quality rendering images, the problem of time-consuming 3D scene rendering is solved, improving user experience and rendering efficiency while reducing hardware costs.
Patent Information
- Application Number
- CN202510873113.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-10-17
AI Technical Summary
The existing 3D scene rendering process takes a long time, affecting the user experience.
A 3D scene rendering method is provided, which responds to user adjustment operations in the display interface, displays the online rendering effect of sub-scenes in real time, and generates a high-quality target rendering effect map after the online rendering is completed. It utilizes processes bound to the GPU to realize the mixed deployment of rendering tasks with different priorities.
It enables users to preview and adjust effects in real time, improves creation efficiency and interactive experience, reduces hardware costs, and improves the execution efficiency of rendering tasks and GPU resource utilization.
Smart Images

Figure CN120807739A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of data processing, and particularly relates to a rendering method and device for a three-dimensional scene, an apparatus and a storage medium. BACKGROUND
[0002] When editing a three-dimensional scene, a user usually edits the three-dimensional scene first, and performs rendering after an editing confirmation operation to present a final rendering effect. However, the rendering process is time-consuming, which increases the waiting time of the user and affects the user experience. SUMMARY
[0003] The present disclosure provides a rendering method and device for a three-dimensional scene, an apparatus and a storage medium to solve or alleviate one or more technical problems in the prior art.
[0004] In a first aspect, the present disclosure provides a rendering method for a three-dimensional scene, comprising:
[0005] In response to an adjustment operation on a sub-scene in a display interface, at least displaying the sub-scene after the adjustment operation in a first display area, and displaying a real-time rendering effect of online rendering on the sub-scene after the adjustment operation in a second display area; wherein the sub-scene is part of an initial three-dimensional scene displayed by the display interface; the first display area and the second display area are both part of the display interface.
[0006] In response to a rendering operation on the initial three-dimensional scene after the adjustment operation, displaying a target rendering effect diagram after the rendering operation in a third display area in the display interface; wherein the target rendering effect diagram at least includes the real-time rendering effect of online rendering on the sub-scene after the adjustment operation.
[0007] In a second aspect, the present disclosure provides a rendering device for a three-dimensional scene, comprising:
[0008] An input unit configured to obtain an adjustment operation or a rendering operation.
[0009] The rendering unit is configured to, in response to an adjustment operation on a sub-scene in a display interface, display at least the sub-scene after the adjustment operation in a first display area, and display a real-time rendering effect of online rendering of the sub-scene after the adjustment operation in a second display area; the sub-scene is part of an initial three-dimensional scene displayed by the display interface; the first display area and the second display area are both part of the display interface; in response to a rendering operation on the initial three-dimensional scene after the adjustment operation, a target rendering effect diagram after the rendering operation is displayed in a third display area in the display interface; the target rendering effect diagram at least includes the real-time rendering effect of online rendering of the sub-scene after the adjustment operation.
[0010] In a third aspect, an electronic device is provided, comprising:
[0011] at least one processor; and
[0012] a memory in communication with the at least one processor; wherein
[0013] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any of the embodiments of the present disclosure.
[0014] In a fourth aspect, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to perform the method according to any of the embodiments of the present disclosure.
[0015] In a fifth aspect, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the method according to any of the embodiments of the present disclosure.
[0016] The technical solutions provided by the present disclosure have at least the following beneficial effects:
[0017] In this way, the present disclosure can trigger online rendering of the adjusted sub-scene and display the online rendering result in real time when the adjustment of the sub-scene in the three-dimensional scene is completed; after the online rendering is completed, a rendering operation on the initial three-dimensional scene after the adjustment operation can also be triggered to obtain a high-quality target rendering effect diagram. Thus, compared with the existing rendering method of the three-dimensional scene, the present disclosure can flexibly select the rendering method according to the user's rendering requirements, which enables the user to not only preview the effect of each adjustment in real time, but also obtain the final high-quality rendering effect diagram; thereby improving the user's creation efficiency and enhancing the user's experience.
[0018] It is to be understood that the details set forth herein do not limit the scope of the disclosure to the one embodiment described. Rather, the scope encompasses other embodiments which can become apparent to those skilled in the art in light of the teachings herein. BRIEF DESCRIPTION OF DRAWINGS
[0019] In the drawings, like reference numerals refer to same or similar functionalities throughout the several views. The drawings are not necessarily to scale, the emphasis instead being placed upon illustrating the principles of the application. It should be understood that the drawings are merely schematic and that the application can be embodied in many different forms.
[0020] Figure 1 is a schematic flowchart of a rendering method for a three-dimensional scene according to an embodiment of the application Figure 1 ;
[0021] Fig. 2(a) and Fig. 2(b) are scene diagrams for rendering of a three-dimensional scene according to an embodiment of the application;
[0022] Figure 3 is a schematic flowchart of a rendering method for a three-dimensional scene according to an embodiment of the application
[0023] Figure 4 is a schematic flowchart of a rendering method for a three-dimensional scene according to an embodiment of the application Figure 3 ;
[0024] Figure 5 is an interaction diagram of a rendering method for a three-dimensional scene according to an embodiment of the application in a specific example;
[0025] Figure 6 is a scene diagram of an immediate rendering process and a non-immediate rendering process according to an embodiment of the application;
[0026] Figure 7 is a structural diagram of a rendering apparatus for a three-dimensional scene according to an embodiment of the application;
[0027] Figure 8 is a block diagram of an electronic device for implementing a rendering method for a three-dimensional scene according to an embodiment of the application. DETAILED DESCRIPTION
[0028] The present disclosure will be further described in detail with reference to the drawings. Like reference numerals in the figures indicate like elements or features. Although the various aspects of the embodiments are illustrated in the drawings, the drawings are not necessarily drawn to scale unless specifically noted.
[0029] In addition, for a better illustration of the present disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that the present disclosure can be practiced without certain specific details. In some instances, well-known methods, structures, elements, and circuits have not been described in detail in order to avoid obscuring the subject matter.
[0030] The present solution provides a rendering method for a three-dimensional scene. After completing adjustment of a sub-scene in the initial three-dimensional scene, online rendering for the adjusted sub-scene can be triggered to preview the adjustment effect in real time. After the real-time rendering effect obtained by the online rendering is displayed, rendering operation for the initial three-dimensional scene after the adjustment operation can also be triggered and executed to obtain a target rendering effect picture. Here, since the present solution can trigger online rendering after completing adjustment of a sub-scene in a three-dimensional scene and display the rendering effect in real time, the user can intuitively preview the adjustment effect, thereby discovering problems in time and making adjustments. Moreover, by executing rendering operation for the adjusted three-dimensional scene, a high-quality rendering effect picture can be obtained, thus effectively improving the user's interactive experience.
[0031] Specifically, Figure 1 is a schematic flow of a rendering method for a three-dimensional scene according to an embodiment of the present application Figure 1 The method can be optionally applied in electronic devices such as personal computers, servers, server clusters, etc.
[0032] Further, the method includes at least part of the following contents. As shown in Figure 1 includes:
[0033] Step S101: In response to an adjustment operation on a sub-scene in a display interface, at least the sub-scene after the adjustment operation is displayed in a first display area, and a real-time rendering effect obtained by online rendering of the sub-scene after the adjustment operation is displayed in a second display area.
[0034] Here, the sub-scene is part of the scene in the initial three-dimensional scene displayed by the display interface; the first display area and the second display area are both part of the display interface.
[0035] For example, as shown in FIG. 2(a), the display interface in the scene configuration tool displays an initial three-dimensional scene. Further, a first display area in the display interface displays part of the initial three-dimensional scene (corresponding to the above-mentioned sub-scene). After adjustment of the sub-scene in the first display area, such as adjustment of a target object in the sub-scene, an adjusted sub-scene is obtained, and online rendering of the adjusted sub-scene is performed to display a real-time rendering effect in a second display area in the display interface.
[0036] Further, in an example, the first display area is located at a different position from the second display area.
[0037] Further, in an example, the scene configuration tool shown in FIG. 2(a) includes, in addition to the display interface, a material display area for displaying scene materials (such as scene material 1, scene material 2, and scene material 3), a scene parameter setting area for setting scene parameters of the initial three-dimensional scene, and a tool area including functions such as “save” and “edit”. The specific functions in the scene configuration tool can be set according to actual needs, and the present disclosure does not make specific limitations thereto.
[0038] It should be noted that, in an example, in response to the adjustment operation on the sub-scene, the scene data of the adjusted sub-scene is rendered online, in other words, in the case where the adjustment operation on the sub-scene is detected, online rendering of the adjusted sub-scene is triggered, and the real-time rendering effect is displayed immediately, so that the user can browse the adjustment effect of the sub-scene in real time, thus further improving the user experience.
[0039] Here, in this example, each adjustment of the sub-scene by the user will trigger corresponding online rendering, and each online rendering can be regarded as a “phased” rendering.
[0040] Step S102: In response to the rendering operation on the adjusted initial three-dimensional scene, the target rendering effect diagram after the rendering operation is displayed in the third display area in the display interface.
[0041] Here, the target rendering effect diagram at least includes the real-time rendering effect after online rendering of the adjusted sub-scene. For example, in an example, the target rendering effect diagram includes the rendering effect of the adjusted initial three-dimensional scene.
[0042] For example, as shown in FIG. 2(b), the user can trigger rendering of the current adjusted initial three-dimensional scene by clicking the “render” button, and place the rendering result (i.e., the target rendering effect diagram) in the third display area to display it to the user.
[0043] Here, in actual application, the third display area pops up in the display interface after the rendering operation is completed, so as to display the rendering result in the third display area. In this way, the user experience is further improved.
[0044] Further, in an example, a display area of the third display region is not less than a sum of display areas of the first display region and the second display region. Further, in an example, the third display region is capable of covering the first display region and the second display region, so as to intuitively show a target rendering effect diagram to a user, and thus, user experience is improved.
[0045] In this way, the disclosed scheme can trigger online rendering for the adjusted sub-scene and display the online rendering result in real time when the adjustment for the sub-scene in the three-dimensional scene is completed, and can further trigger rendering for the initial three-dimensional scene after the adjustment operation is performed, so as to obtain a high-quality target rendering effect diagram. Thus, compared with the existing rendering mode of a three-dimensional scene, the disclosed scheme can provide a corresponding rendering mode according to the rendering requirement of a user, which enables the user to not only preview the effect of each adjustment in real time, but also obtain a final high-quality rendering effect diagram, thereby improving the creation efficiency of the user and improving the user experience.
[0046] Moreover, since the disclosed scheme triggers online rendering for each adjustment of the initial three-dimensional scene, the corresponding real-time rendering effect can be presented immediately after each adjustment, so that the user can intuitively see the visual effect after the adjustment according to the real-time rendering effect, and thus, potential problems can be found in time and adjusted. This what-you-see-is-what-you-get scene modeling mode can greatly improve the creation efficiency and interactive experience of the user.
[0047] In addition, since the disclosed scheme can trigger rendering for the three-dimensional scene after the adjustment operation is performed after the online rendering is completed, the disclosed scheme can realize mixed deployment of the two rendering modes of “online rendering” and “rendering operation” within limited resources, such as the same rendering server, which improves the utilization of the rendering server resources in the time dimension, and also effectively reduces the hardware cost required for the rendering task.
[0048] It should be noted that the “rendering” in the “online rendering” of the disclosed scheme can be understood as an instant rendering mode, which has a higher timeliness requirement and can be applied to a scene that needs an instant response. At this time, the rendering task performed by using this rendering mode can be referred to as an instant rendering task. The “rendering” in the “rendering operation” can be understood as a non-instant rendering mode, which has a lower timeliness requirement and can be applied to fine rendering for a complex scene. At this time, the rendering task performed by using this rendering mode can be referred to as a non-instant rendering task.
[0049] For example, in an example, the instant rendering task in the present disclosure can be a rendering task with high timeliness requirement in an online rendering scene, and the non-instant rendering task can be a rendering task with low timeliness requirement in the online rendering scene, or a rendering task in an offline rendering scene.
[0050] In a specific example, before displaying the real-time rendering effect of the online rendering of the sub-scene after the adjustment operation, further comprising:
[0051] In the first process, the target GPU with a binding relationship with itself is used to perform online rendering on the sub-scene after the adjustment operation to obtain the real-time rendering effect of the sub-scene after the adjustment operation.
[0052] That is, in an example, in response to the adjustment operation on the sub-scene in the display interface, the sub-scene after the adjustment operation is obtained, and in the first process, the target GPU with a binding relationship with itself is used to perform online rendering on the sub-scene after the adjustment operation to obtain the real-time rendering effect of the sub-scene after the adjustment operation, and the real-time rendering effect is displayed in the second display area.
[0053] In this way, the present disclosure can use the target GPU with a binding relationship with itself to perform online rendering on the sub-scene after the adjustment operation in the first process, so that the rendering effect can be displayed immediately, ensuring low latency of online rendering to meet the immediate response needs of users, thereby improving user experience.
[0054] In a specific example, before the third display area in the display interface displays the target rendering effect diagram after the rendering operation, further comprising:
[0055] In the case where the first process completes the online rendering on the sub-scene after the adjustment operation using the target GPU, the first process is controlled to release the occupation right to the target GPU.
[0056] That is, in the case where the first process completes the online rendering on the sub-scene after the adjustment operation using the target GPU, the first process is controlled to release the target GPU exclusively occupied by the first process. In other words, after completing the rendering task, the first process releases the target GPU exclusively occupied by the first process. In this way, the long-time occupation of the target GPU by the first process is effectively avoided, and the released target GPU can be used for other rendering tasks, thereby improving the utilization rate of GPU resources.
[0057] Further, in a specific example, in the case where the first process completes the online rendering on the sub-scene after the adjustment operation using the target GPU, the first process is controlled to release the occupation right to the target GPU, which can specifically include:
[0058] Manner 1: generating a first operation instruction for the first process in a case where it is determined that the first process is in an idle state.
[0059] Here, the first operation instruction is used to instruct the first process to release a read lock of a target GPU; the read lock of the target GPU is capable of allowing the first process to perform a read operation on a resource of the target GPU.
[0060] That is, after the first process performs online rendering on the sub-scene after the adjustment operation using the target GPU, it is determined that there is no other rendering task to be executed in the first process, that is, it is determined that the first process is in an idle state, at this time, the first process can be controlled to immediately release the read lock of the target GPU through the generated first operation instruction, so that the long-time occupation of the GPU resource by the first process is effectively avoided.
[0061] Manner 2: generating a first operation instruction for the first process in a case where it is determined that the first process is in an idle state and a rendering operation is detected.
[0062] Here, the first operation instruction is used to instruct the first process to release a read lock of a target GPU; the read lock of the target GPU is capable of allowing the first process to perform a read operation on a resource of the target GPU.
[0063] That is, after the first process performs online rendering on the sub-scene after the adjustment operation using the target GPU, it is determined that the first process is in an idle state, and a rendering operation on the initial three-dimensional scene after the adjustment operation is detected, at this time, the first process can be controlled to immediately release the read lock of the target GPU through the generated first operation instruction, so as to schedule the GPU resource in the idle period to other rendering tasks.
[0064] In this way, the present scheme provides two release opportunities for the first process to release the occupation right of the target GPU, so that the long-time occupation of the target GPU by the first process is effectively avoided, and the GPU resource in the idle period can be obtained in time when other rendering tasks need to be executed, so that the utilization of the GPU resource in the time dimension is improved, thereby ensuring the fluency and responsiveness of the system.
[0065] Figure 3 is a schematic flowchart two of a method for rendering a three-dimensional scene according to an embodiment of the present application. The method can be optionally applied in an electronic device, such as a personal computer, a server, a server cluster, etc. It can be understood that the above Figure 1 The related contents of the method shown in FIG. 2 can also be applied in this example, and the associated contents will not be described again.
[0066] Further, the method comprises at least part of the following. As shown, it comprises: Figure 3
[0067] Step S301: in response to an adjustment operation on a sub-scene in a display interface, performing online rendering on the sub-scene after the adjustment operation in a first process by using a target GPU having a binding relationship with itself, to obtain a real-time rendering effect of the sub-scene after the adjustment operation.
[0068] Here, the sub-scene is part of an initial three-dimensional scene displayed by the display interface.
[0069] Step S302: in a case where the first process performs online rendering on the sub-scene after the adjustment operation by using the target GPU is completed, controlling the first process to release the occupation right of the target GPU.
[0070] Step S303: after the first process releases the occupation right of the target GPU, in response to a rendering operation on the initial three-dimensional scene after the adjustment operation, performing rendering on the initial three-dimensional scene after the adjustment operation in a second process having a binding relationship with the target GPU by using the target GPU, to obtain a target rendering effect picture.
[0071] Here, the target rendering effect picture at least comprises a real-time rendering effect after online rendering on the sub-scene after the adjustment operation.
[0072] It should be noted that the first process in the present disclosure is used to execute a high-priority rendering task (also referred to as an immediate rendering task), so as to immediately present a rendering effect after quickly executing the rendering task, thereby meeting the real-time response requirement of a user. At this time, the first process can also be referred to as a high-priority process (or an immediate rendering process). Correspondingly, the second process in the present disclosure is used to execute a low-priority rendering task (also referred to as a non-immediate rendering task). Compared with the immediate rendering task, the non-immediate rendering task has a lower timeliness requirement. At this time, the second process can also be referred to as a low-priority process (or a non-immediate rendering process).
[0073] That is, after the first process executes online rendering on the sub-scene after the adjustment operation by using the target GPU having a binding relationship with itself is completed, the first process releases the occupation right of the target GPU, so that the second process can use the resources of the target GPU to execute a rendering operation on the initial three-dimensional model after the adjustment operation, thereby obtaining a target rendering effect picture. In other words, after the first process executes a high-priority rendering task by using the resources of the target GPU is completed, the second process is allowed to obtain and use the target GPU to execute a low-priority rendering task.
[0074] In this way, the disclosed scheme can achieve mixed deployment of rendering tasks of different priorities by using the first process and the second process that have a binding relationship with the target GPU. Thus, the long-time occupation of GPU resources by the first process is effectively avoided, dynamic resource release is achieved, the utilization of GPU resources is improved, and the processing efficiency of tasks is improved. Moreover, for the rendering task performed in the first process, the instant response requirement of the user can be met, and for the rendering task performed in the second process, the GPU resources in the idle period can be obtained in time, and the waiting time of the user is reduced. Thus, the user experience is further improved.
[0075] Further, since the disclosed scheme achieves mixed deployment of rendering tasks of different priorities, the disclosed scheme can effectively solve the problem that two types of rendering tasks cannot coexist in a static resource allocation mode. Thus, independent rendering servers do not need to be separately deployed for the two types of rendering tasks, and the hardware cost required for performing rendering tasks is effectively reduced.
[0076] Further, in a specific example, after the first process releases the occupation permission of the target GPU, the target GPU is used to render other three-dimensional scenes in the second process that has a binding relationship with the target GPU.
[0077] It should be noted that after the first process releases the occupation permission of the target GPU, the second process can use the resources of the target GPU to perform non-instant rendering on other three-dimensional scenes. For example, in an example, the second process can use the resources of the target GPU to perform offline rendering on other three-dimensional scenes.
[0078] It should be noted that the non-instant rendering task in the second process can be the rendering task corresponding to the "render button" in the scene shown in FIG. 2(b), or can be other rendering tasks that can be executed in the second process. The disclosed scheme does not limit this. Thus, the utilization of GPU in the time dimension is effectively improved, and the execution efficiency of the rendering task is improved.
[0079] In this way, the disclosed scheme can schedule the GPU resources in the idle state to other rendering tasks after the first process releases the occupation permission of the target GPU. Thus, the utilization of GPU resources is effectively improved, and the execution efficiency of the rendering task is improved.
[0080] Further, in a specific example, after it is determined that the first process has released the read lock of the target GPU, a second operation instruction for the second process is generated.
[0081] Here, the second operation instruction is used to instruct the second process to acquire a write lock of the target GPU; the write lock of the target GPU can allow the second process to perform a write operation on a resource of the target GPU.
[0082] That is, after determining that the first process has released the read lock of the target GPU, a second operation instruction is generated for the second process to acquire a write lock of the target GPU, so as to perform a rendering task by using a resource of the target GPU.
[0083] Alternatively, in another example, after determining that the first process has released the read lock of the target GPU and detecting the rendering operation, a second operation instruction is generated for the second process.
[0084] That is, after determining that the first process has released the read lock of the target GPU, if the rendering operation is detected, a second operation instruction is generated to control the second process to acquire a write lock of the target GPU, so as to perform rendering on the initial three-dimensional scene after the adjustment operation by using the target GPU to obtain a target rendering effect picture. In this way, the utilization rate of the GPU resource is effectively improved, and for non-instant rendering tasks, the waiting time of the user is reduced, thereby improving the user experience.
[0085] Figure 4 is a schematic flow of a rendering method for a three-dimensional scene according to an embodiment of the present application Figure 3 . The method can be optionally applied in an electronic device, such as a personal computer, a server, a server cluster, and the like. It can be understood that the related content of the method shown in the above Figures 1 to 3 may also be applied in this example, and the associated content will not be described again.
[0086] Further, the method at least includes at least part of the following content. As shown in the Figure 4 , it includes:
[0087] Step S401: in response to an adjustment operation on a sub-scene in a display interface, performing online rendering on the sub-scene after the adjustment operation by using a target GPU having a binding relationship with the first process to obtain a real-time rendering effect of the sub-scene after the adjustment operation.
[0088] Here, the sub-scene is part of an initial three-dimensional scene displayed by the display interface.
[0089] Step S402: in a case where the first process performs online rendering on the sub-scene after the adjustment operation by using the target GPU, controlling the first process to release the occupation right of the target GPU.
[0090] Step S403: After the first process releases the occupation right of the target GPU, in response to the rendering operation of the initial three-dimensional scene after the adjustment operation, the second process that has a binding relationship with the target GPU is used to render the initial three-dimensional scene after the adjustment operation by using the target GPU.
[0091] It should be noted that the related content of online rendering, rendering operation, first process and second process can refer to the above examples, and will not be repeated here.
[0092] Step S404: In the process of rendering the initial three-dimensional scene after the adjustment operation by using the second process, a pause request is detected.
[0093] Here, the pause request is generated when the first process needs to use the GPU for online rendering again, and is used to request the second process to pause the use of the resources of the target GPU.
[0094] Step S405: In response to the pause request, a third operation instruction is generated, which is used to instruct the second process to release the write lock of the target GPU.
[0095] Step S406: In the first process, online rendering is performed again by using the target GPU.
[0096] For example, in an example, after the second process releases the write lock of the target GPU, the first process acquires the read lock of the target GPU, and then online rendering is performed again in the first process by using the target GPU.
[0097] Step S407: In the case where the first process performs online rendering again by using the target GPU, the first process is controlled to release the occupation right of the target GPU.
[0098] Step S408: After the first process releases the occupation right of the target GPU, in the second process, rendering of the initial three-dimensional scene after the adjustment operation is continued to obtain a target rendering effect picture.
[0099] For example, in an example, after the first process releases the occupation right of the target GPU, the second process acquires the write lock of the target GPU, and then rendering is continued in the second process by using the target GPU.
[0100] That is, in an example, during a process in which the second process renders the initial three-dimensional scene after the adjustment operation by using the target GPU, it is detected that the first process needs to use the target GPU again to perform a new instant rendering task, at this time, a pause request can be generated to request the second process to pause the use of the resources of the target GPU; further, in response to the pause request, a third operation instruction is generated to instruct the second process to release the write lock of the target GPU, so that the first process can acquire the read lock of the target GPU again, facilitating the first process to use the target GPU to perform the new instant rendering task again.
[0101] Further, in a case where the first process performs the new instant rendering task by using the target GPU again, the first process is controlled to release the read lock of the target GPU, and a recovery instruction for the second process is generated to instruct the second process to reacquire the target GPU and continue to perform non-instant rendering on the initial three-dimensional scene after the adjustment operation by using the target GPU.
[0102] It can be understood that the "new instant rendering task" in this example can specifically be instant rendering triggered when the user adjusts the sub-scene after the adjustment operation again, in other words, the "new rendering task" is instant rendering on the sub-scene after the secondary adjustment.
[0103] In this way, since the priority of the first process in the present disclosure is higher than the priority of the second process, when the first process needs to perform an instant rendering task, the first process can acquire and use the resources of the target GPU in priority, effectively avoiding performance degradation caused by resource competition, in other words, if it is detected that the first process needs to use the target GPU again while the second process is performing non-instant rendering, the second process is forced to pause the use of the target GPU and release it for use by the first process. In this way, the present disclosure uses a dynamic preemption mechanism based on process priority to ensure the real-time performance of the instant rendering task in the first process, thereby meeting the instant response needs of the user and improving the user experience.
[0104] Moreover, since the present disclosure releases the read lock of the target GPU occupied by the first process immediately after the first process performs the new instant rendering task, and recovers the non-instant rendering task in the second process that is not performed by using the generated recovery instruction, the long-time occupation of GPU resources by the first process is effectively avoided, which enables the second process to reoccupy the GPU resources in the idle period, thereby realizing dynamic release and reoccupation of GPU resources and improving the utilization of GPU resources in the time dimension.
[0105] The present disclosure is further described below in detail with reference to specific examples. Specifically, the present disclosure provides a rendering method for a three-dimensional scene. Specifically, the present disclosure uses an instant rendering process (corresponding to the first process described above) and a non-instant rendering process (corresponding to the second process described above) that have a binding relationship with a GPU to implement the mixed deployment of instant rendering tasks and non-instant rendering tasks on the same rendering server (i.e., the GPU). In this way, the long-time occupation of resources by idle processes is effectively avoided, thereby improving the utilization of GPU resources. Moreover, users can flexibly select the required rendering method according to their needs, thereby improving the user's creation efficiency and interactive experience.
[0106] (I) Resource and process isolation
[0107] A single server is deployed with K GPUs, and each GPU is bound with two independent rendering processes, which are:
[0108] (1) Instant rendering process: supports processing multiple (e.g., 10) instant rendering tasks at the same time;
[0109] (2) Non-instant rendering process: only processes 1 non-instant rendering task to avoid resource overload.
[0110] In addition, the resources such as CPU, memory, and disk in the server are allocated according to the priority of the task type. For example, when an instant rendering task needs to be executed, the various resources in the server are used preferentially.
[0111] Here, in actual applications, the present disclosure supports the deployment of M×K instant rendering tasks and K non-instant rendering tasks on a single server, which is suitable for different hardware configurations. In this way, the present disclosure has stronger scalability.
[0112] (II) Dynamic preemption mechanism
[0113] (1) Preemption trigger
[0114] When the instant rendering process needs the GPU to execute an instant rendering task, the rendering lock (acquireRenderLock) scheduler is acquired to immediately send a suspend (Suspend) request to the non-instant rendering process to force the non-instant rendering process to release the write lock of the GPU and mark the non-instant rendering task being executed as a suspended state.
[0115] (2) Resource release and recovery
[0116] After the immediate rendering process completes the immediate rendering task by utilizing the GPU, the rendering lock (such as the read lock of the GPU) is released, at which time, the scheduler awakens the non-immediate rendering task in the non-immediate rendering process in the suspended state by sending a resume instruction, and allows the non-immediate rendering process to re-contend for the GPU resource.
[0117] (3) Priority rule
[0118] The immediate rendering task has the highest preemption priority to ensure immediate response; in addition, if multiple immediate rendering tasks contend, the GPU lock is allocated according to the first-come-first-served principle.
[0119] Specifically, as shown in Figure 5 and Figure 6 , the rendering processing steps of the scheme of the present disclosure include:
[0120] Step 1: In response to an adjustment operation on a sub-scene in an initial three-dimensional scene, an adjusted sub-scene is obtained, and an immediate rendering instance in an immediate rendering process sends a rendering request for the adjusted sub-scene to an immediate rendering agent.
[0121] Step 2: The immediate rendering agent sends an acquisition request to a target GPU read-write lock that has a binding relationship with the immediate rendering process to acquire a read lock of the target GPU, so that the immediate rendering agent utilizes resources of the target GPU to render the adjusted sub-scene to obtain a real-time rendering effect; and after the rendering is completed, the read lock of the target GPU is released.
[0122] Here, the read lock of the target GPU can allow the immediate rendering agent to perform a read operation on the resources of the target GPU.
[0123] Step 3: In response to a rendering operation on the adjusted initial three-dimensional model, a non-immediate rendering instance in a non-immediate rendering process sends a rendering request for the adjusted initial three-dimensional scene to a non-immediate rendering agent.
[0124] Step 4: The non-immediate rendering agent sends an acquisition request to a target GPU read-write lock that has a binding relationship with the non-immediate rendering process to acquire a write lock of the target GPU, so that the non-immediate rendering agent utilizes resources of the target GPU to render the adjusted initial three-dimensional scene.
[0125] Here, the write lock of the target GPU can allow the non-immediate rendering agent to perform a write operation on the resources of the target GPU.
[0126] Step 5: In the case that the non-instant rendering agent is performing a rendering task for the initial three-dimensional scene after the adjustment operation, the instant rendering agent in the instant rendering process generates a pause request for the non-instant rendering process in response to the new rendering request sent by the instant rendering instance, to request the non-instant rendering agent in the non-instant rendering process to pause the execution of the rendering task for the initial three-dimensional scene after the adjustment operation, and immediately release the write lock of the target GPU.
[0127] Here, the new rendering request carries a new instant rendering task. Further, the new instant rendering task can specifically be rendering the sub-scene after the secondary adjustment operation.
[0128] Further, after pausing the execution of the rendering task for the initial three-dimensional scene after the adjustment operation, the non-instant rendering agent marks the rendering task for the initial three-dimensional scene after the adjustment operation as a suspended state, to wait for resumption at any time.
[0129] Step 6: In the case that it is determined that the non-instant rendering process has released the write lock of the target GPU, the instant rendering agent in the instant rendering process sends an acquisition request to the read-write lock of the target GPU to acquire the read lock of the target GPU, so that the instant rendering agent executes the new instant rendering task by using the resources of the target GPU, and releases the read lock of the target GPU after the execution is completed.
[0130] Step 7: In the case that the instant rendering agent completes the execution of the new instant rendering task by using the resources of the target GPU, and has released the read lock of the target GPU, a resumption instruction for the non-instant rendering process is generated to instruct the non-instant rendering agent in the non-instant rendering process to reacquire the write lock of the target GPU.
[0131] Step 8: The non-instant rendering agent in the non-instant rendering process continues to render the initial three-dimensional scene after the adjustment operation by using the resources of the target GPU, to obtain a target rendering effect picture.
[0132] In summary, compared with the existing rendering method for a three-dimensional scene, the disclosed scheme has the following advantages:
[0133] First, the interactive rendering experience is better. Compared with the existing method of rendering the edited three-dimensional scene and obtaining the final rendering effect, the disclosed scheme triggers instant rendering for each adjustment of the three-dimensional scene, so that the corresponding real-time rendering effect can be presented instantly after each adjustment, which enables the user to intuitively see the visual effect after the adjustment according to the real-time rendering effect, and to discover potential problems in time and make adjustments. This what-you-see-is-what-you-get scene rendering method can greatly improve the user's creation efficiency and interactive experience.
[0134] Second, the rendering cost is lower. The first process and the second process having a binding relationship with the GPU are utilized to implement mixed deployment of rendering tasks of different priorities (such as instant rendering tasks and non-instant rendering tasks), effectively avoiding long-time occupation of GPU resources by the first process, improving the utilization rate of GPU resources, and without separately deploying independent rendering servers for the two types of rendering tasks, the hardware cost required for executing the rendering tasks is effectively reduced.
[0135] Third, the task execution efficiency is higher. Since the first process and the second process having a binding relationship with the GPU are utilized to execute rendering tasks of different priorities, long-time occupation of GPU resources by the first process is effectively avoided, which can meet the instant response requirement of a user for instant rendering tasks in the first process, and can timely obtain GPU resources in an idle period for non-instant rendering tasks in the second process, reducing the waiting time of the user, thereby further improving the execution efficiency of the rendering tasks.
[0136] The present disclosure also provides a rendering device for a three-dimensional scene, as shown in Figure 7 The rendering device comprises:
[0137] The input unit 701 is configured to obtain an adjustment operation or a rendering operation.
[0138] The rendering unit 702 is configured to, in response to the adjustment operation for the sub-scene in the display interface, display at least the sub-scene after the adjustment operation in the first display area, and display real-time rendering effects after online rendering of the sub-scene after the adjustment operation in the second display area; the sub-scene is part of an initial three-dimensional scene displayed by the display interface; the first display area and the second display area are both part of the display interface; in response to the rendering operation for the initial three-dimensional scene after the adjustment operation, the target rendering effect diagram after the rendering operation is displayed in the third display area in the display interface; the target rendering effect diagram at least includes real-time rendering effects after online rendering of the sub-scene after the adjustment operation.
[0139] In a specific example of the present disclosure, the display area of the third display area is not less than the sum of the display areas of the first display area and the second display area.
[0140] In a specific example of the present disclosure, the third display area can cover the first display area and the second display area.
[0141] In a specific example of the present disclosure, the rendering unit is further configured to:
[0142] In the first process, a target image processor GPU with a binding relationship with itself is used to perform online rendering on the adjusted sub-scene to obtain a real-time rendering effect of the adjusted sub-scene.
[0143] In a specific example of the present disclosure, the rendering unit is further configured to:
[0144] In a case where the first process completes the online rendering on the adjusted sub-scene using the target GPU, the first process is controlled to release the occupation right of the target GPU.
[0145] In a specific example of the present disclosure, the rendering unit is specifically configured to:
[0146] In a case where it is determined that the first process is in an idle state, a first operation instruction for the first process is generated;
[0147] Alternatively,
[0148] In a case where it is determined that the first process is in an idle state and the rendering operation is detected, a first operation instruction for the first process is generated;
[0149] The first operation instruction is used to instruct the first process to release a read lock of a target GPU, and the read lock of the target GPU can allow the first process to perform a read operation on resources of the target GPU.
[0150] In a specific example of the present disclosure, the rendering unit is further configured to:
[0151] After the first process releases the occupation right of the target GPU, in a second process having a binding relationship with the target GPU, the target GPU is used to render the adjusted initial three-dimensional scene to obtain a target rendering effect map.
[0152] In a specific example of the present disclosure, the rendering unit is further configured to:
[0153] After the first process releases the occupation right of the target GPU, in a second process having a binding relationship with the target GPU, the target GPU is used to render the adjusted initial three-dimensional scene to obtain a target rendering effect map.
[0154] In a specific example of the present disclosure, the rendering unit is further configured to:
[0155] After it is determined that the first process has released the read lock of the target GPU, a second operation instruction for the second process is generated;
[0156] Alternatively,
[0157] in a case where it is determined that the first process has released the read lock of the target GPU and the rendering operation is detected, generating a second operation instruction for the second process;
[0158] The second operation instruction is used to instruct the second process to acquire a write lock of the target GPU, and the write lock of the target GPU can allow the second process to perform a write operation on the resource of the target GPU.
[0159] In a specific example of the present disclosure, the rendering unit is further configured to:
[0160] In the process of rendering the initial three-dimensional scene after the adjustment operation by using the second process, a pause request is detected, the pause request is generated in a case where the first process needs to perform online rendering by using the target GPU again, and is used to request the second process to pause the use of the resource of the target GPU.
[0161] In response to the pause request, a third operation instruction is generated, and the third operation instruction is used to instruct the second process to release the write lock of the target GPU.
[0162] In a specific example of the present disclosure, the rendering unit is further configured to:
[0163] In a case where the first process performs online rendering by using the target GPU again, the first process is controlled to release the occupation right of the target GPU;
[0164] After the first process releases the occupation right of the target GPU, the rendering of the initial three-dimensional scene after the adjustment operation is continued in the second process to obtain a target rendering effect picture.
[0165] The specific functions and examples of the units of the apparatus of the embodiments of the present disclosure are described in the related description of the corresponding steps in the above method embodiments, which will not be described here.
[0166] In the technical solutions of the present disclosure, the acquisition, storage and application of user personal information comply with relevant laws and regulations and do not violate public order and good customs.
[0167] Figure 8 is a structural block diagram of an electronic device according to an embodiment of the present disclosure. As shown in Figure 8As shown, the electronic device includes a memory 810 and a processor 820, the memory 810 stores a computer program which can be run on the processor 820. The number of the memory 810 and the processor 820 can be one or more. The memory 810 can store one or more computer programs, when the one or more computer programs are executed by the electronic device, the electronic device performs the method provided by the above-mentioned method embodiments. The electronic device can also include a communication interface 830 for communicating with external devices and transmitting data.
[0168] If the memory 810, the processor 820 and the communication interface 830 are independently implemented, the memory 810, the processor 820 and the communication interface 830 can be connected to each other through a bus and complete communication between each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the middle, but it does not mean that there is only one bus or only one type of bus.
[0169] Optionally, in specific implementation, if the memory 810, the processor 820 and the communication interface 830 are integrated on a chip, the memory 810, the processor 820 and the communication interface 830 can complete communication between each other through an internal interface.
[0170] It should be understood that the above-mentioned processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. It is worth noting that the processor can be an advanced RISC machine (ARM) architecture processor.
[0171] Further, the aforementioned memory can include a read-only memory and a random access memory, and can also include a non-volatile random access memory. The memory can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memory. The non-volatile memory can include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically EPROM (EEPROM), or a flash memory. The volatile memory can include a random access memory (RAM) used as an external cache. By way of example, and not limitation, many forms of RAM can be used. For example, a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced SDRAM (ESDRAM), a Synchlink DRAM (SLDRAM), and a direct Rambus RAM (DR RAM) can be used.
[0172] In the above embodiments, all or part of the steps can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the steps can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present disclosure are generated. The computer can be a general purpose computer, a special purpose computer, a computer network or other programmable apparatus. The computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transferred from one website, computer, server or data center to another website, computer, server or data center through wired (for example: coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example: infrared, Bluetooth, microwave, etc.) mode. The computer readable storage medium can be any available medium accessible by a computer, or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be a magnetic medium (for example: floppy disk, hard disk, magnetic tape), an optical medium (for example: digital versatile disc (DVD)) or a semiconductor medium (for example: solid state disk (SSD)) etc. It is worth noting that the computer readable storage medium mentioned in the present disclosure can be a non-volatile storage medium, in other words, it can be a non-transitory storage medium.
[0173] A person of ordinary skill in the art can understand that all or part of the steps of the above embodiments can be completed by hardware, or the program can instruct the related hardware to complete, and the program can be stored in a computer readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk.
[0174] In the description of the embodiments of the present disclosure, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples. In addition, those skilled in the art can combine and combine the different embodiments or examples described in the specification and the features of the different embodiments or examples without contradiction.
[0175] In the description of the embodiments of the present disclosure, unless otherwise specified, " / " means or, for example, A / B can mean A or B. "And / or" in this document only describes the relationship between associated objects, which means that there can be three relationships, for example, A and / or B, which can mean: A exists alone, A and B exist together, and B exists alone.
[0176] In the description of the embodiments of the present disclosure, the terms "first", "second" are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more of the features. In the description of the embodiments of the present disclosure, unless otherwise specified, the meaning of "multiple" is two or more.
[0177] The above only describes exemplary embodiments of the present disclosure, and is not intended to limit the present disclosure. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A rendering method for a three-dimensional scene, comprising: In response to an adjustment operation on a sub-scene in a display interface, at least the sub-scene after the adjustment operation is displayed in a first display area, and a real-time rendering effect after online rendering of the sub-scene after the adjustment operation is displayed in a second display area; wherein the sub-scene is a partial scene in an initial three-dimensional scene displayed on the display interface; and the first display area and the second display area are both partial areas of the display interface; In response to the rendering operation of the initial three-dimensional scene after the adjustment operation, the third display area in the display interface displays the target rendering effect diagram after the rendering operation; wherein, the target rendering effect diagram at least includes the real-time rendering effect after the online rendering of the sub-scene after the adjustment operation.
2. The method according to claim 1, wherein The display area of the third display area is not less than the sum of the display areas of the first display area and the second display area.
3. The method according to claim 2, wherein: The third display area can cover the first display area and the second display area.
4. The method according to any one of claims 1 to 3, further comprising: In the first process, the target image processor GPU having a binding relationship with itself is used to perform online rendering on the sub-scene after the adjustment operation, so as to obtain a real-time rendering effect of the sub-scene after the adjustment operation.
5. The method according to claim 4, wherein Before the third display area in the display interface displays the target rendering effect image after the rendering operation, the method further includes: When the first process completes online rendering of the sub-scene after the adjustment operation by using the target GPU, the first process is controlled to release the occupation right of the target GPU.
6. The method according to claim 5, wherein: When the first process completes online rendering of the sub-scene after the adjustment operation by using the target GPU, controlling the first process to release the occupation right of the target GPU includes: generating a first operation instruction for the first process when it is determined that the first process is in an idle state; or, generating a first operation instruction for the first process when it is determined that the first process is in an idle state and the rendering operation is detected; The first operation instruction is used to instruct the first process to release the read lock of the target GPU; the read lock of the target GPU can allow the first process to perform a read operation on the resources of the target GPU.
7. The method according to claim 5 or 6, further comprising: After the first process releases the occupation right of the target GPU, in the second process having a binding relationship with the target GPU, the target GPU is used to render the initial three-dimensional scene after the adjustment operation to obtain a target rendering effect image.
8. The method according to claim 5 or 6, further comprising: After the first process releases the occupation right of the target GPU, in the second process having a binding relationship with the target GPU, the target GPU is used to render other three-dimensional scenes.
9. The method according to claim 7, further comprising: After determining that the first process has released the read lock of the target GPU, generating a second operation instruction for the second process; or, If it is determined that the first process has released the read lock of the target GPU and the rendering operation is detected, generating a second operation instruction for the second process; The second operation instruction is used to instruct the second process to obtain a write lock of the target GPU; the write lock of the target GPU can allow the second process to perform write operations on resources of the target GPU.
10. The method according to claim 7, further comprising: During the process of rendering the initial three-dimensional scene after the adjustment operation using the second process, a pause request is detected, where the pause request is generated when the first process needs to use the target GPU for online rendering again, and is used to request the second process to suspend use of resources of the target GPU; In response to the pause request, a third operation instruction is generated, where the third operation instruction is used to instruct the second process to release the write lock of the target GPU.
11. The method according to claim 9, further comprising: When the first process completes online rendering by using the target GPU again, controlling the first process to release the occupation right of the target GPU; After the first process releases the occupation right of the target GPU, the second process continues to render the initial three-dimensional scene after the adjustment operation to obtain a target rendering effect image.
12. A rendering device for a three-dimensional scene, comprising: Input unit, used to obtain adjustment operations or rendering operations; A rendering unit is used to, in response to an adjustment operation on a sub-scene in a display interface, display at least the sub-scene after the adjustment operation in a first display area, and display a real-time rendering effect after online rendering of the sub-scene after the adjustment operation in a second display area; wherein, the sub-scene is a partial scene in an initial three-dimensional scene displayed on the display interface; the first display area and the second display area are both partial areas in the display interface; in response to the rendering operation on the initial three-dimensional scene after the adjustment operation, display a target rendering effect diagram after the rendering operation in a third display area of the display interface; wherein, the target rendering effect diagram includes at least a real-time rendering effect after online rendering of the sub-scene after the adjustment operation.
13. The device according to claim 12, wherein The rendering unit is further configured to: In the first process, the target image processor GPU having a binding relationship with itself is used to perform online rendering on the sub-scene after the adjustment operation, so as to obtain a real-time rendering effect of the sub-scene after the adjustment operation.
14. The device according to claim 13, wherein The rendering unit is further configured to: After the first process releases the occupation right of the target GPU, in the second process having a binding relationship with the target GPU, the target GPU is used to render the initial three-dimensional scene after the adjustment operation to obtain a target rendering effect image.
15. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 11.
16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-11.
17. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 11.
Citation Information
Cited By
Controllable generation method and device of three-dimensional effect picture, equipment and storage medium
CN121353552A