Virtual scene loading method and device, electronic equipment and storage medium

By distinguishing visible and invisible objects in the virtual scene according to the location of the virtual camera, and rendering only the rendering data of visible objects in the virtual scene loading, the problem of low loading efficiency of virtual scenes is solved, and fast loading and normal response are achieved.

CN119034195APending Publication Date: 2024-11-29SHANGHAI MIHA YOUHAIYUANCHENG TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411084460.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

In a virtual scene, when the object is of large scale, loading operations need to be performed for each object, resulting in low loading efficiency and a lot of time and performance.

Method used

According to the location of the virtual camera, determine the invisible object in the virtual scene, and remove the rendering type data from its corresponding first scene data to obtain the second scene data. Only the rendering type data of the visible object is loaded and rendered, while retaining the invisible object. The object's non-rendering type data in response to non-rendering type operation instructions.

Benefits of technology

By distinguishing visible and invisible objects, reducing the amount of data loading, improving the loading speed of scenes, avoiding the problem of not being able to respond to operation instructions normally after data removal, and ensuring that virtual objects have normal system functions when they are invisible.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119034195A_ABST
    Figure CN119034195A_ABST
Patent Text Reader

Abstract

The invention relates to the field of data processing, and particularly discloses a virtual scene loading method and device, electronic equipment and a storage medium. The method comprises the following steps: determining invisible objects in a plurality of virtual objects of a virtual scene according to the position of a virtual camera; removing rendering type data of invisible objects from the first scene data corresponding to the plurality of virtual objects to obtain second scene data corresponding to the plurality of virtual objects; wherein the first scene data corresponding to the plurality of virtual objects are used for storing rendering type data and non-rendering type data of each virtual object; rendering and loading second scene data corresponding to the plurality of virtual objects; wherein the non-rendering type data of the invisible object in the second scene data is used for responding to the non-rendering type operation instruction. According to the mode, the to-be-loaded data information can be accurately determined according to actual requirements, the loading data volume can be greatly reduced, and the defect that an operation instruction cannot be normally responded after data is removed can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of data processing technology, and in particular to a method, device, electronic device and storage medium for loading a virtual scene. Background Art

[0002] Virtual scenes are simulated scenes formed by computer technology and can be widely used in many fields such as games and virtual reality. In the process of loading virtual scenes, a large number of scene objects need to be rendered and loaded.

[0003] When the number of objects in the virtual scene is very large, it is necessary to perform loading operations for each object separately, which consumes a lot of time and performance, resulting in low loading efficiency. Summary of the invention

[0004] In view of the above problems, the present disclosure is proposed to provide a method, device, electronic device and storage medium for loading a virtual scene that overcomes the above problems or at least partially solves the above problems.

[0005] According to one aspect of an embodiment of the present disclosure, a method for loading a virtual scene is provided, comprising:

[0006] Determining, according to the virtual camera position, invisible objects among a plurality of virtual objects of the virtual scene;

[0007] Eliminating the rendering type data of the invisible object from the first scene data corresponding to the multiple virtual objects to obtain the second scene data corresponding to the multiple virtual objects; wherein the first scene data corresponding to the multiple virtual objects is used to store the rendering type data and non-rendering type data of each virtual object;

[0008] Rendering and loading second scene data corresponding to the multiple virtual objects; wherein the non-rendering type data of the invisible objects in the second scene data is used to respond to non-rendering type operation instructions.

[0009] In an optional implementation, the non-rendering type operation instruction includes: a shadow type operation instruction corresponding to a shadow calculation type, a collision type operation instruction corresponding to a collision calculation type, and / or a special effect type operation instruction corresponding to a special effect calculation type;

[0010] The non-rendering type data includes: shadow type data for responding to the shadow type operation instruction, collision type data for responding to the collision type operation instruction, and / or special effect type data for responding to the special effect type operation instruction.

[0011] In an optional implementation, the virtual scene includes a plurality of scene spaces; and a plurality of visible object sets corresponding to the plurality of scene spaces are pre-generated; then the invisible objects among the plurality of virtual objects of the virtual scene are determined according to a target visible object set corresponding to the virtual camera position in the plurality of visible object sets;

[0012] Among them, the set of visible objects corresponding to any scene space is generated in the following way:

[0013] Generating scene construction information of the virtual scene according to rendering type data of multiple virtual objects of the virtual scene;

[0014] A pre-rendering camera is arranged in any scene space to perform pre-rendering processing on the scene construction information of the virtual scene, and a set of visible objects in any scene space is determined according to the processing result.

[0015] In an optional implementation, the scene construction information for generating the virtual scene includes:

[0016] In a case where the virtual scene includes a virtual object of a first preset type, generating simulation rendering data of the virtual object of the first preset type;

[0017] Generating scene construction information of the virtual scene according to the simulation rendering data;

[0018] The first preset type of virtual object includes: a virtual object capable of emitting light; and the size and / or shape of the rendering grid contained in the simulation rendering data is determined according to the lighting coverage of the first preset type of virtual object.

[0019] In an optional implementation, the scene information for generating the virtual scene includes:

[0020] In a case where the virtual scene includes a virtual object of a second preset type, removing rendering type data of the virtual object of the second preset type, and generating scene construction information of the virtual scene according to the removed rendering type data;

[0021] The second preset type of virtual objects includes: non-fixed virtual objects that can be displaced, and semi-transparent non-blocking virtual objects.

[0022] In an optional implementation, the virtual scene is a game scene, and the camera position of the pre-rendering camera set in any scene space is determined according to a preset sampling point position;

[0023] The preset sampling point position is obtained in the following way:

[0024] Detecting potential landing points in the scene space by means of ray detection;

[0025] Determine a moving step length according to a character moving mode and / or a camera moving mode, and determine a character landing point corresponding to the potential landing point according to the moving step length;

[0026] Determine the sampling point position corresponding to the character's landing point.

[0027] In an optional implementation, the virtual scene includes: a first virtual space set including a plurality of first virtual space units, and a second virtual space set including a plurality of second virtual space units;

[0028] The step of determining the invisible objects among the multiple virtual objects of the virtual scene according to the virtual camera position comprises:

[0029] Determine a first target space unit that matches the virtual camera position from a plurality of first virtual space units in the first virtual space set; determine a second target space unit that matches the virtual camera position from a plurality of second virtual space units in the second virtual space set;

[0030] Acquire a first visible object set corresponding to the first target space unit and a second visible object set corresponding to the second target space unit;

[0031] Invisible objects among a plurality of virtual objects in the virtual scene are determined according to a union of the first visible object set and the second visible object set.

[0032] In an optional implementation, the unit size of the first virtual space unit is larger than the unit size of the second virtual space unit;

[0033] Furthermore, the multiple virtual objects of the virtual scene include: a first virtual object and a second virtual object; wherein the object size of the first virtual object is larger than the object size of the second virtual object;

[0034] The visible object set of the first virtual space unit is used to store the first virtual object in a visible state, and the visible object set of the second virtual space unit is used to store the second virtual object in a visible state.

[0035] In an optional implementation, the first target space unit and the second target space unit are dynamically switched as the position of the virtual camera moves;

[0036] Furthermore, a switching frequency of the first target space unit is lower than a switching frequency of the second target space unit.

[0037] According to another aspect of the present disclosure, a virtual scene loading device is provided, comprising:

[0038] A determination module, used for determining an invisible object among a plurality of virtual objects of the virtual scene according to a virtual camera position;

[0039] A culling module, configured to cull the rendering type data of the invisible object from the first scene data corresponding to the multiple virtual objects, to obtain the second scene data corresponding to the multiple virtual objects; wherein the first scene data corresponding to the multiple virtual objects is used to store the rendering type data and the non-rendering type data of each virtual object;

[0040] A loading module is used to render and load second scene data corresponding to the multiple virtual objects; wherein the non-rendering type data of the invisible objects in the second scene data is used to respond to non-rendering type operation instructions.

[0041] According to another aspect of the present disclosure, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0042] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the virtual scene loading method as described above.

[0043] According to another aspect of the present disclosure, a computer storage medium is provided, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to execute the virtual scene loading method as described above.

[0044] In an embodiment of the present disclosure, it is possible to determine the visible objects and invisible objects among multiple virtual objects of a virtual scene according to the position of a virtual camera, so as to eliminate the invisible objects to reduce the time consumption of scene rendering and loading. In addition, in the present disclosure, the object data of each virtual object in the virtual scene is split into rendering type data and non-rendering type data, and in the elimination process, only the rendering type data of the invisible objects is eliminated, while the non-rendering type data of the invisible objects is retained, so that the non-rendering type operation instructions can be responded normally after loading. It can be seen that through the distinction between visible objects and invisible objects, and the splitting of rendering type data and non-rendering type data, the present disclosure can accurately determine the data information to be loaded according to actual needs, which can not only greatly reduce the amount of loaded data, but also avoid the disadvantage of not being able to respond normally to operation instructions after data elimination. In summary, on the one hand, since the rendering type data of invisible objects are eliminated, there is no need to render and load this part of the data during the loading process of the virtual scene, which can greatly reduce the memory space occupied and significantly improve the loading speed of the scene; on the other hand, since the non-rendering type data of invisible objects is still retained, it can respond normally to various non-rendering type operation instructions, thereby ensuring that the virtual objects in the virtual scene still have normal system functions when they are invisible.

[0045] The above description is only an overview of the technical solution of the present disclosure. In order to more clearly understand the technical means of the present disclosure, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present disclosure more obvious and easy to understand, the specific implementation methods of the present disclosure are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present disclosure. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0047] Figure 1 A flowchart of a method for loading a virtual scene provided by an embodiment of the present disclosure is shown;

[0048] Figure 2 A schematic diagram of cell segmentation in an example of the present disclosure is shown;

[0049] Figure 3 A main flow chart of a method for loading a virtual scene provided in an example of the present disclosure is shown;

[0050] Figure 4 Shows Figure 3A flowchart of each sub-step in step S330;

[0051] Figure 5 Shows Figure 3 A flowchart of each sub-step in step S340;

[0052] Figure 6 A schematic diagram of a virtual scene loading device provided by another embodiment of the present disclosure is shown;

