CN111790152A - Method and device for loading object in scene, storage medium and electronic equipment - Google Patents

Method and device for loading object in scene, storage medium and electronic equipment Download PDF

Info

Publication number
CN111790152A
CN111790152A CN202010596562.2A CN202010596562A CN111790152A CN 111790152 A CN111790152 A CN 111790152A CN 202010596562 A CN202010596562 A CN 202010596562A CN 111790152 A CN111790152 A CN 111790152A
Authority
CN
China
Prior art keywords
visible
current
scene
loading
objects
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010596562.2A
Other languages
Chinese (zh)
Inventor
余洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Mihoyo Tianming Technology Co Ltd
Original Assignee
Shanghai Mihoyo Tianming Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Mihoyo Tianming Technology Co Ltd filed Critical Shanghai Mihoyo Tianming Technology Co Ltd
Priority to CN202010596562.2A priority Critical patent/CN111790152A/en
Publication of CN111790152A publication Critical patent/CN111790152A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a method and a device for loading an object in a scene, a storage medium and electronic equipment. The method comprises the following steps: acquiring object index information in a pre-loaded current scene, wherein the object index information comprises first positions of objects in the current scene; determining a current visible object set of a current object based on a second position of the current object in the current scene, a preset visible range of each response layer and a first position of each object in the object index information; and loading the visible objects in the current visible object set. The dynamic loading of each object in the scene based on the position information of the target object is realized, the synchronous loading of all objects in the scene is replaced, the object loading pertinence is improved on the basis of ensuring the object integrity of the visible region of the target scene, and the object loading pressure is reduced.

Description

