Method and device for generating three-dimensional virtual picture, equipment and medium
By collaborating on the loading and preloading of virtual models between the rendering end and the resource loading server, the problem of slow model loading speed in 3D virtual scenes is solved, and high-quality and smooth three-dimensional virtual screen display on terminal devices is achieved.
Patent Information
- Application Number
- CN202510739513.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-07-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, the model loading speed of the three-dimensional virtual scene is slow, resulting in high performance requirements of terminal equipment and difficult to load and run smoothly, reducing the smoothness and quality of the generation of three-dimensional virtual pictures.
By working together between the rendering side and the resource loading server, the virtual model is loaded and preloaded dynamically based on the location information of the virtual lens, and the queue mechanism is used to manage model resources, reducing the load on the terminal and improving loading fluency.
It realizes smooth display of high-quality three-dimensional virtual pictures on terminal devices, reduces the requirements for terminal performance, and improves the experience of watching three-dimensional virtual pictures.
Smart Images

Figure CN120259514A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of three-dimensional image processing technologies, and in particular, to a method, apparatus, device, and medium for generating a three-dimensional virtual image. Background Art
[0002] With the development of science and technology, three-dimensional virtual models are increasingly widely used, and are often used to construct three-dimensional digital virtual scenes. A certain viewing image in the three-dimensional digital virtual scene is a three-dimensional virtual image. The three-dimensional digital virtual scene needs to be loaded with various three-dimensional virtual models through a rendering end, and the loading speed of the models affects the viewing experience of the three-dimensional virtual image.
[0003] In related technologies, virtual models required for a three-dimensional digital virtual scene are often loaded at one time on a terminal. However, in the face of a large three-dimensional digital virtual scene, the number of virtual models to be loaded is huge and complex, and the performance requirements for the terminal device are relatively high. As a result, even a terminal with high-performance configuration is difficult to successfully load and run the scene, thereby reducing the smoothness and quality of the generation of the three-dimensional virtual image and the viewing experience of the three-dimensional virtual image. Summary of the Invention
[0004] The main objective of the embodiments of the present disclosure is to propose a method, apparatus, device, and medium for generating a three-dimensional virtual image, which can improve the smoothness and quality of the generation of the three-dimensional virtual image and the viewing experience of the three-dimensional virtual image.
[0005] To achieve the above objective, a first aspect of the embodiments of the present disclosure proposes a method for generating a three-dimensional virtual image, which is applied to a rendering end and includes: Obtain an initial three-dimensional virtual image in a three-dimensional display scene, where the initial three-dimensional virtual image is captured in a preset virtual map through initial position information of a virtual camera towards multiple loaded virtual models in the three-dimensional display scene; When the virtual camera moves to target position information, synchronize the target position information to a resource loading server, so that the resource loading server determines distance information between the virtual camera and each of the virtual models in the virtual map based on the target position information, and adds the virtual models within a preloading area around the virtual camera to a first queue based on the distance information, and adds the virtual models within a loading area around the virtual camera in the first queue to a second queue; Receive the first queue and the second queue sent by the resource loading server, perform a loading operation on the virtual models in the second queue, and perform a preloading operation on the virtual models in the first queue to obtain an updated three-dimensional display scene; Based on the target position information where the virtual camera is located, capture a target three-dimensional virtual image of multiple loaded virtual models in the updated three-dimensional display scene, and send the target three-dimensional virtual image to the terminal.
[0006] In some embodiments, the obtaining of the initial three-dimensional virtual image in the three-dimensional display scene includes: In response to a scene initialization creation request for any three-dimensional display scene in a preset virtual map, construct a blank scene without models; Obtain the pre-configured scene configuration information of the three-dimensional display scene, where the scene configuration information includes multiple virtual models located in the three-dimensional display scene; Based on the scene configuration information, perform a loading operation on multiple virtual models in the three-dimensional display scene, and add the loaded multiple virtual models to the blank scene to generate the three-dimensional display scene; Create a virtual camera in the three-dimensional display scene, and based on the initial position information where the virtual camera is located, capture an initial three-dimensional virtual image of multiple loaded virtual models in the three-dimensional display scene.
[0007] In some embodiments, there are multiple virtual models in the first queue and the second queue, and the multiple virtual models are all arranged according to the size of the loading weights; The performing a loading operation on the virtual models in the second queue and a preloading operation on the virtual models in the first queue to obtain an updated three-dimensional display scene includes: In sequence according to the sorting order among the virtual models in the second queue, perform a loading operation on the virtual models in the second queue; And, in sequence according to the sorting order among the virtual models in the first queue, perform a preloading operation on the virtual models in the first queue to obtain an updated three-dimensional display scene.
[0008] In some embodiments, before obtaining the updated three-dimensional display scene, the method for generating the three-dimensional virtual image further includes: Perform an unloading operation on the virtual models that are not in the first queue and the second queue but have been loaded in the current three-dimensional display scene; For the virtual models that are not in the second queue but are in the first queue and have been loaded in the current three-dimensional display scene, first perform an unloading operation and then a preloading operation.
[0009] To achieve the above object, a second aspect of the embodiments of the present disclosure provides a device for generating a three-dimensional virtual image, which is applied to a resource loading server and includes: Receiving target position information to which a virtual camera moves sent by a rendering end, where the target position information is sent synchronously by the rendering end when the virtual camera moves to the target position information after obtaining an initial three-dimensional virtual image in a three-dimensional display scene, and the initial three-dimensional virtual image is captured in a preset virtual map through the initial position information where the virtual camera is located for a plurality of loaded virtual models in the three-dimensional display scene; Determining distance information between the virtual camera and each of the virtual models in the virtual map based on the target position information, and adding the virtual models in a preloading area around the virtual camera to a first queue based on the distance information, and adding the virtual models in a loading area around the virtual camera in the first queue to a second queue; Synchronizing the first queue and the second queue to the rendering end, so that the rendering end performs a loading operation on the virtual models in the second queue and a preloading operation on the virtual models in the first queue to obtain an updated three-dimensional display scene; Wherein, the rendering end also captures a target three-dimensional virtual image for a plurality of loaded virtual models in the updated three-dimensional display scene through the target position information where the virtual camera is located, and sends the target three-dimensional virtual image to a terminal.
[0010] In some embodiments, the adding the virtual models in a preloading area around the virtual camera to a first queue based on the distance information, and adding the virtual models in a loading area around the virtual camera in the first queue to a second queue includes: Determining a loading weight of each of the virtual models in the virtual map; Adding the virtual models in a preloading area around the virtual camera to the first queue in sequence according to the corresponding magnitudes of the loading weights based on the distance information; And adding the virtual models in a loading area around the virtual camera in the first queue to the second queue in sequence according to the corresponding magnitudes of the loading weights based on the distance information.
[0011] In some embodiments, the determining a loading weight of each of the virtual models in the virtual map includes: Determining a virtual volume of each of the virtual models in the virtual map; Configure loading weights of corresponding sizes for each of the virtual models according to the size of the virtual volume.
[0012] In some embodiments, after determining the loading weights of the virtual models in the virtual map, the method for generating the three-dimensional virtual scene further includes: In response to a parameter adjustment instruction for any one of the virtual models, adjust the corresponding loading weight; Alternatively, obtain the historical loading frequencies of the virtual models in the virtual map, and adjust the loading weights corresponding to the virtual models according to the loading frequencies.
[0013] In some embodiments, the method for generating the three-dimensional virtual scene further includes: Obtain the moving speed of the virtual camera; When the moving speed reaches a preset target speed threshold, adjust the sizes of the preloading area and the loading area according to the magnitude of the moving speed.
[0014] In some embodiments, the determining the distance information between the virtual camera and each of the virtual models in the virtual map based on the target position information includes: Determine the position information of the model center points of the virtual models in the virtual map; Based on the target position information and the position information of each of the model center points, calculate the distance information between the virtual camera and each of the virtual models in the virtual map.
[0015] In some embodiments, the determining the distance information between the virtual camera and each of the virtual models in the virtual map based on the target position information, and adding the virtual models within the preloading area around the virtual camera to a first queue based on the distance information, and adding the virtual models within the loading area around the virtual camera in the first queue to a second queue includes: Determine a first distance determination range and a second distance determination range for each of the virtual models in the virtual map; If the target position information is within the first distance determination range of any one of the virtual models, add the corresponding virtual model to the first queue; If the target position information is within the second distance determination range of any one of the virtual models, add the corresponding virtual model to the second queue.
[0016] To achieve the above object, a third aspect of the embodiments of the present disclosure provides a device for generating a three-dimensional virtual scene, which is applied to a rendering end and includes: A screen acquisition module, configured to acquire an initial three-dimensional virtual screen in a three-dimensional display scene, where the initial three-dimensional virtual screen is captured in a preset virtual map through initial position information of a virtual camera and directed at a plurality of loaded virtual models in the three-dimensional display scene; A position synchronization module, configured to synchronize the target position information to a resource loading server when the virtual camera moves to the target position information, so that the resource loading server determines distance information between the virtual camera and each of the virtual models in the virtual map based on the target position information, and adds the virtual models within a preloading area around the virtual camera to a first queue based on the distance information, and adds the virtual models within a loading area around the virtual camera in the first queue to a second queue; A model processing module, configured to receive the first queue and the second queue sent by the resource loading server, perform a loading operation on the virtual models in the second queue, and perform a preloading operation on the virtual models in the first queue to obtain an updated three-dimensional display scene; A screen generation module, configured to capture a target three-dimensional virtual screen by using the target position information of the virtual camera and directed at a plurality of loaded virtual models in the updated three-dimensional display scene, and send the target three-dimensional virtual screen to a terminal.
[0017] To achieve the above object, a fourth aspect of the embodiments of the present disclosure provides a device for generating a three-dimensional virtual screen, which is applied to a resource loading server and includes: A position receiving module, configured to receive target position information to which a virtual camera moves sent by a rendering end, where the target position information is synchronously sent by the rendering end after acquiring an initial three-dimensional virtual screen in a three-dimensional display scene and when the virtual camera moves to the target position information, and the initial three-dimensional virtual screen is captured in a preset virtual map through initial position information of the virtual camera and directed at a plurality of loaded virtual models in the three-dimensional display scene; A resource loading module, configured to determine distance information between the virtual camera and each of the virtual models in the virtual map based on the target position information, and add the virtual models within a preloading area around the virtual camera to a first queue based on the distance information, and add the virtual models within a loading area around the virtual camera in the first queue to a second queue; A resource synchronization module, configured to synchronize the first queue and the second queue to the rendering end, so that the rendering end performs a loading operation on the virtual models in the second queue, and a pre-loading operation on the virtual models in the first queue, to obtain an updated three-dimensional display scene; Wherein, the rendering end further captures a target three-dimensional virtual image of multiple loaded virtual models in the updated three-dimensional display scene through the target position information where the virtual camera is located, and sends the target three-dimensional virtual image to the terminal.
[0018] To achieve the above object, a fifth aspect of the embodiments of the present disclosure provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the method for generating a three-dimensional virtual image described in the first aspect embodiment above, or the method for generating a three-dimensional virtual image described in the second aspect embodiment above.
[0019] To achieve the above object, a sixth aspect of the embodiments of the present disclosure provides a storage medium, the storage medium is a computer-readable storage medium, the storage medium stores a computer program, and when the computer program is executed by a processor, it implements the method for generating a three-dimensional virtual image described in the first aspect embodiment above, and the method for generating a three-dimensional virtual image described in the second aspect embodiment above.
[0020] The method, device, equipment and medium for generating a three-dimensional virtual image proposed in the embodiments of the present disclosure, the method for generating a three-dimensional virtual image can be applied in a device for generating a three-dimensional virtual image. By executing the method for generating a three-dimensional virtual image, when the rendering end displays the current three-dimensional display scene, only the virtual models in the scene are loaded. When the virtual camera in the scene moves, the target position information of the virtual camera can be synchronized to the resource loading server, and the resource loading server determines the virtual models that need to be loaded and pre-loaded around according to the new position of the virtual camera into the relevant queues. When the rendering end receives the synchronized first queue and second queue, it can specifically load and pre-load the virtual models near the position where the virtual camera moves, thereby greatly reducing the resource load. The rendering end does not need to load all the virtual models in the virtual map at one time, and the resource loading server can be used to select the virtual models that need to be loaded, thereby improving the fluency of the rendering and loading process. Finally, a high-quality three-dimensional virtual image can be smoothly generated and sent to the terminal, so that the terminal can smoothly display the three-dimensional virtual image without high-performance configuration, and the viewing experience of the three-dimensional virtual image is improved. Description of the Drawings
[0021] Figure 1 It is a schematic diagram of an application environment of the method for generating a three-dimensional virtual image provided by the embodiments of the present disclosure; Figure 2 It is a schematic flowchart of a method for generating a three-dimensional virtual scene applied to a rendering end according to an embodiment of the present disclosure; Figure 3 It is a schematic diagram of a virtual map according to an embodiment of the present disclosure; Figure 4 It is a schematic diagram of a virtual camera at the initial position information according to an embodiment of the present disclosure; Figure 5 It is a schematic diagram of a virtual camera at the target position information according to an embodiment of the present disclosure; Figure 6 It is Figure 2 a schematic flowchart further included in step S101 in Figure 7 It is Figure 2 a schematic flowchart further included in step S103 in Figure 8 It is Figure 2 a schematic flowchart further included in another step S103 in Figure 9 It is a schematic flowchart of a method for generating a three-dimensional virtual scene applied to a resource loading server according to an embodiment of the present disclosure; Figure 10 It is Figure 9 a schematic flowchart further included in step S502 in Figure 11 It is Figure 10 a schematic flowchart further included in step S601 in Figure 12 It is Figure 10 a schematic flowchart further included after step S601 in Figure 13 It is another schematic flowchart of a method for generating a three-dimensional virtual scene according to an embodiment of the present disclosure; Figure 14 It is a schematic diagram of different preloading areas and loading areas according to an embodiment of the present disclosure; Figure 15 It is Figure 9 a schematic flowchart further included in another step S502 in Figure 16 It is Figure 9 a schematic flowchart further included in yet another step S502 in Figure 17 It is a schematic diagram for determining a second distance determination range according to an embodiment of the present disclosure; Figure 18 It is a schematic diagram of functional modules of a device for generating a three-dimensional virtual scene applied to a rendering end according to an embodiment of the present disclosure; Figure 19It is a schematic diagram of the functional modules of a three-dimensional virtual scene generation device applied in a resource loading server provided by an embodiment of the present disclosure; Figure 20 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners
[0022] In order to make the objectives, technical solutions and advantages of the present disclosure more clear and understandable, the present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.
[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present disclosure belongs. The terms used herein are only for the purpose of describing the embodiments of the present disclosure and are not intended to limit the present disclosure.
[0024] First, several terms involved in the present disclosure are analyzed: Artificial intelligence (AI): It is a new technical science that studies, develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence; artificial intelligence is a branch of computer science. Artificial intelligence attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a way similar to human intelligence. The research in this field includes robots, speech recognition, image recognition, natural language processing and expert systems, etc. Artificial intelligence can simulate the information process of human consciousness and thinking. Artificial intelligence also uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results of theories, methods, technologies and application systems.
[0025] Artificial intelligence basic technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation / interaction systems, and mechatronics. Artificial intelligence software technologies mainly include several major directions such as computer vision technology, robotics technology, biometric technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0026] The rendering engine is the core part of a three-dimensional engine, which is responsible for rendering data such as three-dimensional models, textures, and lighting into two-dimensional images in real time, so as to construct a realistic virtual scene.
[0027] With the development of science and technology, the application of three-dimensional virtual models has become increasingly widespread, and it is often used to construct three-dimensional digital virtual scenes. A certain viewing screen in the three-dimensional digital virtual scene is a three-dimensional virtual picture. The three-dimensional digital virtual scene needs to load each three-dimensional virtual model through a rendering end, and the loading speed of the model affects the viewing experience of the three-dimensional virtual picture.
[0028] In related technologies, the virtual models required for a three-dimensional digital virtual scene are often loaded at one time on the terminal. However, in the face of a large three-dimensional digital virtual scene, for example, the current large digital virtual city scene usually adopts the method of integrating the entire city modeling together and running and loading it at one time. The number of virtual models to be loaded is huge and complex, and the performance requirements for the terminal device are relatively high, resulting in difficulty for even a terminal with high-performance configuration to smoothly load and run the scene, thereby reducing the smoothness and quality of the generation of the three-dimensional virtual picture and the viewing experience of the three-dimensional virtual picture.
[0029] Based on this, the embodiments of the present disclosure provide a method, device, equipment, and medium for generating a three-dimensional virtual picture, which can improve the smoothness and quality of the generation of the three-dimensional virtual picture and the viewing experience of the three-dimensional virtual picture.
[0030] The method for generating a three-dimensional virtual picture in the embodiments of the present disclosure can be illustrated by the following embodiments.
[0031] The embodiments of the present disclosure can acquire and process relevant data based on artificial intelligence technology.
[0032] The method for generating a three-dimensional virtual picture provided by the embodiments of the present disclosure can be deployed in a rendering end, a resource loading server, or a system composed of the two, and can also be deployed in a terminal; the resource loading server is a server end, or software running on a terminal or a server end. Exemplarily, please refer to Figure 1 , Figure 1 is a schematic diagram of an application environment of the method for generating a three-dimensional virtual picture provided by the embodiments of the present disclosure. The three-dimensional virtual picture generation system (hereinafter referred to as the system for short) is provided with a rendering end and a resource loading server. The rendering end is deployed with a rendering engine. The rendering end can be a terminal device or a server. The rendering end is communicatively connected to the resource loading server, and the rendering end can also be communicatively connected to the terminal. The embodiments of the present disclosure do not make specific limitations on this.
[0033] In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the method for generating a three-dimensional virtual picture, etc., but is not limited to the above forms.
[0034] The present disclosure can be used in numerous general-purpose or special-purpose computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and so on. The present disclosure can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present disclosure can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0035] It should be noted that in each specific implementation manner of the present disclosure, when obtaining the relevant data of the initial three-dimensional virtual picture and the virtual model for relevant processing, the user's permission or consent will be obtained first. Moreover, the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiments of the present disclosure need to obtain the relevant data of the initial three-dimensional virtual picture and the virtual model, the user's separate permission or separate consent can be obtained through a pop-up window or by jumping to a confirmation page, etc. After clearly obtaining the user's separate permission or separate consent, then obtain the necessary relevant data of the initial three-dimensional virtual picture and the virtual model for the embodiments of the present disclosure to operate normally.
[0036] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of the method for generating a three-dimensional virtual picture of the application in the rendering end provided by the embodiments of the present disclosure, Figure 2 The method in
[0037] Step S101, obtain the initial three-dimensional virtual picture in the three-dimensional display scene; Among them, the initial three-dimensional virtual scene is captured in a preset virtual map through the initial position information of the virtual camera, towards multiple loaded virtual models in the three-dimensional display scene; Step S102, when the virtual camera moves to the target position information, synchronize the target position information to the resource loading server, so that the resource loading server determines the distance information between the virtual camera and each virtual model in the virtual map based on the target position information, and adds the virtual models within the preloading area around the virtual camera to the first queue based on the distance information, and adds the virtual models within the loading area around the virtual camera in the first queue to the second queue; Step S103, receive the first queue and the second queue sent by the resource loading server, perform a loading operation on the virtual models in the second queue, and perform a preloading operation on the virtual models in the first queue to obtain an updated three-dimensional display scene; Step S104, capture a target three-dimensional virtual scene through the target position information of the virtual camera towards multiple loaded virtual models in the updated three-dimensional display scene, and send the target three-dimensional virtual scene to the terminal.
[0038] Regarding the above-mentioned step S101, the three-dimensional display scene is a currently displayed scene, which is a virtual environment composed of multiple three-dimensional virtual models in a computer. The virtual models can be digital representations of any objects or environments that can be found in the real world, such as buildings, people, animals, plants, terrain, etc.
[0039] The three-dimensional display scene in the embodiments of the present disclosure allows users to move and interact in the virtual space through a virtual camera, simulating a real or imaginary environment. This scene is defined in a virtual map, which is a database containing the positions and attributes of all scene elements. The three-dimensional display scene is a specific scene in the virtual map, or the current display scene of the virtual map. The virtual map contains multiple virtual models, and the three-dimensional display scene can load some of them.
[0040] It should be noted that the virtual camera has an initial position information, which determines from which angle and position to observe this three-dimensional display scene. The rendering end in the embodiments of the present disclosure can "capture" images of multiple loaded virtual models in the scene according to the initial position information of the virtual camera, that is, render the scene seen from this perspective.
[0041] Regarding the above-mentioned step S102, when the virtual camera moves in the 3D display scene, its position information will change. The target position information can be any new target position or a specified target position. Once the virtual camera moves to the new target position information, in the embodiments of the present disclosure, the rendering end can synchronize the position of the virtual camera to the resource loading server, that is, the rendering end synchronizes the target position information to the resource loading server. The role of the resource loading server is to determine which virtual models should be loaded and which should be pre-loaded according to the position of the virtual camera.
[0042] The first queue contains virtual models within a certain range around the virtual camera. This range is the pre-loading range. The virtual models within the pre-loading range may be seen by the user in the near future, so they need to be pre-loaded. Pre-loading means loading the model resources (such as materials, textures, meshes, positions, sizes, textures, etc.) of these models into the memory, but not necessarily rendering them immediately. The second queue contains virtual models within a closer range to the virtual camera. This range is the loading range. The virtual models within the loading range are those that the user is currently or about to see, so they need to be loaded and rendered immediately.
[0043] Specifically, after receiving the target position information of the virtual camera, the resource loading server calculates the distance information between this position and any virtual model in the virtual map. The distance information can be calculated through spatial coordinates. The resource loading server divides the virtual models according to the distance information. When the position of the virtual model is within the pre-loading area, these virtual models need to be added to the first queue for pre-loading; when the position of the virtual model is within the loading area, these virtual models need to be added to the second queue for loading.
[0044] It should be noted that if the distance information indicates that the virtual model is not within the pre-loading range, it means that these virtual models are not shown near the current scene, so no loading or pre-loading process is required. As the virtual camera moves, the resource loading server will continuously update the content of the first queue and the second queue. This is a synchronous process, and virtual models may move from one queue to another or be removed from the queue, depending on their distance from the current position of the virtual camera.
[0045] Regarding the above-mentioned step S103, during the process of the resource loading server updating the first queue and the second queue, the resource loading server can synchronously update the first queue and the second queue to the rendering end in real time. After receiving the synchronously updated first queue and second queue, the rendering end can perform a loading operation on the virtual models in the second queue, including reading the model resources of the virtual models in the first queue from the storage device and loading them into the memory so that these models can be immediately rendered. In addition, the rendering end performs a preloading operation on the virtual models in the first queue, including loading the model resources of the virtual models in the first queue into the memory, but not necessarily rendering them immediately. The purpose of preloading is to reduce the loading delay when the user actually sees these models.
[0046] After completing the loading and preloading operations, the rendering end updates the three-dimensional display scene, including adding the newly loaded virtual models to the scene and updating the existing models in the scene, such as position, animation state, etc., so as to obtain an updated three-dimensional display scene.
[0047] It should be noted that after updating the three-dimensional display scene, the rendering end can prepare for the rendering of the next frame, including setting the parameters of the virtual camera, such as position, direction, focal length, etc., and determining which virtual models are visible in the current view and preparing to render them.
[0048] Regarding the above-mentioned step S104, after the rendering end obtains the updated three-dimensional display scene, the rendering end can perform a screen output based on the updated three-dimensional display scene. Specifically, the rendering end uses the virtual camera to "take" a picture from the updated three-dimensional display scene. This process is completed by the rendering engine, which calculates and generates a two-dimensional image, that is, the target three-dimensional virtual picture, according to the parameters of the virtual camera, such as position, direction, focal length, etc., and the attributes of the virtual models in the scene, such as shape, color, texture, etc. After the target three-dimensional virtual picture is generated, the rendering end will send it to the terminal through the network or other communication means. After receiving the target three-dimensional virtual picture, the terminal can display the target three-dimensional virtual picture or perform further image processing operations based on the target three-dimensional virtual picture. The embodiments of the present disclosure do not make specific limitations on this.
[0049] Next, the above embodiments will be illustrated by examples.
[0050] Please refer to Figure 3 , Figure 3It is a schematic diagram of a virtual map provided by an embodiment of the present disclosure. In some embodiments, the virtual map may include four virtual models, namely Building A, Building B, Building C, and Building D, and there are also roads connecting the buildings in the virtual map. The present disclosure embodiment does not make specific limitations on other virtual models in the virtual map. Among them, the virtual camera can be located at the upper right corner of the virtual map. By moving the virtual camera, it is possible to move in the virtual map, including moving on the road or entering a building.
[0051] Please refer to Figure 4 , Figure 4 It is a schematic diagram of the virtual camera at the initial position information provided by an embodiment of the present disclosure. When the virtual camera is at the initial position information, the three-dimensional display scene that can be captured is shown by the solid circle in the figure. It can be seen that the current Building A and Building B are within the loading range and are several virtual models that need to be viewed currently, while Building C and Building D are outside the current line of sight. However, since Building C is relatively close to Building B, that is, a virtual model that will be seen in the current field of view, this model can be within the preloading range, that is, within the dotted circle in the figure. Based on this, in the embodiment of the present disclosure, the relevant information of Building C can be added to the first queue, and the relevant information of Building A and Building B can be added to the second queue. Subsequently, after the rendering end obtains the first queue and the second queue, it can load Building A and Building B and preload Building C without loading or preloading Building D to obtain the current three-dimensional display scene.
[0052] Please refer to Figure 5 , Figure 5 It is a schematic diagram of the virtual camera at the target position information provided by an embodiment of the present disclosure. After the virtual camera moves from the initial position information to the target position information, it can be seen that Building A, Building B, and Building C are within the current loading range and are several virtual models that need to be viewed currently, while Building D is outside the current line of sight. However, since Building D is relatively close to Building C, that is, a virtual model that will be seen in the current field of view, this model can be within the preloading range, that is, within the dotted circle in the figure. Based on this, in the embodiment of the present disclosure, the relevant information of Building C can be updated to the second queue, and the relevant information of Building D can be added to the first queue. Subsequently, after the rendering end obtains the first queue and the second queue, since Building A and Building B have already been loaded, only the preloaded Building C needs to be loaded and Building D needs to be preloaded to obtain the updated three-dimensional display scene.
[0053] In summary, in the embodiments of the present disclosure, through steps S101 to S104, by executing the method for generating a three-dimensional virtual scene, when the rendering end displays the current three-dimensional display scene, only the virtual models within the scene are loaded. When the virtual camera in the scene moves, the target position information of the virtual camera can be synchronized to the resource loading server, and the resource loading server determines the virtual models that need to be loaded and pre-loaded around according to the new position of the virtual camera and adds them to the relevant queues. When the rendering end receives the synchronized first queue and second queue, it can specifically load and pre-load the virtual models near the position where the virtual camera moves, thereby greatly reducing the resource load. The rendering end does not need to load all the virtual models in the virtual map at one time, and the resource loading server can be used to select the virtual models that need to be loaded, thereby improving the smoothness of the rendering and loading process. Finally, a high-quality three-dimensional virtual scene can be smoothly generated and sent to the terminal, enabling the terminal to smoothly display the three-dimensional virtual scene without high-performance configuration, and improving the viewing experience of the three-dimensional virtual scene.
[0054] The above embodiments describe the content of how to smoothly generate a high-quality three-dimensional virtual scene during the operation of the scene. In addition, the embodiments of the present disclosure can also be improved during the initialization of the scene to smoothly generate a high-quality three-dimensional virtual scene during the initialization process of the scene.
[0055] Please refer to Figure 6 , Figure 6 which Figure 2 is a schematic flowchart further included in step S101 in In some embodiments, step S101 may include steps S201 to S204: Step S201, in response to a scene initialization creation request for any three-dimensional display scene in a preset virtual map, construct a blank scene without models; Step S202, obtain the pre-configured scene configuration information of the three-dimensional display scene; Among them, the scene configuration information includes a plurality of virtual models located within the three-dimensional display scene; Step S203, perform a loading operation on the plurality of virtual models within the three-dimensional display scene based on the scene configuration information, and add the loaded plurality of virtual models to the blank scene to generate a three-dimensional display scene; Step S204, create a virtual camera in the three-dimensional display scene, and based on the initial position information where the virtual camera is located, take an initial three-dimensional virtual scene of the plurality of loaded virtual models within the three-dimensional display scene.
[0056] In the above steps, the scene initialization creation request can be issued by a user or an application, and it is a creation request for creating the current 3D display scene. When the rendering end receives a scene initialization creation request for a 3D display scene in a preset virtual map, it can respond to this request. The rendering end creates a new, blank 3D scene, obtaining a blank scene without models. In the blank scene, there are no virtual models, textures, light sources, or other elements, just an empty space waiting to be filled.
[0057] The scene configuration information is the detailed information for constructing the 3D display scene. The scene configuration information includes multiple virtual models located within the 3D display scene. Further, the scene configuration information includes the model resources of each virtual model within the scene. It should be noted that the scene configuration information can be generated after splitting each virtual model in the virtual map in advance. For example, during the process of splitting the model resources of each virtual resource in the virtual map, the model resources of multiple virtual models in a certain scene can be integrated together to form the scene configuration information for that scene. Subsequently, the scene configuration information is stored in the scene configuration library, which can be a database or a storage system and can be used to store the scene configuration information for different scenes, so as to be obtained by the rendering end and the resource loading server during the initialization process.
[0058] After obtaining the pre-configured scene configuration information of the 3D display scene, the rendering end starts to load these models according to the virtual model list in the scene configuration information. The loading process includes parsing these files into data structures in memory based on the model resources of each virtual model in the scene configuration information or the model files containing the model resources, and performing any necessary preprocessing, such as texture loading, lighting calculation, etc. Finally, the rendering end places the loaded virtual models at the corresponding positions in the blank scene, and a complete 3D display scene is generated.
[0059] After establishing the 3D display scene, the rendering end generates a virtual camera in the 3D display scene. The creation of the virtual camera involves setting parameters such as its position, orientation, and field of view. In one embodiment, the embodiments of the present disclosure can generate the virtual camera and its initial position information based on pre-configured parameters such as position, orientation, and field of view. In addition, the initial position information of the virtual camera can also be determined based on the scene configuration information or user input, and the embodiments of the present disclosure do not make specific limitations in this regard.
[0060] After generating the virtual camera, the rendering end can use the virtual camera to "shoot" the scene. The rendering end can calculate the scene image seen by the virtual camera. The result of the shooting process is an initial three-dimensional virtual picture. This picture is the scene image observed from the initial position of the virtual camera, and it contains the rendering results of all the loaded virtual models in the scene. This initial three-dimensional virtual picture is the picture that the user sees when first entering the three-dimensional display scene. Finally, after obtaining the initial three-dimensional display picture, the initialization process in the embodiments of the present disclosure is completed.
[0061] It should be noted that in the embodiments of the present disclosure, during the initialization process, the resource loading server can obtain the relevant information of the current scene from the scene configuration information, and obtain the initial position information of the virtual camera therein, so that subsequent resource judgment can be started from the initial position information to determine which virtual models need to be loaded and pre-loaded.
[0062] In summary, in the embodiments of the present disclosure, in the initialization stage, the rendering end first starts a blank scene without three-dimensional models. Immediately afterwards, the resource loading server and the rendering end query the scene configuration information, load the relevant model resources of the virtual models that need to be loaded only for initialization instead of the full amount according to the scene configuration information, perform scene initialization, run the scene and generate a virtual camera in the scene, and start to synchronize the camera information to the resource loading server, thereby providing a basis for subsequent scene operation and dynamic loading. It is not necessary to load all the virtual models in the virtual map, avoiding overload, and ensuring that high-quality three-dimensional virtual pictures can be generated even in the scene initialization stage.
[0063] In some embodiments, there are multiple virtual models in the first queue and the second queue, and the multiple virtual models are all arranged according to the loading weights. Please refer to Figure 7 , Figure 7 is Figure 2 The schematic flow diagram further included in step S103 in Step S301, perform loading operations on the virtual models in the second queue in sequence according to the sorting order among the virtual models in the second queue; Step S302, and perform pre-loading operations on the virtual models in the first queue in sequence according to the sorting order among the virtual models in the first queue to obtain an updated three-dimensional display scene.
[0064] In the above steps, the rendering end will receive the second queue sent by the resource loading server. This queue contains the virtual models within the loading area around the virtual camera. These models are the ones that the virtual camera in the current scene is most likely to immediately observe, so they need to be preferentially loaded to the rendering end to ensure that the user can smoothly experience the three-dimensional virtual scene.
[0065] Specifically, in the second queue, the virtual models have been sorted according to corresponding rules. For example, they have been sorted according to the magnitude of the loading weights. Those with larger loading weights need to be loaded first. This sorting ensures that the virtual models closest to the virtual camera, the largest virtual models, or the virtual models most important to the user will be loaded first. Therefore, the rendering end will load each virtual model in sequence according to the sorting order in the second queue.
[0066] Similarly, the rendering end will receive the first queue sent by the resource loading server. This queue contains virtual models within the preloading area around the virtual camera. Although these models are not currently within the direct line of sight of the virtual camera, according to the movement trend of the virtual camera and the scene layout, they may be observed by the virtual camera in the near future. Therefore, preloading these models can ensure that when the user moves to these areas, high-quality 3D virtual images can be immediately seen without delay or lag.
[0067] Specifically, similar to the second queue, the virtual models in the first queue have been sorted according to corresponding rules, which will not be elaborated here. However, since these models are preloaded, their sorting may focus more on predicting future movement trends and possible viewpoints. Therefore, the rendering end will perform preloading operations on each virtual model in sequence according to the sorting order in the first queue.
[0068] Finally, as the models in the second queue are loaded and the models in the first queue are preloaded, the 3D display scene will be continuously updated. This update is dynamic and will be adjusted in real time according to the movement and interaction of the virtual camera. When the virtual camera moves to a new position, the rendering end will repeat the process of the above steps to ensure that the scene always remains synchronized with the viewpoint of the virtual camera.
[0069] Please refer to Figure 8 , Figure 8 which Figure 2 is another schematic flow diagram further included in step S103 in Step S401: Unload the virtual models that are not in the first queue and the second queue but have already been loaded in the current 3D display scene; Step S402: For the virtual models that are not in the second queue but are in the first queue and have already been loaded in the current 3D display scene, first perform an unloading operation and then a preloading operation.
[0070] In the above steps, the rendering end checks all the loaded virtual models in the current 3D display scene and determines which virtual models are neither in the first queue nor in the second queue. These virtual models no longer need to be loaded or pre-loaded. For the filtered unnecessary virtual models, the rendering end performs an unloading operation, including releasing the data of these virtual models from memory, stopping any rendering processes related to the virtual model, and possibly cleaning up other resources associated with the virtual model, such as textures, lighting data, etc.
[0071] Similarly, the rendering end processes those virtual models that are in the first queue but not currently in the second queue and have been loaded in the current 3D display scene. Although these models are not currently within the user's direct line of sight, they are still around the current virtual camera. If the virtual camera moves back, they may be observed by the virtual camera at some point in the future. Therefore, for these identified virtual models, the rendering end will first perform an unloading operation to remove them from the current scene to release memory and other resources to prepare for the upcoming loading of new models. After unloading, the rendering end will immediately perform a pre-loading operation on these models to ensure that when these virtual models enter the loading area in the future, they can be immediately rendered without causing significant delays or stutters.
[0072] Through the above steps, the rendering end can manage memory and resources more efficiently while ensuring that users can smoothly experience the 3D virtual scene. This method not only improves the rendering efficiency but also optimizes the user experience, enabling smooth and high-quality rendering even when facing large and complex 3D digital virtual scenes.
[0073] As Figure 9 shown, Figure 9 is a schematic flowchart of a method for generating a 3D virtual picture applied to a resource loading server provided by an embodiment of the present disclosure. Figure 9 The method in
[0074] Step S501: Receive the target position information where the virtual camera moves to sent by the rendering end; Among them, the target position information is synchronously sent by the rendering end after obtaining the initial 3D virtual picture in the 3D display scene when the virtual camera moves to the target position information. The initial 3D virtual picture is taken in a preset virtual map through the initial position information of the virtual camera to multiple loaded virtual models in the 3D display scene. Step S502: Determine the distance information between the virtual camera and each virtual model in the virtual map based on the target position information, add the virtual models within the preloading area around the virtual camera to the first queue based on the distance information, and add the virtual models within the loading area around the virtual camera in the first queue to the second queue; Step S503: Synchronize the first queue and the second queue to the rendering end, so that the rendering end performs a loading operation on the virtual models in the second queue and a preloading operation on the virtual models in the first queue to obtain an updated three-dimensional display scene; Among them, the rendering end also captures a target three-dimensional virtual image of multiple loaded virtual models in the updated three-dimensional display scene through the target position information where the virtual camera is located, and sends the target three-dimensional virtual image to the terminal.
[0075] Regarding the above-mentioned step S501, the three-dimensional display scene is a currently displayed scene, which is a virtual environment composed of multiple three-dimensional virtual models in a computer. The virtual models can be digital representations of any objects or environments that can be found in the real world, such as buildings, people, animals, plants, terrain, etc.
[0076] The three-dimensional display scene in the embodiments of the present disclosure allows users to move and interact in the virtual space through the virtual camera, simulating a real or imagined environment. This scene is defined in the virtual map, which is a database containing the positions and attributes of all scene elements. The three-dimensional display scene is a specific scene in the virtual map or a current display scene of the virtual map. The virtual map contains multiple virtual models, and the three-dimensional display scene can load some of these virtual models.
[0077] It should be noted that the virtual camera has an initial position information, which determines from which angle and position to observe this three-dimensional display scene. The rendering end in the embodiments of the present disclosure can "capture" images of multiple loaded virtual models in the scene according to the initial position information of the virtual camera, that is, render the scene seen from this perspective.
[0078] When the virtual camera moves in the three-dimensional display scene, its position information will change. The target position information can be any new target position or a specified target position. Once the virtual camera moves to the new target position information, in the embodiments of the present disclosure, the rendering end can synchronize the position of the virtual camera to the resource loading server, that is, the rendering end synchronizes the target position information to the resource loading server. The role of the resource loading server is to determine which virtual models should be loaded and which should be preloaded according to the position of the virtual camera.
[0079] Regarding the above step S502, the first queue contains virtual models within a certain range around the virtual camera. This range is the preloading range. The virtual models within the preloading range may be seen by the user in the near future, so preloading is required. Preloading means loading the model resources (such as materials, textures, meshes, positions, sizes, textures, etc.) of these models into memory, but not necessarily rendering them immediately. The second queue contains virtual models within a closer range to the virtual camera. This range is the loading range. The virtual models within the loading range are those that the user is currently or about to see, so they need to be loaded and rendered immediately.
[0080] Specifically, after the resource loading server receives the target position information of the virtual camera, it calculates the distance information between this position and any virtual model in the virtual map. The distance information can be calculated through spatial coordinates. The resource loading server divides the virtual models according to the distance information. When the position of a virtual model is within the preloading area, these virtual models need to be added to the first queue for preloading; when the position of a virtual model is within the loading area, these virtual models need to be added to the second queue for loading.
[0081] It should be noted that if the distance information indicates that the virtual model is not within the preloading range, it means that these virtual models are not shown near the current scene, so no loading or preloading process is required. As the virtual camera moves, the resource loading server will continuously update the content of the first queue and the second queue. This is a synchronous process, and virtual models may move from one queue to another or be removed from the queue, depending on their distance from the current position of the virtual camera.
[0082] Regarding the above step S503, during the process of the resource loading server updating the first queue and the second queue, the resource loading server can synchronously update the first queue and the second queue to the rendering end in real time. When the rendering end receives the synchronously updated first queue and second queue, the rendering end can perform a loading operation on the virtual models in the second queue, including reading the model resources of the virtual models in the first queue from the storage device and loading them into memory so that these models can be rendered immediately. In addition, the rendering end performs a preloading operation on the virtual models in the first queue, including loading the model resources of the virtual models in the first queue into memory, but not necessarily rendering them immediately. The purpose of preloading is to reduce the loading delay when the user actually sees these models.
[0083] After completing the loading and preloading operations, the rendering end updates the three-dimensional display scene, including adding the newly loaded virtual models to the scene and updating the existing models in the scene, such as positions, animation states, etc., to obtain an updated three-dimensional display scene.
[0084] It should be noted that after updating the three-dimensional display scene, the rendering end can prepare for the rendering of the next frame, including setting parameters of the virtual camera, such as position, orientation, focal length, etc., and determining which virtual models are visible in the current view and preparing to render them.
[0085] After the rendering end obtains the updated three-dimensional display scene, the rendering end can perform picture output based on the updated three-dimensional display scene. Specifically, the rendering end uses the virtual camera to "take" a picture from the updated three-dimensional display scene, and this process is completed by the rendering engine. It calculates and generates a two-dimensional image, that is, the target three-dimensional virtual picture, according to parameters of the virtual camera such as position, orientation, focal length, etc., and attributes of the virtual models in the scene, such as shape, color, texture, etc. After the target three-dimensional virtual picture is generated, the rendering end will send it to the terminal through the network or other communication means. After receiving the target three-dimensional virtual picture, the terminal can display the target three-dimensional virtual picture or perform further image processing operations based on the target three-dimensional virtual picture, etc., and the embodiments of the present disclosure do not make specific limitations on this.
[0086] In summary, through steps S501 to S503, by executing the method for generating a three-dimensional virtual picture, when the rendering end displays the current three-dimensional display scene, only the virtual models in the scene are loaded. When the virtual camera in the scene moves, the target position information of the virtual camera can be synchronized to the resource loading server, and the resource loading server determines the virtual models that need to be loaded and pre-loaded around according to the new position of the virtual camera and adds them to the relevant queues. When the rendering end receives the synchronized first queue and second queue, it can specifically load and pre-load the virtual models near the position where the virtual camera moves, thereby greatly reducing the resource load. The rendering end does not need to load all the virtual models in the virtual map at one time, and the resource loading server can be used to select the virtual models that need to be loaded, thereby improving the fluency of the rendering and loading process. Finally, a high-quality three-dimensional virtual picture can be smoothly generated and sent to the terminal, enabling the terminal to smoothly display the three-dimensional virtual picture without high-performance configuration and improving the viewing experience of the three-dimensional virtual picture.
[0087] Please refer to Figure 10 , Figure 10 is Figure 9 a schematic flowchart further included in step S502 in Step S601, determining the loading weights of each virtual model in the virtual map; Step S602, based on the distance information, adding the virtual models within the pre-loading area around the virtual camera to the first queue in sequence according to the magnitudes of the corresponding loading weights; Step S603, and based on the distance information, add the virtual models within the loading area around the virtual camera in the first queue to the second queue in sequence according to the corresponding loading weights.
[0088] In the above steps, embodiments of the present disclosure can determine the loading weights of each virtual model in the virtual map, so that after being added to the corresponding first queue or second queue, the rendering end can determine the loading or preloading order of the virtual models based on the magnitudes of the corresponding loading weights of each virtual model in the queue. The magnitude of the loading weight represents the importance of the virtual model. The virtual model with a larger loading weight is more important or has a greater impact on the visual effect of the picture, so it needs to be loaded first. On the contrary, the virtual model with a smaller loading weight is a relatively ordinary model or has a smaller visual impact on the picture and can be loaded later.
[0089] After determining the loading weights of each virtual model in the virtual map, the resource loading service area in the embodiments of the present disclosure can, based on the distance information, add the virtual models within the preloading area around the virtual camera to the first queue in sequence according to the corresponding loading weights, so that each virtual model in the first queue can be arranged in the order of the magnitudes of the loading weights. Subsequently, after the rendering end synchronously updates to the first queue, it can preload each virtual model in the first queue in sequence according to the magnitudes of the loading weights.
[0090] Similarly, after determining the loading weights of each virtual model in the virtual map, the resource loading server in the embodiments of the present disclosure can, based on the distance information, add the virtual models within the loading area around the virtual camera in the first queue to the second queue in sequence according to the corresponding loading weights, so that each virtual model in the second queue can be arranged in the order of the magnitudes of the loading weights. Subsequently, after the rendering end synchronously updates to the second queue, it can load each virtual model in the second queue in sequence according to the magnitudes of the loading weights.
[0091] Please refer to Figure 11 , Figure 11 is Figure 10 a schematic flowchart further included in step S601 in . In some embodiments, step S601 may include steps S701 to S702: Step S701, determine the virtual volumes of each virtual model in the virtual map; Step S702, configure corresponding loading weights of corresponding magnitudes for each virtual model according to the magnitudes of the virtual volumes.
[0092] In the above steps, the loading weights of the virtual models are determined during the model splitting process, which can be completed before initialization in advance, or during initialization or scene operation. In this embodiment of the disclosure, an example is given where the model splitting is completed before initialization.
[0093] In this embodiment of the disclosure, multiple virtual models in the virtual map can be first split to obtain the three-dimensional scene space information where each virtual model is located, and pre-compute information such as lighting, shadows, and reflections for each virtual model and its referenced resources. The program traverses all the resources required by the models, including materials, textures, meshes, etc., using the references of the virtual models, and finally packages static files. Therefore, each model file contains the model resources of each virtual model, such as the material, texture, mesh, position, size, texture, etc. of the virtual model.
[0094] Subsequently, the scene configuration information for each scene can be generated based on the three-dimensional scene space information and the split model files. In addition, the model files of each obtained virtual model can be uploaded to a file storage service for storage, so that the resource loading server can obtain the model files of each virtual model from the file storage service during rendering, and the scene configuration information is stored in a database and can be read by the rendering end and the resource loading server during initialization for operations such as resource loading and resource dynamic management calculation.
[0095] The calculation method of the loading weight is mainly determined according to the size of the scene volume occupied by the virtual model. Based on this, this embodiment of the disclosure needs to determine the virtual volume of each virtual model in the virtual map, and configure corresponding loading weights of different sizes for each virtual model according to the size of the virtual volume. Among them, the virtual volume is the volume of the scene occupied by the virtual model. The larger the virtual volume, the larger the loading weight. The larger the loading weight, the higher the loading priority and the larger the dynamic loading determination range, etc.
[0096] Exemplarily, this embodiment of the disclosure can determine the virtual volume of the virtual model based on the size of the minimum bounding box where the virtual model is located. First, the vertex coordinates of the virtual model can be accessed to find the minimum and maximum X, Y, and Z coordinates to obtain the minimum bounding box of the virtual model. After obtaining the minimum and maximum coordinates of the bounding box, the bounding box volume can be calculated according to the following formula: Volume=(MaxX-MinX)*(MaxY-MinY)*(MaxZ-MinZ); Among them, (MaxX-MinX) is the width of the bounding box, (MaxY-MinY) is the height of the bounding box, and (MaxZ-MinZ) is the depth of the bounding box.
[0097] It should be noted that after obtaining the loading weights of each virtual model, corresponding loading weights of different sizes can be configured for each virtual model according to the size of the virtual volume. For example, the virtual volume value can be directly used as the loading weight; or, different ranges can be divided for the size of the virtual volume, and the weights are distinguished based on each 10% of the virtual volume as a gradient. The highest weight is 10 and the lowest weight is 1. Assuming that the weight is set to 0, the scene will not be loaded, and if the weight is 10, it is a model that is initially loaded and not unloaded.
[0098] Please refer to Figure 12 , Figure 12 which Figure 10 is a schematic flowchart further included after step S601 in Step S801: In response to a parameter adjustment instruction for any one virtual model, adjust the corresponding loading weight; Step S802: Alternatively, obtain the historical loading frequencies of each virtual model in the virtual map, and adjust the loading weights corresponding to each virtual model according to the loading frequencies.
[0099] In the above steps, the loading weights are not fixed and can be adjusted according to actual needs. Embodiments of the present disclosure can adjust the corresponding loading weights in response to a parameter adjustment instruction for any one virtual model. Among them, there are various ways to generate the parameter adjustment instruction. For example, when a certain area or a certain virtual model in the virtual map is updated, with details added, appearance changed, or importance altered, its loading weight can be automatically generated or adjusted based on user input; or, when some virtual models have a greater impact on the user experience, their loading weights can be increased accordingly based on user input to ensure that these models can be quickly loaded when needed; or, if the loading of some virtual models causes a relatively large burden on the system performance, while their impact on the overall picture effect is relatively small, their loading weights can be automatically generated or adjusted based on user input to reduce the loading weights and relieve the system pressure; or, after the model splitting is completed, there may be an unreasonable situation in the calculation of the loading weights. For example, when a virtual model with a large volume is in an occluded state, it may not require such a high loading weight during the loading process. In this state, the resource loading server can automatically correct the loading weights based on the distance and relative position relationship between the known virtual camera position and each virtual model, thereby correcting the model loading order and determination.
[0100] In addition, embodiments of the present disclosure can also obtain the historical loading frequencies of various virtual models in the virtual map and adjust the loading weights corresponding to each virtual model according to the loading frequencies. Among them, the loading frequency can be achieved by recording the virtual model information added to the second queue each time. After statistically analyzing the collected loading frequency data, the resource loading server can identify which virtual models have a high loading frequency, and thus adjust the loading weights of the virtual models according to the analysis results. For example, virtual models with a high loading frequency will be given a higher loading weight to ensure that they can be quickly loaded when needed. It should be noted that the adjustment of the loading weight based on the loading frequency in embodiments of the present disclosure is a continuous process. As time goes by and user requirements change, it is necessary to regularly re-analyze the loading frequency data and adjust the loading weights.
[0101] Please refer to Figure 13 , Figure 13 which is another flowchart of the method for generating a three-dimensional virtual scene provided by embodiments of the present disclosure. In some embodiments, the method for generating a three-dimensional virtual scene may further include steps S901 to S902: Step S901, obtaining the moving speed of the virtual camera; Step S902, when the moving speed reaches a preset target speed threshold, adjusting the sizes of the preloading area and the loading area according to the magnitude of the moving speed.
[0102] In the above steps, the moving speed is the speed at which the virtual camera moves from the initial position information to the target position information. When the target position information is dynamically changing, the moving speed can be the speed between any camera positions during the movement of the virtual camera in the virtual map. Specifically, the resource loading server can record the virtual camera positions at multiple consecutive time points, and then calculate the change amount between adjacent time point positions, and combine the time interval to calculate the moving speed of the virtual camera.
[0103] When the moving speed reaches the preset target speed threshold, the resource loading server can adjust the sizes of the preloading area and the loading area according to the magnitude of the moving speed. Among them, the speed threshold is a preset threshold for determining whether the moving speed of the virtual camera has reached the level where the sizes of the preloading and loading areas need to be adjusted. The speed threshold can be set according to the actual application scenario and performance requirements. When the moving speed of the virtual camera reaches or exceeds the preset speed threshold, if the speed is relatively fast, the sizes of the preloading area and the loading area can be appropriately increased to ensure that when the virtual camera moves quickly, enough virtual models can be pre-loaded and rendered in advance to avoid frame drops or delays in the scene. On the contrary, if the speed is relatively slow, the sizes of these areas can be appropriately reduced to reduce unnecessary resource loading and waste.
[0104] Exemplarily, please refer to Figure 14 , Figure 14 which is a schematic diagram of different preloading areas and loading areas provided by an embodiment of the present disclosure. The center point in the figure is the position of the virtual lens. The circle close to the virtual lens is the loading range, and the outer circle is the preloading range. Among them, the left side of the figure shows a schematic diagram of the sizes of the preloading range and the loading range when the moving speed is relatively large, and the right side of the figure shows a schematic diagram of the sizes of the preloading range and the loading range when the moving speed is relatively small. It can be seen that when the moving speed increases, the embodiment of the present disclosure can increase the sizes of the preloading range and the loading range. Therefore, by obtaining the moving speed of the virtual lens and dynamically adjusting the sizes of the preloading area and the loading area according to the speed magnitude, the rendering efficiency of the three-dimensional virtual picture and the user experience can be further improved.
[0105] Please refer to Figure 15 , Figure 15 which is Figure 9 another process schematic diagram further included in step S502 in Step S1001: Determine the position information of the model center point of each virtual model in the virtual map; Step S1002: Based on the target position information and the position information of each model center point, calculate the distance information between the virtual lens and each virtual model in the virtual map.
[0106] In the above steps, the position information of the model center point is a reference point of the virtual model in the three-dimensional space of the virtual map, which can be the geometric center or the center of gravity of the virtual model, and is used to represent the position of the entire virtual model in space, facilitating distance calculation, collision detection, lighting calculation, etc. It should be noted that the position information of the model center point can be obtained during the process of model splitting and stored as model resources in the model file of the virtual resource.
[0107] After obtaining the model center point location information of each virtual model, the resource loading server can calculate the distance information between the virtual lens and each virtual model in the virtual map based on the target location information and the location information of the center points of each model. Specifically, in a three-dimensional virtual scene, the virtual lens will continue to move, causing the virtual models that need to be loaded and rendered to also change constantly. By calculating the distance between the lens and the model, it is possible to determine in real time which models are within or near the visible range of the lens, thereby dynamically loading these models and reducing unnecessary resource consumption. By calculating the distance between the lens and the virtual model, and combining the movement speed and direction of the lens, it is possible to predict which virtual models may soon enter the visible range of the lens, thereby loading these models in advance and improving the smoothness of the picture.
[0108] For example, in the embodiment of the present disclosure, the Euclidean distance may be used to calculate the distance information between the virtual lens and each virtual model in the virtual map. For example, the calculation formula of the distance information L is as follows: ; Among them, (x1, y1, z1) is the model center point position information of a virtual model, and (x2, y2, z2) is the target position information.
[0109] See also Figure 16 , Figure 16 yes Figure 9 In some embodiments, step S502 may further include steps S1101 to S1103: Step S1101, determining a first distance determination range and a second distance determination range for each virtual model in the virtual map; Step S1102, if the target location information is within the first distance determination range of any virtual model, the corresponding virtual model is added to the first queue; Step S1103: if the target location information is within the second distance determination range of any virtual model, the corresponding virtual model is added to the second queue.
[0110] In the above steps, if all virtual models need to recalculate the distance with the virtual lens each time the virtual lens moves, the efficiency is relatively low. Based on this, the embodiment of the present disclosure provides a method for quickly determining the distance between the virtual lens and each virtual model to determine whether to add the virtual model to the first queue or the second queue.
[0111] Specifically, the disclosed embodiment may first determine the first distance determination range and the second distance determination range of each virtual model in the virtual map. Among them, the first distance determination range is a relatively large range, which is used to determine which virtual models are within a closer range of the virtual lens, but may not yet be within the area to be loaded immediately. These virtual models are added to the first queue for preloading. The second distance determination range is a smaller range, which is used to determine which virtual models are within a closer range of the virtual lens and therefore need to be loaded immediately. These virtual models are added to the second queue, and the rendering end will prioritize loading these virtual models to ensure that they can appear seamlessly in the user's field of view.
[0112] When the target position information of the virtual lens is within the first distance judgment range of a virtual model, although these models are not currently in the user's field of view, according to the movement trend and speed of the virtual lens, they may soon enter the user's field of view. Therefore, the virtual model can be added to the first queue for preloading on the rendering end. By preloading, these virtual models can be prepared before they are actually needed to be rendered, thereby reducing the delay during rendering and improving the smoothness of the picture.
[0113] Similarly, when the target position information of the virtual lens is within the second distance judgment range of a virtual model, the virtual model is about to appear in the user's field of view. If it is not loaded immediately, blank space or delayed loading will appear in the screen, seriously affecting the user experience. Therefore, the virtual model needs to be added to the second queue for loading on the rendering end. This ensures that these virtual models have been rendered at the moment they appear in the user's field of view or before, thereby ensuring the continuity and quality of the picture.
[0114] Furthermore, the sizes of the first distance determination range and the second distance determination range can be set as needed. In some embodiments, the geometric side length of each virtual model can be determined, and the geometric side length can be the distance between the leftmost end and the rightmost end of the virtual model, or the distance between the vertex and the bottom of the virtual model. Figure 17 , Figure 17It is a schematic diagram for determining the second distance determination range provided by an embodiment of the present disclosure. After determining the geometric side length, the resource loading server can use the position information of the model center point of each virtual model as the center of a circle, and twice the geometric side length as the double-weight determination distance. Thus, a virtual cube bounding model can be constructed with reduced computational load. This virtual cube bounding model will serve as a larger bounding box to enclose the virtual model. When the virtual camera moves into this virtual cube bounding model, it can be considered that the target position information of the virtual camera is within the second distance determination range of the virtual model. Therefore, the corresponding virtual model is added to the second queue, which can ensure that the required models are loaded in a timely manner during the movement of the virtual camera, reduce the loading delay, and improve the user experience. In addition, the determination process of the first distance determination range can be similar, such as using four times the geometric side length as the quadruple-weight determination distance to construct a virtual cube bounding model as the first distance determination range, and unloading the virtual models that are not within the range and have been loaded. The embodiments of the present disclosure do not make specific limitations on this.
[0115] In summary, the embodiments of the present disclosure use a virtual cube bounding model for distance determination, which can avoid unnecessary repeated calculations and save computational resources. For larger models, a larger bounding model can be used, and for smaller models, a smaller bounding model can be used. This approach not only ensures the accuracy of the determination but also improves the flexibility.
[0116] Please refer to Figure 18 , an embodiment of the present disclosure also provides a device for generating a three-dimensional virtual scene, which is applied to the rendering end and can implement the method for generating a three-dimensional virtual scene applied to the rendering end. The device for generating a three-dimensional virtual scene includes: A screen acquisition module 1801, configured to acquire an initial three-dimensional virtual scene in a three-dimensional display scene, where the initial three-dimensional virtual scene is captured in a preset virtual map through the initial position information of the virtual camera for multiple loaded virtual models in the three-dimensional display scene; A position synchronization module 1802, configured to synchronize the target position information to the resource loading server when the virtual camera moves to the target position information, so that the resource loading server determines the distance information between the virtual camera and each virtual model in the virtual map based on the target position information, and adds the virtual models within the preloading area around the virtual camera to the first queue based on the distance information, and adds the virtual models within the loading area around the virtual camera in the first queue to the second queue; A model processing module 1803, configured to receive the first queue and the second queue sent by the resource loading server, perform a loading operation on the virtual models in the second queue, and perform a preloading operation on the virtual models in the first queue to obtain an updated three-dimensional display scene; The screen generation module 1804 is configured to capture a target three-dimensional virtual screen from multiple loaded virtual models in the updated three-dimensional display scene based on the target position information of the virtual camera, and send the target three-dimensional virtual screen to the terminal.
[0117] In summary, the three-dimensional virtual screen generation device generates a three-dimensional virtual screen by executing the three-dimensional virtual screen generation method. When the rendering end displays the current three-dimensional display scene, only the virtual models in the scene are loaded. When the virtual camera in the scene moves, the target position information of the virtual camera can be synchronized to the resource loading server. The resource loading server determines the virtual models that need to be loaded and pre-loaded around according to the new position of the virtual camera and adds them to the relevant queues. When the rendering end receives the synchronized first queue and second queue, it can specifically load and pre-load the virtual models near the position where the virtual camera moves, thereby greatly reducing the resource load. The rendering end does not need to load all the virtual models in the virtual map at one time. The resource loading server can be used to select the virtual models that need to be loaded, thus improving the fluency of the rendering and loading process. Finally, a high-quality three-dimensional virtual screen can be generated smoothly and sent to the terminal, enabling the terminal to display the three-dimensional virtual screen smoothly without high-performance configuration and improving the viewing experience of the three-dimensional virtual screen.
[0118] The specific implementation manner of the three-dimensional virtual screen generation device is basically the same as the specific embodiment of the three-dimensional virtual screen generation method applied to the rendering end, and will not be described in detail here. On the premise of meeting the requirements of the embodiments of the present disclosure, other functional modules can be set in the three-dimensional virtual screen generation device to implement the three-dimensional virtual screen generation method in the above embodiments.
[0119] Please refer to Figure 19 , the embodiments of the present disclosure further provide a three-dimensional virtual screen generation device, which is applied to a resource loading server and can implement the three-dimensional virtual screen generation method applied to the resource loading server. The three-dimensional virtual screen generation device includes: The position receiving module 1901 is configured to receive the target position information of the virtual camera movement sent by the rendering end, where the target position information is sent synchronously by the rendering end when the virtual camera moves to the target position information after obtaining the initial three-dimensional virtual screen in the three-dimensional display scene. The initial three-dimensional virtual screen is captured from multiple loaded virtual models in the three-dimensional display scene based on the initial position information of the virtual camera in a preset virtual map; A resource loading module 1902, configured to determine distance information between a virtual camera and each virtual model in a virtual map based on target position information, add virtual models within a preloading area around the virtual camera to a first queue based on the distance information, and add virtual models within a loading area around the virtual camera in the first queue to a second queue; A resource synchronization module 1903, configured to synchronize the first queue and the second queue to a rendering end, so that the rendering end performs a loading operation on the virtual models in the second queue and a preloading operation on the virtual models in the first queue to obtain an updated three-dimensional display scene; Wherein, the rendering end also captures a target three-dimensional virtual image of multiple loaded virtual models in the updated three-dimensional display scene through the target position information where the virtual camera is located, and sends the target three-dimensional virtual image to the terminal.
[0120] In summary, the three-dimensional virtual image generation device generates a three-dimensional virtual image by executing the three-dimensional virtual image generation method. When the rendering end displays the current three-dimensional display scene, only the virtual models in the scene are loaded. When the virtual camera in the scene moves, the target position information of the virtual camera can be synchronized to the resource loading server. The resource loading server determines the virtual models that need to be loaded and preloaded around the new position of the virtual camera into relevant queues. When the rendering end receives the synchronized first queue and second queue, it can specifically load and preload the virtual models near the position where the virtual camera moves, thereby greatly reducing the resource load. The rendering end does not need to load all the virtual models in the virtual map at once, and the resource loading server can be used to select the virtual models that need to be loaded, thus improving the smoothness of the rendering and loading process. Finally, a high-quality three-dimensional virtual image can be generated smoothly and sent to the terminal, enabling the terminal to display the three-dimensional virtual image smoothly without high-performance configuration, and improving the viewing experience of the three-dimensional virtual image.
[0121] The specific implementation manner of the three-dimensional virtual image generation device is basically the same as the specific embodiment of the three-dimensional virtual image generation method applied to the resource loading server, and will not be elaborated here. On the premise of meeting the requirements of the embodiments of the present disclosure, other functional modules can be set in the three-dimensional virtual image generation device to implement the three-dimensional virtual image generation method in the above embodiments.
[0122] The embodiments of the present disclosure also provide an electronic device, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the above three-dimensional virtual image generation method is implemented. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.
[0123] Please refer to Figure 20 , Figure 20Schematically shows the hardware structure of an electronic device according to another embodiment. The electronic device includes: A processor 2001, which can be implemented in ways such as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present disclosure; A memory 2002, which can be implemented in forms such as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 2002 can store an operating device and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 2002 and are called by the processor 2001 to execute the method for generating a three-dimensional virtual picture in the embodiments of the present disclosure; An input / output interface 2003, which is used to implement information input and output; A communication interface 2004, which is used to implement communication and interaction between this device and other devices, and can achieve communication through a wired method (such as USB, network cable, etc.) or can also achieve communication through a wireless method (such as a mobile network, WIFI, Bluetooth, etc.); A bus 2005, which transmits information between various components of the device (such as the processor 2001, the memory 2002, the input / output interface 2003, and the communication interface 2004); Among them, the processor 2001, the memory 2002, the input / output interface 2003, and the communication interface 2004 are communicatively connected to each other inside the device through the bus 2005.
[0124] The embodiments of the present disclosure also provide a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, it implements the above-mentioned method for generating a three-dimensional virtual picture.
[0125] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory can include a high-speed random access memory, and can also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory optionally includes a memory remotely set relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above-mentioned network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0126] The embodiments described in the embodiments of the present disclosure are for more clearly illustrating the technical solutions of the embodiments of the present disclosure, and do not constitute a limitation on the technical solutions provided by the embodiments of the present disclosure. Those skilled in the art can know that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present disclosure are equally applicable to similar technical problems.
[0127] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present disclosure, and may include more or fewer steps than those shown in the figures, or combine certain steps, or different steps.
[0128] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0129] Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, and the functional modules / units in the devices and equipment can be implemented as software, firmware, hardware and their appropriate combinations.
[0130] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present disclosure and the above drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, device, product or equipment that includes a series of steps or units does not have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or equipment.
[0131] It should be understood that in this disclosure, "at least one (item)" means one or more, and "a plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist simultaneously. Here, A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one (one)" or similar expressions below refer to any combination of these items, including any combination of single items (one) or plural items (ones). For example, at least one (one) of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0132] In several embodiments provided in this disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the above division of units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical, or other forms.
[0133] The units described above as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0134] In addition, the functional units in each embodiment of this disclosure can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0135] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes multiple instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present disclosure. The aforementioned storage medium includes: various media that can store programs, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs.
[0136] The preferred embodiments of the embodiments of the present disclosure have been described above with reference to the accompanying drawings, which does not limit the scope of the rights of the embodiments of the present disclosure. Any modifications, equivalent replacements, and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of the present disclosure shall be within the scope of the rights of the embodiments of the present disclosure.
Claims
1. A method for generating a three-dimensional virtual image, characterized in that, Applied to the rendering end, including: Obtain an initial three-dimensional virtual scene in the three-dimensional display scene, where the initial three-dimensional virtual scene is captured in a preset virtual map through the initial position information of the virtual camera to multiple loaded virtual models in the three-dimensional display scene; When the virtual camera moves to the target position information, synchronize the target position information to the resource loading server, so that the resource loading server determines the distance information between the virtual camera and each virtual model in the virtual map based on the target position information, and adds the virtual models in the preloading area around the virtual camera to the first queue based on the distance information, and adds the virtual models in the loading area around the virtual camera in the first queue to the second queue; Receive the first queue and the second queue sent by the resource loading server, perform a loading operation on the virtual models in the second queue, and perform a preloading operation on the virtual models in the first queue to obtain an updated three-dimensional display scene; Capture a target three-dimensional virtual scene through the target position information of the virtual camera to multiple loaded virtual models in the updated three-dimensional display scene, and send the target three-dimensional virtual scene to the terminal.
2. The method for generating a three-dimensional virtual image according to claim 1, wherein The obtaining of the initial three-dimensional virtual scene in the three-dimensional display scene includes: In response to a scene initialization creation request for any three-dimensional display scene in the preset virtual map, construct a blank scene without models; Obtain the scene configuration information preconfigured for the three-dimensional display scene, where the scene configuration information includes multiple virtual models in the three-dimensional display scene; Perform a loading operation on multiple virtual models in the three-dimensional display scene based on the scene configuration information, and add the loaded multiple virtual models to the blank scene to generate the three-dimensional display scene; Create a virtual camera in the three-dimensional display scene, and capture an initial three-dimensional virtual scene through the initial position information of the virtual camera to multiple loaded virtual models in the three-dimensional display scene.
3. The method for generating a three-dimensional virtual image according to claim 1, wherein There are multiple virtual models in the first queue and the second queue, and the multiple virtual models are all arranged according to the size of the loading weight; The performing a loading operation on the virtual models in the second queue and performing a preloading operation on the virtual models in the first queue to obtain an updated three-dimensional display scene includes: Sequentially perform a loading operation on the virtual models in the second queue according to the sorting order between the virtual models in the second queue; And sequentially perform a preloading operation on the virtual models in the first queue according to the sorting order between the virtual models in the first queue to obtain an updated three-dimensional display scene.
4. The method for generating a three-dimensional virtual image according to claim 1, characterized in that, Before obtaining the updated three-dimensional display scene, the method for generating the three-dimensional virtual scene further includes: Unload the virtual models that are not in the first queue and the second queue but have already been loaded in the current 3D display scene; For the virtual models that are not in the second queue but are in the first queue and have already been loaded in the current 3D display scene, first perform an unloading operation and then a preloading operation.
5. A method for generating a three-dimensional virtual image, characterized in that, Applied to a resource loading server, including: Receive the target position information where the virtual camera moves to sent by the rendering end. Among them, the target position information is sent synchronously by the rendering end when the virtual camera moves to the target position information after obtaining the initial 3D virtual image in the 3D display scene. The initial 3D virtual image is captured in a preset virtual map through the initial position information where the virtual camera is located and captured for multiple loaded virtual models in the 3D display scene; Based on the target position information, determine the distance information between the virtual camera and each virtual model in the virtual map, and based on the distance information, add the virtual models within the preloading area around the virtual camera to the first queue, and add the virtual models within the loading area around the virtual camera in the first queue to the second queue; Synchronize the first queue and the second queue to the rendering end, so that the rendering end performs a loading operation on the virtual models in the second queue and a preloading operation on the virtual models in the first queue to obtain an updated 3D display scene; Among them, the rendering end also captures a target 3D virtual image for multiple loaded virtual models in the updated 3D display scene through the target position information where the virtual camera is located, and sends the target 3D virtual image to the terminal.
6. The method for generating a three-dimensional virtual image according to claim 5, characterized in that, The step of adding the virtual models within the preloading area around the virtual camera to the first queue and adding the virtual models within the loading area around the virtual camera in the first queue to the second queue based on the distance information includes: Determine the loading weights of each virtual model in the virtual map; Based on the distance information, add the virtual models within the preloading area around the virtual camera to the first queue in order according to the corresponding magnitudes of the loading weights; And, based on the distance information, add the virtual models within the loading area around the virtual camera in the first queue to the second queue in order according to the corresponding magnitudes of the loading weights.
7. The method for generating a three-dimensional virtual image according to claim 6, wherein The step of determining the loading weights of each virtual model in the virtual map includes: Determine the virtual volumes of each virtual model in the virtual map; Configure corresponding loading weights of different magnitudes for each virtual model according to the magnitudes of the virtual volumes.
8. The method for generating a three-dimensional virtual picture according to claim 6 or 7, characterized in that, After determining the loading weights of each virtual model in the virtual map, the method for generating the 3D virtual image further includes: In response to a parameter adjustment instruction for any one of the virtual models, adjust the corresponding loading weight; Alternatively, obtain the historical loading frequencies of the virtual models in the virtual map, and adjust the loading weights corresponding to the virtual models according to the loading frequencies.
9. The method for generating a three-dimensional virtual image according to claim 5, wherein The method for generating the three-dimensional virtual scene further includes: Obtain the moving speed of the virtual camera; When the moving speed reaches a preset target speed threshold, adjust the sizes of the preloading area and the loading area according to the magnitude of the moving speed.
10. The method for generating a three-dimensional virtual image according to claim 5, wherein The determining the distance information between the virtual camera and each of the virtual models in the virtual map based on the target position information includes: Determine the position information of the model center points of each of the virtual models in the virtual map; Based on the target position information and the position information of each of the model center points, calculate the distance information between the virtual camera and each of the virtual models in the virtual map.
11. The method for generating a three-dimensional virtual image according to claim 5, characterized in that, The determining the distance information between the virtual camera and each of the virtual models in the virtual map based on the target position information, and adding the virtual models within the preloading area around the virtual camera to a first queue based on the distance information, and adding the virtual models within the loading area around the virtual camera in the first queue to a second queue includes: Determine the first distance determination range and the second distance determination range of each of the virtual models in the virtual map; If the target position information is within the first distance determination range of any one of the virtual models, add the corresponding virtual model to the first queue; If the target position information is within the second distance determination range of any one of the virtual models, add the corresponding virtual model to the second queue.
12. A device for generating a three-dimensional virtual image, characterized in that, When applied to a rendering end, it includes: A scene acquisition module, configured to acquire an initial three-dimensional virtual scene in a three-dimensional display scene, where the initial three-dimensional virtual scene is captured within a preset virtual map through the initial position information of the virtual camera for multiple loaded virtual models in the three-dimensional display scene; A position synchronization module, configured to synchronize the target position information to a resource loading server when the virtual camera moves to the target position information, so that the resource loading server determines the distance information between the virtual camera and each of the virtual models in the virtual map based on the target position information, and adds the virtual models within the preloading area around the virtual camera to a first queue based on the distance information, and adds the virtual models within the loading area around the virtual camera in the first queue to a second queue; A model processing module, configured to receive the first queue and the second queue sent by the resource loading server, perform a loading operation on the virtual models in the second queue, and perform a preloading operation on the virtual models in the first queue to obtain an updated three-dimensional display scene; A screen generation module, configured to capture a target three-dimensional virtual screen from a plurality of loaded virtual models in the updated three-dimensional display scene according to the target position information where the virtual camera is located, and send the target three-dimensional virtual screen to a terminal.
13. A generating device for a three-dimensional virtual image, characterized in that, Applied to a resource loading server, it includes: A position receiving module, configured to receive the target position information where the virtual camera moves to sent by a rendering end. The target position information is sent synchronously by the rendering end when the virtual camera moves to the target position information after obtaining an initial three-dimensional virtual screen in a three-dimensional display scene. The initial three-dimensional virtual screen is captured from a plurality of loaded virtual models in the three-dimensional display scene according to the initial position information where the virtual camera is located in a preset virtual map. A resource loading module, configured to determine distance information between the virtual camera and each of the virtual models in the virtual map according to the target position information, and add the virtual models within a pre-loading area around the virtual camera to a first queue based on the distance information, and add the virtual models within a loading area around the virtual camera in the first queue to a second queue. A resource synchronization module, configured to synchronize the first queue and the second queue to the rendering end, so that the rendering end performs a loading operation on the virtual models in the second queue and a pre-loading operation on the virtual models in the first queue to obtain an updated three-dimensional display scene. Wherein, the rendering end also captures a target three-dimensional virtual screen from a plurality of loaded virtual models in the updated three-dimensional display scene according to the target position information where the virtual camera is located, and sends the target three-dimensional virtual screen to a terminal.
14. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, it implements the method for generating a three-dimensional virtual screen according to any one of claims 1 to 4, or the method for generating a three-dimensional virtual screen according to any one of claims 5 to 11.
15. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for generating a three-dimensional virtual screen according to any one of claims 1 to 4, or the method for generating a three-dimensional virtual screen according to any one of claims 5 to 11.
Citation Information
Patent Citations
Virtual reality three-dimensional scene loading and rendering method and device and terminal equipment
CN113516769A
Image rendering method and device, electronic equipment and storage medium
CN119444953A