[0053] Figure 7 A schematic structural diagram of an electronic device provided by yet another embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0054] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0055] Figure 1 FIG. 1 is a flowchart of a method for loading a virtual scene provided by an embodiment of the present disclosure. Figure 1 As shown, the method specifically includes:

[0056] Step S110: determining invisible objects among multiple virtual objects in the virtual scene according to the virtual camera position.

[0057] Among them, the virtual scene can be various scenes such as game scenes and virtual reality scenes. The virtual camera can use the computer system to simulate the function and operation of the camera. Since the scene space of the virtual scene is large, the virtual camera can simulate the visual situation of the human eye. Accordingly, according to the position of the virtual camera, the visible objects and invisible objects among the multiple virtual objects of the virtual scene can be determined. Among them, the visible object refers to: a virtual object that is visible relative to the virtual camera position; the invisible object refers to: a virtual object that is invisible relative to the virtual camera position, for example, it can be a blocked virtual object.

[0058] Among them, the visible objects and invisible objects in multiple virtual objects can be determined by the View Cone algorithm. In computer graphics, the view cone is used to characterize the field of view of a camera (such as a virtual camera in a game scene) or an observer (such as a virtual character or player in a game), which determines which objects can be seen. Among them, the view cone range generally refers to the range of light that the visual system can capture and process. Accordingly, according to the view cone algorithm, virtual objects within the view cone range can be treated as visible objects, and virtual objects not within the view cone range can be treated as invisible objects. Among them, multiple virtual objects in a virtual scene refer to: virtual objects to be loaded in the virtual scene, which can be all virtual objects in the virtual scene or some virtual objects in the virtual scene, which are determined according to business needs. This application does not limit the scope and number of multiple virtual objects.

[0059] There are many ways to determine the invisible objects among multiple virtual objects. They can be determined dynamically in real time or in advance offline. This application does not limit the method for determining the invisible objects.

[0060] Step S120: Eliminate rendering type data of invisible objects from the first scene data corresponding to the multiple virtual objects to obtain second scene data corresponding to the multiple virtual objects; wherein the first scene data corresponding to the multiple virtual objects is used to store rendering type data and non-rendering type data of each virtual object.

[0061] The first scene data corresponding to the multiple virtual objects includes: rendering type data and non-rendering type data of each virtual object to be rendered. The object data of each virtual object is pre-split into rendering type data and non-rendering type data, so that in the culling process, it is possible to flexibly select which data to cull and which data to retain. Therefore, by splitting the object data into two types, the culling operation can be made finer and more accurate.

[0062] In the present disclosure, rendering type data of invisible objects are removed from first scene data corresponding to multiple virtual objects, and non-rendering type data of invisible objects are retained to obtain second scene data corresponding to multiple virtual objects.

[0063] Among them, rendering type data refers to: data information that needs to participate in rendering calculations. For example, rendering type data may include: rendering mesh, rendering color, rendering material and other types of information. Non-rendering type data refers to: data information that does not need to participate in rendering calculations, but needs to participate in other system operations. For example, non-rendering type data may include: shadow data, collision data, special effects data, interaction data, etc. It can be seen that non-rendering type data does not need to directly participate in rendering calculations and will not be directly related to the rendering results of virtual objects. However, non-rendering type data needs to participate in other system operations other than rendering calculations (ie, non-rendering calculations, such as interaction operations, etc.). Therefore, retaining non-rendering data in the second scene data can accurately respond to system operations.

[0064] Step S130: Rendering and loading second scene data corresponding to a plurality of virtual objects; wherein the non-rendering type data of the invisible objects in the second scene data is used to respond to non-rendering type operation instructions.

[0065] Compared with the first scene data, the second scene data does not contain rendering type data of invisible objects, thereby reducing the total amount of data and shortening the rendering and loading time.

[0066] In addition, the second scene data includes non-rendering type data of invisible objects, so it is possible to respond to non-rendering type operation instructions, avoiding the problem of inaccurate instruction response due to occlusion culling. Among them, non-rendering type operation instructions include various types of operation instructions other than rendering operation instructions, such as shadow operation instructions, collision operation instructions, special effect operation instructions, interactive operation instructions, etc. In addition, interactive operation instructions can be various instructions associated with interactive operations, such as dialogue response instructions, etc.

[0067] In short, the present application does not limit the specific types of rendering type data and non-rendering type operation instructions, and all auxiliary data related to other system operations except rendering can be used as non-rendering type data.

[0068] It can be seen that in this method, the object data of each virtual object in the virtual scene is split into rendering type data and non-rendering type data, and in the elimination process, only the rendering type data of the invisible object is eliminated, and the non-rendering type data of the invisible object is retained, so that the non-rendering type operation instruction can be normally responded to after the loading is completed. It can be seen that through the distinction between visible objects and invisible objects, and the splitting of rendering type data and non-rendering type data, the present disclosure can accurately determine the data information to be loaded according to actual needs, which can not only greatly reduce the amount of loaded data, but also avoid the disadvantage of not being able to respond normally to operation instructions after data elimination.

[0069] In summary, on the one hand, since the rendering type data of invisible objects is eliminated, there is no need to render and load this part of the data during the loading process of the virtual scene, which can greatly reduce the memory space occupied and significantly improve the loading speed of the scene; on the other hand, since the non-rendering type data of invisible objects is still retained, it can respond normally to various non-rendering type operation instructions, thereby ensuring that the virtual objects in the virtual scene still have normal system functions when they are invisible, such as shadow display function, collision function, interaction function, etc.

[0070] In addition, in order to achieve better technical effects, those skilled in the art may also make various changes and modifications to the above embodiments:

[0071] In an optional implementation, the non-rendering type operation instruction may include: a shadow type operation instruction corresponding to the shadow calculation type, a collision type operation instruction corresponding to the collision calculation type, and / or a special effect type operation instruction corresponding to the special effect calculation type. Correspondingly, the non-rendering type data may include: shadow type data for responding to the shadow type operation instruction, collision type data for responding to the collision type operation instruction, and / or special effect type data for responding to the special effect type operation instruction.

[0072] For example, shadow operation instructions are used to calculate shadow information in a virtual scene based on the shadow type data of a virtual object. Assume that an invisible object (such as a virtual character or a virtual object) at the corner of the scene is located in an invisible area behind a door, but the shadow cast by the invisible object under the action of light may be located in the current visible area. Therefore, if the object data is not split into rendering type data and non-rendering type data, all object data of the invisible object will be directly eliminated, resulting in the shadow type data of the invisible object being eliminated, which in turn causes the shadow cast by the invisible object under the action of light to be mistakenly deleted, that is, the virtual scene finally loaded is distorted compared to the virtual scene actually created. However, if the object data is split into rendering type data and non-rendering type data, and the shadow type data of the invisible object is retained, the invisible object can still respond to the shadow operation instructions normally, thereby ensuring that the shadow cast by the invisible object under the action of light can be displayed normally, thereby improving the realism of the virtual scene and avoiding the scene distortion problem caused by the mistaken elimination of shadows. The shadow type data may be shadow grid data for realizing shadow effects.

[0073] For another example, collision operation instructions are used to calculate collision information in a virtual scene based on collision type data of virtual objects. Assume that a virtual scene includes multiple scene spaces connected to each other, and each scene space can be a room. Assume that room A is connected to rooms B and C, but when the virtual camera is located in room A, most virtual objects in rooms B and C are invisible. At this time, assuming that the virtual character in the game launches a virtual weapon and equipment, and the virtual weapon and equipment can be ejected for a long distance, the virtual weapon and equipment may collide with the invisible objects in rooms B and C during the ejection process, causing the invisible objects in rooms B and C to deform due to the collision. However, if the object data is not split into rendering type data and non-rendering type data, all object data of the invisible objects in rooms B and C will be directly eliminated, resulting in the collision type data of the invisible objects in rooms B and C being eliminated, which in turn causes the invisible objects to be unable to deform when they are ejected and collided, resulting in scene distortion. However, when the object data is split into rendering type data and non-rendering type data, and the collision type data of the invisible objects is retained, the invisible objects in rooms B and C can still respond to collision type operation instructions normally, thereby ensuring that the invisible objects can be deformed during the collision process, thereby improving the realism of the virtual scene. The collision type data can be collision mesh data or collision volume data for realizing collision.

[0074] In addition, special effect operation instructions are used to calculate special effect information in the virtual scene based on the special effect type data of the virtual object. Among them, special effect information includes: luminous special effects, deformation special effects and other special effects. The specific principles are similar to shadow type data and collision type data, which will not be repeated here. In addition, interactive operation instructions are used to calculate interactive information based on the interactive type data of the virtual object, where the interactive information may include various types of information such as voice dialogue information. In short, with the help of non-rendering type data, the normal response of various non-rendering type operation instructions can be ensured, so that invisible objects can have normal interactive operation functions.

[0075] In an optional implementation, the virtual scene includes multiple scene spaces. Among them, the scene space can be divided according to the connected components such as the entrance door and the passage contained in the virtual scene, so that the interconnected space is divided into a scene space. The number and size of the scene space can be flexibly set according to actual needs, and this application does not limit it. For example, the scene space can be divided according to a larger spatial interval (for example, a room is divided into a scene space); for another example, the scene space can also be divided according to a smaller spatial interval (for example, a room is further divided into multiple cells). In addition, multiple visible object sets corresponding to multiple scene spaces are pre-generated. Among them, for each scene space, a visible object set corresponding to the scene space is generated, and the visible object set is used to store multiple virtual objects that are in a visible state when the camera is located in the corresponding scene space. Correspondingly, the invisible objects among the multiple virtual objects of the virtual scene can be determined by the pre-generated target visible object set corresponding to the virtual camera position. The target visible object set is a visible object set that matches the virtual camera position in multiple visible object sets (that is, a visible object set corresponding to the scene space to which the virtual camera position belongs).