Method and device for loading object in scene, storage medium and electronic equipment
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a method and a device for loading an object in a scene, a storage medium and electronic equipment.
Background
With the continuous development of computer technology, online games are accepted by more and more users, and the requirements for online games are higher and higher.
In the current online game, each scene includes a large number of objects, such as buildings, characters, scenery, and the like, and when a character of a user performs the scene, the loading process of the objects in the scene is too long.
Disclosure of Invention
The invention provides a method and a device for loading objects in a scene, a storage medium and electronic equipment, which are used for dynamically loading the objects in the scene.
In a first aspect, an embodiment of the present invention provides a method for loading an object in a scene, including:
acquiring object index information in a pre-loaded current scene, wherein the object index information comprises first positions of objects in the current scene;
determining a current visible object set of a current object based on a second position of the current object in the current scene, a preset visible range of each response layer and a first position of each object in the object index information;
and loading the visible objects in the current visible object set.
In a second aspect, an embodiment of the present invention further provides a device for loading an object in a scene, including:
the index information acquisition module is used for acquiring pre-loaded object index information in a current scene, wherein the object index information comprises first positions of objects in the current scene;
a visible object set determining module, configured to determine a current visible object set of a current object based on a second position of the current object in the current scene, a preset visible range of each response layer, and a first position of each object in the object index information;
and the visible object loading module is used for loading the visible objects in the current visible object set.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the object loading method in the scene provided by the embodiment of the invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for loading the object in the scene provided by the embodiment of the present invention.
According to the technical scheme provided by the embodiment, based on the position information of the target object and the preset visible range of each response layer, the target object obtains the visible object set of the target object under the current second position for the visible objects of each response layer, and loads the visible objects in the visible range, so that the dynamic loading of each object in the scene based on the position information of the target object is realized, the synchronous loading of all objects in the scene is replaced, further, the objects of each response layer are layered in the visible range, the authenticity of the visible object layers in the scene is improved, the object loading pertinence is improved on the basis of ensuring the object integrity of the visible area of the target scene, and the object loading pressure is reduced.
Drawings
Fig. 1 is a schematic flowchart of a method for loading an object in a scene according to an embodiment of the present invention;
fig. 2 is an exemplary diagram of preset visible ranges corresponding to different response layers according to a second embodiment of the present invention;
FIG. 3 is a schematic diagram of region segmentation of a scene according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a variation of the visible region provided by an embodiment of the present invention;
fig. 5 is a schematic flowchart of a method for loading an object in a scene according to a second embodiment of the present invention;
fig. 6 is a schematic structural diagram of an object loading device in a scene according to a third embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a schematic flow chart of a method for loading an object in a scene according to an embodiment of the present invention, where this embodiment is applicable to a situation where an object in a scene is dynamically loaded in an online game, and the method may be implemented by the method provided in the embodiment of the present invention, and specifically includes the following steps:
s110, obtaining pre-loaded object index information in the current scene, wherein the object index information comprises first positions of all objects in the current scene
S120, determining a current visible object set of the current object based on the second position of the current object in the current scene, the preset visible range of each response layer and the first position of each object in the object index information.
S130, loading the visible objects in the current visible object set.
In a network game, a plurality of scenes may be included, each scene may include a plurality of objects, such as but not limited to plants, buildings, mountains, stones, rivers, clouds, characters, and the like. The objects are distributed in a scene, the target object can be a game role used for operating each game, and when the target object progresses through the scene, each object in the scene needs to be loaded.
Each scene is provided with object index information including type labels, sizes, shapes, colors of respective objects in the scene, first positions displayed in the scene, and storage paths of object models. The object index information may be pre-loaded, for example, the object index information may be loaded in the process of entering the scene, specifically, a scene entering instruction is obtained, corresponding object index information is loaded according to the tag information of the scene, and the scene is entered when the object index information is loaded.
The method has the advantages that the scene area is large, the number of objects in the scene is large, and when the objects in the scene are uniformly loaded in the process of carrying out the scene by the target object, the object loading time is long, so that the time for entering the scene is long, and the efficiency is low. In this embodiment, by dynamically loading the objects in the scene, uniform loading of the objects in the scene is avoided, and the number of loaded objects is reduced on the premise that normal operation of the target object in the scene is not affected, so as to relieve loading pressure.
In this embodiment, the object to be loaded is determined according to the second position of the target object in the scene and the preset visible range of the target object to the object. The method comprises the steps of constructing a response logic layer, wherein the response logic layer comprises a plurality of response layers, objects corresponding to the response layers are different, and preset visible ranges corresponding to different response layers are different. For example, referring to fig. 2, fig. 2 is an exemplary diagram of preset visible ranges corresponding to different response layers according to a second embodiment of the present invention. Fig. 2 exemplarily includes preset visible ranges corresponding to four response layers 01, 02, 03, and 04, respectively. Objects may be placed in each of the response layers according to object category and/or size and/or importance rating. The size of the object is positively correlated with the preset visible range of the response layer, and the importance level of the object is positively correlated with the preset visible range of the response layer. For example, the smaller the size of the object, the smaller the preset visible range of the belonging response layer, the higher the importance level of the object, and the larger the preset visible range of the belonging response layer. Taking flowers and plants as an example, the object size is small, and a response layer which belongs to the minimum corresponding preset visible range, such as a 01 response layer, can be set; for example, in the case of landmark buildings, the importance level is high, and a response layer corresponding to the maximum preset visible range, such as a 04 response layer, may be set.
In some embodiments, the response layer 01 may correspond to a flower and grass object, the response layer 02 may correspond to a stone object, the response layer 03 may correspond to a building object, and the response layer 04 may correspond to a terrain and mountain object, and the preset visible ranges of the four response layers 01, 02, 03, and 04 are sequentially increased as can be seen from fig. 2. In this embodiment, the object index information includes a response layer tag of the object, and the response layer to which the object belongs can be determined by the response layer tag. It should be noted that the response layer in the scene is not limited to the response layer shown in fig. 2, and may be set according to the requirement of the response distance.
For any response layer, determining a visible area of the target object to the object of the response layer based on the second position of the target object and the preset visible range of the response layer, determining the object of the response layer in the visible area as a visible object, and adding the visible object to the current visible object set. And executing the mode on each response layer to obtain the current visible object set. Only the visible objects in the current visible object set are loaded to ensure normal display of the objects in the visible range of the target object, and the objects outside the visible range are not required to be loaded, so that the loading pressure is relieved. And each response layer can determine the visible objects of the corresponding response layer in parallel, and the visible objects of each response layer are added to the current visible object set.
For any response layer, determining the distance between the first position of the object of each response layer in the scene and the second position of the target object, and when the distance is smaller than or equal to the preset visible range of the response layer, determining that the object is within the visible range of the target object, is the visible object of the target object, and adding the visible object into the current visible object set; when the distance is greater than the preset visible range of the response layer, it is determined that the object is outside the visible range of the target object and is not a visible object of the target object. Taking the flowers and plants as an example, determining the distance between each flower and plant in the scene and the second position of the target object, and when the distance is less than or equal to the preset visible range of the flowers and plants, determining that the object is within the visible range of the target object and is the visible object of the target object.
Optionally, determining the current visible object set of the current object based on the second position of the current object in the current scene, the preset visible range of each response layer, and the first position of each object in the object index information, includes: iteratively performing tree region segmentation on the current scene, and obtaining object index information corresponding to each leaf region according to a first position of an object in the current scene and each leaf region segmented by the tree region; for any response layer, determining a visible area of a second position under the response layer according to the second position of the current object in the current scene and a preset visible range of the response layer; and determining an overlapping area of the visible area under the response layer and at least one leaf area where the visible area is located, and adding the object corresponding to the response layer in the overlapping area into the current visible object set.
In this embodiment, the current scene may be quickly located by performing region segmentation on the current scene, where the tree region segmentation may be quadtree segmentation or Binary Space Partitioning (BSP). Taking quadtree segmentation as an example, referring to fig. 3, fig. 3 is a schematic diagram of region segmentation of a scene according to an embodiment of the present invention. In fig. 3, all the regions corresponding to a scene are root regions, the scene is divided into four sub-regions, the sub-regions are child nodes of the root node, each child node is a root node, and correspondingly, the sub-regions can be divided into regions corresponding to the four child nodes, and so on, and the minimum region obtained by region division is a child node of a tree region, that is, a leaf region. And determining the object index information corresponding to each leaf area according to the first position of each object in the object index information and the range of each leaf area.
For any response layer, the visible region of the target object may be a circular region formed by taking the second position of the target object as a center and taking the preset visible range of the response layer as a radius, or may be a rectangular region formed by taking the second position of the target object as a center and taking 2 times of the preset visible range of the response layer as a side length, see fig. 3. Wherein, the shape of the visible region of the target object can be set according to the requirement of a user.
And determining at least one leaf area where the visible area of the target object is located, wherein in fig. 3, for the leaf areas 1, 2, 3 and 4, the leaf areas where the visible area of the target object under the response layer is located are the leaf areas 1 and 4, and determining the current visible object set based on the leaf areas 1 and 4 with overlapping areas with the visible area. For example, distances of a first position of the object of the response layer and a second position of the target object in at least one leaf area where the visible area is located under the response layer are respectively determined, and whether the object is within a preset visible range of the response layer is determined based on the distances. For example, it may also be determined whether the object is located within the visible region based on the first position information and the object size of the object of the response layer in the at least one leaf region where the visible region is located under the response layer. And determining an object positioned in a visible area under the response layer as a visible object of the target object, and adding the object to the current visible object set.
In some embodiments, adding the object corresponding to the response layer in the overlap region to the current set of visible objects includes: setting a virtual external box for each object in the current scene, wherein the virtual external box is the minimum external box of the object; and when part or all of the virtual bounding box of the object corresponding to the response layer is positioned in the overlapping area, adding the virtual bounding box to the current visible object set of the current object.
Due to the irregularity of the shape of the object and the large size of the object relative to the coordinates of the first position, which may be the center position of the object, the visibility determination of the object based only on the first position of the object is prone to a determination error. In this embodiment, a virtual external box is set for each object, where the virtual external box may be a cube or a cuboid, so as to determine an area occupied by the virtual external box in a scene, and the area occupied by the virtual external box in the scene may be determined as a projection of the object in the scene, and when part or all of the virtual external box is located in a visible area (an overlapping area) corresponding to the corresponding response layer, the object in the virtual external box is determined as a visible object of the target object.
Taking the mountain as an example, the first position of the mountain can be the center position coordinate of the mountain, and because the mountain occupies a large area, the first position of the mountain is located in one leaf area, while the whole mountain can be spread over a plurality of leaf areas, and the visibility of the mountain is determined only through the first position, so that a large error exists. By setting a virtual external box for the mountains, the virtual external box and the mountains have the same distribution, namely are distributed in a plurality of leaf areas, and when any part of the virtual external box is located in the mountain visible area corresponding to the second position of the target object, the mountains are visible objects and are added into the current visible object set.
In some embodiments, determining the current visible object set of the current object based on the second position of the current object in the current scene, the preset visible range of each response layer, and the first position of each object in the object index information comprises: setting a virtual external box for each object in the current scene, wherein the virtual external box is the minimum external box of the object; for any response layer, calculating a minimum distance between any edge of the virtual outside box of the object and a second position of the current object in the current scene; when the minimum distance is within the preset visible range of the response layer, adding the object corresponding to the minimum distance into the current visible object set of the current object.
Due to the fact that the number of edges is large due to the irregularity of the shape of the object, the distance between the object and the target object is calculated directly on the basis of the edges of the object, and the calculation amount is large. The virtual external box is arranged on each object, so that the edge information of the object is simplified, the distance between the edge of the object and the target object is quickly determined, and the visibility of the object is judged according to the minimum distance between the edge of the object and the target object. And when the minimum distance between the edge of the object and the target object is less than or equal to the preset visible range corresponding to the response layer of the object, determining that the object is positioned in the visible area of the target object, and adding the object to the current visible object set.
By setting the virtual external box for each object and determining whether the object is visible or not based on the virtual external box, the accuracy of judging the visibility of the object is improved, and further, the accuracy of the visible scene of the target object of the scene is improved.
Further, a virtual circumscribed box is set for the objects of the current response layer in the at least one leaf area where the visible area is located under the current response layer, so that the visible objects can be quickly determined from the objects of the current response layer in the at least one leaf area where the visible area is located. By carrying out tree-shaped region segmentation on the scene, the leaf regions corresponding to the visible regions are convenient to determine, and the objects in other leaf regions except the visible regions are not visible objects, so that the object screening range is simplified, and the calculation amount is reduced.
Optionally, after determining the current visible object set of the target object, the method further includes: deleting the loaded object and the loading object from the current set of visible objects. The object index information may include an identifier of an object loading state, and the object loading state may include loaded, and unloaded, for example, the identifier is identified by 0,1, and 2, respectively. After the current visible object set is determined, whether the loaded object and the loading object are included can be determined through the identification of the object loading state of each object, and the loaded object and the loading object are deleted from the previous visible object set, so that the repeated loading of the same object is avoided.
It should be noted that, during the scene movement (e.g., running, walking, jumping), the second position of the target object changes continuously, and accordingly, the visible area of the target object under each response layer changes, and the current visible object set is updated continuously.
In some embodiments, for any response layer, in the moving process of the target object, according to a difference object of the response layer in a preset visible range corresponding to the current second position, where the object is in the preset visible range corresponding to the previous second position, the visible object set corresponding to the previous second position is updated, so as to obtain the current visible object set. Taking the walking or running of the target object as an example, the change of the second position of the target object may be a unit length of the walking or running, and the previous second position is a position located in a previous step of the current second position, that is, a position corresponding to the current second position minus the unit length of the walking or running. And determining the difference objects according to the change of the visible region, wherein the difference objects comprise an added object and a deleted object. Referring to fig. 4, fig. 4 is a schematic diagram of a variation of a visible region provided in an embodiment of the present invention. The solid line rectangular area is a visible area corresponding to a previous second position under any response layer, and the dotted line rectangular area is a visible area corresponding to a current second position under the response layer, so that the newly added area and the deleted area can be determined. The visible object set corresponding to the previous second position comprises objects A and B, the newly added region comprises object C, the deleted region comprises object B, the visible object set corresponding to the previous second position is updated according to the difference object, object C of the newly added region is added, and object B of the deleted region is removed, wherein objects A, B and C are the same response layer. And updating the objects of each response layer based on the current visible object set updating mode to form a current visible object set.
In some embodiments, the current second position and the previous second position may be determined based on a preset time interval, for example, the preset time interval may be 50ms, and the previous second position may be a position corresponding to the preset time interval before the current time.
The previous visible object set is updated through the different objects in the visible area, the current visible object set is quickly obtained, the determination process of the current visible object set is simplified, and the calculation amount is reduced.
The visible objects in the current visible object set are loaded, the loading quantity is small, and the loading speed is high.
According to the technical scheme of the embodiment, based on the position information of the target object and the preset visible range of each response layer, the target object obtains the visible object set of the target object at the current second position for the visible objects of each response layer, and loads the visible objects in the visible range, so that the dynamic loading of each object in the scene based on the position information of the target object is realized, the synchronous loading of all objects in the scene is replaced, further, the objects of each response layer are layered in the visible range, the authenticity of the visible object layers in the scene is improved, the object loading pertinence is improved on the basis of ensuring the object integrity of the visible area of the target scene, and the object loading pressure is reduced.
Example two
Fig. 5 is a schematic flow chart of a method for loading an object in a scene according to a second embodiment of the present invention, which is optimized based on the second embodiment, and specifically includes:
s210, obtaining pre-loaded object index information in the current scene, wherein the object index information comprises first positions of all objects in the current scene
S220, determining a current visible object set of the current object based on the second position of the current object in the current scene, the preset visible range of each response layer and the first position of each object in the object index information.
S230, determining the loading priority of each visible object according to at least one of the current sight angle of the target object, the size of the visible object and the distance between the visible object and the target object.
And S240, loading each visible object based on the loading priority.
In this embodiment, the number of visible objects in the current visible object set is at least one, the priority of each visible object is determined, and the loading order of the visible objects in the current visible object set is determined based on the priority. Wherein the priority of the visible object is determined based on one or more of a current gaze angle of the target object, a size of the visible object, a distance of the visible object from the target object. For example, the priority of the visible object is positively correlated with the size of the visible object, and negatively correlated with the distance between the visible object and the target object, and the priority of the visible object within the current gaze angle of the target object is higher than the priority of the visible objects outside the current gaze angle of the target object.
In some embodiments, weights for setting the current viewing angle of the target object, the size of the visible object, and the distance between the visible object and the target object may be set, and the priority of the visible object may be obtained through calculation. Optionally, determining a loading priority of each visible object according to at least one of a current gaze angle of the target object, a size of the visible object, and a distance between the visible object and the target object, includes: determining an included angle between a first position of the object and a current sight angle of the target object; and performing weighted calculation based on the included angle, the first weight corresponding to the included angle, the size of the visible object, the second weight of the size of the visible object, the distance between the visible object and the target object and the third weight of the distance, and determining the loading priority of each visible object. The first weight, the second weight, and the third weight may be preset.
The priority of each visible object is determined based on one or more of the current sight angle of the target object, the size of the visible object and the distance between the visible object and the target object, and the loading sequence or the loading speed of each visible object is determined, so that the obvious visible objects in the sight line can be loaded preferentially, and the scene in the sight line can be displayed rapidly.
In some embodiments, loading each of the visible objects based on the loading priority comprises: creating at least one process, and asynchronously loading each visible object based on the at least one process, wherein the loading speed of each visible object is positively correlated with the priority. The loading speed of the visible objects is provided by the asynchronous loading of the plurality of visible objects through the plurality of processes.
When the position of the target object moves or the sight line changes, the priority of the visible object is updated in real time or on the basis of a preset time interval and on the basis of the changed current sight line angle, the size of the visible object and the distance between the visible object and the target object, the visible object in the sight line is guaranteed to be loaded quickly when the position of the target object moves or the sight line changes, when the loading of the scene of the target object in the sight line is finished, the target object can execute operation or move in the scene, and the loading of all visible objects in the current visible object set is not required to be finished.
According to the technical scheme provided by the embodiment, the loading priority of the visible objects in the current visible object set is determined through at least one of the current sight angle of the target object, the size of the visible objects and the distance between the visible objects and the target object, the visible objects are loaded based on the priority, the objects which are accessible to the sight of the target object are loaded preferentially, the scenes in the sight of the target object are displayed rapidly, and the waiting time of the target object is shortened.
EXAMPLE III
Fig. 6 is a schematic structural diagram of an object loading apparatus in a scene according to a third embodiment of the present invention, where the apparatus includes:
an index information obtaining module 310, configured to obtain object index information in a current scene, where the object index information includes first positions of objects in the current scene;
a visible object set determining module 320, configured to determine a current visible object set of a current object based on a second position of the current object in the current scene, a preset visible range of each response layer, and a first position of each object in the object index information;
a visible object loading module 330, configured to load visible objects in the current visible object set.
Optionally, the visible object set determining module 320 includes:
the region segmentation unit is used for iteratively performing tree region segmentation on the current scene, and obtaining object index information corresponding to each leaf region according to a first position of an object in the current scene and each leaf region segmented by the tree region;
a visible region determining unit, configured to determine, for any response layer, a visible region of a second position in the response layer according to the second position of the current object in the current scene and a preset visible range of the response layer;
a first current visible object set determining unit, configured to determine an overlapping area between a visible area under the response layer and at least one leaf area where the visible area is located, and add an object corresponding to the response layer in the overlapping area to the current visible object set.
Optionally, the current visible object set determining unit is configured to:
setting a virtual external box for each object in the current scene, wherein the virtual external box is the minimum external box of the object;
and when part or all of the virtual bounding box of the object corresponding to the response layer is positioned in the overlapping area, adding the virtual bounding box to the current visible object set of the current object.
Optionally, the visible object set determining module 320 includes:
a virtual external box setting unit, configured to set a virtual external box for each object in the current scene, where the virtual external box is a minimum external box of the objects;
a minimum distance determination unit, configured to calculate, for any response layer, a minimum distance between any edge of the virtual outside box of the object and a second position of the current object in the current scene;
a second current visible object set determining unit, configured to add, when the minimum distance is within a preset visible range of the response layer, an object corresponding to the minimum distance to the current visible object set of the current object.
Optionally, the apparatus further comprises:
a first visible object set updating module for deleting the loaded object and the loading object from the current visible object set after determining the current visible object set of the target object.
Optionally, the apparatus further comprises:
and the second visible object set updating module is used for updating the visible object set at the previous moment according to the difference object of the object in the preset visible range corresponding to the current second position and the object in the preset visible range corresponding to the previous second position in the moving process of the current object for any response layer to obtain the current visible object set.
Optionally, the visible object loading module 330 includes:
a priority determining unit, configured to determine a loading priority of each visible object according to at least one of a current gaze angle of the target object, a size of the visible object, and a distance between the visible object and the target object;
and the loading unit is used for loading each visible object based on the loading priority.
Optionally, the priority determining unit is configured to:
determining an included angle between a first position of the object and a current sight angle of the target object;
and performing weighted calculation based on the included angle, the first weight corresponding to the included angle, the size of the visible object, the second weight of the size of the visible object, the distance between the visible object and the target object and the third weight of the distance, and determining the loading priority of each visible object.
Optionally, the loading unit is configured to:
creating at least one process, and asynchronously loading each visible object based on the at least one process, wherein the loading speed of each visible object is positively correlated with the priority.
The product can execute the method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
Fig. 7 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. FIG. 7 illustrates a block diagram of an electronic device 412 suitable for use in implementing embodiments of the present invention. The electronic device 412 shown in fig. 7 is only an example and should not bring any limitations to the functionality and scope of use of the embodiments of the present invention. The device 412 is typically an electronic device that undertakes image classification functions.
As shown in fig. 7, the electronic device 412 is in the form of a general purpose computing device. The components of the electronic device 412 may include, but are not limited to: one or more processors 416, a storage device 428, and a bus 418 that couples the various system components including the storage device 428 and the processors 416.
Bus 418 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 412 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 412 and includes both volatile and nonvolatile media, removable and non-removable media.
Storage 428 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 430 and/or cache Memory 432. The electronic device 412 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 434 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 7, commonly referred to as a "hard drive"). Although not shown in FIG. 7, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk-Read Only Memory (CD-ROM), a Digital Video disk (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 418 by one or more data media interfaces. Storage 428 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
Program 436 having a set (at least one) of program modules 426 may be stored, for example, in storage 428, such program modules 426 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination may comprise an implementation of a network environment. Program modules 426 generally perform the functions and/or methodologies of embodiments of the invention as described herein.
The electronic device 412 may also communicate with one or more external devices 414 (e.g., keyboard, pointing device, camera, display 424, etc.), with one or more devices that enable a user to interact with the electronic device 412, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 412 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 422. Also, the electronic device 412 may communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN), and/or a public Network, such as the internet) via the Network adapter 420. As shown, network adapter 420 communicates with the other modules of electronic device 412 over bus 418. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 412, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive Arrays, disk array (RAID) systems, tape drives, and data backup storage systems, to name a few.
The processor 416 executes programs stored in the storage device 428 to perform various functional applications and data processing, such as implementing the object loading method in the scene provided by the above-described embodiments of the present invention.
EXAMPLE five
Fifth embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for loading objects in a scene according to the fifth embodiment of the present invention.
Of course, the computer program stored on the computer-readable storage medium provided by the embodiments of the present invention is not limited to the method operations described above, and may also execute the method for loading objects in a scene provided by any embodiment of the present invention.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable source code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Source code embodied on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer source code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The source code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (12)

1. A method for loading objects in a scene, comprising:
acquiring object index information in a pre-loaded current scene, wherein the object index information comprises first positions of objects in the current scene;
determining a current visible object set of a current object based on a second position of the current object in the current scene, a preset visible range of each response layer and a first position of each object in the object index information;
and loading the visible objects in the current visible object set.
2. The method of claim 1, wherein determining the current visible object set of the current object based on the second position of the current object in the current scene, the preset visible range of each response layer, and the first position of each object in the object index information comprises:
iteratively performing tree region segmentation on the current scene, and obtaining object index information corresponding to each leaf region according to a first position of an object in the current scene and each leaf region segmented by the tree region;
for any response layer, determining a visible area of a second position under the response layer according to the second position of the current object in the current scene and a preset visible range of the response layer;
and determining an overlapping area of the visible area under the response layer and at least one leaf area where the visible area is located, and adding the object corresponding to the response layer in the overlapping area into the current visible object set.
3. The method of claim 2, wherein adding the object corresponding to the response layer in the overlap region to the current set of visible objects comprises:
setting a virtual external box for each object in the current scene, wherein the virtual external box is the minimum external box of the object;
and when part or all of the virtual bounding box of the object corresponding to the response layer is positioned in the overlapping area, adding the virtual bounding box to the current visible object set of the current object.
4. The method of claim 1, wherein determining the current visible object set of the current object based on the second position of the current object in the current scene, the preset visible range of each response layer, and the first position of each object in the object index information comprises:
setting a virtual external box for each object in the current scene, wherein the virtual external box is the minimum external box of the object;
for any response layer, calculating a minimum distance between any edge of the virtual outside box of the object and a second position of the current object in the current scene;
when the minimum distance is within the preset visible range of the response layer, adding the object corresponding to the minimum distance into the current visible object set of the current object.
5. The method of any of claims 1-4, wherein after determining the current set of visible objects for the current object, the method further comprises:
deleting the loaded object and the loading object from the current set of visible objects.
6. The method according to any one of claims 1-4, further comprising:
for any response layer, in the moving process of the current object, according to the difference object between the object in the preset visible range corresponding to the current second position and the object in the preset visible range corresponding to the previous second position, the visible object set of the previous second position is updated, and the current visible object set is obtained.
7. The method of claim 1, wherein the loading visible objects in the current set of visible objects comprises:
determining the loading priority of each visible object according to the current sight angle of the current object, the size of the visible object and the distance between the visible object and the current object;
loading each of the visible objects based on the loading priority.
8. The method of claim 7, wherein determining the loading priority for each visible object based on a current gaze angle of the current object, a size of the visible object, and a distance of the visible object from the current object comprises:
determining an included angle between a first position of the object and a current sight angle of the current object;
and performing weighted calculation based on the included angle, the first weight corresponding to the included angle, the size of the visible object, the second weight of the size of the visible object, the distance between the visible object and the current object and the third weight of the distance, and determining the loading priority of each visible object.
9. The method of claim 7, wherein said loading each of the visible objects based on the loading priority comprises:
creating at least one process, and asynchronously loading each visible object based on the at least one process, wherein the loading speed of each visible object is positively correlated with the priority.
10. An apparatus for loading objects in a scene, comprising:
the index information acquisition module is used for acquiring pre-loaded object index information in a current scene, wherein the object index information comprises first positions of objects in the current scene;
a visible object set determining module, configured to determine a current visible object set of a current object based on a second position of the current object in the current scene, a preset visible range of each response layer, and a first position of each object in the object index information;
and the visible object loading module is used for loading the visible objects in the current visible object set.
11. An electronic device, characterized in that the electronic device comprises:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a method for in-scene object loading as claimed in any one of claims 1-9.
12. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out a method for loading objects in a scene as claimed in any one of claims 1 to 9.
CN202010596562.2A 2020-06-28 2020-06-28 Method and device for loading object in scene, storage medium and electronic equipment Pending CN111790152A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010596562.2A CN111790152A (en) 2020-06-28 2020-06-28 Method and device for loading object in scene, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010596562.2A CN111790152A (en) 2020-06-28 2020-06-28 Method and device for loading object in scene, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN111790152A true CN111790152A (en) 2020-10-20