[0076] Among them, the set of visible objects corresponding to any scene space can be generated in the following way: according to the rendering type data of multiple virtual objects of the virtual scene, the scene construction information of the virtual scene is generated. Among them, the scene construction information of the virtual scene is used to characterize the specific information such as the arrangement position and form of each virtual object to be rendered in the virtual scene. In other words, the scene construction information is used to construct the virtual scene. Through a pre-rendering camera set in any scene space, the scene construction information of the virtual scene is pre-rendered, and the set of visible objects in any scene space is determined according to the processing result. Among them, the virtual camera can call the GPU for pre-rendering, so as to determine the set of visible objects in any scene space according to the pre-rendering processing result.

[0077] In addition, the rendering type data of the multiple virtual objects of the virtual scene used when generating the scene construction information may include: rendering meshes, rendering materials and other types of rendering-related information of the virtual objects.

[0078] In specific implementation, a corresponding object identifier can be set for each virtual object in the virtual scene in the scene construction information of the virtual scene. Accordingly, in the pre-rendering process, the object identifier of the virtual object in the scene construction information is obtained through the shader. Among them, all virtual objects in an unobstructed state (i.e., visible objects) can obtain the corresponding object identifier through the shader, while virtual objects in an obstructed state (i.e., invisible objects) cannot obtain the corresponding object identifier through the shader. Therefore, by querying the object identifier of the virtual object stored in the rendering buffer, the visible objects in the virtual scene can be quickly determined, thereby improving the efficiency of determining the visible objects.

[0079] In an optional implementation, the scene construction information of the virtual scene is generated in the following manner:

[0080] In the case where a virtual scene includes a virtual object of the first preset type, simulated rendering data of the virtual object of the first preset type is generated; based on the simulated rendering data, scene construction information of the virtual scene is generated. Wherein, the virtual object of the first preset type includes: a virtual object that can emit light; and the size and / or shape of the rendering grid contained in the simulated rendering data is determined according to the lighting coverage of the virtual object of the first preset type. It can be seen that the virtual object of the first preset type can be a light-type object. Correspondingly, the simulated rendering data can also be referred to as light proxy data or a light proxy body. Wherein, if the lighting coverage of the virtual object is large, the size of the rendering grid contained in the simulated rendering data is large; conversely, if the lighting coverage of the virtual object is small, the size of the rendering grid contained in the simulated rendering data is small. In addition, the shape of the rendering grid contained in the simulated rendering data can be determined according to the shape of the lighting coverage of the virtual object.

[0081] Among them, since virtual objects of the first preset type, such as lights, usually do not have corresponding rendering grids, therefore, when it is detected that the virtual scene contains virtual objects of the first preset type, simulated rendering data (i.e., light proxy bodies) are generated for such virtual objects, so as to simulate the coverage of the virtual objects of the first preset type in the scene through the simulated rendering data. By setting the simulated rendering data, the accuracy of the visibility detection of virtual objects of the light type can be improved, and the visibility judgment error caused by the lack of actual rendering grids for virtual objects of the light type or the mismatch between the actual rendering grids and the illumination range can be avoided.

[0082] In an optional implementation, the virtual objects capable of emitting light may include: virtual objects of point light source type, virtual objects of directional light source type, and virtual objects of volume light source type. The virtual objects of the first preset type may be virtual objects of point light source type, but do not include virtual objects of directional light source type and virtual objects of volume light source type.

[0083] In an optional implementation, the scene information of the virtual scene is generated in the following manner: when the virtual scene contains a virtual object of a second preset type, the rendering type data of the virtual object of the second preset type is eliminated, and the scene construction information of the virtual scene is generated according to the eliminated rendering type data. Wherein, the virtual objects of the second preset type include: non-fixed virtual objects that can be displaced, and translucent non-blocking virtual objects. Wherein, the non-fixed virtual objects that can be displaced may include: virtual objects that can move freely, such as animal virtual objects. Since the position information of the non-fixed virtual objects that can be displaced is uncertain, it is easy to cause the subsequent visible object set to be inaccurate. Therefore, a whitelist can be set to eliminate this type of virtual objects so that they do not participate in the scene construction. Wherein, the translucent non-blocking virtual objects refer to: virtual objects that are in a transparent or translucent state and do not block other objects. Since the translucent non-blocking virtual objects do not actually block the objects behind, if they are allowed to participate in the scene construction, it is easy to cause the problem of false occlusion. Therefore, by eliminating the virtual objects of the second preset type, the accuracy of the scene construction can be improved, thereby ensuring the accuracy of the subsequent generated visible object set.

[0084] In an optional implementation, the virtual scene is a game scene, and in order to ensure that the shooting perspective of the visible object set matches the perspective of the character during the game, the camera position of the pre-rendered camera in any scene space can be set according to the preset character landing point position. The preset character landing point position can be obtained by the following method: by ray detection, the potential landing point in the scene space is detected. Correspondingly, the potential landing point is a position point where the character can stand, for example, cliffs, cliffs, obstacles and other positions cannot be used as potential landing points. The moving step length is determined according to the character movement mode and / or the camera movement mode, and the character landing point corresponding to the potential landing point is determined according to the moving step length. The character movement mode is used to characterize the moving speed, moving stride, moving direction, etc. of the character, and the camera movement mode is used to characterize the moving speed, moving direction, etc. of the camera. Therefore, based on the character movement mode and / or the camera movement mode, the single moving step length can be determined, and based on the single moving step length, one or more character landing points corresponding to the potential landing point can be determined. Wherein, the position of the character's foothold is used to characterize the position of the virtual character, and accordingly, the camera position of the pre-rendered camera can be further determined according to the sampling point position corresponding to the character's foothold. Wherein, the sampling point position is used to characterize the placement position of the pre-rendered camera. The sampling point position corresponding to the character's foothold can either match the character's foothold position or be at a preset angle or preset distance from the character's foothold position. Wherein, if the virtual character corresponding to the character's foothold is used to characterize the player, that is, the perspective of the virtual character matches the perspective of the player, then the sampling point position can be matched with the character's foothold position (for example, the sampling point position is the same as the character's foothold position or does not exceed the preset distance). If the virtual character corresponding to the character's foothold is a character other than the player, the sampling point position can be set to a position point that is convenient for photographing the character's foothold position (that is, the sampling point is located at a preset angle or preset distance from the character's foothold position).

[0085] In an optional implementation, in order to improve the accuracy of the visible object set, the virtual scene can be divided into multiple virtual space units, so as to generate a visible object set with the virtual space unit as the granularity. The size of the virtual space unit is usually smaller than the scene space mentioned above. In other words, a scene space usually includes multiple virtual space units.

[0086] In addition, in order to avoid the problem of poor accuracy of the visible object set caused by a single division method, the virtual scene can be divided into at least two virtual space sets by at least two division methods, and each virtual space set includes multiple virtual space units. In addition, the unit size and unit number of the virtual space units in different virtual space sets are different. The unit size of multiple virtual space units in the same virtual space set can be the same.

[0087] For example, the virtual scene may include: a first virtual space set including a plurality of first virtual space units, and a second virtual space set including a plurality of second virtual space units. Accordingly, the invisible objects among the plurality of virtual objects of the virtual scene are determined in the following manner:

[0088] From the multiple first virtual space units of the first virtual space set, determine the first target space unit that matches the virtual camera position; from the multiple second virtual space units of the second virtual space set, determine the second target space unit that matches the virtual camera position. For example, assume that the first virtual space set includes 2*2*2=8 first virtual space units, and the size of each first virtual space unit is 40cm*40cm*40cm, that is, the length, width and height are all 40cm. The second virtual space set includes 4*4*4=64 second virtual space units, and the size of each second virtual space unit is 20cm*20cm*20cm, that is, the length, width and height are all 20cm. In addition, the set areas of the first virtual space set and the second virtual space set both match the entire scene area of ​​the virtual scene (here, it is assumed that the entire scene area is a cube area). In other words, the entire scene area of ​​the virtual scene is divided according to two different division methods to obtain the first virtual space set and the second virtual space set. It can be seen that there is overlap between the virtual space units in the first virtual space set and the second virtual space set. When the virtual camera position is located at the lower right corner of the entire scene area, the first target space unit is a 40cm*40cm*40cm space unit located at the lower right corner among the 8 first virtual space units, and the second target space unit may be a 20cm*20cm*20cm space unit located at the lower right corner among the 64 second virtual space units.

[0089] Get a first visible object set corresponding to the first target space unit and a second visible object set corresponding to the second target space unit. The first visible object set corresponding to the first target space unit refers to: when the pre-rendering camera is placed inside the first target space unit, a set of visible objects in the virtual scene obtained by pre-rendering and baking. The second visible object set corresponding to the second target space unit refers to: when the pre-rendering camera is placed inside the second target space unit, a set of visible objects in the virtual scene obtained by pre-rendering and baking.

[0090] According to the union of the first visible object set and the second visible object set, the visible objects among the multiple virtual objects of the virtual scene are determined. Among them, the visible objects among the multiple virtual objects of the virtual scene are the virtual objects belonging to the union. Correspondingly, objects other than the visible objects are invisible objects.

[0091] In the above manner, the visible objects and invisible objects are determined by combining the union of two visible object sets corresponding to two spatial units of different division granularities, which can improve accuracy.

[0092] In order to improve accuracy, the set of visible objects corresponding to each spatial unit is determined by one or more sampling points located inside the spatial unit. The sampling points are used to characterize the position of the pre-rendering camera. By setting multiple sampling points inside the spatial unit and performing multiple pre-rendering sampling operations through the pre-rendering camera, the accuracy of the final set of visible objects can be improved. The position of the sampling point can be fixed to a specified position in the spatial unit, such as the center point or corner point of the spatial unit. Alternatively, the position of the sampling point can also be determined based on the position of the character's foothold, so that the set of visible objects is more in line with the character's line of sight.

[0093] In an optional implementation, the unit size of the first virtual space unit is greater than the unit size of the second virtual space unit; and the multiple virtual objects of the virtual scene include: a first virtual object and a second virtual object; wherein the object size of the first virtual object is greater than the object size of the second virtual object. For example, the first virtual object is a large object in the scene, and the second virtual object is a small object in the scene. Among them, the visible object set of the first virtual space unit is used to store the first virtual object in a visible state, and the visible object set of the second virtual space unit is used to store the second virtual object in a visible state. It can be seen that the present application divides the scene objects in the virtual scene into the first virtual object and the second virtual object according to the size, and stores the larger first virtual object in the visible object set corresponding to the larger first virtual space unit, and stores the smaller second virtual object in the visible object set corresponding to the smaller second virtual space unit. It can be seen that in the present application, when generating the corresponding visible object set for each virtual space unit, it will be determined whether to store the visible virtual object in the visible object set corresponding to the virtual space unit according to whether the object size of the virtual object in the visible state matches the unit size of the virtual space unit.

[0094] In an optional implementation, the first target space unit and the second target space unit are dynamically switched as the virtual camera position moves; and the switching frequency of the first target space unit is lower than the switching frequency of the second target space unit. Since the virtual camera position moves from one virtual space unit to another virtual space unit, a switching operation needs to be performed in order to determine the visible objects and invisible objects according to the visible object set of the moved virtual space unit. Therefore, the above-mentioned first target space unit and the second target space unit can be dynamically switched as the virtual camera position moves. In addition, since the size of the first virtual space unit is larger, the switching frequency of the first target space unit is lower, thereby reducing the rendering and loading time during switching.

[0095] It should be noted that the above-mentioned first virtual space set and second virtual space set are only schematic. In actual situations, a third virtual space set or even a fourth virtual space set can also be set. Correspondingly, the first virtual object and the second virtual object are also only schematic. In actual situations, a third virtual object and a fourth virtual object can also be set. In addition, the visible object set of the third virtual space unit in the third virtual space set is used to store the third virtual object in a visible state, and the visible object set of the fourth virtual space unit in the fourth virtual space set is used to store the fourth virtual object in a visible state. In addition, the object sizes of the first virtual object, the second virtual object, the third virtual object, and the fourth virtual object can decrease in sequence, and the unit sizes of the first virtual space unit, the second virtual space unit, the third virtual space unit, and the fourth virtual space unit also decrease in sequence. In short, the present application does not limit the number of types of virtual objects and the number of virtual space sets, and those skilled in the art can flexibly set them.

[0096] By setting up multiple virtual space sets and multiple types of virtual objects, and the object sizes of the multiple types of virtual objects correspond to the unit sizes of the virtual space units in the multiple virtual space sets, the visible object sets of the virtual space units in different virtual space sets can be used to store virtual objects of different object sizes, and by reducing the switching frequency of the visible object sets of the virtual space units of large sizes, the effect of reducing the switching time during loading is achieved.

[0097] In an optional implementation, the multiple scene spaces are multiple connected spaces divided according to connectivity. Accordingly, the first scene data corresponding to the multiple virtual objects of the virtual scene may include: the first connected space where the virtual camera is currently located and multiple virtual objects in the second connected space that have an association relationship with the first connected space. Correspondingly, the visible objects among the multiple virtual objects of the virtual scene include: the visible objects in the first connected space where the virtual camera is currently located. Among them, the first connected space is the connected space where the virtual camera is currently located, which can be changed dynamically according to the movement of the virtual camera. The invisible objects among the multiple virtual objects of the virtual scene may include: the invisible objects in the second connected space that has an association relationship with the first connected space; wherein the association relationship includes: adjacent spatial positions, and / or connected through a connecting channel. It can be seen that when the virtual scene contains multiple connected spaces, the rendering and loading time can be further reduced through scene switching processing.

[0098] For ease of understanding, an example is used below to introduce the implementation of the above embodiment. This example can be applied to the field of games.

[0099] The following is an explanation of some of the concepts that may be involved in this example:

[0100] Streaming: refers to the loading / unloading behavior that does not block the game operation. Specifically, it can replace unnecessary assets with required assets without the player noticing during the game; or replace assets of different precisions to achieve the goal of optimizing performance.

[0101] LOD: Abbreviation for "Level of Detail", an optimization technique used to dynamically adjust the complexity of an object based on the distance between the camera and the object. Generally speaking, when an object is far away from the camera, it is rendered as a simplified model with a small number of polygons; when the object is close to the camera, it is rendered as a highly detailed model with a large number of polygons.

[0102] Block: A group of prefabs, similar to a folder. Each Block can be configured with a Prefab as an HLOD. HLOD is a low-precision rendering object that summarizes the object information in the entire Block.

[0103] Stage: A complete scene in the game. Each stage is composed of several blocks. Switching between multiple stages will cause blocking loading (picture reading). All loading within a single stage is streaming.

[0104] OBB: The abbreviation of "Oriented Bounding Box", which is a geometric shape used in collision detection and other calculations. It is a rectangular box aligned with the direction of the object itself. Unlike the axis-aligned bounding box (AABB, Axis-Aligned Bounding Box), OBB can rotate with the rotation of the object and more closely enclose irregularly shaped objects.

[0105] Volume: A space in the game that contains a specified optimization configuration. Volume can also be understood as a specific implementation of the scene space mentioned above. Usually, a Volume is marked by an OBB. When the virtual camera is located in this space, the optimization configuration will be used for special streaming behavior.

[0106] PVS: Potentially Visible Sets, which is a specific implementation of the visible object set mentioned above. PVS is a method that calculates visibility offline and uses visibility data to guide Streaming during operation.

[0107] Open world scene: Generally, it is relatively open, players are free to move, and there is no fixed route. Because players are free to move, there are few obstructions, and the map is huge, it is usually difficult to apply some special optimization methods.

[0108] Sandbox scene: generally refers to a relatively small game scene where the player's movement line is relatively fixed. There is generally a relatively strict occlusion relationship between different areas of the sandbox scene, and some special optimization methods can be applied. This example is mainly applied to the sandbox scene.

[0109] Item: refers to the smallest data set unit for rendering images at runtime, corresponding to a real object, which can be a specific implementation form of the virtual object mentioned above.

[0110] Cell: Divide the three-dimensional space into several small spaces, each of which is called a Cell, which is a specific implementation form of the virtual space unit mentioned above.

[0111] PVV: (Precomputed Visibility Volume) Precomputed visual volume, which is a collection of spatial positions that the camera may visit when the game is running.

[0112] PVS Cell Data: refers to the data related to the set of scene contents visible when the virtual camera is located in the Cell, including the visibility data of scene objects and lights. PVS CellData refers to the data information in the PVS corresponding to each Cell.

[0113] BFS: (Breadth-First-Search), breadth-first search.

[0114] LRU: (Least Recently Used), least recently used algorithm.

[0115] HiZ: (Hierarchical Z-buffer), or hierarchical Z buffer, is a technology used to improve graphics processing performance, mainly by reducing unnecessary pixel shading. In the 3D rendering process, the Z-buffer (also known as the depth buffer) is used to determine which surfaces are in front of other surfaces in the camera's view, thereby determining which pixels should appear on the screen in the end. When the depth value of a pixel is higher than the depth value already in the Z-buffer, the point is discarded because it means that it is occluded by other surfaces. HiZ stores the Z-buffer at different resolution levels in a hierarchical method, which can exclude pixels that will not appear in the final rendered image more quickly. Before detecting whether to render a pixel or an area, HiZ can first perform a rough check to determine whether the area is completely occluded. If the entire block is determined to be occluded during the hierarchical detection process, all pixels of the block can be quickly discarded, eliminating the need for further computationally intensive pixel shading operations. This method can significantly improve rendering speed, especially when there are a lot of occlusions in the scene. By avoiding excessive pixel processing for occluded objects, HiZ reduces the workload on the GPU, allowing resources to be used more efficiently to render the parts of the scene that the user can actually see.

[0116] OC: Occlusion Culling. Occlusion Culling is a performance optimization technique used to reduce the amount of geometry that needs to be rendered. It can remove objects that are not visible in the final image because they are blocked by other geometry. In this way, further graphics processing such as lighting calculations and pixel shading can be avoided for these objects, thereby saving processor resources and improving rendering efficiency.

[0117] As users' requirements for game quality increase, scene performance, as a very important part of the game screen, is also constantly improving in terms of object details, object quantity, and object types. This will bring two problems: on the one hand, a large amount of resources at runtime may cause the memory to exceed the device's safety value, causing the application to crash; on the other hand, a large number of rendering objects will cause excessive rendering overhead (such as high CPU and GPU overhead), resulting in increased power consumption, abnormal power consumption and heating, and over time will cause the device to reduce frequency and cause unstable game frame rate.

[0118] In response to these two problems, the core optimization logic is to hide and uninstall things that players cannot see, and replace objects that are far away from the player with low-precision resources to control performance. For example, when using the LOD (Level of Detail) solution, the artist will make several low-precision models based on the high-precision model in sequence when producing assets (such as a house), so that the accuracy decreases step by step. Among them, the high-precision model is called Lod0, and the low-precision models are called Lod1, Lod2, etc. as the accuracy decreases. Different Lods will be used according to some strategies during the game. The common solution is to replace objects that are far away and / or have a small screen-to-body ratio with Lod based on the distance between the object and the virtual camera, or the screen-to-body ratio of the object's AABB, reducing memory while saving rendering overhead. Usually, the distance for switching Lods needs to ensure that there is no loss in visual performance, so it is usually far away. However, the Lod solution also has its limitations: the Lod solution will introduce additional models and materials, resulting in an increase in the data content and number of transfers that need to be passed to the GPU. At the same time, many invisible objects that are blocked in the distance will still be submitted for rendering, resulting in a waste of rendering overhead. At the same time, for scenes with a relatively small range, the Lod level of distant objects may not be very low.

[0119] It can be seen that the Lod solution works better in open world scenes with low object density. However, for the box garden scene, the reduction in the scale of the scene means that the density of objects that need to be filled in the box garden scene is higher in the same space, and the effect of the Lod optimization solution will be greatly reduced. For example, in a small scene (such as 150*150 meters) but with a high object density, most objects cannot reach the distance to switch Lod. At this time, high-density objects will generate greater memory pressure.

[0120] In response to the problem of poor effect of using Lod optimization in the sandbox scene, this application uses a large number of occlusion structures in the sandbox scene to divide the virtual scene into multiple Volumes (i.e. the scene space mentioned above), and sets the Streaming strategy of some scene blocks (Blocks) in the Volume. At the same time, combined with the PVS algorithm, it can solve the problem that more invisible resources cannot be unloaded due to insufficient Lod distance in small scenes. Through the method in this example, the scene resources that need to be loaded during the Streaming process can be reduced, and the memory usage at runtime can be optimized. At the same time, since the number of scene objects that need to be created is reduced, the overhead of instantiating scene objects at runtime can also be reduced, saving device CPU resources; at the same time, since the content that needs to be submitted for rendering is reduced, the overhead of GPU scheduling and GPU calculation can also be saved; while making the game running frame rate more stable, it can reduce the power consumption required for the device to run the game.

[0121] Specifically, for the sandbox scene with complex occlusion, since the scene is clearly divided into blocks and there is relatively clear occlusion between the blocks, more strategies can be used for Streaming based on these occlusions. The following briefly introduces the relevant strategies:

[0122] A complete virtual scene can be divided into several volumes according to the partitions between areas. A group of virtual objects (also called objects) inside each volume constitutes a block. Each block can merge and reduce all the objects inside, and can produce a very low-precision rendering object to summarize the entire block. This type of object generated by merging a large number of objects is called HLOD. Volume is a space calibrated using OBB. Based on the scene occlusion in this space, you can configure the loading / unloading of different blocks, unload the blocks that are completely invisible in this space, or stream the distant / hard-to-see blocks as HLOD. For example, according to the player's movement line, you can dynamically determine the volume where the virtual camera is currently located and the visible blocks in the volume, and then unload other distant volumes and the invisible blocks in these distant volumes as a whole, thereby saving a lot of memory. In this way, PVS processing can be performed at the granularity of Block. That is, the visibility of other blocks in the Volume is saved, and the invisible blocks in the Volume are hidden as a whole, and the low-visibility blocks are switched to HLOD display. Therefore, based on the division of the Volume, the visibility of multiple blocks can be judged from the granularity of the blocks, so that completely invisible blocks can be hidden as a whole, thereby batch hiding all objects in the block, improving the culling efficiency.

[0123] Among them, Volume is mainly suitable for the situation where the scene is clearly divided and the occlusion is strict. For the situation where the occlusion is not strict enough, if the block is divided into coarse granularity, the PVS culling efficiency will be relatively low (for example, each volume will think that all other blocks are visible and cannot be culled); if the block is divided into very small granularity, it will cause a serious burden on scene development. At this time, the PVS strategy with objects (i.e. single virtual objects) as the granularity can be implemented. At this time, the PVS strategy will guide the Streaming object loading strategy and only load the objects visible at the current position. The entire process of the PVS strategy mainly consists of three parts: offline baking visibility data, generating runtime visibility data, and using visibility data for Streaming during operation. Among them, when baking visibility data offline, a large number of sampling points will be scattered in the volume, and each sampling point will calculate the visibility of all objects in the visible block under the current volume. When generating runtime visibility data, the volume will first be evenly divided into several small spaces, each of which is called a cell. Figure 2 The schematic diagram of Cell segmentation is shown. Figure 2 Each small square in the image is a Cell. Each Cell will count the sampling points within a certain range inside the current Cell and / or in the adjacent area, and calculate the highest visibility value of each object among these sampling points (used to determine the visibility value of the object corresponding to the Cell). According to the visibility value of each object corresponding to the Cell, the potential visibility value set of all objects in the entire scene corresponding to the Cell is obtained. When using visibility data for Streaming during operation, based on the Cell where the virtual camera is currently located, the potential visibility value set can be used to make a judgment: if the potential visibility of an object is low (that is, the visibility value is low), it means that the object is not visible at this time, and is also not visible in a certain space around it. At this time, the object can be unloaded.

[0124] Figure 3 The main flow chart of this example is shown as Figure 3 As shown, the method for loading the virtual scene in this example specifically includes the following steps:

[0125] Step S310: Generate scene construction information of the virtual scene.

[0126] The scene construction information is generated in the preprocessing stage and is used to determine the object information to be rendered in the virtual scene in the preprocessing stage. This step is used to initialize the scene. Specifically, various virtual objects in the virtual scene that need to bake visibility information are collected, including objects and lights, so as to build the scene data structure required for PVS baking.

[0127] A whitelist can be set to exclude special objects that do not need to be baked in the preprocessing stage. For example, the non-fixed virtual objects that can be displaced and the semi-transparent non-occluded virtual objects mentioned above can be stored in the whitelist so that the virtual objects in the whitelist do not need to participate in the generation of scene construction information. At the same time, the occlusion properties of the objects should also be set in this step, such as occludeable and obscurable properties.

[0128] Step S320: Pre-rendering processing is performed on the scene construction information of the virtual scene through a pre-rendering camera set in any scene space, and a visible object set of any scene space is determined according to the processing result.

[0129] Among them, the pre-rendering camera is used to determine the visibility data corresponding to the position of the pre-rendering camera in the virtual scene by pre-rendering in the pre-processing stage. It can be seen that this step is used to bake the visibility data of the sampling point. Specifically, the pre-rendering camera is set at the sampling point position, wherein the sampling point position can be dynamically determined by a preset strategy. The pre-rendering operation is performed by the pre-rendering camera in six directions, namely, up, down, left, right, front, and back, so as to determine the set of visible objects in each direction respectively. Among them, for any direction, it is necessary to draw the depth of the occluder, and obtain a depth map through processing such as cone clipping to generate HiZ, and obtain all visibility test targets (that is, virtual objects to be verified whether they are visible). By pre-rendering all visibility test targets, visibility data of all visible objects can be generated in the rendering buffer. By reading back the rendering buffer, a set of visible objects in each direction can be obtained.

[0130] Among them, after obtaining all visibility test targets, it is determined whether any visibility test target meets the preset optimization conditions. If the preset optimization conditions are met, it is drawn through a low-resolution conservative grating to improve the drawing efficiency. Among them, before drawing through a low-resolution conservative grating, frustum clipping and HiZOC (Hierarchical Z-Buffer Occlusion Culling) culling can also be performed to reduce the amount of drawing. If the preset optimization conditions are not met, it is drawn through an ordinary grating of the original resolution. Regardless of the drawing method used, the number of drawn pixels is counted by atomic counting after the drawing results, so as to obtain the final set of visible objects by reading back the visibility data. Among them, the preset optimization conditions can be: the visibility test target supports indirect drawing, and / or the visibility test target does not contain a near-cut light source.

[0131] It can be seen that in the above method, a pre-rendered camera can be placed at each sampling point to capture the six faces of each sampling point, use atomic counting to count the visibility information of the object, and use indirect rendering and conservative rasterization algorithms to improve baking efficiency. The rendering process can include the following: drawing the depth of the occluder, where the GPU draws objects closer to the camera through frustum clipping; drawing objects that do not support indirect rendering, where the GPU draws the remaining objects after frustum clipping and OC clipping; generating HiZ, drawing all objects, performing depth testing, and using atomic counting to count the number of pixels visible for each object.

[0132] Through the processing in this step, a set of visible objects (also called PVS sampling point data) of any scene space can be obtained. The scene space can be either a volume space or a cell space. Usually, a corresponding set of visible objects is generated for each volume space and each cell space. The visibility data of each sampling point in each volume space and cell space can be serialized and stored.

[0133] Step S330: Export the PVS Cell data of each Cell space required during the game running process.

[0134] The PVS sampling point data obtained in the above steps is used to divide the space in conjunction with the Volume data and the Stage data. The sampling points are collected according to the divided space, and the PVS Cell Data corresponding to the space is calculated and saved to the storage device.

[0135] This step can be implemented through the PVS data sampling point maintenance module, the scene data maintenance module, and the PVS runtime data maintenance module. Among them, the PVS data sampling point maintenance module is responsible for reading the PVS sampling point data from the storage device and establishing a data structure for accelerating spatial queries. The scene data maintenance module is responsible for reading the scene data and volume data from the storage device and providing query services. The PVS runtime data maintenance module is responsible for saving the PVS Cell Data obtained by merging the sampling points to obtain Lod0. At the same time, this module is also responsible for calculating the multi-level Lod of the PVS Cell Data, performing incremental splitting of the picture quality visibility, and compressing and saving the PVS Cell Data.

[0136] Among them, step S330 can be further divided into Figure 4 The individual sub-steps shown:

[0137] Step S331: Read PVS sampling point data and set a data structure for accelerating spatial query.

[0138] Specifically, the PVS data sampling point maintenance module may be called to read the PVS sampling point data, and a data structure for accelerating spatial query may be constructed in the memory.

[0139] Step S332: Obtain the visible data set of each Cell.

[0140] Specifically, read the Volume data and Stage data, traverse each Volume, obtain the corresponding PVV for each Volume at fixed intervals on the XZ plane, then query all sampling points within the PVV, and then count the visibility of all visible scene objects and lights in the PVV (the visibility value range is [0,1], which can be the visibility value mentioned above), record it in the memory data structure of the Cell, and obtain the visible data set of each Cell.

[0141] In this step, supersampling is performed by introducing behaviors including but not limited to external expansion to collect sampling information, so as to reduce the loss of object visibility due to the sampling interval.

[0142] In the case where multiple cells of different sizes are provided, it is necessary to read cells of all sizes respectively to obtain a visible data set of cells of each size.

[0143] Step S333: Calculate the visibility of objects in the Cell under different scene qualities according to the scene quality defined by the game.

[0144] Specifically, according to the scene quality and image quality defined by the game, the visibility threshold defined under different image qualities and the visibility of the object in the PVV are calculated, and the visibility of the object in the Cell is calculated (the value is bool, that is, visible or invisible). This method can generate different visibility data for different scene quality and image quality, so as to facilitate adaptation to various game image qualities.

[0145] Step S334: compress the data and store it in a storage device according to the visibility recorded in the Cell.

[0146] Step S335: Generate an index file according to the spatial location of the PVS Cell Data.

[0147] Specifically, according to the spatial position of all current PVS Cell Data, an index file is generated and stored in the stage file. The index file saves the hash value of the center xz coordinate of the Cell and its corresponding Cell data file directory. By establishing an index, the query speed during scene loading can be improved.

[0148] Step S340: During the running of the game, the set of visible objects in the virtual scene is dynamically determined according to the position of the virtual camera.

[0149] Among them, steps S310 to S330 are all operations in the game preprocessing stage. Starting from step S340, the process of the game running stage is entered. Step S340 is used to implement the Streaming process of runtime objects, specifically to implement the loading and unloading of PVS data when the game is running, and the process of optimizing scene loading using PVS data. This step is used to load PVS data through Streaming at runtime, so as to use PVS data to cull scene objects.

[0150] Among them, this step can be implemented by the following modules: Cell index data module, Cell LRU module, Cell data maintenance module. Among them, Cell index data module: responsible for reading in Cell data, and constructing Cell index data structure to provide query logic. Cell LRU module: caches a specified number of Cell data in memory. If the limit is exceeded, the LRU algorithm is used to release the least recently used Cell data. Cell data maintenance module: responsible for decompressing and deserializing the Cell data read from the storage device, and calculating the visibility information of scene objects and lights through the current game picture quality.

[0151] Figure 5 A flowchart showing the various sub-steps included in step S340 is shown:

[0152] Step S341: construct an index query data structure through the index file.

[0153] Among them, at the very beginning of the game scene construction, the Cell index file is read into the Cell through the Cell index data module to build an index query data structure.

[0154] Step S342: According to the current position of the virtual camera, determine the Cell file name corresponding to the current position of the virtual camera.

[0155] The Cell file name is used to represent the location of the corresponding Cell and the storage location of its corresponding visible object set.

[0156] Among them, after the game scene is constructed, each frame will use the current virtual camera position for hash mapping, and after mapping, query the index data structure to obtain the Cell file corresponding to the current camera position xz coordinate. Since there may be multiple cells overlapping in the y direction, this query will traverse all cells under the same xz coordinate, and determine the Cell that needs to be loaded at this moment based on the priority of the Volume corresponding to the PVV corresponding to these cells. After calculating the Cell that needs to be loaded currently, calculate the Cell corresponding to the position in the adjacent direction on the XZ plane according to the given step size, and then query the Cell index data module to obtain the file names corresponding to these Cells.

[0157] Step S343: Obtain the corresponding Cell file according to the queried Cell file name.

[0158] Among them, the Cell file is used to store the visibility data of the corresponding Cell (that is, the visibility values ​​of each object when the camera is located in the Cell). Specifically, obtain the name of the Cell file that needs to be read currently, access the LRU module of the Cell for query. If the file already exists in the LRU cache, it means that the corresponding data is ready and no operation is required. If it does not exist in the LRU cache and the file read has not been initiated before, a file read request is initiated to read the corresponding Cell file. In particular, if you only need to obtain the Cell file of the position adjacent to the current position, an asynchronous read request is initiated to reduce performance overhead. If you need to obtain the Cell file corresponding to the current position of the camera, a synchronous read request is initiated (regardless of whether the file read has been initiated before) to improve timeliness. After the corresponding Cell file is read, it is passed to the maintenance module of the Cell data, and the cache is updated according to the LRU algorithm. If necessary, the least recently used Cell file is released and the maintenance module of the Cell data is notified to release the corresponding data.

[0159] Step S344: Calculate visibility information according to the Cell file.

[0160] Among them, after receiving the newly read Cell file, the Cell data maintenance module decompresses and deserializes the data, and calculates the corresponding visibility information based on the current image quality options of the game. These calculation processes are completed by the main thread according to the configuration file, or distributed to the child thread for calculation to avoid blocking the main thread.

[0161] Step S345: When the game quality option changes, the Cell data maintenance module is notified to update the visibility information of all current Cells.

[0162] The above steps complete the Streaming loading process of PVS data.

[0163] Step S350: Determine invisible objects in the virtual scene according to the visible object set.

[0164] This step is used to optimize the culling of scene objects using the PVS system during the game scene streaming process. The following modules can be used in step S350: scene streaming module, PVS system module. The scene streaming module is a logic module responsible for calculating the set of scene objects that need to be loaded and created according to the current camera position. The PVS system module is responsible for the above-mentioned PVS data reading and maintenance functions, and provides scene visibility query functions for the scene streaming module.

[0165] This step can be specifically implemented in the following ways:

[0166] First, the scene streaming module will calculate at a certain time interval based on the current camera position, the object position in the scene object data, and the Lod template corresponding to the object to obtain the list of scene objects that need to be loaded.

[0167] Then, traverse the objects created in the current scene. If there is an instantiated object that is not in the calculated scene object list, or query the PVS system module to find that the object is not visible in the current cell and adjacent cells, initiate a request to destroy the object. Traverse the calculated scene object list. If the object does not exist in the created list of the scene, and the object is visible in the current cell or adjacent cells, initiate a request to create the object. Otherwise, update the Lod of the object.

[0168] Next, after the scene object is created, query the PVS system module. If the object is not visible on the cell where the current camera is located, set its visibility to hidden, otherwise set it to displayed. At the same time, register the object in the PVS system module. When destroying the scene object, unregister it from the PVS system module.

[0169] Finally, since the operation of "getting the list of scene objects that currently need to be loaded" is performed at a certain interval, the camera position may change during this period, causing the visibility of some objects to change. Therefore, after the xz hash value of the camera's current position changes, all scene objects registered to the PVS system module are immediately traversed and their visibility is updated based on whether they are visible in the Cell corresponding to the current camera position and the Cell adjacent to the current camera position.

[0170] Step S360: Eliminate rendering type data of invisible objects from the pre-generated first scene data to obtain second scene data corresponding to multiple virtual objects.

[0171] The first scene data is pre-generated data containing all information in the virtual scene, and the first scene data contains object information of all virtual objects (including visible objects and invisible objects), specifically including rendering type data and non-rendering type data of each virtual object. The rendering type data includes various types of information such as rendering mesh and rendering material. The non-rendering type data includes shadow data, collision data, etc.

[0172] Correspondingly, after removing the rendering type data of the invisible objects from the first scene data, the second scene data corresponding to the multiple virtual objects obtained mainly includes: rendering type data and non-rendering type data of the visible objects, and non-rendering type data of the invisible objects.

[0173] Step S370: Rendering and loading second scene data corresponding to a plurality of virtual objects; wherein the non-rendering type data of the invisible objects in the second scene data is used to respond to non-rendering type operation instructions.

[0174] Among them, the loaded second scene data includes rendering type data and non-rendering type data of visible objects, so visible objects can be displayed normally, and shadows and collision effects appear normally. In addition, the loaded second scene data does not include rendering type data of invisible objects, so it can reduce rendering overhead, improve rendering efficiency, and avoid performance problems caused by rendering invisible objects. In addition, since the second scene data also includes non-rendering type data of invisible objects, the shadows of invisible objects can be displayed normally, and the invisible objects can respond normally to interactive operations such as collisions, thereby improving the accuracy of information in the game scene.

[0175] In addition, in the above example, in order to improve the accuracy of the pre-rendered Cell file so that the rendering angle is consistent with the perspective of the real game character, the camera position of the pre-rendered camera when generating the Cell file can be determined according to the preset character landing point position. Among them, the preset character landing point position can be obtained in the following ways: by ray detection, the potential landing point in the scene space is detected; the moving step length is determined according to the character movement mode and / or the camera movement mode, and the character landing point corresponding to the potential landing point is determined according to the moving step length. In addition, the camera position of the pre-rendered camera can be called a sampling point position, wherein the sampling point position can be determined according to the character landing point position. For example, for any character landing point position, its corresponding sampling point position is a position point that is convenient for photographing the character's landing point position.

[0176] Specifically, in the sampling point generation process, the Volume data reading module and the position search module are involved. Among them, the Volume data reading module is used to read the Volume data, obtain the position of the initial sampling point based on the space marked by the Volume, and provide the relevant spatial data query logic of the Volume. The position search module performs a breadth-first search in the virtual scene based on the protagonist movement rules and the lens movement rules during game runtime to search for potential possible sampling point positions. The subsequent baking module will use the sampling point positions calculated by the position search module for PVS calculation.

[0177] Accordingly, the sampling point generation process specifically includes the following operations:

[0178] First, read the Volume data in the virtual scene. For each Volume, use the collision ray detection method on the XZ plane at fixed intervals to determine whether there is a legal character foothold (a position where the character can stand). If so, the legal foothold position will be recorded in the BFS traversal queue and the foothold position will also be recorded in the foothold set data.

[0179] Then, use the traversal queue to traverse to obtain all possible character landing positions. The process details are to take out the first position in the traversal queue, then use this position to move a fixed step length in the XZ horizontal plane direction, and then use the actual character movement rules of the game to detect whether this position is a reasonable character movement position. If the position passes the test and the distance between this position and all the landing points in the landing point set is greater than the threshold, then add this position to the end of the traversal queue and add it to the landing point set. The traversal process continues until the traversal queue is empty.

[0180] Finally, traverse the footholds calculated above, and based on the movement rules of the protagonist's third-person camera when the game is running, calculate the point set that the camera may actually visit at runtime from these footholds, and save the point set for subsequent PVS baking.

[0181] It can be seen that in the above method, the moving step length is determined by the character movement rule and the camera movement rule, so that all possible potential landing points can be detected, so that the sampling points generated according to the potential landing points have better effect.

[0182] In addition, in the above example, in order to improve the accuracy of processing virtual objects of light and avoid accidental deletion or loading of lights, the light management can be performed through the light system at runtime. The light system will also use PVS information for guidance to hide lights that are not visible from the current camera position. At runtime, all lights are queued in the command queue (CommandQueue) through the light command (LightCommand), which is specifically divided into general light switching and PVS-controlled light switching processes. The processes are as follows:

[0183] The general process of switching lights on and off is as follows: calculate the Block where the current virtual camera is located according to the name of the current Block, obtain the light information of the corresponding Block in the light index file, obtain the set of light IDs to be switched on and off by finding the intersection, register all the sets of light IDs to be switched on and off in the PVS culling system, and create a LightCommand to turn on the light and put it in the CommandQueue.

[0184] PVS light switch process: register the PVS callback interface to switch lights. Among them, the PVS culling system notifies each light switch through callback (only called when the PVS information changes), puts all collected light switch states into the critical area, and calculates the final set of lights to be changed. When updating, all recorded light sets are created as LightCommand and put into CommandQueue.

[0185] The CommandQueue (also called the light management queue) can be used to smooth out light switching operations, making the lighting results smoother and more accurate when switching lights on and off frequently in a short period of time.

[0186] In addition, in the above process, in order to obtain a softer and more realistic lighting effect, the gradient of the light can also be calculated, where the gradient includes intensity gradient and LOD gradient. Among them, intensity gradient: call the callback function corresponding to each light that needs gradient, and call the end callback after the gradient is completed. If the light is turned off, put the light in the unloading queue and wait for unloading. LOD gradient: call the callback function corresponding to each light that needs gradient, and call the end callback after the gradient is completed, and check whether there are remaining LODs in the LOD queue. If there are, start the gradient of the next LOD, otherwise remove the light from the LOD gradient queue and put it in the unloading queue and wait for unloading. Finally, release all lights in the unloading queue.

[0187] In summary, the above example has at least the following advantages:

[0188] (1) Compared with the traditional method of detecting visibility through rays, this example uses GPU pre-rendering calculation method to detect visibility, which can greatly improve the efficiency of calculating PVS. Among them, the corresponding object identifier is set in advance for each pixel in each virtual object in the virtual scene. A pre-rendering camera is established at the sampling point position, and pre-rendering is performed through the pre-rendering camera. In the pre-rendering process, it is necessary to obtain the object identifier corresponding to each pixel (i.e., fragment) through the shader (the color value is obtained in the traditional rendering method, and this example can pre-encode the object identifier in accordance with the encoding method of the color value). Accordingly, in the pre-rendering drawing process, the color value is not drawn in the rendering buffer, but the object identifier is drawn in the rendering buffer. Accordingly, the object identifier corresponding to each pixel can be determined by reverse checking the rendering buffer. That is: the object identifier corresponding to the fragment is additionally passed in during the processing process to achieve the effect of quickly detecting the visibility of the object.

[0189] (2) A method for automatically generating sampling points is provided, and the PVVs of runtime data are automatically segmented and exported in combination with the manually arranged coarse-grained PVVs, which greatly reduces the cost of manually intervening in the PVV arrangement. For example, a breadth-first search can be performed in the scene based on the protagonist movement rules and the camera movement rules during game runtime to search for potential sampling point locations.

[0190] (3) It provides a set of automatic splitting solutions for scene objects (splitting the object data of virtual objects into rendering type data and non-rendering type data), which can solve the problem of incorrect physical effects such as shadows and collisions caused by the traditional PVS method after objects are eliminated.

[0191] For example, objects in a virtual scene are divided into rendering meshes (i.e., object bodies) and non-rendering meshes (including shadow meshes and collision meshes). When invisible objects in a scene are culled according to PVS, only the rendering meshes of the invisible objects are culled, and the non-rendering meshes of the invisible objects are retained.

[0192] Traditional PVS does not split objects into rendering meshes and non-rendering meshes. Therefore, when invisible objects in the scene are culled according to PVS, both the rendering meshes and non-rendering meshes of the invisible objects will be culled at the same time. This will lead to the following problems: Assuming there are three rooms 1, 2, and 3, when you are in room 1, rooms 2 and 3 are usually invisible, but the shadows of objects near the door in room 2 can still be projected in room 1, and when the character launches virtual props such as boomerangs, although the objects in rooms 2 and 3 are invisible, they can still respond to the collision operations of the virtual props. It can be seen that this example can improve the accuracy of various special scenes in the game scene by splitting objects into two categories: rendering meshes and non-rendering meshes.

[0193] (4) Compared with the traditional PVS method, there is no need to read in all the PVS Cell data, and streaming reading of PVS data loading can be achieved, thereby reducing the additional memory overhead introduced when the PVS system needs to read in PVS Cell data.

[0194] Among them, PVS Cell data can be loaded dynamically according to the index: PVS CellData of each Cell is generated in advance, and at runtime, the current cell corresponding to the camera is determined dynamically according to the camera position, and the PVSCell Data of the current cell is loaded dynamically. Among them, cells of various sizes, large, medium, and small, can be set in advance, and objects can be divided into three different sizes of large, medium, and small according to their sizes. Large objects are stored in large cells, medium objects are stored in medium cells, and small objects are stored in small cells. Correspondingly, for any camera position, the union of the PVS Cell Data of the three levels of large, medium, and small cells corresponding to the camera position is obtained, and invisible objects are culled according to the union. Since the switching frequency of large cells is low during camera movement, performance can be saved compared to setting only small cells.

[0195] (5) Compared with the traditional PVS method, this example also optimizes the overhead of lights. According to the offline calculated light visibility information, only the currently visible lights are rendered and calculated, saving rendering overhead. In addition, when calculating visibility, the accuracy of light culling can be improved by introducing the light proxy body. Among them, a light management queue is created to smooth the operation of turning on and off lights. Specifically, all lights that need to execute the light turning on and off instructions are added to this queue, so that when receiving the rendering instruction, the switch status of one or more lights associated with the current rendering instruction can be obtained from the queue and rendered. Through the queue management method, unnecessary processing caused by frequent switching of lights can be avoided. In addition, multiple LODs with different precision levels can be set for each light. The light parameters of each LOD are different, which are specifically reflected in the number, intensity and shape of lights. For example, 5 lights are displayed in the near distance, and fade to one light in the far distance; the intensity and shape will also change dynamically with the distance, so as to achieve the effect of gradual in and fade out. In addition to smoothing operations, it is also necessary to handle the dependencies between lights. The turning off of some lights responsible for casting shadows depends on the turning off of some non-shadow-casting lights.

[0196] In addition, a light proxy is configured for each light, and the light proxy is a spherical area set according to the illumination range of the light. The main reason for setting a light proxy for a light is that the light is different from other objects, and its visible range is usually larger than the range in which it is located. Therefore, a light proxy mesh is set according to the illumination range of the light, so that the PVS processing of the light is realized through the light proxy mesh. For example, taking the light near the door of Room 2 as an example, although the light itself is not visible, its light is visible. Therefore, the visible light near the door of Room 2 can be accurately rendered through the light proxy mesh.

[0197] (6) Optimizing performance through volume partitioning: According to the connectivity of the space, it can be cut at the intersection to obtain multiple subspaces. For example, the space can be cut at the exit and the entrance to obtain multiple volumes. In addition, a block corresponds to a group of objects. A volume usually corresponds to a block. A volume usually only has visibility information of the block. However, a cell usually has visibility information of all virtual objects. In order to improve the culling efficiency, blocks can be culled first, and then objects (i.e., virtual objects) can be culled. This involves the calculation of block visibility: in the current volume, completely invisible blocks need to be hidden. For example, in a certain Volume, the visibility of all scenes in the Volume is calculated based on the visibility of all cells in the current Volume. If all objects in a block in the Volume are not visible, the Block is considered invisible in the Volume and can be directly removed as a whole. If only a few objects in the Block are visible (taking a percentage threshold), the Block is considered to only need to display HLOD (low-precision mesh model) in the Volume to reduce loading overhead.

[0198] It can be seen that this example can manage the loading and unloading of multiple objects in a unified manner through blocks: in a certain Volume, the visibility of all objects in the Volume is calculated based on the visibility of all cells in the current Volume. If all objects of a certain block are not visible in the Volume, the Block is considered to be invisible in the Volume (just remove the Block directly); if only a small number of objects in the Block are visible (taking a percentage threshold), it is considered that the Block only needs to display HLOD in the Volume.

[0199] In addition, the accuracy of visible object judgment can be improved by storing moving objects (whose positions are not fixed and will affect the accuracy) and translucent objects (to prevent them from accidentally blocking other objects) in the whitelist.

[0200] It can be seen that the effect of this example is related to the original spatial planning of the scene. For the well-enclosed areas in the larger scene, the volume division method in this example can achieve very good results (memory can be reduced by more than 75%); for the more open outdoor scenes, the optimization range of using volume is smaller, only about 25%. On this basis, using PVS for optimization can further reduce power consumption and memory by about 25%.

[0201] Figure 6 A schematic diagram of a virtual scene loading device provided by another embodiment of the present disclosure is shown, and the device specifically includes:

[0202] A determination module 61, configured to determine, according to a virtual camera position, an invisible object among a plurality of virtual objects of the virtual scene;

[0203] A culling module 62 is used to cull the rendering type data of the invisible object from the first scene data corresponding to the multiple virtual objects to obtain the second scene data corresponding to the multiple virtual objects; wherein the first scene data corresponding to the multiple virtual objects is used to store the rendering type data and non-rendering type data of each virtual object;

[0204] The loading module 63 is used to render and load the second scene data corresponding to the multiple virtual objects; wherein the non-rendering type data of the invisible objects in the second scene data is used to respond to the non-rendering type operation instruction.

[0205] In an optional implementation, the non-rendering type operation instruction includes: a shadow type operation instruction corresponding to a shadow calculation type, a collision type operation instruction corresponding to a collision calculation type, and / or a special effect type operation instruction corresponding to a special effect calculation type;

[0206] The non-rendering type data includes: shadow type data for responding to the shadow type operation instruction, collision type data for responding to the collision type operation instruction, and / or special effect type data for responding to the special effect type operation instruction.

[0207] In an optional implementation, the virtual scene includes a plurality of scene spaces; and the invisible objects among the plurality of virtual objects of the virtual scene are determined by a pre-generated target visible object set corresponding to the virtual camera position; wherein, a plurality of visible object sets corresponding to the plurality of scene spaces are pre-generated, and the target visible object set is a visible object set in the plurality of visible object sets that matches the virtual camera position;

[0208] Among them, the set of visible objects corresponding to any scene space is generated in the following way:

[0209] Generating scene construction information of the virtual scene according to rendering type data of multiple virtual objects of the virtual scene;

[0210] A pre-rendering camera is arranged in any scene space to perform pre-rendering processing on the scene construction information of the virtual scene, and a set of visible objects in any scene space is determined according to the processing result.

[0211] In an optional implementation, the device further includes:

[0212] A generation module for generating scene construction information of the virtual scene; wherein the generation module is specifically used to:

[0213] In a case where the virtual scene includes a virtual object of a first preset type, generating simulation rendering data of the virtual object of the first preset type;

[0214] Generating scene construction information of the virtual scene according to the simulation rendering data;

[0215] The first preset type of virtual object includes: a virtual object capable of emitting light; and the size and / or shape of the rendering grid contained in the simulation rendering data is determined according to the lighting coverage of the first preset type of virtual object.

[0216] In an optional implementation, the generating module is specifically used for:

[0217] In a case where the virtual scene includes a virtual object of a second preset type, removing rendering type data of the virtual object of the second preset type, and generating scene construction information of the virtual scene according to the removed rendering type data;

[0218] The second preset type of virtual objects includes: non-fixed virtual objects that can be displaced, and semi-transparent non-blocking virtual objects.

[0219] In an optional implementation, the virtual scene is a game scene, and the camera position of the pre-rendered camera set in any scene space is determined according to a preset character landing point position;

[0220] The preset character landing point position is obtained by:

[0221] Detecting potential landing points in the scene space by means of ray detection;

[0222] The moving step length is determined according to the character movement mode and / or the camera movement mode, and the character landing point corresponding to the potential landing point is determined according to the moving step length.

[0223] In an optional implementation, the virtual scene includes: a first virtual space set including a plurality of first virtual space units, and a second virtual space set including a plurality of second virtual space units;

[0224] The determination module is specifically used for:

[0225] Determine a first target space unit that matches the virtual camera position from a plurality of first virtual space units in the first virtual space set; determine a second target space unit that matches the virtual camera position from a plurality of second virtual space units in the second virtual space set;

[0226] Acquire a first visible object set corresponding to the first target space unit and a second visible object set corresponding to the second target space unit;

[0227] Invisible objects among a plurality of virtual objects in the virtual scene are determined according to a union of the first visible object set and the second visible object set.

[0228] In an optional implementation, the unit size of the first virtual space unit is larger than the unit size of the second virtual space unit;

[0229] Furthermore, the multiple virtual objects of the virtual scene include: a first virtual object and a second virtual object; wherein the object size of the first virtual object is larger than the object size of the second virtual object;

[0230] The visible object set of the first virtual space unit is used to store the first virtual object in a visible state, and the visible object set of the second virtual space unit is used to store the second virtual object in a visible state.

[0231] In an optional implementation, the first target space unit and the second target space unit are dynamically switched as the position of the virtual camera moves;

[0232] Furthermore, a switching frequency of the first target space unit is lower than a switching frequency of the second target space unit.

[0233] The specific working principles of the above modules can be found in the description of the corresponding parts in the method embodiment, which will not be repeated here.

[0234] Figure 7 A schematic structural diagram of an electronic device according to another embodiment of the present disclosure is shown. The specific embodiment of the present disclosure does not limit the specific implementation of the electronic device.

[0235] like Figure 7 As shown, the electronic device may include: a processor (processor) 502 , a communication interface (Communications Interface) 504 , a memory (memory) 506 , and a communication bus 508 .

[0236] in:

[0237] The processor 502 , the communication interface 504 , and the memory 506 communicate with each other via a communication bus 508 .

[0238] The communication interface 504 is used to communicate with other devices such as clients or other servers.

[0239] The processor 502 is used to execute the program 510, and specifically can execute the relevant steps in the above-mentioned video image detection method embodiment.

[0240] Specifically, the program 510 may include program codes, which include computer operation instructions.

[0241] The processor 502 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present disclosure. The one or more processors included in the electronic device may be processors of the same type, such as one or more CPUs. They may also be processors of different types, such as one or more CPUs and one or more ASICs.

[0242] The memory 506 is used to store the program 510. The memory 506 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0243] The program 510 can be specifically used to enable the processor 502 to execute the corresponding operations in the above-mentioned virtual scene loading method embodiment.

[0244] The algorithms and displays provided herein are not inherently related to any particular computer, virtual device or other device. Various general purpose devices may also be used together with the teachings based thereon. According to the above description, it is apparent that the structure required for constructing such devices is. In addition, the present disclosure is not directed to any particular programming language either. It should be understood that various programming languages ​​may be utilized to implement the disclosure described herein, and the description of the specific languages ​​above is intended to disclose the best mode of implementation of the present disclosure.

[0245] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present disclosure can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0246] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various disclosed aspects, in the above description of exemplary embodiments of the present disclosure, various features of the present disclosure are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed disclosure requires more features than are expressly recited in each claim.

[0247] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0248] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present disclosure and form different embodiments. For example, any one of the claimed embodiments may be used in any combination.

[0249] The various component embodiments of the present disclosure may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the device according to the embodiments of the present disclosure. The present disclosure may also be implemented as a device or device program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present disclosure may be stored on a computer-readable medium, or may have the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0250] It should be noted that the above embodiments illustrate the present disclosure rather than limit the present disclosure, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets should not be constructed as a limitation to the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The present disclosure may be implemented by means of hardware including several different elements and by means of appropriately programmed computers. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names.

Claims

1. A method for loading a virtual scene, the method comprising: Determining, according to the virtual camera position, invisible objects among a plurality of virtual objects of the virtual scene; Eliminating the rendering type data of the invisible object from the first scene data corresponding to the multiple virtual objects to obtain the second scene data corresponding to the multiple virtual objects; wherein the first scene data corresponding to the multiple virtual objects is used to store the rendering type data and non-rendering type data of each virtual object; Rendering and loading second scene data corresponding to the multiple virtual objects; wherein the non-rendering type data of the invisible objects in the second scene data is used to respond to non-rendering type operation instructions.

2. The method according to claim 1, wherein: The non-rendering type operation instructions include: shadow type operation instructions corresponding to the shadow calculation type, collision type operation instructions corresponding to the collision calculation type, and / or special effect type operation instructions corresponding to the special effect calculation type; The non-rendering type data includes: shadow type data for responding to the shadow type operation instruction, type data for responding to the collision type operation instruction, and / or special effect type data for responding to the special effect type operation instruction.

3. The method according to claim 1 or 2, wherein: The virtual scene includes a plurality of scene spaces; and a plurality of visible object sets corresponding to the plurality of scene spaces are pre-generated; then the invisible objects among the plurality of virtual objects of the virtual scene are determined according to a target visible object set corresponding to the virtual camera position in the plurality of visible object sets; Among them, the set of visible objects corresponding to any scene space is generated in the following way: Generating scene construction information of the virtual scene according to rendering type data of multiple virtual objects of the virtual scene; A pre-rendering camera is arranged in any scene space to perform pre-rendering processing on the scene construction information of the virtual scene, and a set of visible objects in any scene space is determined according to the processing result.

4. The method according to claim 3, wherein: The scene construction information for generating the virtual scene includes: In a case where the virtual scene includes a virtual object of a first preset type, generating simulation rendering data of the virtual object of the first preset type; Generating scene construction information of the virtual scene according to the simulation rendering data; The first preset type of virtual object includes: a virtual object capable of emitting light; and the size and / or shape of the rendering grid contained in the simulation rendering data is determined according to the lighting coverage of the first preset type of virtual object.

5. The method according to claim 3 or 4, wherein: The scene information for generating the virtual scene includes: In a case where the virtual scene includes a virtual object of a second preset type, removing rendering type data of the virtual object of the second preset type, and generating scene construction information of the virtual scene according to the removed rendering type data; The second preset type of virtual objects includes: non-fixed virtual objects that can be displaced, and semi-transparent non-blocking virtual objects.

6. The method according to any one of claims 3 to 5, wherein: The virtual scene is a game scene, and the camera position of the pre-rendering camera set in any scene space is determined according to a preset sampling point position; The preset sampling point position is obtained in the following way: Detecting potential landing points in the scene space by means of ray detection; Determine a moving step length according to a character moving mode and / or a camera moving mode, and determine a character landing point corresponding to the potential landing point according to the moving step length; Determine the sampling point position corresponding to the character's landing point.

7. The method according to any one of claims 3 to 6, wherein: The virtual scene includes: a first virtual space set including a plurality of first virtual space units, and a second virtual space set including a plurality of second virtual space units; The step of determining the invisible objects among the multiple virtual objects of the virtual scene according to the virtual camera position comprises: Determine a first target space unit that matches the virtual camera position from a plurality of first virtual space units in the first virtual space set; determine a second target space unit that matches the virtual camera position from a plurality of second virtual space units in the second virtual space set; Acquire a first visible object set corresponding to the first target space unit, and a second visible object set corresponding to the second target space unit; Invisible objects among a plurality of virtual objects in the virtual scene are determined according to a union of the first visible object set and the second visible object set.

8. The method according to claim 7, wherein: The unit size of the first virtual space unit is larger than the unit size of the second virtual space unit; Furthermore, the plurality of virtual objects of the virtual scene include: a first virtual object and a second virtual object; wherein the object size of the first virtual object is larger than the object size of the second virtual object; The visible object set of the first virtual space unit is used to store the first virtual object in a visible state, and the visible object set of the second virtual space unit is used to store the second virtual object in a visible state.

9. The method according to claim 8, wherein: The first target space unit and the second target space unit are dynamically switched as the position of the virtual camera moves; Furthermore, a switching frequency of the first target space unit is lower than a switching frequency of the second target space unit.

10. A virtual scene loading device, comprising: A determination module, used for determining an invisible object among a plurality of virtual objects of the virtual scene according to a virtual camera position; A culling module, configured to cull the rendering type data of the invisible object from the first scene data corresponding to the multiple virtual objects, to obtain the second scene data corresponding to the multiple virtual objects; wherein the first scene data corresponding to the multiple virtual objects is used to store the rendering type data and non-rendering type data of each virtual object; A loading module is used to render and load second scene data corresponding to the multiple virtual objects; wherein the non-rendering type data of the invisible objects in the second scene data is used to respond to non-rendering type operation instructions.

11. An electronic device, comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the virtual scene loading method according to any one of claims 1-9.

12. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and wherein the executable instruction enables a processor to execute the virtual scene loading method according to any one of claims 1 to 9.

Citation Information

Cited By

  • Scene resource visibility processing method and device, electronic equipment and storage medium

    CN119941933A