Family

ID=72803810

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010596562.2A Pending CN111790152A (en) 2020-06-28 2020-06-28 Method and device for loading object in scene, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111790152A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103713903A (en) * 2013-12-20 2014-04-09 汉柏科技有限公司 Hard disk dynamic loading method and device
CN106547599A (en) * 2016-11-24 2017-03-29 腾讯科技(深圳)有限公司 A kind of method and terminal of resource dynamic load
CN107168780A (en) * 2017-04-06 2017-09-15 北京小鸟看看科技有限公司 Loading method, equipment and the virtual reality device of virtual reality scenario
US20190060754A1 (en) * 2017-08-24 2019-02-28 Nintendo Co., Ltd. Storage medium, information processing apparatus, image processing method, and information processing system
CN109523621A (en) * 2018-11-15 2019-03-26 腾讯科技(深圳)有限公司 Loading method and device, storage medium, the electronic device of object
CN110716766A (en) * 2019-10-17 2020-01-21 网易(杭州)网络有限公司 Game scene loading method and device, computer readable medium and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103713903A (en) * 2013-12-20 2014-04-09 汉柏科技有限公司 Hard disk dynamic loading method and device
CN106547599A (en) * 2016-11-24 2017-03-29 腾讯科技(深圳)有限公司 A kind of method and terminal of resource dynamic load
CN107168780A (en) * 2017-04-06 2017-09-15 北京小鸟看看科技有限公司 Loading method, equipment and the virtual reality device of virtual reality scenario
US20190060754A1 (en) * 2017-08-24 2019-02-28 Nintendo Co., Ltd. Storage medium, information processing apparatus, image processing method, and information processing system
CN109523621A (en) * 2018-11-15 2019-03-26 腾讯科技(深圳)有限公司 Loading method and device, storage medium, the electronic device of object
CN110716766A (en) * 2019-10-17 2020-01-21 网易(杭州)网络有限公司 Game scene loading method and device, computer readable medium and electronic equipment

Similar Documents

Publication Publication Date Title
US11270497B2 (en) Object loading method and apparatus, storage medium, and electronic device
CN110478898B (en) Configuration method and device of virtual scene in game, storage medium and electronic equipment
CN113112603B (en) Method and device for optimizing three-dimensional model
CN111135574B (en) Game scene generation method and device, computer readable medium and electronic equipment
CN111882634B (en) Image rendering method, device, equipment and storage medium
KR102216749B1 (en) Method, apparatus and computer program for coloring of a target image
CN109992640B (en) Method, device, equipment and storage medium for determining position grid
US20230042968A1 (en) High-definition map creation method and device, and electronic device
CN111862204A (en) Method for extracting visual feature points of image and related device
CN111744199A (en) Image processing method and device, computer readable storage medium and electronic device
CN112023400A (en) Height map generation method, device, equipment and storage medium
US20100315420A1 (en) Object loading and unloading system
US20140142912A1 (en) Automating weather model configurations
CN111790151A (en) Method and device for loading object in scene, storage medium and electronic equipment
US20190102506A1 (en) Semiconductor package metal shadowing checks
CN113496543A (en) Point cloud data screening method and device, electronic equipment and storage medium
CN111790152A (en) Method and device for loading object in scene, storage medium and electronic equipment
CN110555916A (en) Terrain editing method and device for virtual scene, storage medium and electronic equipment
CN113625770B (en) Autonomous navigation planning method and device for carrying out inspection on photovoltaic power station based on flying unmanned aerial vehicle
CN114519762A (en) Model normal processing method and device, storage medium and electronic equipment
CN111538410A (en) Method and device for determining target algorithm in VR scene and computing equipment
CN111882633A (en) Picture rendering method, device, equipment and medium
CN118037914A (en) Three-dimensional object rendering method, three-dimensional object rendering device, computer equipment and storage medium
CN113496550B (en) DSM calculation method and device, computer equipment and storage medium
CN109542573B (en) Scene display method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination