WO2024131205A1 - Method and apparatus for displaying precomputed cell, and method and apparatus for generating precomputed cell - Google Patents

Method and apparatus for displaying precomputed cell, and method and apparatus for generating precomputed cell Download PDF

Info

Publication number
WO2024131205A1
WO2024131205A1 PCT/CN2023/123184 CN2023123184W WO2024131205A1 WO 2024131205 A1 WO2024131205 A1 WO 2024131205A1 CN 2023123184 W CN2023123184 W CN 2023123184W WO 2024131205 A1 WO2024131205 A1 WO 2024131205A1
Authority
WO
WIPO (PCT)
Prior art keywords
space
grid
perspective
overlapping
full
Prior art date
Application number
PCT/CN2023/123184
Other languages
French (fr)
Chinese (zh)
Inventor
陈律昊
高洋
毛峻宏
黎浩良
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2024131205A1 publication Critical patent/WO2024131205A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation
    • G06T17/205Re-meshing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation

Definitions

  • the present application relates to the field of computer technology, and in particular to a pre-calculated cell display method, a pre-calculated cell display method, an apparatus, a computer device, a computer-readable storage medium, and a computer program product.
  • the traditional pre-computed cell generation and display method generates pre-computed cells of PVS based on the navigation grid in the virtual scene.
  • the navigation grid cannot cover all reachable areas in the virtual scene. Therefore, the traditional method has the disadvantage of low matching degree between the pre-computed cells and the virtual scene.
  • a pre-calculated cell display method a pre-calculated cell generation method, an apparatus, a computer device, a computer-readable storage medium, and a computer program product are provided.
  • the present application provides a method for pre-calculating cell display, which is performed by a computer device.
  • the method comprises:
  • a navigation grid corresponding to a first space in the viewing angle-restricted space is displayed, and a plurality of pre-calculated cells extending along a standing direction of the virtual character and covering the navigation grid are displayed, wherein the first space is a space in the viewing angle-restricted space that does not overlap with the full viewing angle space, and the navigation grid is used to represent a reachable area of the virtual character in the viewing angle-restricted space;
  • a static grid corresponding to a second space in the full-view space displays a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the static grid, wherein the second space is a space in the full-view space that does not overlap with the view-restricted space, and the static grid is used to represent the object outline of a static object in the space.
  • the present application also provides a pre-calculated cell display device.
  • the device comprises:
  • a viewing space display module for responding to a viewing space division event triggered for a virtual scene where a virtual character is located, and displaying the divided viewing space with limited viewing angle and full viewing space in the virtual scene;
  • a pre-calculated cell display module configured to display a plurality of pre-calculated cells corresponding to a navigation grid of a first space in the viewing angle-restricted space, extending along a standing direction of the virtual character and covering the navigation grid, wherein the first space is a space in the viewing angle-restricted space that does not overlap with the full viewing angle space, and the navigation grid is used to represent a reachable area of the virtual character in the viewing angle-restricted space;
  • a static grid corresponding to a second space in the full-view space displays a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the static grid, wherein the second space is a space in the full-view space that does not overlap with the view-restricted space, and the static grid is used to represent the object outline of a static object in the space.
  • the present application also provides a method for generating a pre-calculated cell.
  • the method comprises:
  • a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the static grid are generated, wherein the static grid is used to represent the object outline of the static object in the space.
  • the present application also provides a pre-calculated cell generation device.
  • the device comprises:
  • a viewing angle space determination module used to obtain viewing angle space parameters for a virtual scene where a virtual character is located, and determine a viewing angle restricted space and a full viewing angle space in the virtual scene;
  • a non-overlapping space determining module configured to determine, according to respective positions of the viewing angle limited space and the full viewing angle space in the virtual scene, a first space in the viewing angle limited space that does not overlap with the full viewing angle space, and a second space in the full viewing angle space that does not overlap with the viewing angle limited space;
  • a pre-calculated cell generation module configured to generate, corresponding to the navigation grid of the first space, a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the navigation grid, wherein the navigation grid is used to represent a reachable area of the virtual character in the view-limited space;
  • a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the static grid are generated, wherein the static grid is used to represent the object outline of the static object in the space.
  • the present application further provides a computer device, which includes a memory and one or more processors, wherein the memory stores computer-readable instructions, and the one or more processors execute the steps of each method embodiment of the present application when executing the computer-readable instructions.
  • the present application further provides a computer-readable storage medium having computer-readable instructions stored thereon, and when the computer-readable instructions are executed by one or more processors, the steps of the method embodiments of the present application are executed.
  • the present application further provides a computer program product, which includes computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the steps of the method embodiments of the present application are executed.
  • FIG1 is a diagram of an application environment of a pre-calculated cell display method and a generation method in some embodiments
  • FIG2 is a schematic diagram of a flow chart of a method for pre-calculating cell display in some embodiments
  • FIG3 is a schematic diagram of a display interface of a viewing angle space in some embodiments.
  • FIG4 is a schematic diagram of a display interface of a navigation grid in some embodiments.
  • FIG5 is a schematic diagram of a display interface of a pre-calculated cell of the full viewing space D in FIG3 ;
  • FIG6 is a schematic diagram of a display interface of a pre-calculated cell in some other embodiments.
  • FIG7 is a schematic diagram of a flow chart of a method for pre-calculating cell display in some other embodiments.
  • FIG8 is a schematic diagram of a process flow of a method for generating a pre-calculated cell in some embodiments
  • FIG9 is a schematic diagram of overlapping spaces in one embodiment
  • FIG10 is a schematic diagram of a process of splitting a non-target viewing space in some embodiments.
  • FIG11 is a schematic diagram of the projection of the overlapping subspace K3 in FIG10 on the XY plane after being split;
  • FIG12 is a schematic diagram of a grid structure of a pre-calculated cell in some embodiments.
  • FIG13 is a schematic diagram of a plane projection area and a grid projection area on an XY plane in some embodiments
  • FIG14 is a schematic diagram of a flow chart of a method for generating a pre-calculated cell in some other embodiments
  • FIG15 is a schematic diagram of the generation result of a pre-calculated cell in one embodiment
  • FIG16 is a schematic diagram of the generation result of pre-calculated cells in another embodiment
  • FIG17 is a block diagram of a pre-calculated cell display device in some embodiments.
  • FIG18 is a block diagram of a pre-calculated cell generation device in some embodiments.
  • FIG19 is a diagram of the internal structure of a computer device in some embodiments.
  • FIG. 20 is a diagram of the internal structure of a computer device in some embodiments.
  • the pre-calculated cell display method and generation method provided in the embodiment of the present application relate to computer vision technology of artificial intelligence, and can be specifically applied in the application environment shown in Figure 1.
  • the application end 102 communicates with the server end 104 through a network.
  • the network can be a wide area network or a local area network, or a combination of the two, using wireless or wired links to realize data transmission.
  • the data storage system can store data that the service end 104 needs to process.
  • the data storage system can be integrated on the server end 104, or it can be placed on the cloud or other computer devices.
  • the server end 104 responds to the perspective space division event triggered for the virtual scene where the virtual character is located, and displays the divided perspective restricted space and full perspective space in the virtual scene, corresponding to the navigation grid of the first space in the perspective restricted space that does not overlap with the full perspective space, and the static grid of the second space in the full perspective space that does not overlap with the perspective restricted space, and generates or displays a plurality of pre-calculated cells extending along the standing direction of the virtual character to cover the navigation grid of the first space and the static grid of the second space; the navigation grid is used to represent the reachable area of the virtual character in the perspective restricted space; the static grid is used to represent the object contour of the static object in the space.
  • the server 104 can calculate the PVS for each pre-calculated cell and save the PVS calculation result, so that when the application 102 accesses the virtual scene, fast scene rendering can be achieved according to the PVS calculation result corresponding to the location of the virtual character to improve the display effect of the scene picture.
  • the server 104 can be a terminal or a server with an external display screen.
  • the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart TV, a smart watch, etc., but is not limited to this.
  • the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), and big data and artificial intelligence platforms.
  • the application end 102 and the server end 104 can be directly or indirectly connected through wired or wireless communication, and this application does not limit this.
  • the application end 102 can install an application that supports virtual scenes, and then access the virtual scenes through the application, but the application is not necessary, and the application end 102 can also access the virtual scenes through a web page.
  • the application can be any one of a multiplayer online tactical competitive game (MOBA, Multiplayer Online Battle Arena games), a three-dimensional (Three Dimension, 3D) game application, a virtual reality application, a three-dimensional map program, or a multiplayer competitive survival game.
  • the application can also be a stand-alone application, such as a stand-alone 3D game program.
  • the pre-calculated cell generation and display method can be applied to game application scenarios such as stand-alone shooting games or multiplayer online tactical competitive games.
  • game application scenarios such as stand-alone shooting games or multiplayer online tactical competitive games.
  • the server 104 responds to the perspective space division of the virtual scene where the virtual character is located.
  • the divided view-limited space and full view space are displayed in the virtual scene, wherein the view-limited space includes the area where the house with inaccessible areas such as the roof is located; the full view space may include the area where the outdoor grass is located.
  • the server 104 displays a plurality of pre-calculated cells extending along the standing direction of the virtual character, corresponding to the navigation mesh of the first space in the view-limited space that does not overlap with the full view space, and the static mesh of the second space in the full view space that does not overlap with the view-limited space, to cover the navigation mesh of the first space and the static mesh of the second space;
  • the navigation mesh is used to represent the accessible area of the virtual character in the view-limited space, such as the indoor accessible area of the house;
  • the static mesh is used to represent the object outline of the static object in the space, such as the outline of the ground or grass.
  • the server 104 can calculate the PVS for each pre-calculated cell, and save the PVS calculation result in the scene data of the virtual scene, and send it to the application 102 together with the scene data, so that when the application 102 accesses the virtual scene, it can remove the currently invisible static objects in the rendering echelon according to the PVS calculation result corresponding to the position of the virtual character, thereby realizing fast scene rendering.
  • the server can also query the PVS calculation result corresponding to the position of the virtual character of the application 104, and realize the rendering of the current virtual scene of the application 104 based on the PVS calculation results obtained by the query.
  • the pre-calculated cell generation and display method can be applied to the application scenario of map navigation.
  • the application end 102 can install a map navigation application, and the user can view the rendered image corresponding to the real scene image on the navigation path by accessing the application.
  • the server end 104 for each simulation scene corresponding to the real scene in the map, responds to the perspective space division event for the simulation scene, and displays the perspective-restricted space divided into perspective-restricted areas such as streets and the full perspective space including perspective-unrestricted areas such as outdoor open spaces in the simulation scene.
  • the server end 104 displays a plurality of pre-calculated cells extending along the user's standing direction, corresponding to the navigation grid of the first space in the perspective-restricted space that does not overlap with the full perspective space, and the static grid of the second space in the full perspective space that does not overlap with the perspective-restricted space, to cover the navigation grid of the first space and the static grid of the second space;
  • the navigation grid is used to represent the user's accessible area in the perspective-restricted space, such as the road between street buildings;
  • the static grid is used to represent the object contour of the static object in the space, such as the ground contour.
  • the server 104 can calculate PVS for each pre-calculated cell and save the PVS calculation result in the scene data of the simulation scene.
  • the server 104 can query the PVS calculation result corresponding to the position according to the viewing angle position specified by the user, and determine the visible objects at the current viewing angle position based on the PVS calculation results obtained by the query, and by rendering the visible objects, feedback the rendered image at the viewing angle position to the application 102.
  • the viewing angle position is used to represent the position and orientation of the user in the scene.
  • a pre-calculated cell display method is provided, and the method is applied to the server 104 in FIG. 1 as an example for description, including the following steps:
  • Step S202 in response to a perspective space division event triggered for a virtual scene where the virtual character is located, displaying the divided perspective restricted space and full perspective space in the virtual scene.
  • the virtual scene refers to the virtual activity space provided by the application or web page in the application end during operation, for the virtual character to perform various activities in the virtual activity space.
  • the virtual scene can be a simulation scene of the real world, or a semi-simulation and semi-fictional scene, or a purely fictional scene.
  • the virtual scene can include virtual objects, which can be scene components in the virtual scene, such as virtual grass or virtual buildings, or scene participating elements in the virtual scene, such as virtual objects controlled by the application end and active in the virtual scene, and non-player characters (NPC, Non-Player Character) not controlled by the application end. That is, the virtual character refers to an active object controlled by the application end in the virtual scene.
  • the active object can be at least one of a virtual person, a virtual animal, and an animated character.
  • the application end can control the virtual character to move in the virtual scene according to the received user operation.
  • the activities of the virtual character in the virtual scene include: walking, running, jumping, climbing, lying down, attacking, releasing skills, picking up props, and sending messages, but are not limited to this, and the embodiments of the present application are not limited to this.
  • the view space division event is an event used to instruct the server to divide the view space in the virtual scene and display the divided view space.
  • the triggering method of the view space division event is not unique.
  • a view space division control may be displayed on the development interface, and the developer may click the view space division control.
  • the server may trigger a view space division event in response to the click operation of the view space division control.
  • a view space division option may also be displayed on the development interface, and the developer may select the view space division option.
  • the server may trigger a view space division event in response to the selection operation of the view space division option.
  • the server may also automatically trigger a view space division event after the lighting construction of the virtual scene is completed.
  • Perspective-restricted space and full-perspective space are two different types of perspective spaces.
  • Perspective-restricted space refers to a perspective space that includes perspective-restricted areas such as houses, streets, and bridges.
  • Perspective-restricted areas refer to spaces where there are restrictions on the movement trajectory of virtual characters, and the accessible areas of virtual characters can be represented by navigation grids.
  • the roof and walls of a house may be inaccessible areas for virtual characters
  • buildings in the street may be inaccessible areas for virtual characters
  • piers and ropes of bridges may be inaccessible areas for virtual characters.
  • Full-perspective space refers to a perspective space that includes full-perspective areas such as outdoor open spaces.
  • a full-perspective area refers to a space where there are no restrictions on the movement trajectory of a virtual character, that is, within a full-perspective area, a virtual character can touch all static objects contained in the area.
  • ground elements in an outdoor open space include soil, grass, and the like.
  • the perspective space is used to define the range of generating PVS pre-computed cells in the virtual scene, and the perspective space can be displayed as a mapped object or an unmapped wireframe.
  • the spatial shape of the perspective space is not unique, for example, it can be a cuboid, a cylinder, a prism or an irregular shape, and the spatial shapes of the perspective-restricted space and the full perspective space can be the same or different.
  • the perspective space can be represented by a precomputed visible volume (Precompute Visible Volume) displayed as a cuboid wireframe.
  • Precompute Visible Volume precompute Visible Volume
  • the divided perspective-restricted space C containing the house A and the full perspective space D containing the open space B can be displayed.
  • the house A in FIG3 includes a navigation grid E for representing the reachable area of the virtual character.
  • a developer can click on the perspective space division interface of the development interface, or select the perspective space division option of the development interface, and the server can respond to the developer's interface operation on the development interface, trigger the perspective space division event for the virtual scene where the virtual character is located, and divide and display the perspective restricted space and the full perspective space in the virtual scene.
  • the server can respond to the perspective space division event triggered for the virtual scene where the virtual character is located, divide the perspective restricted space and the full perspective space in the virtual scene, and display the divided perspective restricted space and the full perspective space at the corresponding position in the virtual scene.
  • the specific way for the server to divide the perspective restricted space and the full perspective space in the virtual scene is not unique.
  • a developer may determine the parameters of the viewing space and input the parameters into the server, which will divide the virtual scene into a viewing restricted space and a full viewing space according to the input parameters.
  • a developer may also draw wireframes corresponding to the viewing restricted space and the full viewing space in the virtual scene by dragging the mouse.
  • the server may also determine the viewing restricted elements and the full viewing elements contained in the virtual scene based on the reachable range attribute parameters of the scene constituent elements of the virtual scene, and then divide the virtual scene into a viewing restricted space containing the viewing restricted elements and a full viewing space containing the full viewing elements.
  • the display modes of the perspective-restricted space and the full perspective space may be the same or different.
  • the divided perspective-restricted space and the full perspective space may be displayed respectively by different types of wireframes, and the different types of wireframes may be different in at least one of line color, line thickness or line type;
  • the perspective-restricted space and the full perspective space may also be displayed differently by displaying a space type identifier, and the space type identifier is used to identify the space type of the perspective-restricted space or the full perspective space, and the space type is a perspective-restricted type or a full perspective type.
  • the space type identifier may include a combination of one or more of text, symbols or numbers.
  • the perspective space may also be configured to be hidden, so that the developer can choose to display or not display the corresponding perspective space as needed. That is, the perspective-restricted space and the full perspective space divided in the virtual scene may be displayed in full, partially or not at all.
  • the number of the view-restricted space and the full view space can be one or more, and any two view spaces in each view-restricted space and each full view space may or may not have overlapping space.
  • the view-restricted space C and the full view space D have overlapping space in the area where the house A is located.
  • the overlapping space can be calculated by precompute the reload volume (Precompute Override Volume) characterization.
  • Step S204 corresponding to the navigation grid of the first space in the viewing angle-limited space, displays a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the navigation grid.
  • the pre-calculated cell (Cell) is the smallest calculation unit of PVS calculation, which can be understood as the location of the virtual character's eyes or the camera following the virtual character.
  • the PVS calculation process corresponds to the process of determining the potential visible set corresponding to each Cell.
  • the first space is the space in the perspective-restricted space that does not overlap with the full perspective space; the second space is the space in the full perspective space that does not overlap with the perspective-restricted space.
  • the navigation grid is used to characterize the reachable area of the virtual character in the perspective-restricted space. For the first space in the perspective-restricted space that does not overlap with the full perspective space, the navigation grid in the first space can relatively accurately characterize the reachable area of the virtual character in the first space.
  • the server can display a plurality of pre-calculated cells extending along the standing direction of the virtual character corresponding to the navigation grid of the first space in the space with limited viewing angle to cover the navigation grid of the first space.
  • the standing direction of the virtual character can refer to the Z direction in the left-hand coordinate system.
  • the display mode of the pre-calculated cell is not unique, for example, it can be displayed as a mapped object or an unmapped wireframe.
  • the spatial shape of the pre-calculated cell is also not unique, for example, it can be a cube or a cuboid. In a specific application, the pre-calculated cell is composed of multiple grids.
  • the grid divides the space into regular grids, each grid is a pixel unit, and the corresponding attribute values are assigned to each grid to realize the representation of the entity in the space.
  • the pre-calculated cell is displayed as a cubic wireframe.
  • the pre-calculated cell can also be configured to be hidden, so that the developer can choose to display or not display the pre-calculated cell as needed.
  • the overlapping space of different perspective-restricted spaces corresponds to the first space in the perspective-restricted space that does not overlap with the full perspective space in the above text, and the reachable area of the virtual character in the space can be represented by the navigation grid.
  • Step S206 corresponding to the static grid of the second space in the full-view space, display a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the static grid.
  • the second space is the space in the full-view space that does not overlap with the view-restricted space.
  • the static mesh is used to represent the object outline of the static object in the space.
  • the object outline of the static object contained in the virtual scene can be represented by the static mesh (Static Mesh) of the static object.
  • Static Mesh static mesh
  • the static object displayed in the virtual scene is a texture display of the static mesh of the static object.
  • Static objects refer to immovable virtual objects in the virtual scene. For example, the ground, buildings, trees, etc.
  • the static mesh in the second space can relatively accurately represent the reachable area of the virtual character in the second space, such as the static objects that the virtual character can touch in the second space, the ground that can be reached, etc.
  • the server can display a plurality of pre-calculated cells extending along the standing direction of the virtual character corresponding to the static grid of the second space in the full-view space to cover the static grid of the second space.
  • a plurality of pre-calculated cells F extending along the standing direction of the virtual character are displayed corresponding to the static grid of the second space to cover the static grid of the second space.
  • the navigation grid and the static grid may or may not be displayed.
  • FIG4 shows the navigation grid D of the indoor space of the house A in FIG3
  • FIG5 does not show the static grid of the open space B
  • FIG6 does not show both the navigation grid and the static grid, and only the multiple pre-calculated cells G finally generated are displayed.
  • the overlapping space of different full-view spaces corresponds to the second space in the full-view space that does not overlap with the view-restricted space mentioned above, and the reachable area of the virtual character in the space can be represented by a static grid.
  • the server can display multiple pre-calculated cells extending along the standing direction of the virtual character corresponding to the navigation grid and the static grid in the overlapping space; it can also display multiple pre-calculated cells extending along the standing direction of the virtual character corresponding to the navigation grid or the static grid in the overlapping space.
  • the above-mentioned pre-calculated cell display method responds to the perspective space division triggered by the virtual scene where the virtual character is located.
  • Event display the divided perspective-restricted space and full perspective space in the virtual scene, corresponding to the navigation grid of the first space in the perspective-restricted space that does not overlap with the full perspective space, and the static grid of the second space in the full perspective space that does not overlap with the perspective-restricted space, generate or display multiple pre-calculated cells extending along the standing direction of the virtual character to cover the navigation grid of the first space and the static grid of the second space.
  • the static grid is used to represent the object outline of the static object in the space
  • the static grid can relatively accurately represent the reachable area of the virtual character in the full perspective space
  • the navigation grid is used to represent the reachable area of the virtual character in the perspective-restricted space.
  • the above method can improve the coverage of the reachable area of the virtual character in the virtual scene by the pre-calculated cells, thereby improving the matching degree between the pre-calculated cells and the virtual scene.
  • step S202 includes: displaying at least two sets of perspective space parameters in response to a perspective space parameter input event; and displaying at least two perspective spaces in a virtual scene according to the at least two sets of perspective space parameters.
  • the perspective space parameter may include a position parameter and a type parameter.
  • the position parameter is used to characterize the spatial position of the perspective space in the virtual scene;
  • the type parameter is used to characterize the spatial type of the perspective space.
  • the space type includes a perspective-restricted type and a full-perspective type. That is, at least two perspective spaces displayed in the virtual scene include a perspective-restricted space and a full-perspective space.
  • a group of perspective space parameters is used to characterize the spatial position and spatial type of a perspective space, that is, the server displays a perspective space matching the group of perspective space parameters in the virtual scene according to each parameter in the same group of perspective space parameters.
  • a parameter input window may be displayed on the development interface of the server, and the developer may define the parameters of the perspective space to be divided by inputting the perspective space parameters in the parameter input window;
  • a movable cursor may also be displayed on the development interface of the server, and the developer may also select the target position in the virtual scene as the spatial position of the perspective space to be divided by controlling the movable cursor;
  • the development interface of the server may also display candidate types, and the developer may select a candidate type as the spatial type of the perspective space to be divided.
  • the specific method of selecting the target position or candidate type may be single-clicking, double-clicking, or hovering, etc.
  • a developer can input at least two sets of perspective space parameters through a development interface, and the server responds to the parameter input operation of the developer, triggers and responds to the perspective space parameter input event, obtains and displays at least two sets of perspective space parameters, and then, according to each set of perspective space parameters, divides and displays the perspective space matching the set of perspective space parameters in the virtual scene.
  • the perspective space finally displayed includes the perspective-restricted space and the full perspective space.
  • a perspective space matching the input parameters is displayed in the virtual scene, and the developer can flexibly divide the perspective space according to the specific virtual scene, which is conducive to improving the matching degree between the perspective space obtained after the division and the virtual scene, and further improving the matching degree between the pre-calculated cells determined based on the perspective space and the virtual scene.
  • the perspective space parameters include position parameters, type parameters, and shape parameters of the perspective space.
  • displaying at least two perspective spaces in the virtual scene according to at least two sets of perspective space parameters includes: displaying the perspective space in the virtual scene according to the position parameters, type parameters, and shape parameters in each set of perspective space parameters.
  • the spatial position of the viewing space is the position represented by the position parameter
  • the spatial shape of the viewing space is the shape represented by the shape parameter
  • the spatial type of the viewing space is the type represented by the type parameter.
  • the spatial position for example, can be the center of gravity of the viewing space, or the center of a boundary surface in the viewing space.
  • the shape can be, for example, a cuboid, a cylinder, a prism, or an irregular shape that can constitute a closed space customized by the developer.
  • the spatial shape of the viewing space can be defined as a shape that matches the projection surface of the house on the ground, for example, if the projection surface is the center of the circle, the spatial shape of the viewing space is a cylinder, and if the projection surface is a rectangle, the spatial shape of the viewing space is a cuboid.
  • the server can determine the spatial position, spatial shape and spatial type of the viewing space that matches the set of viewing space parameters according to the position parameters, type parameters and shape parameters in each set of viewing space parameters, and divide and display the viewing space in the virtual scene.
  • the viewing angle space parameters include the position parameter, type parameter and shape parameter of the viewing angle space. Developers can determine the spatial position, spatial type and spatial shape of the perspective space where pre-calculated cells need to be generated according to the actual situation of the current virtual scene, which can further improve the matching degree between the pre-calculated cells determined based on the perspective space obtained after division and the virtual scene.
  • the pre-calculated cell display method further includes: when there is overlapping space between the limited viewing angle space and the full viewing angle space, displaying a plurality of pre-calculated cells extending along the standing direction of the virtual character corresponding to the navigation grid or static grid in the overlapping space.
  • the overlapping space of the perspective-restricted space and the full perspective space may contain both the navigation grid and the static grid.
  • the server in order to avoid repeated generation of pre-calculated cells in the overlapping space, the server can display multiple pre-calculated cells extending along the standing direction of the virtual character corresponding to one of the navigation grids and static grids in the overlapping space.
  • the server can generate and display multiple pre-calculated cells extending along the standing direction of the virtual character corresponding to the target grid of the target perspective space with a higher priority based on the respective priorities of the perspective-restricted space and the full perspective space associated with the overlapping space, so as to cover the target grid in the overlapping space; it can also generate and display multiple pre-calculated cells extending along the standing direction of the virtual character corresponding to any one of the navigation grids or static grids in the overlapping space.
  • the pre-calculated cells are displayed corresponding to the navigation grid or static grid in the overlapping space, which can avoid the repeated display of the pre-calculated cells, improve the matching degree between the pre-calculated cells and the virtual scene, and reduce the waste of memory.
  • a plurality of pre-calculated cells extending along the standing direction of the virtual character are displayed corresponding to the navigation mesh or static mesh in the overlapping space, including: in response to a priority parameter input event of the perspective space, the priority parameters of the perspective-restricted space and the full perspective space are displayed; if the priority of the perspective-restricted space is higher than that of the full perspective space, then corresponding to the navigation mesh in the overlapping space of the perspective-restricted space and the full perspective space, a plurality of pre-calculated cells of the navigation mesh extending along the standing direction of the virtual character and covering the overlapping space are displayed; if the priority of the full perspective space is higher than that of the perspective-restricted space, then corresponding to the static mesh in the overlapping space, a plurality of pre-calculated cells of the static mesh extending along the standing direction of the virtual character and covering the overlapping space are displayed.
  • the priority parameter is used to characterize the priority of the viewing space, and the priority parameter may include at least one of a spatial priority parameter and a type priority parameter.
  • the priority represented by the priority parameter may include at least one of a spatial priority represented by a spatial priority parameter and a type priority represented by a type priority parameter.
  • the spatial priority parameter can be represented by a priority identifier of the viewing space, and the priority identifier can be, for example, a number, and the smaller the value of the number, the higher the spatial priority.
  • the type priority parameter can be represented by a type parameter and the type priority of each type parameter, for example, the type priority of the viewing angle limited type is higher than the type priority of the full viewing angle type, or the type priority of the full viewing angle type is higher than the type priority of the viewing angle limited type.
  • a priority parameter input window may be displayed on the development interface of the server, and the developer may define the priority of the viewing space by inputting the priority parameter in the priority parameter input window; the server development interface may also display candidate priority parameters, and the developer may select a candidate priority parameter as the priority parameter of the viewing space.
  • the naming of the viewing space includes the priority parameter, and the developer may determine the priority parameter of the viewing space by defining the name of the viewing space.
  • the server may trigger a priority parameter input event when there is overlapping space between the viewing restricted space and the full viewing space, and display the priority parameter input window on the development interface, and the developer may input the priority parameter through the priority parameter input window. Then, the server may respond to the parameter input operation of the developer and display the input priority parameters of the viewing restricted space and the full viewing space.
  • the server responds to the priority parameter input event of the viewing space and displays the priority parameters of the viewing space with limited viewing angle and the full viewing angle. Then, for the overlapping space of the viewing space with limited viewing angle and the full viewing angle, the server displays the view along the virtual Multiple pre-calculated cells extending in the standing direction of the character.
  • the navigation mesh corresponding to the overlapping space of the perspective-restricted space and the full perspective space displays multiple pre-calculated cells of the navigation mesh extending in the standing direction of the virtual character and covering the overlapping space;
  • the static mesh corresponding to the overlapping space of the perspective-restricted space and the full perspective space displays multiple pre-calculated cells of the static mesh extending in the standing direction of the virtual character and covering the overlapping space.
  • the server may determine a higher priority viewing space associated with the overlapping space based on the spatial priority or the type priority, or may determine a higher priority viewing space associated with the overlapping space based on the spatial priority and the type priority.
  • the server may determine the comprehensive priority of the viewing space by weighted summation based on the respective weights of the spatial priority and the type priority, and then determine the viewing space associated with the overlapping space with a higher comprehensive priority; the server may also first determine a higher priority selected viewing space based on one of the spatial priority and the type priority, and if there are multiple selected viewing spaces, then determine a higher priority viewing space from each selected viewing space based on the other of the spatial priority and the type priority.
  • a perspective space with a higher priority associated with the overlapping space is determined, and then the pre-calculated cells are displayed corresponding to the target grid of the perspective space.
  • the developer can define the priority of each perspective space according to the needs of the actual scene, which is conducive to improving the accuracy of the display results of the pre-calculated cells.
  • the pre-calculated cell display method further includes: corresponding to the motion track grid of the virtual character, displaying a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the motion track grid.
  • the motion track grid is used to represent the motion track of the virtual character moving off the ground in the virtual scene. Specifically, for the cutscene scene in the virtual scene, the virtual character is allowed to move off the ground. Based on this, the server can generate a motion track grid of the virtual character according to the motion track of leaving the ground allowed in the cutscene scene, and then, corresponding to the motion track grid, display a plurality of pre-calculated cells extending along the standing direction of the virtual character to cover the motion track grid.
  • multiple pre-calculated cells extending along the standing direction of the virtual character and covering the motion trajectory grid are displayed, which can further improve the coverage of the pre-calculated cells on the reachable area of the virtual character in the virtual scene, thereby improving the matching degree between the pre-calculated cells and the virtual scene, and improving the rendering speed of subsequent virtual scenes.
  • a pre-calculated cell display method comprising the following steps:
  • Step S701 in response to a space parameter input event, displaying at least two sets of view space parameters
  • the viewing space parameters include the position parameters, type parameters and shape parameters of the viewing space
  • Step S702 displaying the viewing space in the virtual scene according to the position parameter, type parameter and shape parameter in each set of viewing space parameters;
  • the viewing space includes a viewing space with limited viewing angle and a full viewing space;
  • the spatial position of the viewing space is the position represented by the position parameter
  • the spatial type of the viewing space is the type represented by the type parameter
  • the spatial shape of the viewing space is the shape represented by the shape parameter;
  • Step S703 corresponding to the navigation mesh of the first space in the limited viewing angle space and the static mesh of the space in the full viewing angle space, displaying a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the navigation mesh and the static mesh;
  • the first space is a space in the perspective-restricted space that does not overlap with the full perspective space
  • the second space is a space in the full perspective space that does not overlap with the perspective-restricted space
  • the navigation grid is used to represent the reachable area of the virtual character in the perspective-restricted space
  • the static grid is used to represent the object outline of the static object in the space
  • Step S704 In response to the input event of the priority parameter of the viewing space, display the viewing space with limited viewing angle and the full viewing space.
  • the respective priority parameters
  • Step S705 if the priority of the limited viewing angle space is higher than the priority of the full viewing angle space, then corresponding to the navigation grid in the overlapping space of the limited viewing angle space and the full viewing angle space, a plurality of pre-calculated cells of the navigation grid extending along the standing direction of the avatar and covering the overlapping space are displayed;
  • the priority is characterized by a priority parameter
  • Step S706 if the priority of the full view space is higher than the priority of the limited view space, corresponding to the static grid in the overlapping space of the limited view space and the full view space, a plurality of pre-calculated cells of the static grid extending along the standing direction of the avatar and covering the overlapping space are displayed;
  • Step S707 corresponding to the motion track grid of the virtual character, displaying a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the motion track grid;
  • the motion trajectory grid is used to represent the motion trajectory of the virtual character moving away from the ground in the virtual scene.
  • the present application further provides a pre-calculated cell generation method, which is described by taking the method applied to the server 104 in FIG1 as an example, and includes the following steps:
  • Step S802 obtaining the perspective space parameters of the virtual scene where the virtual character is located, and determining the perspective restricted space and the full perspective space in the virtual scene.
  • the server can obtain the perspective space parameters of the virtual scene where the virtual character is located, and determine the perspective-restricted space and full perspective space in the virtual scene.
  • the specific method for the server to determine the perspective-restricted space and the full perspective space in the virtual scene is not unique.
  • the developer can determine the parameters of the perspective space and input the perspective space parameters to the server, and the server can determine the perspective-restricted space and the full perspective space in the virtual scene according to the input parameters; the developer can also draw the wireframes corresponding to the perspective-restricted space and the full perspective space in the virtual scene by dragging the mouse; the server can also determine the perspective-restricted elements and the full perspective elements contained in the virtual scene according to the reachable range attribute parameters of the scene composition elements of the virtual scene, and then determine the perspective-restricted space containing the perspective-restricted elements and the full perspective space containing the full perspective elements in the virtual scene.
  • Step S804 Determine a first space in the limited viewing angle space that does not overlap with the full viewing angle space and a second space in the full viewing angle space that does not overlap with the limited viewing angle space according to respective positions of the limited viewing angle space and the full viewing angle space in the virtual scene.
  • Step S806 corresponding to the navigation grid of the first space in the viewing angle-limited space, generating a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the navigation grid.
  • Step S808 corresponding to the static grid of the second space in the full-view space, generates a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the static grid.
  • the navigation mesh is used to represent the reachable area of the virtual character in the space with limited viewing angle;
  • the static mesh is used to represent the object outline of the static object in the space.
  • the pre-calculated cell is the smallest calculation unit of PVS calculation.
  • the standing direction of the virtual character can refer to the Z direction in the left-hand coordinate system.
  • the server can determine the first space in the limited view space that does not overlap with the full view space, and the second space in the full view space that does not overlap with the limited view space, based on the respective positions of the limited view space and the full view space in the virtual scene. Then, corresponding to the navigation grid of the first space in the limited view space, a plurality of pre-calculated cells extending along the standing direction of the virtual character are generated to cover the navigation grid of the first space; corresponding to the static grid of the second space in the full view space, a plurality of pre-calculated cells extending along the standing direction of the virtual character are generated to cover the static grid of the second space.
  • the server can display the plurality of pre-calculated cells extending along the standing direction of the virtual character corresponding to the navigation grid and the static grid in the overlapping space; or can display the plurality of pre-calculated cells extending along the standing direction of the virtual character corresponding to the navigation grid or the static grid in the overlapping space.
  • the generation algorithm of visibility cells is not unique.
  • the server can use the virtual character's standing
  • the surface mesh plane of the static mesh in the standing direction is taken as the starting plane, and is extended along the standing direction of the virtual character to generate multiple pre-calculated cells; the starting positions and quantities of the multiple pre-calculated cells used to cover the surface mesh plane can also be determined according to the position information of the surface mesh plane of the static mesh in the standing direction of the virtual character in the virtual scene, and the pre-calculated cell parameter information, and then the multiple pre-calculated cells extending along the standing direction of the virtual character are generated corresponding to the starting positions and the number.
  • the above-mentioned pre-calculated cell generation method obtains the perspective space parameters for the virtual scene where the virtual character is located, determines the perspective restricted space and the full perspective space in the virtual scene; according to the respective positions of the perspective restricted space and the full perspective space in the virtual scene, determines the first space in the perspective restricted space that does not overlap with the full perspective space, and the second space in the full perspective space that does not overlap with the perspective restricted space; corresponding to the navigation grid of the first space in the perspective restricted space and the static grid of the second space in the full perspective space, generates a plurality of pre-calculated cells extending along the standing direction of the virtual character, covering the navigation grid of the first space, and the static grid of the second space.
  • the static grid is used to represent the object contour of the static object in the space
  • the static grid can relatively accurately represent the reachable area of the virtual character in the full perspective space
  • the navigation grid is used to represent the reachable area of the virtual character in the perspective restricted space.
  • step S802 includes: obtaining the reachable range attribute parameters of the scene component elements in the virtual scene where the virtual character is located; generating the perspective space parameters based on the reachable range attribute parameters and the positions of the scene component elements in the virtual scene; based on the perspective space parameters, determining from the virtual scene the perspective restricted space containing the perspective restricted elements and the full perspective space containing the full perspective elements.
  • the reachable range attribute parameter is used to characterize the spatial reachability of the virtual character in the scene component element, and the spatial reachability includes partial spatial reachability and full spatial reachability. Developers can determine the reachable range attribute parameter of the scene component element by calibrating the reachable area in the scene component element.
  • the spatial accessibility of the perspective-restricted element is partially spatially accessible, that is, the area where the perspective-restricted element is located has restrictions on the movement trajectory of the virtual character, and the spatial accessibility is less than 100%.
  • the roof and walls of a house can be inaccessible areas for the virtual character
  • the buildings in the street can be inaccessible areas for the virtual character
  • the piers and ropes of the bridge can be inaccessible areas for the virtual character. Therefore, the house, street and bridge are all perspective-restricted elements in the virtual scene.
  • the spatial accessibility of the full-perspective element is fully spatially accessible, that is, the area where the full-perspective element is located does not restrict the movement trajectory of the virtual character, the spatial accessibility is 100%, and the virtual character can touch all static objects contained in the area where the full-perspective element is located.
  • the virtual character can touch all ground elements in an outdoor open space, including soil, grass, etc., then the outdoor open space is a full-perspective element in the virtual scene.
  • the server can obtain a scene image of the virtual scene, perform semantic analysis and image recognition on the scene image, determine the scene elements contained in the virtual scene, and then determine the spatial accessibility of each scene element according to the type of restriction on the movement trajectory of the virtual character by each scene element, and divide each scene element into a partially spatially accessible perspective-restricted element and a fully spatially accessible full-perspective element. Then, the server determines the perspective-restricted space containing the perspective-restricted element and the full-perspective space containing the full-perspective element from the virtual scene.
  • the server may also obtain scene data of the virtual scene and parse the scene data to determine the reachable range attribute parameters of the scene component elements defined in the process of constructing the virtual scene, and then determine the perspective-restricted space and the full perspective space in the virtual scene based on the reachable range attribute parameters of each scene component element.
  • the shapes of the perspective-restricted elements and full-perspective elements contained in the virtual scene are changing, but the shape of the perspective space may be unchanged.
  • the perspective space is defined as a rectangular space.
  • the server can divide the virtual scene into a perspective-restricted space that at least includes a perspective-restricted area, and a full-perspective space that at least includes a full-perspective area. That is, the range of the perspective-restricted space should be greater than or equal to the area where the perspective-restricted element is located.
  • the perspective-restricted space C includes the area where the perspective-restricted element (i.e., house A) is located.
  • the range of the full-perspective space should be greater than or equal to the full-perspective element.
  • the full-perspective space D includes the area where the full-perspective element (i.e., open space B) is located.
  • the server can realize automatic division of the view-restricted space and the full view space according to the reachable range attribute parameters of the scene constituent elements in the virtual scene, which is beneficial to improving the working efficiency of the pre-calculated cell generation process.
  • the perspective space parameter includes a type parameter and a position parameter.
  • the perspective space parameter is generated based on the reachable range attribute parameter and the position of the scene component element in the virtual scene, including: determining the type parameter of the perspective space based on the reachable range attribute parameter; determining the position parameter of the perspective space based on the position of the scene component element in the virtual scene.
  • the type parameter is used to characterize the spatial type of the viewing space; the spatial type includes a viewing angle restricted type and a full viewing angle type. That is, the viewing space includes a viewing angle restricted space and a full viewing angle space.
  • the position parameter is used to characterize the spatial position of the viewing space in the virtual scene.
  • the position parameter may include at least one of the parameters such as the spatial endpoint and the spatial boundary.
  • the server can determine the type parameter of the viewing space based on the reachable range attribute parameter. If the spatial accessibility represented by the reachable range attribute parameter is partially reachable, the spatial type of the viewing space is a viewing angle restricted type; if the spatial accessibility represented by the reachable range attribute parameter is fully reachable, the spatial type of the viewing space is a full viewing angle type.
  • the server can determine the position parameter of the activity space based on the position of the scene constituent elements in the virtual scene.
  • the server can determine the spatial boundary of the perspective space containing the scene component element based on the element boundary of the scene component element in the virtual scene.
  • the element boundary is the interface between the scene component element of a virtual scene and other elements in the virtual scene.
  • Other elements may be, for example, perspective-restricted elements, full-perspective elements, or zero-perspective elements.
  • the zero-perspective element may be a scene component element in a virtual scene such as an abyss or a jungle that is configured as a virtual character that cannot enter.
  • the element boundaries of different scene component elements may be different.
  • the regional boundary of an indoor space may be a wall
  • the regional boundary of a street may be buildings on both sides of the street
  • the regional boundary of an open grassland may be the edge of the grassland
  • the regional boundary of a frozen lake may be the edge of an ice cube, and so on.
  • the specific way in which the server determines the spatial boundary based on the element boundary is not unique.
  • the server may determine the element boundary of the perspective restricted element as at least including the spatial boundary of the perspective restricted space of the perspective restricted element, that is, the boundary of the perspective restricted space and the perspective restricted element coincides; or the server may determine the updated boundary obtained by moving the element boundary of the perspective restricted element away from the perspective restricted element as at least including the spatial boundary of the perspective restricted space of the perspective restricted element, that is, the perspective restricted element is within the perspective restricted space.
  • the type parameters of the viewing space are determined based on the reachable range attribute parameters, and the position parameters of the viewing space are determined based on the positions of the scene constituent elements in the virtual scene. This can improve the matching degree between the pre-calculated cells determined based on the viewing space obtained after division and the virtual scene.
  • the server can generate multiple pre-calculated cells extending along the standing direction of the virtual character and covering the target grid in the overlapping space, based on the respective priorities of the perspective-restricted space and the full perspective space associated with the overlapping space, corresponding to the target grid of the target perspective space with a higher priority. Based on this, for overlapping spaces, the server also needs to deduplicate the perspective-restricted space and the full perspective space associated with the overlapping space to obtain a pre-calculated visibility space with deduplication of the perspective space, so as to facilitate the subsequent generation of pre-calculated cells in the pre-calculated visibility space.
  • the pre-calculated cell generation method also includes: in the case where there is overlapping space between the perspective restricted space and the full perspective space, obtaining priority parameters of the perspective restricted space and the full perspective space respectively; based on the priorities represented by each priority parameter, determining the target perspective space with the highest priority and the non-target perspective space other than the target perspective space from the perspective restricted space and the full perspective space; deleting the space where the overlapping space is located from the non-target perspective space to obtain a pre-calculated visibility space with the perspective space deduplicated, so as to generate pre-calculated cells in the pre-calculated visibility space.
  • the pre-calculated visibility space is the spatial range represented by the pre-calculated visibility volume.
  • the priority parameter please refer to the above.
  • the following explanation is given by taking the example that the type priority of the perspective-restricted type is higher than the type priority of the full-perspective type.
  • the type priority parameters of multiple perspective-restricted spaces in the same virtual scene are the same, and the spatial priority parameters may be the same or different.
  • the type priority parameters of multiple full-perspective spaces in the same virtual scene are the same, and the spatial priority parameters may be the same or different.
  • the full-perspective The spatial priority of space D1 is level 1, and the type priority is level 2; the spatial priority of full-view space D2 is level 2, and the type priority is level 2; the spatial priority of limited-view space C1 is level 2, and the type priority is level 1.
  • the naming of the perspective space may include a priority parameter, and the developer can determine the priority parameter of the perspective space by defining the name of the perspective space.
  • the name of the perspective space may include fields such as CustomName, GenerateType, and Pri.
  • CustomName is used to carry the developer's user name
  • GenerateType is used to carry the mesh type that matches the space type, including the navigation mesh (NavMesh) of the perspective-restricted space, and the static mesh (StaticMesh) of the full perspective space
  • Pri is used to carry the space priority, which can be identified by numbers such as 0, 1, and 2.
  • the space priority of the full perspective space “Demo_StaticMesh_1” is level 1, and the type priority is level 2; the space priority of the perspective-restricted space “Demo_NavMesh_1” is level 1, and the type priority is level 1.
  • the server when there is overlapping space between the view-restricted space and the full view space, can obtain the priority parameters of the view-restricted space and the full view space in response to the priority parameter input event of the view space; or obtain the priority parameters of the view-restricted space and the full view space by reading the name of the view space.
  • the server determines the target view space with the highest priority and the non-target view space other than the target view space from the view-restricted space and the full view space based on the priorities represented by each priority parameter.
  • the space where the overlapping space is located is deleted from the non-target view space to obtain the pre-calculated visibility space with the view space deduplicated, so as to generate a pre-calculated cell in the pre-calculated visibility space.
  • the server can delete the overlapping subspaces that overlap with the overlapping space from among the multiple subspaces constituting the non-target viewing space.
  • the overlapping space H of the full viewing space “Demo_StaticMesh_0” and the viewing restricted space “Demo_NavMesh_0” since the full viewing space “Demo_StaticMesh_0” and the viewing restricted space “Demo_NavMesh_0” have the same spatial priority, and the type priority of the viewing restricted space “Demo_NavMesh_0” is higher than the type priority of the full viewing space “Demo_StaticMesh_0”, the viewing restricted space “Demo_NavMesh_0” is the target viewing space corresponding to the overlapping space H, and the overlapping subspaces that overlap with the overlapping space H in the full viewing space “Demo_StaticMesh_0” need to be deleted.
  • the target perspective space with the highest priority among the perspective spaces is determined, and the space where the overlapping space is located is deleted from the non-target perspective space to obtain the pre-calculated visibility space with deduplication of the perspective space, so as to generate pre-calculated cells in the pre-calculated visibility space, which can ensure that the pre-calculated cells will not be repeatedly generated in the overlapping space subsequently, thereby reducing the memory usage of the PVS calculation result.
  • the server can determine the target perspective space with the highest priority based on the spatial priority and type priority represented by the priority parameter.
  • the server can determine the comprehensive priority of each perspective space by weighted summation according to the weights of the spatial priority and the type priority, and then determine the target perspective space with the highest comprehensive priority; the server can also first determine the selected perspective space with the highest spatial priority or type priority according to one of the spatial priority and the type priority, and if there are multiple selected perspective spaces, then determine the target perspective space from each selected perspective space according to the other of the spatial priority and the type priority.
  • the priority parameter includes a spatial priority parameter and a type priority parameter; the priority includes a spatial priority represented by the spatial priority parameter, and a type priority represented by the type priority parameter.
  • a target viewing space with the highest priority is determined from the viewing restricted space and the full viewing space, including: determining a selected viewing space with the highest spatial priority from the viewing restricted space and the full viewing space; if the number of the selected viewing spaces is one, determining the selected viewing space as the target viewing space; if the number of the selected viewing spaces is multiple, determining the target viewing space with the highest type priority from each selected viewing space.
  • the number of the perspective-restricted space and the number of the full perspective space can be one or more, and any two perspective spaces in each perspective-restricted space and each full perspective space can be There is an overlapping space. That is, for a certain overlapping space, at least two perspective-restricted spaces may be associated at the same time, or at least two full perspective spaces may be associated at the same time.
  • the same overlapping space is associated with at least two perspective spaces, and each perspective space associated with the overlapping space includes at least one perspective-restricted space and at least one full perspective space.
  • the server may first distinguish the spatial priority, determine the selected perspective space with the highest spatial priority among the perspective-restricted space and the full perspective space, and if the number of selected perspective spaces is one, determine the selected perspective space as the target perspective space.
  • the full perspective space “Demo_StaticMesh_2”
  • the perspective-restricted space “Demo_NavMesh_2”
  • the full perspective space “Demo_StaticMesh_1” with the highest spatial priority is determined as the target perspective space.
  • the server since the spatial priorities of each perspective space may be the same, there is a situation where the number of selected perspective spaces with the highest spatial priority is greater than one. At this point, the server then distinguishes the type priority, and determines the target perspective space with the highest type priority from each selected perspective space.
  • the selected perspective space with the highest spatial priority includes the full perspective space “Demo_StaticMesh_1” and the perspective restricted space “Demo_NavMesh_1”, and the perspective restricted space "Demo_NavMesh_1" with a higher type priority among the two is determined as the target perspective space.
  • the selected view space includes multiple view-restricted spaces. Since these view spaces have the same space type, the grids corresponding to the space type contained in the overlapping space are completely consistent, so the pre-calculated cells generated corresponding to any one of these view spaces in the overlapping space are also the same. Based on this, the server can determine any one of these view spaces as the target view space.
  • determining the target perspective space from multiple dimensions such as spatial priority and type priority can improve the accuracy of the determination result of the target perspective space, and further improve the accuracy of the pre-calculated cells of the overlapping space generated based on the grid of the target perspective space.
  • deleting the space where the overlapping space is located from the non-target perspective space includes: determining an extension surface of a boundary surface of the overlapping space in the non-target perspective space based on respective positions of the overlapping space and the non-target perspective space in the virtual scene; splitting the non-target perspective space based on the extension surface to obtain a plurality of non-target subspaces corresponding to the non-target perspective space; and deleting the overlapping subspaces in each non-target subspace that overlap with the overlapping space.
  • the server can determine the extension surface of the boundary surface of the overlapping space in the non-target perspective space based on the respective positions of the overlapping space and the non-target perspective space in the virtual scene. If the determined extension surface includes the extension surface of all boundary surfaces of the overlapping space, the server can split the non-target perspective space based on the extension surface to obtain multiple non-target subspaces corresponding to the non-target perspective space, and delete the overlapping subspaces in each non-target subspace that overlap with the overlapping space.
  • the server can split the non-target perspective space based on the determined extension surface and another part of the boundary surface in each boundary surface that is not coplanar with the extension surface, obtain multiple non-target subspaces corresponding to the non-target perspective space, and delete the overlapping subspaces in each non-target subspace that overlap with the overlapping space.
  • the non-target viewing space is split and then deduplication is performed.
  • the algorithm is simple and is conducive to improving the efficiency of pre-calculated cell generation.
  • the overlapping space is a rectangular space.
  • the non-target perspective space is split based on the extension surface to obtain multiple non-target subspaces corresponding to the non-target perspective space, including: splitting the non-target perspective space based on the first extension surface of the overlapping space in the non-target perspective space to obtain a first overlapping subspace that overlaps with the overlapping space and a first independent subspace that does not overlap with the overlapping space; splitting the first overlapping subspace based on the second extension surface of the overlapping space in the first overlapping subspace to obtain a second overlapping subspace that overlaps with the overlapping space, and a second independent subspace that does not overlap with the overlapping space; split the second overlapping subspace based on the third boundary surface of the overlapping space perpendicular to the third coordinate axis to obtain an overlapping subspace that overlaps with the overlapping space and a third independent subspace that does not overlap with the overlapping space; determine the first independent subspace, the second independent subspace, the
  • the first extension surface is an extension surface of the first boundary surface of the overlapping space perpendicular to the first coordinate axis; the second extension surface is an extension surface of the second boundary surface of the overlapping space perpendicular to the second coordinate axis in the first overlapping subspace.
  • the first coordinate axis, the second coordinate axis and the third coordinate axis together constitute a spatial coordinate system in the virtual scene.
  • the server can split the non-target perspective space based on the first extension surface of the overlapping space in the non-target perspective space to obtain a first overlapping subspace that overlaps with the overlapping space and a first independent subspace that does not overlap with the overlapping space.
  • the server can split the non-target perspective space based on the first extension surface of the overlapping space in the non-target perspective space to obtain a first overlapping subspace that overlaps with the overlapping space and a first independent subspace that does not overlap with the overlapping space. It can be understood that if there is a set of coplanar boundary surfaces in the boundary surfaces of the overlapping space and the non-target perspective space perpendicular to the first coordinate axis, that is, the overlapping space is located at the edge of the non-target perspective space perpendicular to the first coordinate axis, then the number of first extension surfaces is one, and the number of first independent subspaces is also one. If the overlapping space is located inside the non-target perspective space, the number of first extension surfaces is two, and the
  • the server splits the first overlapping subspace based on the second extension surface of the overlapping space in the first overlapping subspace, and obtains a second overlapping subspace that overlaps with the overlapping space and a second independent subspace that does not overlap with the overlapping space.
  • the server splits the first overlapping subspace based on the second extension surface of the overlapping space in the first overlapping subspace, and obtains a second overlapping subspace that overlaps with the overlapping space and a second independent subspace that does not overlap with the overlapping space.
  • the server splits the first overlapping subspace based on the second extension surface of the overlapping space in the first overlapping subspace, and obtains a second overlapping subspace that overlaps with the overlapping space and a second independent subspace that does not overlap with the overlapping space.
  • the server splits the second overlapping subspace based on the third boundary surface of the overlapping space perpendicular to the third coordinate axis to obtain an overlapping subspace that overlaps with the overlapping space and a third independent subspace that does not overlap with the overlapping space. Finally, the server determines the first independent subspace, the second independent subspace, the overlapping subspace, and the third independent subspace as multiple non-target subspaces corresponding to the non-target perspective space.
  • the overlapping space is located inside the non-target viewing space, and the first coordinate axis direction is the Z axis direction, the second coordinate axis direction is the Y axis direction, and the third coordinate axis direction is the X axis direction.
  • the overlapping space I is located inside the non-target viewing space J.
  • the server can split the non-target viewing space J into independent subspaces K1 and K2 that do not overlap with the overlapping space I, and an overlapping subspace K3 that overlaps with the overlapping space I based on the respective extension surfaces J1 and J2 of the boundary surfaces I1 and I2 perpendicular to the Z direction in the overlapping space I in the non-target viewing space J.
  • the server splits the overlapping subspace K3 into independent subspaces K31 and K32 that do not overlap with the overlapping space I, and an overlapping subspace K33 that overlaps with the overlapping space I based on the respective extension surfaces J3 and J4 of the boundary surfaces I3 and I4 perpendicular to the Y direction in the overlapping space I in the overlapping subspace K3.
  • the server splits the overlapping subspace K33 based on the two boundary surfaces of the overlapping space I perpendicular to the X direction, and obtains the overlapping subspace K333 that overlaps with the overlapping space I, and the independent subspaces K331 and K332 that do not overlap with the overlapping space.
  • the projection of the overlapping subspace K33 on the XY plane includes five areas, corresponding to five subspaces respectively. That is, after the splitting, the non-target perspective space J is divided into seven non-target subspaces, including six independent subspaces and one overlapping subspace, which will be deleted.
  • the space is split in sequence based on the extended surfaces in various directions, which can ensure that the number of independent subspaces remaining after the split is relatively small, which is convenient for the subsequent generation of pre-calculated cells.
  • the process of generating pre-calculated cells includes: determining a grid plane of a target grid in a virtual scene based on a standing direction of a virtual character in the virtual scene; determining cell position parameters of a plurality of pre-calculated cells for covering the target grid according to position information of the grid plane in the virtual scene and pre-calculated cell parameters; and generating a plurality of pre-calculated cells extending along the standing direction and covering the target grid based on the cell position parameters.
  • the target grid includes a navigation grid of the first space in the limited viewing angle space, and a static grid of the second space in the full viewing angle space. Adjacent pre-calculated cells do not overlap each other.
  • the cell position parameters may include the starting position of the cell and the number of pre-calculated cells in each direction.
  • the cell position parameters may also be the position information of each pre-calculated cell in the virtual scene.
  • the starting position refers to the placement position of the first pre-calculated cell, and the number includes the number in three orthogonal directions in the spatial coordinate system. It can be understood that determining the starting position and number of pre-calculated cells is equivalent to determining the array arrangement of multiple pre-calculated cells that need to be generated in the virtual scene.
  • the server can determine the grid plane of the target grid in the virtual scene in the standing direction based on the standing direction of the virtual character in the virtual scene. It can be understood that these grid planes are the surface grid planes of the target grid, that is, grids used to characterize the planes that the virtual character can reach and contact, such as ground grid planes, lake grid planes, or climbable wall grid planes, etc. Then, the server determines the cell position parameters of multiple pre-calculated cells used to cover the target grid based on the position information of the grid plane in the virtual scene and the pre-calculated cell parameters. Finally, based on the cell position parameters, the server generates multiple pre-calculated cells that extend along the standing direction and cover the target grid in accordance with the principle that adjacent pre-calculated cells do not overlap.
  • these grid planes are the surface grid planes of the target grid, that is, grids used to characterize the planes that the virtual character can reach and contact, such as ground grid planes, lake grid planes, or climbable wall grid planes,
  • the server can determine the pre-calculated cells used to cover each grid plane according to the respective position information of each grid plane of the target grid in the virtual scene and the pre-calculated cell parameters, and then obtain multiple pre-calculated cells covering the target grid.
  • the multiple pre-calculated cells covering the target grid are the multiple pre-calculated cells covering all grid planes of the target grid.
  • the grid plane of the target grid is first determined, and then based on the position information of the grid plane and the pre-calculated cell parameters, the cell position parameters of multiple pre-calculated cells used to cover the target grid are determined, and multiple pre-calculated cells covering the target grid that do not overlap are reproduced, which can avoid repeated calculation of PVS data and is conducive to improving data processing efficiency.
  • the pre-calculated cell parameters include the grid composition of the pre-calculated cell and the respective grid positions of each grid used to constitute the pre-calculated cell in the virtual scene.
  • the starting position and number of multiple pre-calculated cells used to cover the target grid are determined, including: based on the position information of the grid plane in the virtual scene, determining the plane projection area of the grid plane in any coordinate plane of the virtual scene, and the height interval of the grid plane perpendicular to the coordinate plane; according to the respective grid positions of each grid in the virtual scene, determining the target grid in each grid that matches the plane projection area and the height interval; according to the position of each target grid in the virtual scene and the grid composition of the pre-calculated cell, determining the starting position and number of multiple pre-calculated cells used to cover the target grid.
  • the grid composition of the pre-calculated cell includes the number and stacking method of the grids in all directions of the pre-calculated cell.
  • the pre-calculated cell G1 may include 8 grids neatly stacked in a 2*2*2 manner, namely g1-g8 (only g1 and g2 are shown in Figure 10).
  • the three-dimensional virtual space where the virtual scene is located can be characterized as a space composed of multiple grids, and the three edges of the same vertex in the grid are respectively parallel to the three coordinate axis directions of the three-dimensional virtual space. That is, the grids used to constitute the pre-calculated cells correspond to unique grid positions in the virtual scene.
  • Each pre-calculated cell includes at least one of the target grids.
  • the server can determine the plane projection area of the grid plane on any coordinate plane of the virtual scene, and the height interval of the grid plane perpendicular to the coordinate plane in the virtual scene based on the position information of the grid plane in the virtual scene.
  • the height interval can be described by a height map.
  • the height map is a diagram used to describe the height interval occupied by the grid surface in the virtual scene, and the height map can be expressed in a discretized manner through a grid.
  • the server determines the target grid in each grid that matches the plane projection area and the height interval based on the grid positions of each grid in the virtual scene. That is, the target grid matches the plane projection area of the grid plane on the coordinate plane, and the target grid matches the grid plane in the height interval perpendicular to the coordinate plane.
  • the target grid can be a grid that intersects and is adjacent to the grid plane, or a grid whose distance to the grid plane is less than the height interval of the grid plane perpendicular to the coordinate plane.
  • the server can determine the target grid to be used based on the position of each target grid in the virtual scene and the grid composition of the pre-calculated cells. The starting positions and numbers of the plurality of pre-calculated cells covering the target grid are determined. Each pre-calculated cell determined includes at least one of the target grids.
  • the target grid is determined based on the plane projection area of the grid plane on any coordinate plane and the height interval perpendicular to the coordinate plane, and then a plurality of pre-calculated cells including at least one target grid for covering the target grid where the grid plane is located are determined, thereby ensuring the coverage of the target grid by the pre-calculated cells.
  • a target grid in each grid that matches the plane projection area and the height range is determined according to the respective grid positions of each grid in the virtual scene, including: determining the respective grid projection area of each grid on the coordinate plane according to the respective grid positions of each grid in the virtual scene; determining, from each grid projection area, a selected grid projection area whose overlapping area with the plane projection area satisfies the area condition; and determining the selected grid in the virtual scene that is within the height range as the target grid.
  • the projection area of the selected grid on the coordinate plane is the selected grid projection area.
  • the overlapping area satisfies the area condition, which may mean that the overlapping area is greater than the set area, or the overlapping area is greater than or equal to the set area, or the ratio of the overlapping area to the grid projection area is greater than the set ratio, or greater than or equal to the set ratio.
  • the area condition can be determined by the developer according to the needs of the actual scene.
  • the server can determine the grid projection area of each grid on the coordinate plane according to the grid positions of each grid in the virtual scene. Then, the server superimposes and displays the grid projection area and the plane projection area of the grid plane, and can determine the overlapping area of the grid projection area and the plane projection area of each grid, and then determine the selected grid projection area whose overlapping area with the plane projection area meets the area condition from each grid projection area. Finally, the server determines the selected grid in the height range in the virtual scene as the target grid.
  • the grid plane can be projected onto the XY plane to determine the selected grid projection area of the grid plane on the XY plane, such as the grid projection area of the shaded part in FIG13, and then, according to the height range of the grid plane in the Z direction, the target grid is determined from each selected grid corresponding to the selected projection area.
  • the selected grid projection area is determined according to the overlapping area of the grid projection area and the plane projection area in the same coordinate plane, and then the target grid is determined from the selected grids whose projection area is the selected grid projection area.
  • the algorithm is simple and is conducive to improving efficiency.
  • the pre-calculated cell parameters include the grid composition of the pre-calculated cell and the grid positions of each grid used to constitute the pre-calculated cell in the virtual scene; the cell position parameters include the cell position information of each pre-calculated cell in the virtual scene.
  • the cell position parameters of multiple pre-calculated cells for covering the target grid are determined, including: based on the position information of the grid plane in the virtual scene, determining the plane projection area of each grid plane in any two coordinate planes of the virtual scene; for each plane projection area, according to the grid positions of each grid in the virtual scene, respectively determining the grid projection area of each grid on the coordinate plane where the plane projection area is located; from each grid projection area, determining the target grid projection area associated with the plane projection area and the grid position information of the target grid jointly represented by each target grid projection area; according to each grid position information and the grid composition of the pre-calculated cell, determining the cell position information of each pre-calculated cell in the virtual scene among the multiple pre-calculated cells for covering the target grid.
  • Each pre-calculated cell includes at least one of the target grids.
  • the grid projection area of the target grid in the coordinate plane intersects, is adjacent to, or is within the plane projection area of the grid plane in the coordinate plane.
  • the grid projection area of the target grid in the coordinate plane and the overlapping area of the plane projection area of the grid plane in the coordinate plane meet the area condition. For the specific definition of the area condition, see above.
  • the server can determine the plane projection area of the grid plane on any two coordinate planes of the virtual scene based on the position information of the grid plane in the virtual scene. Then, for each plane projection area, the server determines the grid projection area of each grid on the coordinate plane where the plane projection area is located according to the grid positions of each grid in the virtual scene. Next, the server determines the grid projection area associated with the plane projection area from each grid projection area. Target grid projection area. The server can determine the grid position information of the target grid represented by the target grid projection areas of each coordinate plane according to the respective target grid projection areas in the two coordinate planes.
  • the target grid projection area in the plane can be determined according to the grid plane and the projection of each grid on the XY plane.
  • the target grid projection area can represent the position information of the target grid in the X-axis direction and the Y-axis direction.
  • the target grid projection area on the XZ plane can represent the position information of the target grid in the X-axis direction and the Z-axis direction.
  • the server can determine the cell position information of each pre-calculated cell in the virtual scene among the multiple pre-calculated cells used to cover the target grid according to the grid position information of each target grid in the virtual scene and the grid composition of the pre-calculated cell.
  • the cell position information is used to represent the position of the pre-calculated cell in the X, Y and Z axis directions.
  • the cell position information of each pre-calculated cell in the virtual scene is determined according to the projection areas of the grid plane and each grid in any two coordinate planes respectively.
  • a unique pre-calculated cell covering the position can be determined. While ensuring that the pre-calculated cells cover the grid plane, the generation of redundant pre-calculated cells can be avoided, which is beneficial to reducing memory usage and improving efficiency.
  • a method for generating a pre-calculated cell comprising the following steps:
  • Step S1401 obtaining the reachable range attribute parameters of the scene component elements in the virtual scene where the virtual character is located;
  • the reachable range attribute parameter is used to characterize the spatial reachability of the virtual character in the scene component elements, and the spatial reachability includes partial spatial reachability and full spatial reachability;
  • Step S1402 determining the type parameter of the viewing space based on the reachable range attribute parameter; determining the position parameter of the viewing space based on the position of the scene component elements in the virtual scene;
  • the type parameter is used to characterize the spatial type of the viewing space;
  • the spatial type includes the viewing limited type and the full viewing type;
  • the position parameter is used to characterize the spatial position of the viewing space in the virtual scene;
  • Step S1403 based on the position parameter and the type parameter, determining from the virtual scene a perspective-restricted space including perspective-restricted elements and a full-perspective space including full-perspective elements;
  • the spatial accessibility of the element with limited viewing angle is partial spatial accessibility
  • the spatial accessibility of the element with full viewing angle is full spatial accessibility
  • Step S1404 judging whether there is any overlapping space between the view-limited space and the full view-space according to their respective positions in the virtual scene;
  • Step S1405 when there is no overlapping space between the view-limited space and the full view space, corresponding to the navigation mesh of the view-limited space and the static mesh of the full view space, generating a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the navigation mesh and the static mesh;
  • the navigation mesh is used to represent the reachable area of the virtual character in the space with limited viewing angle;
  • the static mesh is used to represent the object outline of the static object in the space;
  • Step S1406 when there is an overlapping space between the viewing angle limited space and the full viewing angle space, obtaining priority parameters of the viewing angle limited space and the full viewing angle space respectively;
  • the priority parameter includes a space priority parameter and a type priority parameter; the priority includes a space priority represented by the space priority parameter and a type priority represented by the type priority parameter;
  • Step S1407 determining a selected viewing angle space with the highest spatial priority among the viewing angle-restricted space and the full viewing angle space;
  • Step S1408 if the number of the selected viewing angle spaces is one, then the selected viewing angle space is determined as the target viewing angle space; if the number of the selected viewing angle spaces is multiple, then the target viewing angle space with the highest type priority is determined from among the selected viewing angle spaces;
  • Step S1409 based on the respective positions of the overlapping space and the non-target viewing space in the virtual scene, determine the overlapping space.
  • Step S1410 splitting the target viewing angle space based on the extended surface to obtain a plurality of non-target subspaces corresponding to the non-target viewing angle space;
  • Step S1411 deleting the overlapping subspaces in each non-target subspace that overlap with the overlapping space, to obtain the updated view-limited space and the updated full view space after deduplication;
  • Step S1412 corresponding to updating the navigation mesh of the limited viewing angle space and updating the static mesh of the full viewing angle space, generates a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the navigation mesh and the static mesh.
  • pre-calculated cells of PVS are generated based on a static grid within the scope of a pre-calculated visibility volume, pre-calculated cells will also be generated in the unreachable area of the virtual character of the perspective-restricted element, resulting in a waste of memory and package.
  • the decoration L1 on the periphery of the truncated cone is an unreachable area, and the generated pre-calculated cell M1 is a useless cell.
  • the decorative objects on the walls of the scene also generate unnecessary cells.
  • pre-calculated cells of PVS are generated based on a navigation grid within the scope of a pre-calculated visibility volume, although the number of pre-calculated cells generated can be controlled, for open world scenes, the pre-calculated cells will not be fully covered.
  • a hybrid strategy is adopted to generate pre-calculated cells.
  • pre-calculated cells are generated based on the navigation grid. For example, in the right picture of Figure 15, only the truncated cone is covered with pre-calculated cells, which avoids the generation of invalid cells in the unreachable areas of the virtual character such as the decoration L1 outside the truncated cone.
  • the pre-calculated cells are generated according to the static grid of the terrain.
  • the solution of the present application can ensure the coverage of the character's reachable area in the virtual scene by pre-calculated cells, and effectively avoid the generation of invalid cells.
  • the solution of the present application is applied to the application scenario of the open world. Since the development of the large world has more complex art scenes, it provides players with a wide range of exploration space, which is the trend of game development. As an important technology in the development of large world applications, the key of PVS is to reduce the generation of invalid cells in the virtual scene and increase the distribution of valid cells. The solution of the present application can achieve this goal. Furthermore, in some gameplays with relatively high degrees of freedom, there are some larger areas that do not restrict the movement trajectory of the virtual character, that is, there are non-restricted scenes.
  • NavMesh cannot cover all the character's reachable areas.
  • Cells can be generated according to the StaticMesh in the scene to cover all objects, terrains, etc. that the virtual character may contact in the game.
  • the solution of the present application is applied to restricted scenes such as indoors and streets, and the range of virtual characters walking in these places is completely predictable. Specifically, in a multi-story indoor scene, characters will move freely on each floor, but generally will not climb indoor walls or windows, so invalid grids will be generated in the wall or window area, which will also produce invalid calculations during PVS baking. Therefore, in this scenario, divide the view-restricted space that includes the indoor area and set the priority of the view-restricted space to the highest.
  • the embodiment of the present application also provides a pre-calculated cell display device for implementing the pre-calculated cell display method involved above.
  • the implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more pre-calculated cell display device embodiments provided below can refer to the limitations of the pre-calculated cell display method above.
  • a pre-calculated cell display device 1700 comprising: Angle space display module 1702 and pre-calculated cell display module 1704, wherein:
  • a viewing space display module 1702 is used to display the divided viewing space and the full viewing space in the virtual scene in response to a viewing space division event triggered for the virtual scene where the virtual character is located;
  • the pre-calculated cell display module 1704 is used to display a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the navigation grid corresponding to the navigation grid of the first space in the view-limited space, and to display a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the static grid corresponding to the static grid of the second space in the full view space.
  • the first space is the space in the view-limited space that does not overlap with the full view space
  • the second space is the space in the full view space that does not overlap with the view-limited space
  • the navigation grid is used to represent the reachable area of the virtual character in the view-limited space
  • the static grid is used to represent the object outline of the static object in the space.
  • the perspective space display module 1702 includes: a perspective space parameter display unit, used to display at least two sets of perspective space parameters in response to a space parameter input event; a perspective space display unit, used to display at least two perspective spaces in a virtual scene according to at least two sets of perspective space parameters; a set of perspective space parameters is used to characterize the spatial position and spatial type of a perspective space; the space type includes a perspective-limited type and a full-perspective type.
  • the perspective space parameters include the position parameters, type parameters and shape parameters of the perspective space.
  • the perspective space display unit is specifically used to: display the perspective space in the virtual scene according to the position parameters, type parameters and shape parameters in each group of perspective space parameters; the spatial position of the perspective space is the position represented by the position parameter, the spatial type of the perspective space is the type represented by the type parameter, and the spatial shape of the perspective space is the shape represented by the shape parameter.
  • the perspective space display module 1702 is also used to: when there is overlapping space between the perspective restricted space and the full perspective space, display multiple pre-calculated cells extending along the standing direction of the virtual character corresponding to the navigation grid or static grid in the overlapping space.
  • the viewing space display module 1702 is specifically used to: in response to the viewing space priority parameter input event, display the priority parameters of the viewing space and the full viewing space; if the priority of the viewing space is higher than the priority of the full viewing space, then corresponding to the navigation grid in the overlapping space of the viewing space and the full viewing space, display multiple pre-calculated cells of the navigation grid extending along the standing direction of the virtual character and covering the overlapping space; if the priority of the full viewing space is higher than the priority of the viewing space, then corresponding to the static grid in the overlapping space, display multiple pre-calculated cells of the static grid extending along the standing direction of the virtual character and covering the overlapping space.
  • the priority is represented by the priority parameter.
  • the perspective space display module 1702 is also used to: correspond to the motion trajectory grid of the virtual character, display multiple pre-calculated cells extending along the standing direction of the virtual character and covering the motion trajectory grid; the motion trajectory grid is used to represent the motion trajectory of the virtual character moving away from the ground in the virtual scene.
  • the embodiment of the present application also provides a pre-calculated cell generation device for implementing the pre-calculated cell generation method involved above.
  • the implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more pre-calculated cell generation device embodiments provided below can refer to the limitations of the pre-calculated cell generation method above.
  • a pre-calculated cell generation device 1800 comprising: a viewing space determination module 1802, a non-overlapping space determination module 1804, and a pre-calculated cell generation module 1806, wherein:
  • a viewing angle space determination module 1802 is used to obtain viewing angle space parameters for the virtual scene where the virtual character is located, and determine the viewing angle restricted space and the full viewing angle space in the virtual scene;
  • the non-overlapping space determining module 1804 is used to determine a first space in the perspective-limited space that does not overlap with the full perspective space, and a second space in the full perspective space that does not overlap with the perspective-limited space, according to respective positions of the perspective-limited space and the full perspective space in the virtual scene;
  • the pre-calculated cell generation module 1806 is used to generate a plurality of pre-calculated cells corresponding to the navigation grid of the first space in the limited viewing angle space, extending along the standing direction of the virtual character and covering the navigation grid, and to generate a plurality of pre-calculated cells corresponding to the static grid of the second space in the full viewing angle space, extending along the standing direction of the virtual character and covering the static grid. Pre-computed cells.
  • the navigation mesh is used to represent the reachable area of the virtual character in the space with limited viewing angle; the static mesh is used to represent the object outline of the static object in the space.
  • the perspective space determination module 1802 includes: a reachable range attribute parameter acquisition unit, which is used to acquire the reachable range attribute parameters of the scene component elements in the virtual scene where the virtual character is located; the reachable range attribute parameters are used to characterize the spatial reachability of the virtual character in the scene component elements, and the spatial reachability includes partial spatial reachability and full spatial reachability; a perspective space parameter generation unit, which is used to generate perspective space parameters based on the reachable range attribute parameters and the positions of the scene component elements in the virtual scene; a perspective space determination unit, which is used to determine, from the virtual scene based on the perspective space parameters, a perspective restricted space containing perspective restricted elements and a full perspective space containing full perspective elements; the spatial reachability of the perspective restricted elements is partial spatial reachability; the spatial reachability of the full perspective elements is full spatial reachability.
  • a reachable range attribute parameter acquisition unit which is used to acquire the reachable range attribute parameters of the scene component elements in the virtual scene where the virtual character is located
  • the reachable range attribute parameters are used to characterize the spatial
  • the perspective space parameter includes a type parameter and a position parameter.
  • the perspective space parameter generation unit is specifically used to: determine the type parameter of the perspective space based on the reachable range attribute parameter; the type parameter is used to characterize the space type of the perspective space; the space type includes a perspective-limited type and a full perspective type; determine the position parameter of the perspective space based on the position of the scene component elements in the virtual scene; the position parameter is used to characterize the spatial position of the perspective space in the virtual scene.
  • the pre-calculated cell generation device 1800 also includes: a priority parameter acquisition unit, which is used to obtain the priority parameters of the perspective restricted space and the full perspective space respectively when there is overlapping space between the perspective restricted space and the full perspective space; a target perspective space determination unit, which is used to determine the target perspective space with the highest priority and the non-target perspective space other than the target perspective space from the perspective restricted space and the full perspective space based on the priorities represented by each priority parameter; a deduplication unit, which is used to delete the space where the overlapping space is located from the non-target perspective space to obtain a pre-calculated visibility space with deduplication of the perspective space, so as to generate multiple pre-calculated cells in the pre-calculated visibility space.
  • a priority parameter acquisition unit which is used to obtain the priority parameters of the perspective restricted space and the full perspective space respectively when there is overlapping space between the perspective restricted space and the full perspective space
  • a target perspective space determination unit which is used to determine the target perspective space with the highest priority and the non-target perspective space other than
  • the priority parameter includes a spatial priority parameter and a type priority parameter; the priority includes a spatial priority represented by the spatial priority parameter and a type priority represented by the type priority parameter.
  • the target viewing space determination unit is specifically used to: determine a selected viewing space with the highest spatial priority in the viewing restricted space and the full viewing space; if the number of the selected viewing spaces is one, determine the selected viewing space as the target viewing space; if the number of the selected viewing spaces is multiple, determine the target viewing space with the highest type priority from each selected viewing space.
  • the deduplication unit includes: an extension surface determination subunit, which is used to determine the extension surface of the boundary surface of the overlapping space in the non-target perspective space based on the respective positions of the overlapping space and the non-target perspective space in the virtual scene; a splitting subunit, which is used to split the non-target perspective space based on the extension surface to obtain multiple non-target subspaces corresponding to the non-target perspective space; and a deduplication subunit, which is used to delete the overlapping subspaces in each non-target subspace that overlap with the overlapping space.
  • the overlapping space is a rectangular space
  • the splitting sub-unit is specifically used to: split the non-target perspective space based on the first extension surface of the overlapping space in the non-target perspective space to obtain a first overlapping subspace that overlaps with the overlapping space and a first independent subspace that does not overlap with the overlapping space
  • the first extension surface is an extension surface of the first boundary surface of the overlapping space perpendicular to the first coordinate axis
  • split the first overlapping subspace based on the second extension surface of the overlapping space in the first overlapping subspace to obtain a second overlapping subspace that overlaps with the overlapping space and a second independent subspace that does not overlap with the overlapping space
  • the second extension surface is an extension surface of the second boundary surface of the overlapping space perpendicular to the second coordinate axis
  • split the second overlapping subspace based on the third boundary surface of the overlapping space perpendicular to the third coordinate axis to obtain an overlapping subspace that overlaps with the overlapping space and a
  • the pre-calculated cell generation module 1806 includes: a grid plane determination unit, which is used to determine the grid plane of the target grid in the virtual scene based on the standing direction of the virtual character in the virtual scene; the target grid includes a navigation grid of a first space in the view-limited space and a static grid of a second space in the full view space; a cell position parameter determination unit, which is used to determine the position information of the grid plane in the virtual scene and the pre-calculated cell parameters, Determine the cell position parameters of multiple pre-calculated cells for covering the target grid; a pre-calculated cell generation unit is used for each cell position parameter to generate multiple pre-calculated cells extending along the standing direction and covering the target grid; adjacent pre-calculated cells do not overlap each other.
  • a grid plane determination unit which is used to determine the grid plane of the target grid in the virtual scene based on the standing direction of the virtual character in the virtual scene
  • the target grid includes a navigation grid of a first space in the view-limited space and a static grid
  • the pre-calculated cell parameters include the grid composition of the pre-calculated cell and the grid positions of each grid used to constitute the pre-calculated cell in the virtual scene; the cell position parameters include the starting position and quantity.
  • the cell position parameter determination unit includes: a height interval determination subunit, which is used to determine the plane projection area of the grid plane in any coordinate plane of the virtual scene and the height interval of the grid plane perpendicular to the coordinate plane based on the position information of the grid plane in the virtual scene; a target grid determination subunit, which is used to determine the target grid in each grid that matches the plane projection area and the height interval according to the grid positions of each grid in the virtual scene; a starting position and quantity determination subunit, which is used to determine the starting position and quantity of multiple pre-calculated cells used to cover the target grid according to the position of each target grid in the virtual scene and the grid composition of the pre-calculated cell; each pre-calculated cell includes at least one of each target grid.
  • the target grid determination subunit is specifically used to: determine the grid projection area of each grid on the coordinate plane according to the grid position of each grid in the virtual scene; determine, from each grid projection area, a selected grid projection area whose overlapping area with the plane projection area satisfies the area condition; determine the selected grid located within the height range in the virtual scene as the target grid; and the projection area of the selected grid on the coordinate plane is the selected grid projection area.
  • the pre-calculated cell parameters include the grid composition of the pre-calculated cell and the grid positions of each grid used to constitute the pre-calculated cell in the virtual scene; the cell position parameters include the cell position information of each pre-calculated cell in the virtual scene.
  • the cell position parameter determination unit is specifically used to: determine the plane projection area of the grid plane on any two coordinate planes of the virtual scene based on the position information of the grid plane in the virtual scene; for each plane projection area, determine the grid projection area of each grid on the coordinate plane where the plane projection area is located according to the grid positions of each grid in the virtual scene; from each grid projection area, determine the target grid projection area associated with the plane projection area and the grid position information of the target grid represented by each target grid projection area; according to each grid position information and the grid composition of the pre-calculated cell, determine the cell position information of each pre-calculated cell in the virtual scene among the multiple pre-calculated cells used to cover the target grid; each pre-calculated cell includes at least one of each target grid.
  • Each module in the above-mentioned pre-calculated cell display device and pre-calculated cell generation device can be implemented in whole or in part by software, hardware and a combination thereof.
  • Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
  • a computer device which may be a server, and its internal structure diagram may be shown in FIG19.
  • the computer device includes one or more processors, a memory, an input/output interface (Input/Output, referred to as I/O) and a communication interface.
  • the processor, the memory and the input/output interface are connected via a system bus, and the communication interface is connected to the system bus via the input/output interface.
  • the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, a computer-readable instruction and a database.
  • the internal memory provides an environment for the operation of the operating system and the computer-readable instructions in the non-volatile storage medium.
  • the database of the computer device is used to store data involved in the above method.
  • the input/output interface of the computer device is used to exchange information between the processor and an external device.
  • the communication interface of the computer device is used to communicate with an external terminal via a network connection.
  • a computer device which may be a terminal, and its internal structure diagram may be shown in FIG20.
  • the computer device includes one or more processors, memory, input/output interface, communication interface, display unit and input device.
  • the processor, memory and input/output interface are connected via a system bus, and the communication interface, display unit and input device are connected to the system bus via the input/output interface.
  • the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium, a memory
  • the non-volatile storage medium stores an operating system and computer-readable instructions.
  • the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium.
  • the input/output interface of the computer device is used to exchange information between the processor and the external device.
  • the communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies.
  • WIFI wireless fidelity
  • NFC near field communication
  • the display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device, the display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
  • FIGS. 19 and 20 are merely block diagrams of partial structures related to the scheme of the present application, and do not constitute a limitation on the computer device to which the scheme of the present application is applied.
  • the specific computer device may include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
  • a computer device including a memory and one or more processors, wherein the memory stores computer-readable instructions, and the one or more processors implement the steps in the above-mentioned method embodiments when executing the computer-readable instructions.
  • a computer-readable storage medium on which computer-readable instructions are stored.
  • the steps in the above-mentioned method embodiments are implemented.
  • a computer program product comprising computer-readable instructions, which implement the steps in the above-mentioned method embodiments when executed by one or more processors.
  • user information including but not limited to user device information, user personal information, etc.
  • data including but not limited to data used for analysis, stored data, displayed data, etc.
  • any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory.
  • Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc.
  • Volatile memory can include random access memory (RAM) or external cache memory, etc.
  • RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • the database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database.
  • Non-relational databases may include distributed databases based on blockchain, etc., but are not limited to this.
  • the processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, etc., but are not limited to this.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • Geometry (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Human Computer Interaction (AREA)
  • General Engineering & Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The present application relates to a method and apparatus for displaying a precomputed cell, a method and apparatus for generating a precomputed cell, and a computer device, a computer-readable storage medium and a computer program product. The method for displaying a computed cell comprises: in response to a viewing-angle space division event, which is triggered for a virtual scene where a virtual character is located, displaying, in the virtual scene, a viewing-angle-limited space and a full-viewing-angle space which are obtained by means of division (S202); in correspondence with a navigation mesh of a first space in the viewing-angle-limited space, displaying a plurality of precomputed cells, which extend in a standing direction of the virtual character and cover the navigation mesh (S204); and in correspondence with a static mesh of a second space in the full-viewing-angle space, displaying a plurality of precomputed cells, which extend in the standing direction of the virtual character and cover the static mesh of the second space (S206).

Description

预计算单元格显示方法、预计算单元格生成方法及装置Pre-calculated cell display method, pre-calculated cell generation method and device
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求于2022年12月23日提交中国专利局,申请号为202211662938.0,申请名称为“预计算单元格显示方法、预计算单元格生成方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the China Patent Office on December 23, 2022, with application number 202211662938.0, and application name “Pre-calculated cell display method, pre-calculated cell generation method and device”, all contents of which are incorporated by reference in this application.
技术领域Technical Field
本申请涉及计算机技术领域,特别是涉及一种预计算单元格显示方法、预计算单元格显示方法、装置、计算机设备、计算机可读存储介质和计算机程序产品。The present application relates to the field of computer technology, and in particular to a pre-calculated cell display method, a pre-calculated cell display method, an apparatus, a computer device, a computer-readable storage medium, and a computer program product.
背景技术Background technique
随着计算机技术的快速发展,出现了以计算机技术为依托的虚拟场景,并且虚拟场景中的对象构成越来越丰富。为了降低场景渲染压力,通常预先根据虚拟角色或相机的位置,计算该位置的可视性,得到潜在可见集合(Potential Visibility Set,PVS)存储在场景数据文件中。在计算PVS之前,需要在虚拟场景中划分出多个预计算单元格。With the rapid development of computer technology, virtual scenes based on computer technology have emerged, and the objects in virtual scenes are becoming more and more abundant. In order to reduce the pressure of scene rendering, the visibility of the position is usually calculated in advance according to the position of the virtual character or camera, and the Potential Visibility Set (PVS) is obtained and stored in the scene data file. Before calculating PVS, it is necessary to divide multiple pre-calculated cells in the virtual scene.
传统的预计算单元格生成和显示方法,基于虚拟场景中的导航网格生成PVS的预计算单元格,在虚拟场景中存在不限制虚拟角色的可达区域的全视角空间的情况下,通过导航网格并不能覆盖该虚拟场景下的所有可达区域,因此,采用传统方法存在预计算单元格与虚拟场景的匹配度不高的缺点。The traditional pre-computed cell generation and display method generates pre-computed cells of PVS based on the navigation grid in the virtual scene. When there is a full-view space in the virtual scene that does not limit the reachable area of the virtual character, the navigation grid cannot cover all reachable areas in the virtual scene. Therefore, the traditional method has the disadvantage of low matching degree between the pre-computed cells and the virtual scene.
发明内容Summary of the invention
根据本申请的各个实施例,提供一种预计算单元格显示方法、预计算单元格生成方法、装置、计算机设备、计算机可读存储介质和计算机程序产品。According to various embodiments of the present application, a pre-calculated cell display method, a pre-calculated cell generation method, an apparatus, a computer device, a computer-readable storage medium, and a computer program product are provided.
一方面,本申请提供了一种预计算单元格显示方法,由计算机设备执行。所述方法包括:In one aspect, the present application provides a method for pre-calculating cell display, which is performed by a computer device. The method comprises:
响应于针对虚拟角色所在虚拟场景触发的视角空间划分事件,在所述虚拟场景中显示划分的视角受限空间和全视角空间;In response to a perspective space division event triggered for a virtual scene where a virtual character is located, displaying the divided perspective-restricted space and full perspective space in the virtual scene;
对应于所述视角受限空间内第一空间的导航网格,显示沿所述虚拟角色的站立方向延伸、并覆盖所述导航网格的多个预计算单元格,所述第一空间为所述视角受限空间内未与所述全视角空间重叠的空间,所述导航网格,用于表征所述虚拟角色在所述视角受限空间的可达区域;及A navigation grid corresponding to a first space in the viewing angle-restricted space is displayed, and a plurality of pre-calculated cells extending along a standing direction of the virtual character and covering the navigation grid are displayed, wherein the first space is a space in the viewing angle-restricted space that does not overlap with the full viewing angle space, and the navigation grid is used to represent a reachable area of the virtual character in the viewing angle-restricted space; and
对应于所述全视角空间内第二空间的静态网格,显示沿所述虚拟角色的站立方向延伸、并覆盖所述静态网格的多个预计算单元格,所述第二空间为所述全视角空间内未与所述视角受限空间重叠的空间,所述静态网格,用于表征空间中静态对象的对象轮廓。A static grid corresponding to a second space in the full-view space displays a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the static grid, wherein the second space is a space in the full-view space that does not overlap with the view-restricted space, and the static grid is used to represent the object outline of a static object in the space.
另一方面,本申请还提供了一种预计算单元格显示装置。所述装置包括:On the other hand, the present application also provides a pre-calculated cell display device. The device comprises:
视角空间显示模块,用于响应于针对虚拟角色所在虚拟场景触发的视角空间划分事件,在所述虚拟场景中显示划分的视角受限空间和全视角空间;A viewing space display module, for responding to a viewing space division event triggered for a virtual scene where a virtual character is located, and displaying the divided viewing space with limited viewing angle and full viewing space in the virtual scene;
预计算单元格显示模块,用于对应于所述视角受限空间内第一空间的导航网格,显示沿所述虚拟角色的站立方向延伸、并覆盖所述导航网格的多个预计算单元格,所述第一空间为所述视角受限空间内未与所述全视角空间重叠的空间,所述导航网格,用于表征所述虚拟角色在所述视角受限空间的可达区域;及a pre-calculated cell display module, configured to display a plurality of pre-calculated cells corresponding to a navigation grid of a first space in the viewing angle-restricted space, extending along a standing direction of the virtual character and covering the navigation grid, wherein the first space is a space in the viewing angle-restricted space that does not overlap with the full viewing angle space, and the navigation grid is used to represent a reachable area of the virtual character in the viewing angle-restricted space; and
对应于所述全视角空间内第二空间的静态网格,显示沿所述虚拟角色的站立方向延伸、并覆盖所述静态网格的多个预计算单元格,所述第二空间为所述全视角空间内未与所述视角受限空间重叠的空间,所述静态网格,用于表征空间中静态对象的对象轮廓。A static grid corresponding to a second space in the full-view space displays a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the static grid, wherein the second space is a space in the full-view space that does not overlap with the view-restricted space, and the static grid is used to represent the object outline of a static object in the space.
另一方面,本申请还提供了一种预计算单元格生成方法。所述方法包括:On the other hand, the present application also provides a method for generating a pre-calculated cell. The method comprises:
获取针对虚拟角色所在虚拟场景的视角空间参数,确定所述虚拟场景中的视角受限空间和全视角空间; Obtaining a perspective space parameter for a virtual scene where the virtual character is located, and determining a perspective-restricted space and a full perspective space in the virtual scene;
根据所述视角受限空间和所述全视角空间在所述虚拟场景中各自的位置,确定所述视角受限空间内未与所述全视角空间重叠的第一空间、以及所述全视角空间内未与所述视角受限空间重叠的第二空间;Determine, according to respective positions of the viewing angle limited space and the full viewing angle space in the virtual scene, a first space in the viewing angle limited space that does not overlap with the full viewing angle space, and a second space in the full viewing angle space that does not overlap with the viewing angle limited space;
对应于所述第一空间的导航网格,生成沿所述虚拟角色的站立方向延伸、并覆盖所述导航网格的多个预计算单元格,所述导航网格,用于表征所述虚拟角色在所述视角受限空间的可达区域;及Corresponding to the navigation grid of the first space, generating a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the navigation grid, wherein the navigation grid is used to represent a reachable area of the virtual character in the view-limited space; and
对应于所述第二空间的静态网格,生成沿所述虚拟角色的站立方向延伸、并覆盖所述静态网格的多个预计算单元格,所述静态网格,用于表征空间中静态对象的对象轮廓。Corresponding to the static grid of the second space, a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the static grid are generated, wherein the static grid is used to represent the object outline of the static object in the space.
另一方面,本申请还提供了一种预计算单元格生成装置。所述装置包括:On the other hand, the present application also provides a pre-calculated cell generation device. The device comprises:
视角空间确定模块,用于获取针对虚拟角色所在虚拟场景的视角空间参数,确定所述虚拟场景中的视角受限空间和全视角空间;A viewing angle space determination module, used to obtain viewing angle space parameters for a virtual scene where a virtual character is located, and determine a viewing angle restricted space and a full viewing angle space in the virtual scene;
未重叠空间确定模块,用于根据所述视角受限空间和所述全视角空间在所述虚拟场景中各自的位置,确定所述视角受限空间内未与所述全视角空间重叠的第一空间、以及所述全视角空间内未与所述视角受限空间重叠的第二空间;a non-overlapping space determining module, configured to determine, according to respective positions of the viewing angle limited space and the full viewing angle space in the virtual scene, a first space in the viewing angle limited space that does not overlap with the full viewing angle space, and a second space in the full viewing angle space that does not overlap with the viewing angle limited space;
预计算单元格生成模块,用于对应于所述第一空间的导航网格,生成沿所述虚拟角色的站立方向延伸、并覆盖所述导航网格的多个预计算单元格,所述导航网格,用于表征所述虚拟角色在所述视角受限空间的可达区域;及a pre-calculated cell generation module, configured to generate, corresponding to the navigation grid of the first space, a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the navigation grid, wherein the navigation grid is used to represent a reachable area of the virtual character in the view-limited space; and
对应于所述第二空间的静态网格,生成沿所述虚拟角色的站立方向延伸、并覆盖所述静态网格的多个预计算单元格,所述静态网格,用于表征空间中静态对象的对象轮廓。Corresponding to the static grid of the second space, a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the static grid are generated, wherein the static grid is used to represent the object outline of the static object in the space.
另一方面,本申请还提供了一种计算机设备。所述计算机设备包括存储器和一个或多个处理器,所述存储器存储有计算机可读指令,所述一个或多个处理器执行所述计算机可读指令时执行本申请各方法实施例的步骤。On the other hand, the present application further provides a computer device, which includes a memory and one or more processors, wherein the memory stores computer-readable instructions, and the one or more processors execute the steps of each method embodiment of the present application when executing the computer-readable instructions.
另一方面,本申请还提供了一种计算机可读存储介质。所述计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被一个或多个处理器执行时执行本申请各方法实施例步骤。On the other hand, the present application further provides a computer-readable storage medium having computer-readable instructions stored thereon, and when the computer-readable instructions are executed by one or more processors, the steps of the method embodiments of the present application are executed.
另一方面,本申请还提供了一种计算机程序产品。所述计算机程序产品,包括计算机可读指令,该计算机可读指令被一个或多个处理器执行时执行本申请各方法实施例步骤。On the other hand, the present application further provides a computer program product, which includes computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the steps of the method embodiments of the present application are executed.
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。。Details of one or more embodiments of the present application are set forth in the following drawings and description. Other features, objects, and advantages of the present application will become apparent from the description, drawings, and claims.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施例或传统技术中的技术方案,下面将对实施例或传统技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据公开的附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the conventional technology, the drawings required for use in the embodiments or the conventional technology descriptions will be briefly introduced below. Obviously, the drawings described below are merely embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on the disclosed drawings without paying any creative work.
图1为一些实施例中预计算单元格显示方法和生成方法的应用环境图;FIG1 is a diagram of an application environment of a pre-calculated cell display method and a generation method in some embodiments;
图2为一些实施例中预计算单元格显示方法的流程示意图;FIG2 is a schematic diagram of a flow chart of a method for pre-calculating cell display in some embodiments;
图3为一些实施例中视角空间的显示界面示意图;FIG3 is a schematic diagram of a display interface of a viewing angle space in some embodiments;
图4为一些实施例中导航网格的显示界面示意图;FIG4 is a schematic diagram of a display interface of a navigation grid in some embodiments;
图5为图3中全视角空间D的预计算单元格的显示界面示意图;FIG5 is a schematic diagram of a display interface of a pre-calculated cell of the full viewing space D in FIG3 ;
图6为另一些实施例中预计算单元格的显示界面示意图;FIG6 is a schematic diagram of a display interface of a pre-calculated cell in some other embodiments;
图7为另一些实施例中预计算单元格显示方法的流程示意图;FIG7 is a schematic diagram of a flow chart of a method for pre-calculating cell display in some other embodiments;
图8为一些实施例中预计算单元格生成方法的流程示意图;FIG8 is a schematic diagram of a process flow of a method for generating a pre-calculated cell in some embodiments;
图9为一个实施例中的重叠空间示意图;FIG9 is a schematic diagram of overlapping spaces in one embodiment;
图10为一些实施例中非目标视角空间的拆分过程示意图;FIG10 is a schematic diagram of a process of splitting a non-target viewing space in some embodiments;
图11为图10中重叠子空间K3被拆分后在XY平面上的投影示意图; FIG11 is a schematic diagram of the projection of the overlapping subspace K3 in FIG10 on the XY plane after being split;
图12为一些实施例中一个预计算单元格的栅格构成示意图;FIG12 is a schematic diagram of a grid structure of a pre-calculated cell in some embodiments;
图13为一些实施例中XY平面上平面投影区域和栅格投影区域的示意图;FIG13 is a schematic diagram of a plane projection area and a grid projection area on an XY plane in some embodiments;
图14为另一些实施例中预计算单元格生成方法的流程示意图;FIG14 is a schematic diagram of a flow chart of a method for generating a pre-calculated cell in some other embodiments;
图15为一个实施例中预计算单元格的生成结果示意图;FIG15 is a schematic diagram of the generation result of a pre-calculated cell in one embodiment;
图16为另一个实施例中预计算单元格的生成结果示意图;FIG16 is a schematic diagram of the generation result of pre-calculated cells in another embodiment;
图17为一些实施例中预计算单元格显示装置的结构框图;FIG17 is a block diagram of a pre-calculated cell display device in some embodiments;
图18为一些实施例中预计算单元格生成装置的结构框图;FIG18 is a block diagram of a pre-calculated cell generation device in some embodiments;
图19为一些实施例中计算机设备的内部结构图;FIG19 is a diagram of the internal structure of a computer device in some embodiments;
图20为一些实施例中计算机设备的内部结构图。FIG. 20 is a diagram of the internal structure of a computer device in some embodiments.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
本申请实施例提供的预计算单元格显示方法和生成方法,涉及人工智能的计算机视觉技术,具体可以应用于如图1所示的应用环境中。其中,应用端102通过网络与服务端104进行通信。网络可以是广域网或者局域网,又或者是二者的组合,使用无线或有线链路实现数据传输。数据存储***可以存储服务端104需要处理的数据。数据存储***可以集成在服务端104上,也可以放在云上或其他计算机设备上。服务端104响应于针对虚拟角色所在虚拟场景触发的视角空间划分事件,在虚拟场景中显示划分的视角受限空间和全视角空间,对应于视角受限空间内未与全视角空间重叠的第一空间的导航网格、以及全视角空间内未与视角受限空间重叠的第二空间的静态网格,生成或显示沿虚拟角色的站立方向延伸的多个预计算单元格,以覆盖第一空间的导航网格、以及第二空间的静态网格;该导航网格,用于表征虚拟角色在视角受限空间的可达区域;该静态网格,用于表征空间中静态对象的对象轮廓。获得多个预计算单元格后,服务端104可以针对每一预计算单元格进行PVS的计算,并保存PVS计算结果,以便在应用端102访问该虚拟场景的情况下,可以根据虚拟角色所在位置对应的PVS计算结果实现快速场景渲染,以提高场景画面的显示效果。The pre-calculated cell display method and generation method provided in the embodiment of the present application relate to computer vision technology of artificial intelligence, and can be specifically applied in the application environment shown in Figure 1. Among them, the application end 102 communicates with the server end 104 through a network. The network can be a wide area network or a local area network, or a combination of the two, using wireless or wired links to realize data transmission. The data storage system can store data that the service end 104 needs to process. The data storage system can be integrated on the server end 104, or it can be placed on the cloud or other computer devices. The server end 104 responds to the perspective space division event triggered for the virtual scene where the virtual character is located, and displays the divided perspective restricted space and full perspective space in the virtual scene, corresponding to the navigation grid of the first space in the perspective restricted space that does not overlap with the full perspective space, and the static grid of the second space in the full perspective space that does not overlap with the perspective restricted space, and generates or displays a plurality of pre-calculated cells extending along the standing direction of the virtual character to cover the navigation grid of the first space and the static grid of the second space; the navigation grid is used to represent the reachable area of the virtual character in the perspective restricted space; the static grid is used to represent the object contour of the static object in the space. After obtaining multiple pre-calculated cells, the server 104 can calculate the PVS for each pre-calculated cell and save the PVS calculation result, so that when the application 102 accesses the virtual scene, fast scene rendering can be achieved according to the PVS calculation result corresponding to the location of the virtual character to improve the display effect of the scene picture.
其中,服务端104可以是终端或者外接显示屏的服务器。该终端可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱、智能电视、智能手表等,但并不局限于此。该服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式***,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(CDN,ContentDelivery Network)、以及大数据和人工智能平台等基础云计算服务的云服务器。应用端102和服务端104可以通过有线或无线通信方式进行直接或间接地连接,本申请在此不做限制。Among them, the server 104 can be a terminal or a server with an external display screen. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart TV, a smart watch, etc., but is not limited to this. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), and big data and artificial intelligence platforms. The application end 102 and the server end 104 can be directly or indirectly connected through wired or wireless communication, and this application does not limit this.
在实际应用中,应用端102可以安装支持虚拟场景的应用程序,进而通过该应用程序访问该虚拟场景,但是应用程序也不是必须的,应用端102还可以通过网页访问虚拟场景。该应用程序可以是多人在线战术竞技游戏(MOBA,Multiplayer Online Battle Arena games)、三维(Three Dimension,简称3D)游戏应用、虚拟现实应用程序、三维地图程序或者多人竞技类生存游戏中的任意一种。该应用程序还可以是单机版的应用程序,比如单机版的3D游戏程序。In actual applications, the application end 102 can install an application that supports virtual scenes, and then access the virtual scenes through the application, but the application is not necessary, and the application end 102 can also access the virtual scenes through a web page. The application can be any one of a multiplayer online tactical competitive game (MOBA, Multiplayer Online Battle Arena games), a three-dimensional (Three Dimension, 3D) game application, a virtual reality application, a three-dimensional map program, or a multiplayer competitive survival game. The application can also be a stand-alone application, such as a stand-alone 3D game program.
在一种可能的实现方式中,该预计算单元格生成和显示方法可以应用于单机版射击游戏或者多人在线战术竞技游戏等游戏应用场景中。在该应用场景的虚拟场景中,同时包含房顶等虚拟角色不可达区域、以及不限制虚拟角色的可达区域的室外草地,且房顶对应的房屋设置在草地上。具体地,服务端104响应于针对虚拟角色所在虚拟场景的视角空间划 分事件,在虚拟场景中显示划分的视角受限空间和全视角空间,该视角受限空间包含具备房顶等不可达区域的房屋所在区域;该全视角空间可以包含室外草地所在区域。然后,服务端104对应于视角受限空间内未与全视角空间重叠的第一空间的导航网格、以及全视角空间内未与视角受限空间重叠的第二空间的静态网格,显示沿虚拟角色的站立方向延伸的多个预计算单元格,以覆盖第一空间的导航网格、以及第二空间的静态网格;该导航网格,用于表征虚拟角色在视角受限空间的可达区域,例如可以是房屋的室内可达区域;该静态网格,用于表征空间中静态对象的对象轮廓,例如地面或草的轮廓。获得多个预计算单元格后,服务端104可以针对每一预计算单元格进行PVS的计算,并将PVS计算结果保存在虚拟场景的场景数据中,随场景数据一并下发至应用端102,以便应用端102在访问虚拟场景的情况下,可以根据虚拟角色所在位置对应的PVS计算结果,在渲染梯队中剔除当前不可见的静态对象,进而实现快速的场景渲染。服务端也可以根据应用端104的虚拟角色所在位置,查询该位置对应的PVS计算结果,并基于查询得到的各PVS计算结果实现对应用端104的当前虚拟场景的渲染。In a possible implementation, the pre-calculated cell generation and display method can be applied to game application scenarios such as stand-alone shooting games or multiplayer online tactical competitive games. In the virtual scene of the application scenario, there are both areas that are inaccessible to the virtual character, such as the roof, and outdoor grass that is not restricted to the accessible area of the virtual character, and the house corresponding to the roof is set on the grass. Specifically, the server 104 responds to the perspective space division of the virtual scene where the virtual character is located. According to the event, the divided view-limited space and full view space are displayed in the virtual scene, wherein the view-limited space includes the area where the house with inaccessible areas such as the roof is located; the full view space may include the area where the outdoor grass is located. Then, the server 104 displays a plurality of pre-calculated cells extending along the standing direction of the virtual character, corresponding to the navigation mesh of the first space in the view-limited space that does not overlap with the full view space, and the static mesh of the second space in the full view space that does not overlap with the view-limited space, to cover the navigation mesh of the first space and the static mesh of the second space; the navigation mesh is used to represent the accessible area of the virtual character in the view-limited space, such as the indoor accessible area of the house; the static mesh is used to represent the object outline of the static object in the space, such as the outline of the ground or grass. After obtaining multiple pre-calculated cells, the server 104 can calculate the PVS for each pre-calculated cell, and save the PVS calculation result in the scene data of the virtual scene, and send it to the application 102 together with the scene data, so that when the application 102 accesses the virtual scene, it can remove the currently invisible static objects in the rendering echelon according to the PVS calculation result corresponding to the position of the virtual character, thereby realizing fast scene rendering. The server can also query the PVS calculation result corresponding to the position of the virtual character of the application 104, and realize the rendering of the current virtual scene of the application 104 based on the PVS calculation results obtained by the query.
在另一种可能的实现方式中,该预计算单元格生成和显示方法可以应用于地图导航的应用场景中。在该应用场景下,应用端102可以安装地图导航应用程序,用户通过访问该应用程序可以查看导航路径上与实景图像对应的渲染图像。在该应用场景下,服务端104针对地图中每一现实场景对应的仿真场景,响应于针对该仿真场景的视角空间划分事件,在仿真场景中显示划分的包含街道等视角受限区域的视角受限空间、以及包含室外空旷地等视角不受限区域的全视角空间。然后,服务端104对应于视角受限空间内未与全视角空间重叠的第一空间的导航网格、以及全视角空间内未与视角受限空间重叠的第二空间的静态网格,显示沿用户的站立方向延伸的多个预计算单元格,以覆盖第一空间的导航网格、以及第二空间的静态网格;该导航网格,用于表征用户在视角受限空间的可达区域,例如街道建筑物之间的道路;该静态网格,用于表征空间中静态对象的对象轮廓,例如地面轮廓。获得多个预计算单元格后,服务端104可以针对每一预计算单元格进行PVS的计算,并将PVS计算结果保存在仿真场景的场景数据中,在用户通过应用端102访问地图导航数据的情况下,服务端104可以根据用户指定的视角位置,查询该位置对应的PVS计算结果,并基于查询得到的各PVS计算结果确定当前视角位置下的可见对象,通过对可见对象进行渲染,向应用端102反馈该视角位置下的渲染图像。其中,视角位置用于表征用户在该场景中的位置和朝向。In another possible implementation, the pre-calculated cell generation and display method can be applied to the application scenario of map navigation. In this application scenario, the application end 102 can install a map navigation application, and the user can view the rendered image corresponding to the real scene image on the navigation path by accessing the application. In this application scenario, the server end 104, for each simulation scene corresponding to the real scene in the map, responds to the perspective space division event for the simulation scene, and displays the perspective-restricted space divided into perspective-restricted areas such as streets and the full perspective space including perspective-unrestricted areas such as outdoor open spaces in the simulation scene. Then, the server end 104 displays a plurality of pre-calculated cells extending along the user's standing direction, corresponding to the navigation grid of the first space in the perspective-restricted space that does not overlap with the full perspective space, and the static grid of the second space in the full perspective space that does not overlap with the perspective-restricted space, to cover the navigation grid of the first space and the static grid of the second space; the navigation grid is used to represent the user's accessible area in the perspective-restricted space, such as the road between street buildings; the static grid is used to represent the object contour of the static object in the space, such as the ground contour. After obtaining multiple pre-calculated cells, the server 104 can calculate PVS for each pre-calculated cell and save the PVS calculation result in the scene data of the simulation scene. When the user accesses the map navigation data through the application 102, the server 104 can query the PVS calculation result corresponding to the position according to the viewing angle position specified by the user, and determine the visible objects at the current viewing angle position based on the PVS calculation results obtained by the query, and by rendering the visible objects, feedback the rendered image at the viewing angle position to the application 102. The viewing angle position is used to represent the position and orientation of the user in the scene.
在一些实施例中,如图2所示,提供了一种预计算单元格显示方法,以该方法应用于图1中的服务端104为例进行说明,包括以下步骤:In some embodiments, as shown in FIG. 2 , a pre-calculated cell display method is provided, and the method is applied to the server 104 in FIG. 1 as an example for description, including the following steps:
步骤S202,响应于针对虚拟角色所在虚拟场景触发的视角空间划分事件,在虚拟场景中显示划分的视角受限空间和全视角空间。Step S202 , in response to a perspective space division event triggered for a virtual scene where the virtual character is located, displaying the divided perspective restricted space and full perspective space in the virtual scene.
其中,虚拟场景是指应用端中的应用程序或网页在运行的过程中提供的虚拟活动空间,供虚拟角色在该虚拟活动空间中执行各种活动。该虚拟场景可以是对真实世界的仿真场景,也可以是半仿真半虚构的场景,还可以是纯虚构的场景。虚拟场景可以包括虚拟对象,该虚拟对象可以是虚拟场景中的场景组成元素,如虚拟草地或虚拟建筑物,也可以是虚拟场景中的场景参与元素,如由应用端控制并活动于虚拟场景中的虚拟对象、以及不由应用端控制的非玩家角色(NPC,Non-Player Character)。也即,虚拟角色是指在虚拟场景中被应用端控制的可活动对象。该可活动对象可以是虚拟人物、虚拟动物、动漫人物中的至少一种。应用端可以根据接收到的用户操作控制虚拟角色在虚拟场景中活动。示例性的,虚拟角色在虚拟场景中的活动包括:行走、跑动、跳跃、攀爬、趴下、攻击、释放技能、捡拾道具、发送消息,但不限于此,本申请实施例对此不作限定。Among them, the virtual scene refers to the virtual activity space provided by the application or web page in the application end during operation, for the virtual character to perform various activities in the virtual activity space. The virtual scene can be a simulation scene of the real world, or a semi-simulation and semi-fictional scene, or a purely fictional scene. The virtual scene can include virtual objects, which can be scene components in the virtual scene, such as virtual grass or virtual buildings, or scene participating elements in the virtual scene, such as virtual objects controlled by the application end and active in the virtual scene, and non-player characters (NPC, Non-Player Character) not controlled by the application end. That is, the virtual character refers to an active object controlled by the application end in the virtual scene. The active object can be at least one of a virtual person, a virtual animal, and an animated character. The application end can control the virtual character to move in the virtual scene according to the received user operation. Exemplarily, the activities of the virtual character in the virtual scene include: walking, running, jumping, climbing, lying down, attacking, releasing skills, picking up props, and sending messages, but are not limited to this, and the embodiments of the present application are not limited to this.
视角空间划分事件是指用于指示服务端在虚拟场景中划分出视角空间,并显示划分的视角空间的事件。该视角空间划分事件的触发方式并不唯一。示例性的,可以在开发界面 上显示视角空间划分控件,开发人员可以点击该视角空间划分控件,服务端可以响应于该视角空间划分控件的点击操作,触发视角空间划分事件;也可以在开发界面上显示视角空间划分选项,开发人员可以选定该视角空间划分选项,服务端可以响应于该视角空间划分选项的选定操作,触发视角空间划分事件。进一步地,由于PVS的计算需要在照明构建完成的基础上进行,在一种可能的实现中,服务端也可以在虚拟场景的照明构建完成后,自动触发视角空间划分事件。The view space division event is an event used to instruct the server to divide the view space in the virtual scene and display the divided view space. The triggering method of the view space division event is not unique. For example, in the development interface A view space division control may be displayed on the development interface, and the developer may click the view space division control. The server may trigger a view space division event in response to the click operation of the view space division control. A view space division option may also be displayed on the development interface, and the developer may select the view space division option. The server may trigger a view space division event in response to the selection operation of the view space division option. Furthermore, since the calculation of PVS needs to be performed after the lighting construction is completed, in a possible implementation, the server may also automatically trigger a view space division event after the lighting construction of the virtual scene is completed.
视角受限空间和全视角空间是两种不同类型的视角空间。视角受限空间是指包括房屋、街道、桥梁等视角受限区域的视角空间。视角受限区域是指对虚拟角色的运动轨迹存在限制,可以通过导航网格表征虚拟角色的可达区域的空间。例如,房屋的屋顶和墙壁可以是虚拟角色的不可达区域,街道中的建筑物可以是虚拟角色的不可达区域,桥梁的桥墩、绳索等可以是虚拟角色的不可达区域。全视角空间是指包含室外空旷地等全视角区域的视角空间。全视角区域是指对虚拟角色的运动轨迹不进行限制的空间,也即,在全视角区域内,虚拟角色可以接触到该区域内所包含的所有静态对象。例如,室外空旷地的地面元素,包括泥土、草等。Perspective-restricted space and full-perspective space are two different types of perspective spaces. Perspective-restricted space refers to a perspective space that includes perspective-restricted areas such as houses, streets, and bridges. Perspective-restricted areas refer to spaces where there are restrictions on the movement trajectory of virtual characters, and the accessible areas of virtual characters can be represented by navigation grids. For example, the roof and walls of a house may be inaccessible areas for virtual characters, buildings in the street may be inaccessible areas for virtual characters, and piers and ropes of bridges may be inaccessible areas for virtual characters. Full-perspective space refers to a perspective space that includes full-perspective areas such as outdoor open spaces. A full-perspective area refers to a space where there are no restrictions on the movement trajectory of a virtual character, that is, within a full-perspective area, a virtual character can touch all static objects contained in the area. For example, ground elements in an outdoor open space include soil, grass, and the like.
进一步地,视角空间用于划定虚拟场景中生成PVS预计算单元格的范围,该视角空间可以显示为贴图物体或者未贴图的线框。视角空间的空间形状并不唯一,例如可以是长方体、圆柱体、棱台或者不规则形状,且视角受限空间和全视角空间的空间形状可以相同也可以不相同。在一个具体的应用中,视角空间可以通过显示为长方体线框的预计算可视性体积(Precompute Visible Volume)表征。如图3所示,在包括房屋A和空旷地B的虚拟场景中,可以显示划分的包含房屋A的视角受限空间C、以及包含空旷地B的全视角空间D。如图4所示,图3的房屋A内包括用于表征虚拟角色的可达区域的导航网格E。Furthermore, the perspective space is used to define the range of generating PVS pre-computed cells in the virtual scene, and the perspective space can be displayed as a mapped object or an unmapped wireframe. The spatial shape of the perspective space is not unique, for example, it can be a cuboid, a cylinder, a prism or an irregular shape, and the spatial shapes of the perspective-restricted space and the full perspective space can be the same or different. In a specific application, the perspective space can be represented by a precomputed visible volume (Precompute Visible Volume) displayed as a cuboid wireframe. As shown in FIG3, in a virtual scene including a house A and an open space B, the divided perspective-restricted space C containing the house A and the full perspective space D containing the open space B can be displayed. As shown in FIG4, the house A in FIG3 includes a navigation grid E for representing the reachable area of the virtual character.
在一个实施例中,可以由开发人员点击开发界面的视角空间划分界面、或选定开发界面的视角空间划分选项,由服务端响应于开发人员针对开发界面的界面操作,触发针对虚拟角色所在虚拟场景的视角空间划分事件,在虚拟场景中划分并显示出视角受限空间和全视角空间。服务端可以响应于针对虚拟角色所在虚拟场景触发的视角空间划分事件,在虚拟场景中划分出视角受限空间和全视角空间,并在虚拟场景中的对应位置处显示划分的视角受限空间和全视角空间。服务端在虚拟场景中划分出视角受限空间和全视角空间的具体方式并不唯一。例如,可以由开发人员确定视角空间的参数,并将该参数输入服务端,服务端按照输入的参数在虚拟场景中划分出视角受限空间和全视角空间;也可以由开发人员通过拖动鼠标在虚拟场景中绘制出视角受限空间和全视角空间各自对应的线框;还可以由服务端根据虚拟场景的场景组成元素的可达范围属性参数,确定虚拟场景中所包含的视角受限元素和全视角元素,进而在虚拟场景中划分出包含视角受限元素的视角受限空间、以及包含全视角元素的全视角空间。In one embodiment, a developer can click on the perspective space division interface of the development interface, or select the perspective space division option of the development interface, and the server can respond to the developer's interface operation on the development interface, trigger the perspective space division event for the virtual scene where the virtual character is located, and divide and display the perspective restricted space and the full perspective space in the virtual scene. The server can respond to the perspective space division event triggered for the virtual scene where the virtual character is located, divide the perspective restricted space and the full perspective space in the virtual scene, and display the divided perspective restricted space and the full perspective space at the corresponding position in the virtual scene. The specific way for the server to divide the perspective restricted space and the full perspective space in the virtual scene is not unique. For example, a developer may determine the parameters of the viewing space and input the parameters into the server, which will divide the virtual scene into a viewing restricted space and a full viewing space according to the input parameters. A developer may also draw wireframes corresponding to the viewing restricted space and the full viewing space in the virtual scene by dragging the mouse. The server may also determine the viewing restricted elements and the full viewing elements contained in the virtual scene based on the reachable range attribute parameters of the scene constituent elements of the virtual scene, and then divide the virtual scene into a viewing restricted space containing the viewing restricted elements and a full viewing space containing the full viewing elements.
进一步地,视角受限空间和全视角空间的显示方式可以相同,也可以不相同。示例性地,可以通过不同类型的线框分别显示划分的视角受限空间和全视角空间,该不同类型的线框可以是线条颜色、线条粗细或线条类型中至少一项存在区别;还可以通过显示空间类型标识实现对视角受限空间和全视角空间的区别显示,该空间类型标识用于标识视角受限空间或全视角空间的空间类型,该空间类型为视角受限类型或全视角类型。空间类型标识可以包括文字、符号或数字中一种或多种的组合。此外,视角空间还可以被配置为可隐藏,以便于开发人员根据需要选择显示或不显示对应的视角空间。也即,虚拟场景中划分出的视角受限空间和全视角空间,可以全部显示、部分显示或者全部不显示。Furthermore, the display modes of the perspective-restricted space and the full perspective space may be the same or different. Exemplarily, the divided perspective-restricted space and the full perspective space may be displayed respectively by different types of wireframes, and the different types of wireframes may be different in at least one of line color, line thickness or line type; the perspective-restricted space and the full perspective space may also be displayed differently by displaying a space type identifier, and the space type identifier is used to identify the space type of the perspective-restricted space or the full perspective space, and the space type is a perspective-restricted type or a full perspective type. The space type identifier may include a combination of one or more of text, symbols or numbers. In addition, the perspective space may also be configured to be hidden, so that the developer can choose to display or not display the corresponding perspective space as needed. That is, the perspective-restricted space and the full perspective space divided in the virtual scene may be displayed in full, partially or not at all.
需要说明的是,在同一虚拟场景中,视角受限空间和全视角空间各自的数量,可以是一个,也可以是多个,且各视角受限空间和各全视角空间中的任意两个视角空间,可以不存在重叠空间,也存在重叠空间。如图3中,视角受限空间C和全视角空间D在房屋A的所在区域存在重叠空间。示例性的,该重叠空间可以通过预计算重载体积(Precompute  Override Volume)表征。It should be noted that in the same virtual scene, the number of the view-restricted space and the full view space can be one or more, and any two view spaces in each view-restricted space and each full view space may or may not have overlapping space. As shown in FIG3 , the view-restricted space C and the full view space D have overlapping space in the area where the house A is located. For example, the overlapping space can be calculated by precompute the reload volume (Precompute Override Volume) characterization.
步骤S204,对应于视角受限空间内第一空间的导航网格,显示沿虚拟角色的站立方向延伸、并覆盖该导航网格的多个预计算单元格。Step S204 , corresponding to the navigation grid of the first space in the viewing angle-limited space, displays a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the navigation grid.
其中,预计算单元格(Cell)是PVS计算的最小计算单位,可以理解为虚拟角色的眼睛、或者跟随虚拟角色的摄像机所在的位置,PVS计算过程对应为确定每一个Cell所对应的潜在可见集合的过程。第一空间为视角受限空间内未与全视角空间重叠的空间;第二空间为全视角空间内未与视角受限空间重叠的空间。导航网格用于表征虚拟角色在视角受限空间的可达区域。针对视角受限空间内未与全视角空间重叠的第一空间中,该第一空间中的导航网格可以相对准确地表征虚拟角色在该第一空间中的可达区域。Among them, the pre-calculated cell (Cell) is the smallest calculation unit of PVS calculation, which can be understood as the location of the virtual character's eyes or the camera following the virtual character. The PVS calculation process corresponds to the process of determining the potential visible set corresponding to each Cell. The first space is the space in the perspective-restricted space that does not overlap with the full perspective space; the second space is the space in the full perspective space that does not overlap with the perspective-restricted space. The navigation grid is used to characterize the reachable area of the virtual character in the perspective-restricted space. For the first space in the perspective-restricted space that does not overlap with the full perspective space, the navigation grid in the first space can relatively accurately characterize the reachable area of the virtual character in the first space.
基于此,服务端可以对应于视角受限空间内第一空间的导航网格,显示沿虚拟角色的站立方向延伸的多个预计算单元格,以覆盖该第一空间的导航网格。其中,虚拟角色的站立方向,可以是指左手坐标系中的Z方向。预计算单元格的显示方式并不唯一,例如可以显示为贴图物体或者未贴图的线框等。该预计算单元格的空间形状也不唯一,例如可以是立方体或长方体。在一个具体的应用中,预计算单元格由多个栅格(Grid)构成。栅格是将空间分割成有规律的网格,每一个栅格是一个像素单元,在各栅格上赋予相应的属性值,即可实现对空间中实体的表示。在一种可能的实现中,预计算单元格显示为立方体线框。预计算单元格还可以被配置为可隐藏,以便于开发人员根据需要选择显示或不显示该预计算单元格。Based on this, the server can display a plurality of pre-calculated cells extending along the standing direction of the virtual character corresponding to the navigation grid of the first space in the space with limited viewing angle to cover the navigation grid of the first space. Among them, the standing direction of the virtual character can refer to the Z direction in the left-hand coordinate system. The display mode of the pre-calculated cell is not unique, for example, it can be displayed as a mapped object or an unmapped wireframe. The spatial shape of the pre-calculated cell is also not unique, for example, it can be a cube or a cuboid. In a specific application, the pre-calculated cell is composed of multiple grids. The grid divides the space into regular grids, each grid is a pixel unit, and the corresponding attribute values are assigned to each grid to realize the representation of the entity in the space. In one possible implementation, the pre-calculated cell is displayed as a cubic wireframe. The pre-calculated cell can also be configured to be hidden, so that the developer can choose to display or not display the pre-calculated cell as needed.
需要说明的是,若同一虚拟场景中视角受限空间的数量为多个,则不同视角受限空间的重叠空间,对应于上文中视角受限空间内未与全视角空间重叠的第一空间,可以通过导航网格表征虚拟角色在该空间的可达区域。It should be noted that if there are multiple perspective-restricted spaces in the same virtual scene, the overlapping space of different perspective-restricted spaces corresponds to the first space in the perspective-restricted space that does not overlap with the full perspective space in the above text, and the reachable area of the virtual character in the space can be represented by the navigation grid.
步骤S206,对应于全视角空间内第二空间的静态网格,显示沿虚拟角色的站立方向延伸、并覆盖该静态网格的多个预计算单元格。Step S206 , corresponding to the static grid of the second space in the full-view space, display a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the static grid.
其中,第二空间为全视角空间内未与视角受限空间重叠的空间。静态网格用于表征空间中静态对象的对象轮廓。虚拟场景中所包含的静态对象的对象轮廓可以通过该静态对象的静态网格(Static Mesh)表征。通常虚拟场景中所展示的静态对象,是该静态对象的静态网格的贴图显示。静态对象是指虚拟场景中不可移动的虚拟对象。例如地面、建筑物、树木等等。针对全视角空间内未与视角受限空间重叠的第二空间,该第二空间中的静态网格可以相对准确地表征虚拟角色在该第二空间中的可达区域,例如虚拟角色在第二空间中可以接触的静态物件、可以到达的地面等。Among them, the second space is the space in the full-view space that does not overlap with the view-restricted space. The static mesh is used to represent the object outline of the static object in the space. The object outline of the static object contained in the virtual scene can be represented by the static mesh (Static Mesh) of the static object. Usually, the static object displayed in the virtual scene is a texture display of the static mesh of the static object. Static objects refer to immovable virtual objects in the virtual scene. For example, the ground, buildings, trees, etc. For the second space in the full-view space that does not overlap with the view-restricted space, the static mesh in the second space can relatively accurately represent the reachable area of the virtual character in the second space, such as the static objects that the virtual character can touch in the second space, the ground that can be reached, etc.
基于此,服务端可以对应于全视角空间内第二空间的静态网格,显示沿虚拟角色的站立方向延伸的多个预计算单元格,以覆盖该第二空间的静态网格。示例性的,如图5所示,针对图3中全视角空间D内未与视角受限空间C重叠的第二空间,对应于该第二空间的静态网格,显示沿虚拟角色的站立方向延伸的多个预计算单元格F,以覆盖该第二空间的静态网格。可选地,在开发界面上,导航网格和静态网格可以显示也可以不显示,例如图4中显示了图3房屋A的室内空间的导航网格D,图5中未显示空旷地B的静态网格,图6中导航网格和静态网格均未显示,仅显示了最终生成的多个预计算单元格G。Based on this, the server can display a plurality of pre-calculated cells extending along the standing direction of the virtual character corresponding to the static grid of the second space in the full-view space to cover the static grid of the second space. Exemplarily, as shown in FIG5, for the second space in the full-view space D in FIG3 that does not overlap with the perspective-restricted space C, a plurality of pre-calculated cells F extending along the standing direction of the virtual character are displayed corresponding to the static grid of the second space to cover the static grid of the second space. Optionally, on the development interface, the navigation grid and the static grid may or may not be displayed. For example, FIG4 shows the navigation grid D of the indoor space of the house A in FIG3, FIG5 does not show the static grid of the open space B, and FIG6 does not show both the navigation grid and the static grid, and only the multiple pre-calculated cells G finally generated are displayed.
进一步地,若同一虚拟场景中全视角空间的数量为多个,则不同全视角空间的重叠空间,对应于上文中全视角空间内未与视角受限空间重叠的第二空间,可以通过静态网格表征虚拟角色在该空间的可达区域。可选地,在视角受限空间和全视角空间存在重叠空间的情况下,对于视角受限空间和全视角空间的重叠空间,服务端可以对应于该重叠空间中的导航网格和静态网格,显示沿虚拟角色的站立方向延伸的多个预计算单元格;也可以对应于该重叠空间中的导航网格或静态网格,显示沿虚拟角色的站立方向延伸的多个预计算单元格。Furthermore, if there are multiple full-view spaces in the same virtual scene, the overlapping space of different full-view spaces corresponds to the second space in the full-view space that does not overlap with the view-restricted space mentioned above, and the reachable area of the virtual character in the space can be represented by a static grid. Optionally, in the case where there is an overlapping space between the view-restricted space and the full-view space, for the overlapping space between the view-restricted space and the full-view space, the server can display multiple pre-calculated cells extending along the standing direction of the virtual character corresponding to the navigation grid and the static grid in the overlapping space; it can also display multiple pre-calculated cells extending along the standing direction of the virtual character corresponding to the navigation grid or the static grid in the overlapping space.
上述预计算单元格显示方法,响应于针对虚拟角色所在虚拟场景触发的视角空间划分 事件,在虚拟场景中显示划分的视角受限空间和全视角空间,对应于视角受限空间内未与全视角空间重叠的第一空间的导航网格、以及全视角空间内未与视角受限空间重叠的第二空间的静态网格,生成或显示沿虚拟角色的站立方向延伸的多个预计算单元格,以覆盖第一空间的导航网格、以及第二空间的静态网格。由于静态网格用于表征空间中静态对象的对象轮廓,则静态网格可以相对准确地表征虚拟角色在全视角空间的可达区域,并且,导航网格用于表征虚拟角色在视角受限空间的可达区域,采用上述方法可以提高预计算单元格对虚拟场景下虚拟角色的可达区域的覆盖度,进而提高预计算单元格与虚拟场景的匹配度。The above-mentioned pre-calculated cell display method responds to the perspective space division triggered by the virtual scene where the virtual character is located. Event, display the divided perspective-restricted space and full perspective space in the virtual scene, corresponding to the navigation grid of the first space in the perspective-restricted space that does not overlap with the full perspective space, and the static grid of the second space in the full perspective space that does not overlap with the perspective-restricted space, generate or display multiple pre-calculated cells extending along the standing direction of the virtual character to cover the navigation grid of the first space and the static grid of the second space. Since the static grid is used to represent the object outline of the static object in the space, the static grid can relatively accurately represent the reachable area of the virtual character in the full perspective space, and the navigation grid is used to represent the reachable area of the virtual character in the perspective-restricted space. The above method can improve the coverage of the reachable area of the virtual character in the virtual scene by the pre-calculated cells, thereby improving the matching degree between the pre-calculated cells and the virtual scene.
在一些实施例中,步骤S202包括:响应于视角空间参数输入事件,显示至少两组视角空间参数;按照至少两组视角空间参数,在虚拟场景中显示至少两个视角空间。In some embodiments, step S202 includes: displaying at least two sets of perspective space parameters in response to a perspective space parameter input event; and displaying at least two perspective spaces in a virtual scene according to the at least two sets of perspective space parameters.
其中,视角空间参数可以包括位置参数和类型参数。该位置参数用于表征视角空间在虚拟场景中的空间位置;该类型参数用于表征视角空间的空间类型。该空间类型包括视角受限类型和全视角类型。也即,在虚拟场景中显示的至少两个视角空间,包括视角受限空间和全视角空间。进一步地,一组视角空间参数用于表征一个视角空间的空间位置和空间类型,也即,服务端按照同一组视角空间参数中的各个参数,在虚拟场景中显示与该组视角空间参数匹配的视角空间。Among them, the perspective space parameter may include a position parameter and a type parameter. The position parameter is used to characterize the spatial position of the perspective space in the virtual scene; the type parameter is used to characterize the spatial type of the perspective space. The space type includes a perspective-restricted type and a full-perspective type. That is, at least two perspective spaces displayed in the virtual scene include a perspective-restricted space and a full-perspective space. Further, a group of perspective space parameters is used to characterize the spatial position and spatial type of a perspective space, that is, the server displays a perspective space matching the group of perspective space parameters in the virtual scene according to each parameter in the same group of perspective space parameters.
示例性的,服务端的开发界面上可以显示参数输入窗口,开发人员可以通过在该参数输入窗口输入视角空间参数,定义拟划分的视角空间的参数;服务端的开发界面上也可以显示可移动光标,开发人员也可以通过控制该可移动光标,选定虚拟场景中的目标位置,作为拟划分的视角空间的空间位置;服务端的开发界面上还可以显示候选类型,开发人员可以通过选定某一候选类型,作为拟划分的视角空间的空间类型。选定目标位置或候选类型的具体方式可以是单击、双击或悬停等。For example, a parameter input window may be displayed on the development interface of the server, and the developer may define the parameters of the perspective space to be divided by inputting the perspective space parameters in the parameter input window; a movable cursor may also be displayed on the development interface of the server, and the developer may also select the target position in the virtual scene as the spatial position of the perspective space to be divided by controlling the movable cursor; the development interface of the server may also display candidate types, and the developer may select a candidate type as the spatial type of the perspective space to be divided. The specific method of selecting the target position or candidate type may be single-clicking, double-clicking, or hovering, etc.
在一个具体的实施例中,开发人员可以通过开发界面输入至少两组视角空间参数,服务端响应于开发人员的参数输入操作,触发并响应于视角空间参数输入事件,获取并显示至少两组视角空间参数,然后,分别按照每一组视角空间参数,在虚拟场景中划分并显示与该组视角空间参数匹配的视角空间。最终显示的视角空间包括视角受限空间和全视角空间。In a specific embodiment, a developer can input at least two sets of perspective space parameters through a development interface, and the server responds to the parameter input operation of the developer, triggers and responds to the perspective space parameter input event, obtains and displays at least two sets of perspective space parameters, and then, according to each set of perspective space parameters, divides and displays the perspective space matching the set of perspective space parameters in the virtual scene. The perspective space finally displayed includes the perspective-restricted space and the full perspective space.
上述实施例中,响应于视角空间参数输入事件,在虚拟场景中显示与输入参数匹配的视角空间,开发人员可以根据具体虚拟场景,灵活地进行视角空间的划分,有利于提高划分后得到的视角空间与虚拟场景的匹配度,进而提高基于该视角空间确定的预计算单元格与虚拟场景的匹配度。In the above embodiment, in response to a perspective space parameter input event, a perspective space matching the input parameters is displayed in the virtual scene, and the developer can flexibly divide the perspective space according to the specific virtual scene, which is conducive to improving the matching degree between the perspective space obtained after the division and the virtual scene, and further improving the matching degree between the pre-calculated cells determined based on the perspective space and the virtual scene.
在一些实施例中,视角空间参数包括视角空间的位置参数、类型参数以及形状参数。在该实施例的情形下,按照至少两组视角空间参数,在虚拟场景中显示至少两个视角空间,包括:按照每一组视角空间参数中的位置参数、类型参数以及形状参数,在虚拟场景中显示视角空间。In some embodiments, the perspective space parameters include position parameters, type parameters, and shape parameters of the perspective space. In the case of this embodiment, displaying at least two perspective spaces in the virtual scene according to at least two sets of perspective space parameters includes: displaying the perspective space in the virtual scene according to the position parameters, type parameters, and shape parameters in each set of perspective space parameters.
其中,视角空间的空间位置为位置参数表征的位置,视角空间的空间形状为形状参数表征的形状,视角空间的空间类型为类型参数表征的类型。该空间位置,例如可以是视角空间的重心位置,或者视角空间中某一边界面的中心位置。该形状例如可以是长方体、圆柱体、棱台,或者由开发人员自定义的能够构成封闭空间的不规则形状。示例性地,针对房屋对应的视角受限空间,可以将该视角受限空间的空间形状定义为与该房屋在地面的投影面匹配的形状,例如投影面为圆心,则视角受限空间的空间形状为圆柱体,投影面为长方形,则视角受限空间的空间形状为长方体。具体地,服务端可以按照每一组视角空间参数中的位置参数、类型参数以及形状参数,确定与该组视角空间参数匹配的视角空间的空间位置、空间形状和空间类型,并在虚拟场景中划分并显示该视角空间。Among them, the spatial position of the viewing space is the position represented by the position parameter, the spatial shape of the viewing space is the shape represented by the shape parameter, and the spatial type of the viewing space is the type represented by the type parameter. The spatial position, for example, can be the center of gravity of the viewing space, or the center of a boundary surface in the viewing space. The shape can be, for example, a cuboid, a cylinder, a prism, or an irregular shape that can constitute a closed space customized by the developer. Exemplarily, for the viewing space corresponding to the house, the spatial shape of the viewing space can be defined as a shape that matches the projection surface of the house on the ground, for example, if the projection surface is the center of the circle, the spatial shape of the viewing space is a cylinder, and if the projection surface is a rectangle, the spatial shape of the viewing space is a cuboid. Specifically, the server can determine the spatial position, spatial shape and spatial type of the viewing space that matches the set of viewing space parameters according to the position parameters, type parameters and shape parameters in each set of viewing space parameters, and divide and display the viewing space in the virtual scene.
上述实施例中,视角空间参数包括视角空间的位置参数、类型参数以及形状参数,使 得开发人员可以根据当前虚拟场景的实际情况,确定需要生成预计算单元格的视角空间的空间位置、空间类型和空间形状,能够进一步提高基于划分后得到的视角空间所确定的预计算单元格与虚拟场景的匹配度。In the above embodiment, the viewing angle space parameters include the position parameter, type parameter and shape parameter of the viewing angle space. Developers can determine the spatial position, spatial type and spatial shape of the perspective space where pre-calculated cells need to be generated according to the actual situation of the current virtual scene, which can further improve the matching degree between the pre-calculated cells determined based on the perspective space obtained after division and the virtual scene.
在一些实施例中,预计算单元格显示方法还包括:在视角受限空间和全视角空间存在重叠空间的情况下,对应于重叠空间中的导航网格或静态网格,显示沿虚拟角色的站立方向延伸的多个预计算单元格。In some embodiments, the pre-calculated cell display method further includes: when there is overlapping space between the limited viewing angle space and the full viewing angle space, displaying a plurality of pre-calculated cells extending along the standing direction of the virtual character corresponding to the navigation grid or static grid in the overlapping space.
具体地,由于导航网格用于表征虚拟角色在视角受限空间的可达区域,静态网格用于表征空间中静态对象的对象轮廓,在视角受限空间和全视角空间的重叠空间中,可能同时包含导航网格和静态网格。基于此,在视角受限空间和全视角空间存在重叠空间的情况下,为避免重叠空间中预计算单元格的重复生成,服务端可以对应于重叠空间的导航网格和静态网格中的其中一种网格,显示沿虚拟角色的站立方向延伸的多个预计算单元格。可选地,服务端可以基于重叠空间所关联的视角受限空间和全视角空间各自的优先级,对应于优先级较高的目标视角空间的目标网格,生成并显示沿虚拟角色的站立方向延伸的多个预计算单元格,以覆盖该重叠空间中的目标网格;也可以对应于该重叠空间中的导航网格或静态网格中的任意一种,生成并显示沿虚拟角色的站立方向延伸的多个预计算单元格。Specifically, since the navigation grid is used to represent the reachable area of the virtual character in the perspective-restricted space, and the static grid is used to represent the object outline of the static object in the space, the overlapping space of the perspective-restricted space and the full perspective space may contain both the navigation grid and the static grid. Based on this, in the case where there is an overlapping space between the perspective-restricted space and the full perspective space, in order to avoid repeated generation of pre-calculated cells in the overlapping space, the server can display multiple pre-calculated cells extending along the standing direction of the virtual character corresponding to one of the navigation grids and static grids in the overlapping space. Optionally, the server can generate and display multiple pre-calculated cells extending along the standing direction of the virtual character corresponding to the target grid of the target perspective space with a higher priority based on the respective priorities of the perspective-restricted space and the full perspective space associated with the overlapping space, so as to cover the target grid in the overlapping space; it can also generate and display multiple pre-calculated cells extending along the standing direction of the virtual character corresponding to any one of the navigation grids or static grids in the overlapping space.
上述实施例中,对于视角受限空间和全视角空间的重叠空间,对应于该重叠空间中的导航网格或静态网格显示预计算单元格,可以避免预计算单元格的重复显示,能够在提高预计算单元格与虚拟场景的匹配度的同时,减少内存的浪费。In the above embodiment, for the overlapping space of the limited viewing angle space and the full viewing angle space, the pre-calculated cells are displayed corresponding to the navigation grid or static grid in the overlapping space, which can avoid the repeated display of the pre-calculated cells, improve the matching degree between the pre-calculated cells and the virtual scene, and reduce the waste of memory.
在一个实施例中,在视角受限空间和全视角空间存在重叠空间的情况下,对应于重叠空间中的导航网格或静态网格,显示沿虚拟角色的站立方向延伸的多个预计算单元格,包括:响应于视角空间的优先级参数输入事件,显示视角受限空间和全视角空间各自的优先级参数;若视角受限空间的优先级高于全视角空间的优先级,则对应于视角受限空间和全视角空间的重叠空间中的导航网格,显示沿虚拟角色的站立方向延伸、并覆盖重叠空间的导航网格的多个预计算单元格;若全视角空间的优先级高于视角受限空间的优先级,则对应于重叠空间中的静态网格,显示沿虚拟角色的站立方向延伸、并覆盖重叠空间的静态网格的多个预计算单元格。In one embodiment, when there is overlapping space between the perspective-restricted space and the full perspective space, a plurality of pre-calculated cells extending along the standing direction of the virtual character are displayed corresponding to the navigation mesh or static mesh in the overlapping space, including: in response to a priority parameter input event of the perspective space, the priority parameters of the perspective-restricted space and the full perspective space are displayed; if the priority of the perspective-restricted space is higher than that of the full perspective space, then corresponding to the navigation mesh in the overlapping space of the perspective-restricted space and the full perspective space, a plurality of pre-calculated cells of the navigation mesh extending along the standing direction of the virtual character and covering the overlapping space are displayed; if the priority of the full perspective space is higher than that of the perspective-restricted space, then corresponding to the static mesh in the overlapping space, a plurality of pre-calculated cells of the static mesh extending along the standing direction of the virtual character and covering the overlapping space are displayed.
其中,优先级参数用于表征视角空间的优先级,该优先级参数可以包括空间优先级参数和类型优先级参数中的至少一种,对应地,优先级参数所表征的优先级可以包括空间优先级参数所表征的空间优先级、以及类型优先级参数所表征的类型优先级中的至少一种。该空间优先级参数可以通过视角空间的优先级标识表征,该优先级标识例如可以是数字,且数字的数值越小空间优先级越高。类型优先级参数可以通过类型参数、以及各类型参数各自的类型优先级进行表征,例如视角受限类型的类型优先级高于全视角类型的类型优先级,或者,全视角类型的类型优先级高于视角受限类型的类型优先级。Among them, the priority parameter is used to characterize the priority of the viewing space, and the priority parameter may include at least one of a spatial priority parameter and a type priority parameter. Correspondingly, the priority represented by the priority parameter may include at least one of a spatial priority represented by a spatial priority parameter and a type priority represented by a type priority parameter. The spatial priority parameter can be represented by a priority identifier of the viewing space, and the priority identifier can be, for example, a number, and the smaller the value of the number, the higher the spatial priority. The type priority parameter can be represented by a type parameter and the type priority of each type parameter, for example, the type priority of the viewing angle limited type is higher than the type priority of the full viewing angle type, or the type priority of the full viewing angle type is higher than the type priority of the viewing angle limited type.
示例性的,服务端的开发界面上可以显示优先级参数输入窗口,开发人员可以通过在该优先级参数输入窗口输入优先级参数,定义视角空间的优先级;服务端的开发界面上还可以显示候选优先级参数,开发人员可以通过选定某一候选优先级参数,作为视角空间的优先级参数。在一种可能的实现中,视角空间的命名中包含了优先级参数,开发人员可以通过定义视角空间的名称,确定视角空间的优先级参数。在一种可能的实现中,服务端可以在视角受限空间和全视角空间存在重叠空间的情况下,触发优先级参数输入事件,在开发界面上显示优先级参数输入窗口,由开发人员通过优先级参数输入窗口输入优先级参数,然后,服务端响应于开发人员的参数输入操作,显示输入的视角受限空间和全视角空间各自的优先级参数。Exemplarily, a priority parameter input window may be displayed on the development interface of the server, and the developer may define the priority of the viewing space by inputting the priority parameter in the priority parameter input window; the server development interface may also display candidate priority parameters, and the developer may select a candidate priority parameter as the priority parameter of the viewing space. In a possible implementation, the naming of the viewing space includes the priority parameter, and the developer may determine the priority parameter of the viewing space by defining the name of the viewing space. In a possible implementation, the server may trigger a priority parameter input event when there is overlapping space between the viewing restricted space and the full viewing space, and display the priority parameter input window on the development interface, and the developer may input the priority parameter through the priority parameter input window. Then, the server may respond to the parameter input operation of the developer and display the input priority parameters of the viewing restricted space and the full viewing space.
在一个具体的实施例中,服务端响应于视角空间的优先级参数输入事件,显示视角受限空间和全视角空间各自的优先级参数。然后,服务端针对视角受限空间和全视角空间的重叠空间,根据优先级参数所表征的优先级,对应于优先级较高的视角空间,显示沿虚拟 角色的站立方向延伸的多个预计算单元格。具体在视角受限空间的优先级高于全视角空间的优先级的情况下,对应于视角受限空间和全视角空间的重叠空间中的导航网格,显示沿虚拟角色的站立方向延伸,覆盖重叠空间的导航网格的多个预计算单元格;在全视角空间的优先级高于视角受限空间的优先级的情况下,对应于视角受限空间和全视角空间的重叠空间中的静态网格,显示沿虚拟角色的站立方向延伸、并覆盖重叠空间的静态网格的多个预计算单元格。如图5中,由于视角不受限空间D的优先级低于视角受限空间C,因此在视角受限空间C与视角不受限空间D的重叠空间,未基于该重叠空间中的静态网格显示预计算单元格。In a specific embodiment, the server responds to the priority parameter input event of the viewing space and displays the priority parameters of the viewing space with limited viewing angle and the full viewing angle. Then, for the overlapping space of the viewing space with limited viewing angle and the full viewing angle, the server displays the view along the virtual Multiple pre-calculated cells extending in the standing direction of the character. Specifically, when the priority of the perspective-restricted space is higher than the priority of the full perspective space, the navigation mesh corresponding to the overlapping space of the perspective-restricted space and the full perspective space displays multiple pre-calculated cells of the navigation mesh extending in the standing direction of the virtual character and covering the overlapping space; when the priority of the full perspective space is higher than the priority of the perspective-restricted space, the static mesh corresponding to the overlapping space of the perspective-restricted space and the full perspective space displays multiple pre-calculated cells of the static mesh extending in the standing direction of the virtual character and covering the overlapping space. As shown in Figure 5, since the priority of the perspective-unrestricted space D is lower than that of the perspective-restricted space C, in the overlapping space of the perspective-restricted space C and the perspective-unrestricted space D, the pre-calculated cells based on the static mesh in the overlapping space are not displayed.
需要说明的是,在优先级参数包括空间优先级参数和类型优先级参数的情况下,服务端可以基于空间优先级或类型优先级,确定与重叠空间关联的优先级较高的视角空间,也可以基于空间优先级和类型优先级,确定与重叠空间关联的优先级较高的视角空间。示例性地,服务端可以根据空间优先级和类型优先级各自的权重,通过加权求和确定视角空间的综合优先级,再确定与重叠空间关联的综合优先级较高的视角空间;服务端也可以先根据空间优先级和类型优先级中的其中一个确定优先级较高的选定视角空间,若选定视角空间的数量为多个,再根据空间优先级和类型优先级中的另一个,从各选定视角空间中确定优先级较高的视角空间。It should be noted that, in the case where the priority parameter includes a spatial priority parameter and a type priority parameter, the server may determine a higher priority viewing space associated with the overlapping space based on the spatial priority or the type priority, or may determine a higher priority viewing space associated with the overlapping space based on the spatial priority and the type priority. Exemplarily, the server may determine the comprehensive priority of the viewing space by weighted summation based on the respective weights of the spatial priority and the type priority, and then determine the viewing space associated with the overlapping space with a higher comprehensive priority; the server may also first determine a higher priority selected viewing space based on one of the spatial priority and the type priority, and if there are multiple selected viewing spaces, then determine a higher priority viewing space from each selected viewing space based on the other of the spatial priority and the type priority.
上述实施例中,基于优先级参数所表征的优先级,确定与重叠空间关联的优先级较高的视角空间,进而对应于该视角空间的目标网格显示预计算单元格,开发人员可以根据实际场景的需求定义各视角空间的优先级,有利于提高预计算单元格显示结果的准确性。In the above embodiment, based on the priority represented by the priority parameter, a perspective space with a higher priority associated with the overlapping space is determined, and then the pre-calculated cells are displayed corresponding to the target grid of the perspective space. The developer can define the priority of each perspective space according to the needs of the actual scene, which is conducive to improving the accuracy of the display results of the pre-calculated cells.
在一些实施例中,预计算单元格显示方法还包括:对应于虚拟角色的运动轨迹网格,显示沿虚拟角色的站立方向延伸、并覆盖该运动轨迹网格的多个预计算单元格。In some embodiments, the pre-calculated cell display method further includes: corresponding to the motion track grid of the virtual character, displaying a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the motion track grid.
其中,运动轨迹网格用于表征虚拟角色在虚拟场景中脱离地面运动的运动轨迹。具体地,对于虚拟场景中的过场动画场景,允许虚拟角色脱离地面运动,基于此,服务端可以根据过场动画场景下所允许的脱离地面的运动轨迹,生成虚拟角色的运动轨迹网格,然后,对应于该运动轨迹网格,显示沿虚拟角色的站立方向延伸的多个预计算单元格,以覆盖该运动轨迹网格。The motion track grid is used to represent the motion track of the virtual character moving off the ground in the virtual scene. Specifically, for the cutscene scene in the virtual scene, the virtual character is allowed to move off the ground. Based on this, the server can generate a motion track grid of the virtual character according to the motion track of leaving the ground allowed in the cutscene scene, and then, corresponding to the motion track grid, display a plurality of pre-calculated cells extending along the standing direction of the virtual character to cover the motion track grid.
本实施例中,对应于脱离地面的运动轨迹网格,显示沿虚拟角色的站立方向延伸、并覆盖该运动轨迹网格的多个预计算单元格,可以进一步提高预计算单元格对虚拟场景中虚拟角色的可达区域的覆盖度,进而提高预计算单元格与虚拟场景的匹配度,提高后续虚拟场景的渲染速度。In this embodiment, corresponding to the motion trajectory grid that leaves the ground, multiple pre-calculated cells extending along the standing direction of the virtual character and covering the motion trajectory grid are displayed, which can further improve the coverage of the pre-calculated cells on the reachable area of the virtual character in the virtual scene, thereby improving the matching degree between the pre-calculated cells and the virtual scene, and improving the rendering speed of subsequent virtual scenes.
在一个实施例中,如图7所示,提供了一种预计算单元格显示方法,包括以下步骤:In one embodiment, as shown in FIG7 , a pre-calculated cell display method is provided, comprising the following steps:
步骤S701,响应于空间参数输入事件,显示至少两组视角空间参数;Step S701, in response to a space parameter input event, displaying at least two sets of view space parameters;
其中,视角空间参数包括视角空间的位置参数、类型参数以及形状参数;The viewing space parameters include the position parameters, type parameters and shape parameters of the viewing space;
步骤S702,按照每一组视角空间参数中的位置参数、类型参数以及形状参数,在虚拟场景中显示视角空间;Step S702, displaying the viewing space in the virtual scene according to the position parameter, type parameter and shape parameter in each set of viewing space parameters;
其中,视角空间包括视角受限空间和全视角空间;视角空间的空间位置为位置参数表征的位置,视角空间的空间类型为类型参数表征的类型,视角空间的空间形状为形状参数表征的形状;The viewing space includes a viewing space with limited viewing angle and a full viewing space; the spatial position of the viewing space is the position represented by the position parameter, the spatial type of the viewing space is the type represented by the type parameter, and the spatial shape of the viewing space is the shape represented by the shape parameter;
步骤S703,对应于视角受限空间内第一空间的导航网格和全视角空间内空间的静态网格,显示沿虚拟角色的站立方向延伸,并覆盖该导航网格和该静态网格的多个预计算单元格;Step S703, corresponding to the navigation mesh of the first space in the limited viewing angle space and the static mesh of the space in the full viewing angle space, displaying a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the navigation mesh and the static mesh;
其中,第一空间为视角受限空间内未与全视角空间重叠的空间;第二空间为全视角空间内未与视角受限空间重叠的空间;导航网格,用于表征虚拟角色在视角受限空间的可达区域;静态网格,用于表征空间中静态对象的对象轮廓;The first space is a space in the perspective-restricted space that does not overlap with the full perspective space; the second space is a space in the full perspective space that does not overlap with the perspective-restricted space; the navigation grid is used to represent the reachable area of the virtual character in the perspective-restricted space; the static grid is used to represent the object outline of the static object in the space;
步骤S704,响应于视角空间的优先级参数输入事件,显示视角受限空间和全视角空间 各自的优先级参数;Step S704: In response to the input event of the priority parameter of the viewing space, display the viewing space with limited viewing angle and the full viewing space. The respective priority parameters;
步骤S705,若视角受限空间的优先级高于全视角空间的优先级,则对应于视角受限空间和全视角空间的重叠空间中的导航网格,显示沿虚拟角色的站立方向延伸、并覆盖该重叠空间的导航网格的多个预计算单元格;Step S705, if the priority of the limited viewing angle space is higher than the priority of the full viewing angle space, then corresponding to the navigation grid in the overlapping space of the limited viewing angle space and the full viewing angle space, a plurality of pre-calculated cells of the navigation grid extending along the standing direction of the avatar and covering the overlapping space are displayed;
其中,优先级通过优先级参数表征;Among them, the priority is characterized by a priority parameter;
步骤S706,若全视角空间的优先级高于视角受限空间的优先级,则对应于视角受限空间和全视角空间的重叠空间中的静态网格,显示沿虚拟角色的站立方向延伸、并覆盖该重叠空间的静态网格的多个预计算单元格;Step S706, if the priority of the full view space is higher than the priority of the limited view space, corresponding to the static grid in the overlapping space of the limited view space and the full view space, a plurality of pre-calculated cells of the static grid extending along the standing direction of the avatar and covering the overlapping space are displayed;
步骤S707,对应于虚拟角色的运动轨迹网格,显示沿虚拟角色的站立方向延伸、并覆盖该运动轨迹网格的多个预计算单元格;Step S707, corresponding to the motion track grid of the virtual character, displaying a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the motion track grid;
其中,运动轨迹网格用于表征虚拟角色在虚拟场景中脱离地面运动的运动轨迹。The motion trajectory grid is used to represent the motion trajectory of the virtual character moving away from the ground in the virtual scene.
在一些实施例中,如图8所示,本申请还提供了一种预计算单元格生成方法,以该方法应用于图1中的服务端104为例进行说明,包括以下步骤:In some embodiments, as shown in FIG8 , the present application further provides a pre-calculated cell generation method, which is described by taking the method applied to the server 104 in FIG1 as an example, and includes the following steps:
步骤S802,获取针对虚拟角色所在虚拟场景的视角空间参数,确定虚拟场景中的视角受限空间和全视角空间。Step S802, obtaining the perspective space parameters of the virtual scene where the virtual character is located, and determining the perspective restricted space and the full perspective space in the virtual scene.
其中,关于虚拟角色、虚拟场景、视角空间参数、视角受限空间和全视角空间等的限定参见上文。具体地,服务端可以获取针对虚拟角色所在虚拟场景的视角空间参数,在虚拟场景中确定视角受限空间和全视角空间。For the definition of virtual characters, virtual scenes, perspective space parameters, perspective-restricted space and full perspective space, please refer to the above. Specifically, the server can obtain the perspective space parameters of the virtual scene where the virtual character is located, and determine the perspective-restricted space and full perspective space in the virtual scene.
服务端在虚拟场景中确定视角受限空间和全视角空间的具体方式并不唯一。例如,可以由开发人员确定视角空间的参数,并将视角空间参数输入服务端,由服务端按照输入的参数在虚拟场景中确定视角受限空间和全视角空间;也可以由开发人员通过拖动鼠标在虚拟场景中绘制出视角受限空间和全视角空间各自对应的线框;还可以由服务端根据虚拟场景的场景组成元素的可达范围属性参数,确定虚拟场景中所包含的视角受限元素和全视角元素,进而在虚拟场景中确定包含视角受限元素的视角受限空间、以及包含全视角元素的全视角空间。The specific method for the server to determine the perspective-restricted space and the full perspective space in the virtual scene is not unique. For example, the developer can determine the parameters of the perspective space and input the perspective space parameters to the server, and the server can determine the perspective-restricted space and the full perspective space in the virtual scene according to the input parameters; the developer can also draw the wireframes corresponding to the perspective-restricted space and the full perspective space in the virtual scene by dragging the mouse; the server can also determine the perspective-restricted elements and the full perspective elements contained in the virtual scene according to the reachable range attribute parameters of the scene composition elements of the virtual scene, and then determine the perspective-restricted space containing the perspective-restricted elements and the full perspective space containing the full perspective elements in the virtual scene.
步骤S804,根据视角受限空间和全视角空间在虚拟场景中各自的位置,确定视角受限空间内未与全视角空间重叠的第一空间、以及全视角空间内未与视角受限空间重叠的第二空间。Step S804: Determine a first space in the limited viewing angle space that does not overlap with the full viewing angle space and a second space in the full viewing angle space that does not overlap with the limited viewing angle space according to respective positions of the limited viewing angle space and the full viewing angle space in the virtual scene.
步骤S806,对应于视角受限空间内第一空间的导航网格,生成沿虚拟角色的站立方向延伸、并覆盖该导航网格的多个预计算单元格。Step S806 , corresponding to the navigation grid of the first space in the viewing angle-limited space, generating a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the navigation grid.
步骤S808,对应于全视角空间内第二空间的静态网格,生成沿虚拟角色的站立方向延伸、并覆盖该静态网格的多个预计算单元格。Step S808 , corresponding to the static grid of the second space in the full-view space, generates a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the static grid.
其中,导航网格,用于表征虚拟角色在视角受限空间的可达区域;静态网格,用于表征空间中静态对象的对象轮廓。预计算单元格是PVS计算的最小计算单位。虚拟角色的站立方向,可以是指左手坐标系中的Z方向。Among them, the navigation mesh is used to represent the reachable area of the virtual character in the space with limited viewing angle; the static mesh is used to represent the object outline of the static object in the space. The pre-calculated cell is the smallest calculation unit of PVS calculation. The standing direction of the virtual character can refer to the Z direction in the left-hand coordinate system.
在一个实施例中,服务端根据视角受限空间和全视角空间在虚拟场景中各自的位置,可以确定视角受限空间内未与全视角空间重叠的第一空间、以及全视角空间内未与视角受限空间重叠的第二空间,然后,对应于视角受限空间内第一空间的导航网格,生成沿虚拟角色的站立方向延伸的多个预计算单元格,以覆盖该第一空间的导航网格;对应于全视角空间内第二空间的静态网格,生成沿虚拟角色的站立方向延伸的多个预计算单元格,以覆盖该第二空间的静态网格。在视角受限空间和全视角空间存在重叠空间的情况下,服务端可以对应于该重叠空间中的导航网格和静态网格,显示沿虚拟角色的站立方向延伸的多个预计算单元格;也可以对应于该重叠空间中的导航网格或静态网格,显示沿虚拟角色的站立方向延伸的多个预计算单元格。In one embodiment, the server can determine the first space in the limited view space that does not overlap with the full view space, and the second space in the full view space that does not overlap with the limited view space, based on the respective positions of the limited view space and the full view space in the virtual scene. Then, corresponding to the navigation grid of the first space in the limited view space, a plurality of pre-calculated cells extending along the standing direction of the virtual character are generated to cover the navigation grid of the first space; corresponding to the static grid of the second space in the full view space, a plurality of pre-calculated cells extending along the standing direction of the virtual character are generated to cover the static grid of the second space. In the case where there is an overlapping space between the limited view space and the full view space, the server can display the plurality of pre-calculated cells extending along the standing direction of the virtual character corresponding to the navigation grid and the static grid in the overlapping space; or can display the plurality of pre-calculated cells extending along the standing direction of the virtual character corresponding to the navigation grid or the static grid in the overlapping space.
可视性单元格的生成算法并不唯一。以第二空间为例,服务端可以以虚拟角色的站立 方向上静态网格的表面网格平面为起始面,沿虚拟角色的站立方向延伸,生成多个预计算单元格;也可以根据虚拟角色的站立方向上静态网格的表面网格平面在虚拟场景中的位置信息、以及预计算单元格参数信息,确定用于覆盖该表面网格平面的多个预计算单元格的起始位置和数量,再对应于该起始位置和数量,生成沿虚拟角色的站立方向延伸的多个预计算单元格。The generation algorithm of visibility cells is not unique. Taking the second space as an example, the server can use the virtual character's standing The surface mesh plane of the static mesh in the standing direction is taken as the starting plane, and is extended along the standing direction of the virtual character to generate multiple pre-calculated cells; the starting positions and quantities of the multiple pre-calculated cells used to cover the surface mesh plane can also be determined according to the position information of the surface mesh plane of the static mesh in the standing direction of the virtual character in the virtual scene, and the pre-calculated cell parameter information, and then the multiple pre-calculated cells extending along the standing direction of the virtual character are generated corresponding to the starting positions and the number.
上述预计算单元格生成方法,获取针对虚拟角色所在虚拟场景的视角空间参数,确定虚拟场景中的视角受限空间和全视角空间;根据视角受限空间和全视角空间在虚拟场景中各自的位置,确定视角受限空间内未与全视角空间重叠的第一空间、以及全视角空间内未与视角受限空间重叠的第二空间;对应于视角受限空间内第一空间的导航网格和全视角空间内第二空间的静态网格,生成沿虚拟角色的站立方向延伸,覆盖第一空间的导航网格、以及第二空间的静态网格的多个预计算单元格。由于静态网格用于表征空间中静态对象的对象轮廓,则静态网格可以相对准确地表征虚拟角色在全视角空间的可达区域,并且,导航网格用于表征虚拟角色在视角受限空间的可达区域,采用上述方法可以提高预计算单元格对虚拟场景下虚拟角色的可达区域的覆盖度,进而提高预计算单元格与虚拟场景的匹配度。The above-mentioned pre-calculated cell generation method obtains the perspective space parameters for the virtual scene where the virtual character is located, determines the perspective restricted space and the full perspective space in the virtual scene; according to the respective positions of the perspective restricted space and the full perspective space in the virtual scene, determines the first space in the perspective restricted space that does not overlap with the full perspective space, and the second space in the full perspective space that does not overlap with the perspective restricted space; corresponding to the navigation grid of the first space in the perspective restricted space and the static grid of the second space in the full perspective space, generates a plurality of pre-calculated cells extending along the standing direction of the virtual character, covering the navigation grid of the first space, and the static grid of the second space. Since the static grid is used to represent the object contour of the static object in the space, the static grid can relatively accurately represent the reachable area of the virtual character in the full perspective space, and the navigation grid is used to represent the reachable area of the virtual character in the perspective restricted space. The above-mentioned method can improve the coverage of the reachable area of the virtual character in the virtual scene by the pre-calculated cell, thereby improving the matching degree between the pre-calculated cell and the virtual scene.
在一些实施例中,步骤S802包括:获取虚拟角色所在虚拟场景中场景组成元素的可达范围属性参数;基于可达范围属性参数以及场景组成元素在虚拟场景中的位置,生成视角空间参数;基于视角空间参数,从虚拟场景中,确定出包含视角受限元素的视角受限空间以及包含全视角元素的全视角空间。In some embodiments, step S802 includes: obtaining the reachable range attribute parameters of the scene component elements in the virtual scene where the virtual character is located; generating the perspective space parameters based on the reachable range attribute parameters and the positions of the scene component elements in the virtual scene; based on the perspective space parameters, determining from the virtual scene the perspective restricted space containing the perspective restricted elements and the full perspective space containing the full perspective elements.
其中,可达范围属性参数用于表征虚拟角色在场景组成元素中的空间可达程度,空间可达程度包括部分空间可达和全部空间可达。开发人员可以通过标定场景组成元素中的可达区域,确定该场景组成元素的可达范围属性参数。The reachable range attribute parameter is used to characterize the spatial reachability of the virtual character in the scene component element, and the spatial reachability includes partial spatial reachability and full spatial reachability. Developers can determine the reachable range attribute parameter of the scene component element by calibrating the reachable area in the scene component element.
视角受限元素的空间可达程度为部分空间可达,也即,视角受限元素所在区域对虚拟角色的运动轨迹存在限制,空间可达程度小于100%。例如,房屋的屋顶和墙壁可以是虚拟角色的不可达区域,街道中的建筑物可以是虚拟角色的不可达区域,桥梁的桥墩、绳索等可以是虚拟角色的不可达区域,因此,房屋、街道和桥梁均为虚拟场景中的视角受限元素。全视角元素的空间可达程度为全部空间可达,也即,全视角元素所在区域对虚拟角色的运动轨迹不进行限制,空间可达程度为100%,虚拟角色可以接触到全视角元素所在区域内所包含的所有静态对象。例如,虚拟角色可以接触到室外空旷地的所有地面元素,包括泥土、草等,则,室外空旷地为虚拟场景中的全视角元素。The spatial accessibility of the perspective-restricted element is partially spatially accessible, that is, the area where the perspective-restricted element is located has restrictions on the movement trajectory of the virtual character, and the spatial accessibility is less than 100%. For example, the roof and walls of a house can be inaccessible areas for the virtual character, the buildings in the street can be inaccessible areas for the virtual character, and the piers and ropes of the bridge can be inaccessible areas for the virtual character. Therefore, the house, street and bridge are all perspective-restricted elements in the virtual scene. The spatial accessibility of the full-perspective element is fully spatially accessible, that is, the area where the full-perspective element is located does not restrict the movement trajectory of the virtual character, the spatial accessibility is 100%, and the virtual character can touch all static objects contained in the area where the full-perspective element is located. For example, the virtual character can touch all ground elements in an outdoor open space, including soil, grass, etc., then the outdoor open space is a full-perspective element in the virtual scene.
可选地,服务端可以通过获取虚拟场景的场景图像,对场景图像进行语义分析和图像识别,确定虚拟场景中所包含的场景组成元素,进而根据各场景组成元素对虚拟角色的运动轨迹限制类型,确定各场景组成元素各自的空间可达程度,将各场景组成元素分为部分空间可达的视角受限元素、以及全部空间可达的全视角元素。然后,服务端再从虚拟场景中,确定出包含视角受限元素的视角受限空间,以及包含全视角元素的全视角空间。Optionally, the server can obtain a scene image of the virtual scene, perform semantic analysis and image recognition on the scene image, determine the scene elements contained in the virtual scene, and then determine the spatial accessibility of each scene element according to the type of restriction on the movement trajectory of the virtual character by each scene element, and divide each scene element into a partially spatially accessible perspective-restricted element and a fully spatially accessible full-perspective element. Then, the server determines the perspective-restricted space containing the perspective-restricted element and the full-perspective space containing the full-perspective element from the virtual scene.
可选地,服务端也可以通过获取虚拟场景的场景数据,并解析该场景数据,确定构建该虚拟场景的过程中所定义的场景组成元素的可达范围属性参数,进而基于各场景组成元素各自的可达范围属性参数,在虚拟场景中确定出视角受限空间和全视角空间。Optionally, the server may also obtain scene data of the virtual scene and parse the scene data to determine the reachable range attribute parameters of the scene component elements defined in the process of constructing the virtual scene, and then determine the perspective-restricted space and the full perspective space in the virtual scene based on the reachable range attribute parameters of each scene component element.
实际应用中,虚拟场景所包含的视角受限元素和全视角元素的形状是变化的,但是视角空间的形状可能是不变的。例如,在一些场景下视角空间被定义为长方体空间。基于此,在确定虚拟场景中所包含的视角受限元素和全视角元素后,服务端可以在虚拟场景中划分出至少包含视角受限区域的视角受限空间、以及至少包含全视角区域的全视角空间。也即,视角受限空间的范围应大于或等于视角受限元素所在的区域,例如图3中,视角受限空间C包含视角受限元素(即房屋A)所在的区域。同样,全视角空间的范围应大于或等于全视角元素,例如图3中,全视角空间D包含全视角元素(即空旷地B)所在的区域。 In actual applications, the shapes of the perspective-restricted elements and full-perspective elements contained in the virtual scene are changing, but the shape of the perspective space may be unchanged. For example, in some scenarios, the perspective space is defined as a rectangular space. Based on this, after determining the perspective-restricted elements and full-perspective elements contained in the virtual scene, the server can divide the virtual scene into a perspective-restricted space that at least includes a perspective-restricted area, and a full-perspective space that at least includes a full-perspective area. That is, the range of the perspective-restricted space should be greater than or equal to the area where the perspective-restricted element is located. For example, in Figure 3, the perspective-restricted space C includes the area where the perspective-restricted element (i.e., house A) is located. Similarly, the range of the full-perspective space should be greater than or equal to the full-perspective element. For example, in Figure 3, the full-perspective space D includes the area where the full-perspective element (i.e., open space B) is located.
上述实施例中,服务端根据虚拟场景中场景组成元素的可达范围属性参数,可以实现视角受限空间和全视角空间的自动划分,有利于提高预计算单元格生成过程的工作效率。In the above embodiment, the server can realize automatic division of the view-restricted space and the full view space according to the reachable range attribute parameters of the scene constituent elements in the virtual scene, which is beneficial to improving the working efficiency of the pre-calculated cell generation process.
在一个实施例中,视角空间参数包括类型参数和位置参数。在该实施例的情形下,基于可达范围属性参数以及场景组成元素在虚拟场景中的位置,生成视角空间参数,包括:基于可达范围属性参数,确定视角空间的类型参数;基于场景组成元素在虚拟场景中的位置,确定视角空间的位置参数。In one embodiment, the perspective space parameter includes a type parameter and a position parameter. In the case of this embodiment, the perspective space parameter is generated based on the reachable range attribute parameter and the position of the scene component element in the virtual scene, including: determining the type parameter of the perspective space based on the reachable range attribute parameter; determining the position parameter of the perspective space based on the position of the scene component element in the virtual scene.
其中,类型参数用于表征视角空间的空间类型;空间类型包括视角受限类型和全视角类型。也即,视角空间包括视角受限空间和全视角空间。位置参数用于表征视角空间在虚拟场景中的空间位置。该位置参数可以包括空间端点、空间边界等参数中的至少一项。一方面,服务端可以基于可达范围属性参数,确定视角空间的类型参数,若可达范围属性参数所表征的空间可达程度为部分空间可达,则视角空间的空间类型为视角受限类型;若可达范围属性参数所表征的空间可达程度为全部空间可达,则视角空间的空间类型为全视角类型。另一方面,服务端可以基于场景组成元素在虚拟场景中的位置,确定活动空间的位置参数。Among them, the type parameter is used to characterize the spatial type of the viewing space; the spatial type includes a viewing angle restricted type and a full viewing angle type. That is, the viewing space includes a viewing angle restricted space and a full viewing angle space. The position parameter is used to characterize the spatial position of the viewing space in the virtual scene. The position parameter may include at least one of the parameters such as the spatial endpoint and the spatial boundary. On the one hand, the server can determine the type parameter of the viewing space based on the reachable range attribute parameter. If the spatial accessibility represented by the reachable range attribute parameter is partially reachable, the spatial type of the viewing space is a viewing angle restricted type; if the spatial accessibility represented by the reachable range attribute parameter is fully reachable, the spatial type of the viewing space is a full viewing angle type. On the other hand, the server can determine the position parameter of the activity space based on the position of the scene constituent elements in the virtual scene.
以位置参数为空间边界的情况为例。服务端可以基于场景组成元素在虚拟场景中的元素边界,确定包含该场景组成元素的视角空间的空间边界。其中,元素边界是某一虚拟场景的场景组成元素与该虚拟场景中其他元素的分界面。其他元素例如可以是视角受限元素、全视角元素或零视角元素。该零视角元素如可以是深渊、丛林等虚拟场景中被配置为虚拟角色无法进入的场景组成元素。不同场景组成元素的元素边界可以不同,例如,室内空间的区域边界可以是墙壁,街道的区域边界可以是街道两侧的建筑物,空旷草地的区域边界可以是草地边缘,结冰湖面的区域边界可以是冰块边缘,等等。服务端根据元素边界确定空间边界的具体方式并不唯一。以视角受限空间为例,服务端可以将视角受限元素的元素边界,确定为至少包括该视角受限元素的视角受限空间的空间边界,也即,视角受限空间和视角受限元素的边界重合;也可以将视角受限元素的元素边界向远离视角受限元素的方向移动后得到的更新边界,确定为至少包括该视角受限元素的视角受限空间的空间边界,也即,视角受限元素在视角受限空间内。Take the case where the position parameter is a spatial boundary as an example. The server can determine the spatial boundary of the perspective space containing the scene component element based on the element boundary of the scene component element in the virtual scene. Among them, the element boundary is the interface between the scene component element of a virtual scene and other elements in the virtual scene. Other elements may be, for example, perspective-restricted elements, full-perspective elements, or zero-perspective elements. The zero-perspective element may be a scene component element in a virtual scene such as an abyss or a jungle that is configured as a virtual character that cannot enter. The element boundaries of different scene component elements may be different. For example, the regional boundary of an indoor space may be a wall, the regional boundary of a street may be buildings on both sides of the street, the regional boundary of an open grassland may be the edge of the grassland, and the regional boundary of a frozen lake may be the edge of an ice cube, and so on. The specific way in which the server determines the spatial boundary based on the element boundary is not unique. Taking the perspective restricted space as an example, the server may determine the element boundary of the perspective restricted element as at least including the spatial boundary of the perspective restricted space of the perspective restricted element, that is, the boundary of the perspective restricted space and the perspective restricted element coincides; or the server may determine the updated boundary obtained by moving the element boundary of the perspective restricted element away from the perspective restricted element as at least including the spatial boundary of the perspective restricted space of the perspective restricted element, that is, the perspective restricted element is within the perspective restricted space.
本实施例中,基于可达范围属性参数,确定视角空间的类型参数,基于场景组成元素在虚拟场景中的位置,确定视角空间的位置参数,可以提高基于划分后得到的视角空间所确定的预计算单元格与虚拟场景的匹配度。In this embodiment, the type parameters of the viewing space are determined based on the reachable range attribute parameters, and the position parameters of the viewing space are determined based on the positions of the scene constituent elements in the virtual scene. This can improve the matching degree between the pre-calculated cells determined based on the viewing space obtained after division and the virtual scene.
如前文所述的,针对重叠空间,服务端可以基于重叠空间所关联的视角受限空间和全视角空间各自的优先级,对应于优先级较高的目标视角空间的目标网格,生成沿虚拟角色的站立方向延伸的多个预计算单元格、并覆盖该重叠空间中的目标网格。基于此,针对重叠空间,服务端还需要对该重叠空间所关联的视角受限空间和全视角空间进行去重处理,以得到视角空间去重的预计算可视性空间,便于后续在预计算可视性空间中生成预计算单元格。As mentioned above, for overlapping spaces, the server can generate multiple pre-calculated cells extending along the standing direction of the virtual character and covering the target grid in the overlapping space, based on the respective priorities of the perspective-restricted space and the full perspective space associated with the overlapping space, corresponding to the target grid of the target perspective space with a higher priority. Based on this, for overlapping spaces, the server also needs to deduplicate the perspective-restricted space and the full perspective space associated with the overlapping space to obtain a pre-calculated visibility space with deduplication of the perspective space, so as to facilitate the subsequent generation of pre-calculated cells in the pre-calculated visibility space.
在一些实施例中,预计算单元格生成方法还包括:在视角受限空间和全视角空间存在重叠空间的情况下,获取视角受限空间和全视角空间各自的优先级参数;基于各优先级参数各自表征的优先级,从视角受限空间和全视角空间中确定优先级最高的目标视角空间、以及除目标视角空间以外的非目标视角空间;从非目标视角空间删除重叠空间所在的空间,得到视角空间去重的预计算可视性空间,以在预计算可视性空间中生成预计算单元格。In some embodiments, the pre-calculated cell generation method also includes: in the case where there is overlapping space between the perspective restricted space and the full perspective space, obtaining priority parameters of the perspective restricted space and the full perspective space respectively; based on the priorities represented by each priority parameter, determining the target perspective space with the highest priority and the non-target perspective space other than the target perspective space from the perspective restricted space and the full perspective space; deleting the space where the overlapping space is located from the non-target perspective space to obtain a pre-calculated visibility space with the perspective space deduplicated, so as to generate pre-calculated cells in the pre-calculated visibility space.
其中,预计算可视性空间是预计算可视性体积所表征的空间范围。关于优先级参数的具体限定参见上文。为便于理解,下面均以视角受限类型的类型优先级高于全视角类型的类型优先级为例进行说明。可选地,同一虚拟场景下的多个视角受限空间的类型优先级参数相同,空间优先级参数可以相同,也可以不相同。类似的,同一虚拟场景下的多个全视角空间的类型优先级参数相同,空间优先级参数可以相同,也可以不相同。例如,全视角 空间D1的空间优先级为1级,类型优先级为2级;全视角空间D2的空间优先级为2级,类型优先级为2级;视角受限空间C1的空间优先级为2级,类型优先级为1级。Among them, the pre-calculated visibility space is the spatial range represented by the pre-calculated visibility volume. For the specific definition of the priority parameter, please refer to the above. For ease of understanding, the following explanation is given by taking the example that the type priority of the perspective-restricted type is higher than the type priority of the full-perspective type. Optionally, the type priority parameters of multiple perspective-restricted spaces in the same virtual scene are the same, and the spatial priority parameters may be the same or different. Similarly, the type priority parameters of multiple full-perspective spaces in the same virtual scene are the same, and the spatial priority parameters may be the same or different. For example, the full-perspective The spatial priority of space D1 is level 1, and the type priority is level 2; the spatial priority of full-view space D2 is level 2, and the type priority is level 2; the spatial priority of limited-view space C1 is level 2, and the type priority is level 1.
在一个具体的应用中,视角空间的命名中可以包含优先级参数,开发人员可以通过定义视角空间的名称,确定视角空间的优先级参数。示例性的,视角空间的名称可以包括CustomName、GenerateType和Pri等字段。其中,CustomName用于承载开发人员的用户名;GenerateType用于承载与空间类型匹配的网格类型,包括视角受限空间的导航网格(NavMesh)、以及全视角空间的静态网格(StaticMesh);Pri用于承载空间优先级,可以通过0、1、2等数字标识。例如,全视角空间“Demo_StaticMesh_1”的空间优先级为1级,类型优先级为2级;视角受限空间“Demo_NavMesh_1”的空间优先级为1级,类型优先级为1级。In a specific application, the naming of the perspective space may include a priority parameter, and the developer can determine the priority parameter of the perspective space by defining the name of the perspective space. Exemplarily, the name of the perspective space may include fields such as CustomName, GenerateType, and Pri. Among them, CustomName is used to carry the developer's user name; GenerateType is used to carry the mesh type that matches the space type, including the navigation mesh (NavMesh) of the perspective-restricted space, and the static mesh (StaticMesh) of the full perspective space; Pri is used to carry the space priority, which can be identified by numbers such as 0, 1, and 2. For example, the space priority of the full perspective space "Demo_StaticMesh_1" is level 1, and the type priority is level 2; the space priority of the perspective-restricted space "Demo_NavMesh_1" is level 1, and the type priority is level 1.
在一个实施例中,在视角受限空间和全视角空间存在重叠空间的情况下,服务端可以响应于视角空间的优先级参数输入事件,获取视角受限空间和全视角空间各自的优先级参数;也可以通过读取视角空间的命名,获取视角受限空间和全视角空间各自的优先级参数。在获取优先级参数后,服务端再基于各优先级参数各自表征的优先级,从视角受限空间和全视角空间中确定优先级最高的目标视角空间、以及除目标视角空间以外的非目标视角空间。从非目标视角空间删除重叠空间所在的空间,得到视角空间去重的预计算可视性空间,以在预计算可视性空间中生成预计算单元格。In one embodiment, when there is overlapping space between the view-restricted space and the full view space, the server can obtain the priority parameters of the view-restricted space and the full view space in response to the priority parameter input event of the view space; or obtain the priority parameters of the view-restricted space and the full view space by reading the name of the view space. After obtaining the priority parameters, the server determines the target view space with the highest priority and the non-target view space other than the target view space from the view-restricted space and the full view space based on the priorities represented by each priority parameter. The space where the overlapping space is located is deleted from the non-target view space to obtain the pre-calculated visibility space with the view space deduplicated, so as to generate a pre-calculated cell in the pre-calculated visibility space.
示例性的,服务端可以在构成非目标视角空间的多个子空间中,删除与重叠空间重合的重合子空间。如图9所示,对于全视角空间“Demo_StaticMesh_0”和视角受限空间“Demo_NavMesh_0”的重叠空间H,由于全视角空间“Demo_StaticMesh_0”和视角受限空间“Demo_NavMesh_0”的空间优先级相同,视角受限空间“Demo_NavMesh_0”的类型优先级高于全视角空间“Demo_StaticMesh_0”的类型优先级,因此,视角受限空间“Demo_NavMesh_0”为对应于重叠空间H的目标视角空间,需要删除全视角空间“Demo_StaticMesh_0”中与重叠空间H重合的重合子空间。Exemplarily, the server can delete the overlapping subspaces that overlap with the overlapping space from among the multiple subspaces constituting the non-target viewing space. As shown in FIG9 , for the overlapping space H of the full viewing space “Demo_StaticMesh_0” and the viewing restricted space “Demo_NavMesh_0”, since the full viewing space “Demo_StaticMesh_0” and the viewing restricted space “Demo_NavMesh_0” have the same spatial priority, and the type priority of the viewing restricted space “Demo_NavMesh_0” is higher than the type priority of the full viewing space “Demo_StaticMesh_0”, the viewing restricted space “Demo_NavMesh_0” is the target viewing space corresponding to the overlapping space H, and the overlapping subspaces that overlap with the overlapping space H in the full viewing space “Demo_StaticMesh_0” need to be deleted.
上述实施例中,对于重叠空间,基于与该重叠空间关联的各视角空间各自的优先级,确定各视角空间中优先级最高的目标视角空间,从非目标视角空间删除重叠空间所在的空间,得到视角空间去重的预计算可视性空间,以在预计算可视性空间中生成预计算单元格,可以确保后续在重叠空间不会重复生成预计算单元格,进而降低PVS计算结果的内存占用量。In the above embodiment, for the overlapping space, based on the respective priorities of the perspective spaces associated with the overlapping space, the target perspective space with the highest priority among the perspective spaces is determined, and the space where the overlapping space is located is deleted from the non-target perspective space to obtain the pre-calculated visibility space with deduplication of the perspective space, so as to generate pre-calculated cells in the pre-calculated visibility space, which can ensure that the pre-calculated cells will not be repeatedly generated in the overlapping space subsequently, thereby reducing the memory usage of the PVS calculation result.
需要说明的是,在优先级参数包括空间优先级参数和类型优先级参数的情况下,服务端可以基于优先级参数所表征的空间优先级和类型优先级,确定优先级最高的目标视角空间。示例性地,服务端可以根据空间优先级和类型优先级各自的权重,通过加权求和确定各视角空间各自的综合优先级,进而确定综合优先级最高的目标视角空间;服务端也可以先根据空间优先级和类型优先级中的其中一个,先确定空间优先级或类型优先级最高的选定视角空间,若选定视角空间的数量为多个,再根据空间优先级和类型优先级中的另一个,从各选定视角空间中确定目标视角空间。It should be noted that, in the case where the priority parameter includes a spatial priority parameter and a type priority parameter, the server can determine the target perspective space with the highest priority based on the spatial priority and type priority represented by the priority parameter. Exemplarily, the server can determine the comprehensive priority of each perspective space by weighted summation according to the weights of the spatial priority and the type priority, and then determine the target perspective space with the highest comprehensive priority; the server can also first determine the selected perspective space with the highest spatial priority or type priority according to one of the spatial priority and the type priority, and if there are multiple selected perspective spaces, then determine the target perspective space from each selected perspective space according to the other of the spatial priority and the type priority.
在一个实施例中,优先级参数包括空间优先级参数和类型优先级参数;优先级包括空间优先级参数所表征的空间优先级、以及类型优先级参数所表征的类型优先级。在该实施例的情形下,基于各优先级参数各自表征的优先级,从视角受限空间和全视角空间中确定优先级最高的目标视角空间,包括:确定视角受限空间和全视角空间中空间优先级最高的选定视角空间;若选定视角空间的数量为一个,则将该选定视角空间确定为目标视角空间;若该选定视角空间的数量为多个,则从各选定视角空间中确定类型优先级最高的目标视角空间。In one embodiment, the priority parameter includes a spatial priority parameter and a type priority parameter; the priority includes a spatial priority represented by the spatial priority parameter, and a type priority represented by the type priority parameter. In the case of this embodiment, based on the priorities represented by each priority parameter, a target viewing space with the highest priority is determined from the viewing restricted space and the full viewing space, including: determining a selected viewing space with the highest spatial priority from the viewing restricted space and the full viewing space; if the number of the selected viewing spaces is one, determining the selected viewing space as the target viewing space; if the number of the selected viewing spaces is multiple, determining the target viewing space with the highest type priority from each selected viewing space.
如前文所述的,在同一虚拟场景中,视角受限空间和全视角空间各自的数量,可以是一个,也可以是多个,且各视角受限空间和各全视角空间中的任意两个视角空间,均可以 存在重叠空间。也即,针对某一重叠空间,可能同时关联至少两个视角受限空间,或者,同时关联至少两个全视角空间。具体到本申请,同一重叠空间至少关联两个视角空间,且该重叠空间所关联的各视角空间中,包括至少一个视角受限空间、以及至少一个全视角空间。As mentioned above, in the same virtual scene, the number of the perspective-restricted space and the number of the full perspective space can be one or more, and any two perspective spaces in each perspective-restricted space and each full perspective space can be There is an overlapping space. That is, for a certain overlapping space, at least two perspective-restricted spaces may be associated at the same time, or at least two full perspective spaces may be associated at the same time. Specifically in this application, the same overlapping space is associated with at least two perspective spaces, and each perspective space associated with the overlapping space includes at least one perspective-restricted space and at least one full perspective space.
具体地,服务端可以先进行空间优先级的判别,确定视角受限空间和全视角空间中空间优先级最高的选定视角空间,若选定视角空间的数量为一个,则将该选定视角空间确定为目标视角空间。示例性的,针对全视角空间“Demo_StaticMesh_2”、视角受限空间“Demo_NavMesh_2”和全视角空间“Demo_StaticMesh_1”的重叠空间,将空间优先级最高的全视角空间“Demo_StaticMesh_1”确定为目标视角空间。进一步地,由于各视角空间的空间优先级可能相同,因此,存在空间优先级最高的选定视角空间的数量大于一个的情况。此时,服务端再进行类型优先级的判别,从各选定视角空间中确定类型优先级最高的目标视角空间。示例性的,针对全视角空间“Demo_StaticMesh_1”、视角受限空间“Demo_NavMesh_1”和全视角空间“Demo_StaticMesh_2”的重叠空间,空间优先级最高的选定视角空间包括全视角空间“Demo_StaticMesh_1”和视角受限空间“Demo_NavMesh_1”,将二者中类型优先级较高的视角受限空间“Demo_NavMesh_1”确定为目标视角空间。Specifically, the server may first distinguish the spatial priority, determine the selected perspective space with the highest spatial priority among the perspective-restricted space and the full perspective space, and if the number of selected perspective spaces is one, determine the selected perspective space as the target perspective space. Exemplarily, for the overlapping space of the full perspective space "Demo_StaticMesh_2", the perspective-restricted space "Demo_NavMesh_2" and the full perspective space "Demo_StaticMesh_1", the full perspective space "Demo_StaticMesh_1" with the highest spatial priority is determined as the target perspective space. Furthermore, since the spatial priorities of each perspective space may be the same, there is a situation where the number of selected perspective spaces with the highest spatial priority is greater than one. At this point, the server then distinguishes the type priority, and determines the target perspective space with the highest type priority from each selected perspective space. Exemplarily, for the overlapping space of the full perspective space "Demo_StaticMesh_1", the perspective restricted space "Demo_NavMesh_1" and the full perspective space "Demo_StaticMesh_2", the selected perspective space with the highest spatial priority includes the full perspective space "Demo_StaticMesh_1" and the perspective restricted space "Demo_NavMesh_1", and the perspective restricted space "Demo_NavMesh_1" with a higher type priority among the two is determined as the target perspective space.
需要说明的是,若选定视角空间中最高类型优先级的视角空间的数量为多个,例如,在视角受限空间的类型优先级高于全视角空间的类型优先级的情况下,选定视角空间中包括多个视角受限空间。由于这些视角空间的空间类型相同,在重叠空间中所包含的与空间类型对应的网格完全一致,因此,在该重叠空间中对应于这些视角空间中的任意一个所生成的预计算单元格也相同,基于此,服务端可以将这些视角空间中的任意一个确定为目标视角空间。It should be noted that if there are multiple view spaces with the highest type priority in the selected view space, for example, when the type priority of the view-restricted space is higher than the type priority of the full view space, the selected view space includes multiple view-restricted spaces. Since these view spaces have the same space type, the grids corresponding to the space type contained in the overlapping space are completely consistent, so the pre-calculated cells generated corresponding to any one of these view spaces in the overlapping space are also the same. Based on this, the server can determine any one of these view spaces as the target view space.
本实施例中,从空间优先级和类型优先级等多个维度确定目标视角空间,可以提高目标视角空间的确定结果的准确性,进而提高基于目标视角空间的网格所生成的重叠空间的预计算单元格的准确性。In this embodiment, determining the target perspective space from multiple dimensions such as spatial priority and type priority can improve the accuracy of the determination result of the target perspective space, and further improve the accuracy of the pre-calculated cells of the overlapping space generated based on the grid of the target perspective space.
如前文所述的,针对与同一重叠空间中关联的各视角空间中的非目标视角空间,可以从非目标视角空间删除重叠空间所在的空间,以避免冲突。在一个实施例中,从非目标视角空间删除重叠空间所在的空间,包括:基于重叠空间和非目标视角空间在虚拟场景中各自的位置,确定重叠空间的边界面在非目标视角空间中的延伸面;基于该延伸面拆分非目标视角空间,得到非目标视角空间对应的多个非目标子空间;删除各非目标子空间中与重叠空间重合的重合子空间。As described above, for non-target perspective spaces in each perspective space associated with the same overlapping space, the space where the overlapping space is located can be deleted from the non-target perspective space to avoid conflict. In one embodiment, deleting the space where the overlapping space is located from the non-target perspective space includes: determining an extension surface of a boundary surface of the overlapping space in the non-target perspective space based on respective positions of the overlapping space and the non-target perspective space in the virtual scene; splitting the non-target perspective space based on the extension surface to obtain a plurality of non-target subspaces corresponding to the non-target perspective space; and deleting the overlapping subspaces in each non-target subspace that overlap with the overlapping space.
可选地,服务端可以基于重叠空间和非目标视角空间在虚拟场景中各自的位置,确定重叠空间的边界面在非目标视角空间中的延伸面。若确定的延伸面包括重叠空间的所有边界面的延伸面,则服务端可以基于该延伸面拆分非目标视角空间,得到非目标视角空间对应的多个非目标子空间,并删除各非目标子空间中与重叠空间重合的重合子空间。若确定的延伸面包括重叠空间的一部分边界面的延伸面,则服务端可以基于确定的延伸面、以及各边界面中与延伸面不共面的另一部分边界面,拆分非目标视角空间,得到非目标视角空间对应的多个非目标子空间,并删除各非目标子空间中与重叠空间重合的重合子空间。Optionally, the server can determine the extension surface of the boundary surface of the overlapping space in the non-target perspective space based on the respective positions of the overlapping space and the non-target perspective space in the virtual scene. If the determined extension surface includes the extension surface of all boundary surfaces of the overlapping space, the server can split the non-target perspective space based on the extension surface to obtain multiple non-target subspaces corresponding to the non-target perspective space, and delete the overlapping subspaces in each non-target subspace that overlap with the overlapping space. If the determined extension surface includes the extension surface of a part of the boundary surface of the overlapping space, the server can split the non-target perspective space based on the determined extension surface and another part of the boundary surface in each boundary surface that is not coplanar with the extension surface, obtain multiple non-target subspaces corresponding to the non-target perspective space, and delete the overlapping subspaces in each non-target subspace that overlap with the overlapping space.
本实施例中,基于重叠空间的边界面在非目标视角空间中的延伸面,拆分非目标视角空间后再去重,算法简单,有利于提高预计算单元格生成效率。In this embodiment, based on the extended surface of the boundary surface of the overlapping space in the non-target viewing space, the non-target viewing space is split and then deduplication is performed. The algorithm is simple and is conducive to improving the efficiency of pre-calculated cell generation.
在一个具体的应用中,重叠空间为长方体空间。在该实施例的情形下,基于延伸面拆分非目标视角空间,得到非目标视角空间对应的多个非目标子空间,包括:基于重叠空间在非目标视角空间的第一延伸面,拆分非目标视角空间,得到与重叠空间存在重叠的第一重叠子空间、以及与重叠空间不存在重叠的第一独立子空间;基于重叠空间在第一重叠子空间的第二延伸面,拆分第一重叠子空间,得到与重叠空间存在重叠的第二重叠子空间、 以及与重叠空间不存在重叠的第二独立子空间;基于重叠空间垂直于第三坐标轴方向的第三边界面,拆分第二重叠子空间,得到与重叠空间重合的重合子空间、以及与重叠空间不存在重叠的第三独立子空间;将第一独立子空间、第二独立子空间、重合子空间以及第三独立子空间,确定为非目标活动空间对应的多个非目标子空间。In a specific application, the overlapping space is a rectangular space. In the case of this embodiment, the non-target perspective space is split based on the extension surface to obtain multiple non-target subspaces corresponding to the non-target perspective space, including: splitting the non-target perspective space based on the first extension surface of the overlapping space in the non-target perspective space to obtain a first overlapping subspace that overlaps with the overlapping space and a first independent subspace that does not overlap with the overlapping space; splitting the first overlapping subspace based on the second extension surface of the overlapping space in the first overlapping subspace to obtain a second overlapping subspace that overlaps with the overlapping space, and a second independent subspace that does not overlap with the overlapping space; split the second overlapping subspace based on the third boundary surface of the overlapping space perpendicular to the third coordinate axis to obtain an overlapping subspace that overlaps with the overlapping space and a third independent subspace that does not overlap with the overlapping space; determine the first independent subspace, the second independent subspace, the overlapping subspace and the third independent subspace as multiple non-target subspaces corresponding to the non-target activity space.
其中,第一延伸面为重叠空间垂直于第一坐标轴方向的第一边界面的延伸面;第二延伸面为重叠空间垂直于第二坐标轴方向的第二边界面在第一重叠子空间中的延伸面。第一坐标轴、第二坐标轴和第三坐标轴共同构成虚拟场景中的空间坐标系。The first extension surface is an extension surface of the first boundary surface of the overlapping space perpendicular to the first coordinate axis; the second extension surface is an extension surface of the second boundary surface of the overlapping space perpendicular to the second coordinate axis in the first overlapping subspace. The first coordinate axis, the second coordinate axis and the third coordinate axis together constitute a spatial coordinate system in the virtual scene.
具体地,服务端可以基于重叠空间在非目标视角空间的第一延伸面,拆分非目标视角空间,得到与重叠空间存在重叠的第一重叠子空间、以及与重叠空间不存在重叠的第一独立子空间。可以理解,若重叠空间与非目标视角空间垂直于第一坐标轴方向的各边界面中,存在一组共面的边界面,即重叠空间位于非目标视角空间垂直于第一坐标轴方向的边缘,则第一延伸面的数量为一个,第一独立子空间的数量也为一个。若重叠空间位于非目标视角空间的内部,则第一延伸面的数量为两个,基于这两个第一延伸面可以将非目标视角空间拆分成一个重叠子空间和两个独立子空间。Specifically, the server can split the non-target perspective space based on the first extension surface of the overlapping space in the non-target perspective space to obtain a first overlapping subspace that overlaps with the overlapping space and a first independent subspace that does not overlap with the overlapping space. It can be understood that if there is a set of coplanar boundary surfaces in the boundary surfaces of the overlapping space and the non-target perspective space perpendicular to the first coordinate axis, that is, the overlapping space is located at the edge of the non-target perspective space perpendicular to the first coordinate axis, then the number of first extension surfaces is one, and the number of first independent subspaces is also one. If the overlapping space is located inside the non-target perspective space, the number of first extension surfaces is two, and the non-target perspective space can be split into one overlapping subspace and two independent subspaces based on these two first extension surfaces.
然后,服务端再基于重叠空间在第一重叠子空间的第二延伸面,拆分第一重叠子空间,得到与重叠空间存在重叠的第二重叠子空间、以及与重叠空间不存在重叠的第二独立子空间。同样的,若重叠空间与非目标视角空间垂直于第二坐标轴方向的各边界面中,存在一组共面的边界面,即重叠空间位于非目标视角空间垂直于第二坐标轴方向的边缘,则第二延伸面的数量为一个,第二独立子空间的数量也为一个。若重叠空间位于非目标视角空间的内部,则第二延伸面的数量为两个,基于这两个第二延伸面可以将第一重叠子空间拆分成一个重叠子空间和两个独立子空间。Then, the server splits the first overlapping subspace based on the second extension surface of the overlapping space in the first overlapping subspace, and obtains a second overlapping subspace that overlaps with the overlapping space and a second independent subspace that does not overlap with the overlapping space. Similarly, if there is a set of coplanar boundary surfaces in the boundary surfaces between the overlapping space and the non-target perspective space perpendicular to the second coordinate axis, that is, the overlapping space is located at the edge of the non-target perspective space perpendicular to the second coordinate axis, then the number of second extension surfaces is one, and the number of second independent subspaces is also one. If the overlapping space is located inside the non-target perspective space, the number of second extension surfaces is two, and the first overlapping subspace can be split into one overlapping subspace and two independent subspaces based on these two second extension surfaces.
接着,服务端基于重叠空间垂直于第三坐标轴方向的第三边界面,拆分第二重叠子空间,得到与重叠空间重合的重合子空间、以及与重叠空间不存在重叠的第三独立子空间。最后,服务端将第一独立子空间、第二独立子空间、重合子空间以及第三独立子空间,确定为非目标视角空间对应的多个非目标子空间。Next, the server splits the second overlapping subspace based on the third boundary surface of the overlapping space perpendicular to the third coordinate axis to obtain an overlapping subspace that overlaps with the overlapping space and a third independent subspace that does not overlap with the overlapping space. Finally, the server determines the first independent subspace, the second independent subspace, the overlapping subspace, and the third independent subspace as multiple non-target subspaces corresponding to the non-target perspective space.
下面结合图10和图11,以重叠空间位于非目标视角空间内部,且第一坐标轴方向为Z轴方向、第二坐标轴方向为Y轴方向、第三坐标轴方向为X轴方向的情况为例,对非目标视角空间的拆分过程进行说明。如图10所示,重叠空间I位于非目标视角空间J的内部。服务端可以基于重叠空间I中垂直于Z方向的边界面I1和I2在非目标视角空间J内各自的延伸面J1和J2,将非目标视角空间J拆分成与重叠空间I不存在重叠的独立子空间K1和K2,以及与重叠空间I存在重叠的重叠子空间K3。然后,服务端再基于重叠空间I中垂直于Y方向的边界面I3和I4在重叠子空间K3内各自的延伸面J3和J4,将重叠子空间K3拆分成与重叠空间I不存在重叠的独立子空间K31和K32,以及与重叠空间I存在重叠的重叠子空间K33。最后,服务端再基于重叠空间I垂直于X方向的两个边界面,拆分重叠子空间K33,得到与重叠空间I重合的重合子空间K333、以及与重叠空间不存在重叠的独立子空间K331和K332。如图11所示,重叠子空间K33在XY平面上的投影包括五个区域,分别对应五个子空间。也即,通过拆分之后,将非目标视角空间J划分成了七个非目标子空间,其中包括六个独立子空间和一个重合子空间,该重合子空间将会被删除。In the following, in conjunction with FIG. 10 and FIG. 11, the overlapping space is located inside the non-target viewing space, and the first coordinate axis direction is the Z axis direction, the second coordinate axis direction is the Y axis direction, and the third coordinate axis direction is the X axis direction. As shown in FIG. 10, the overlapping space I is located inside the non-target viewing space J. The server can split the non-target viewing space J into independent subspaces K1 and K2 that do not overlap with the overlapping space I, and an overlapping subspace K3 that overlaps with the overlapping space I based on the respective extension surfaces J1 and J2 of the boundary surfaces I1 and I2 perpendicular to the Z direction in the overlapping space I in the non-target viewing space J. Then, the server splits the overlapping subspace K3 into independent subspaces K31 and K32 that do not overlap with the overlapping space I, and an overlapping subspace K33 that overlaps with the overlapping space I based on the respective extension surfaces J3 and J4 of the boundary surfaces I3 and I4 perpendicular to the Y direction in the overlapping space I in the overlapping subspace K3. Finally, the server splits the overlapping subspace K33 based on the two boundary surfaces of the overlapping space I perpendicular to the X direction, and obtains the overlapping subspace K333 that overlaps with the overlapping space I, and the independent subspaces K331 and K332 that do not overlap with the overlapping space. As shown in Figure 11, the projection of the overlapping subspace K33 on the XY plane includes five areas, corresponding to five subspaces respectively. That is, after the splitting, the non-target perspective space J is divided into seven non-target subspaces, including six independent subspaces and one overlapping subspace, which will be deleted.
本实施例中,针对长方体的重叠空间,基于各方向上的延伸面依次进行空间拆分,可以确保拆分后留存的各独立子空间的数量相对较少,便于后续预计算单元格的生成。In this embodiment, for the overlapping space of the cuboid, the space is split in sequence based on the extended surfaces in various directions, which can ensure that the number of independent subspaces remaining after the split is relatively small, which is convenient for the subsequent generation of pre-calculated cells.
在一些实施例中,生成预计算单元格的过程,包括:基于虚拟角色在虚拟场景中的站立方向,确定虚拟场景中目标网格的网格平面;根据网格平面在虚拟场景中的位置信息、以及预计算单元格参数,确定用于覆盖目标网格的多个预计算单元格的单元格位置参数;基于各单元格位置参数,生成沿站立方向上延伸、并覆盖目标网格的多个预计算单元格。 In some embodiments, the process of generating pre-calculated cells includes: determining a grid plane of a target grid in a virtual scene based on a standing direction of a virtual character in the virtual scene; determining cell position parameters of a plurality of pre-calculated cells for covering the target grid according to position information of the grid plane in the virtual scene and pre-calculated cell parameters; and generating a plurality of pre-calculated cells extending along the standing direction and covering the target grid based on the cell position parameters.
其中,目标网格包括视角受限空间内第一空间的导航网格、以及全视角空间内第二空间的静态网格。相邻的各预计算单元格互不重叠。单元格位置参数可以包括单元格起始位置、以及各方向上的预计算单元格的数量,单元格位置参数也可以是每一预计算单元格在虚拟场景中各自的位置信息。该起始位置是指第一个预计算单元格的摆放位置,该数量包括空间坐标系下三个正交方向上的数量,可以理解,确定了预计算单元格的起始位置和数量,相当于确定了需要生成的多个预计算单元格在虚拟场景中的阵列排列方式。Among them, the target grid includes a navigation grid of the first space in the limited viewing angle space, and a static grid of the second space in the full viewing angle space. Adjacent pre-calculated cells do not overlap each other. The cell position parameters may include the starting position of the cell and the number of pre-calculated cells in each direction. The cell position parameters may also be the position information of each pre-calculated cell in the virtual scene. The starting position refers to the placement position of the first pre-calculated cell, and the number includes the number in three orthogonal directions in the spatial coordinate system. It can be understood that determining the starting position and number of pre-calculated cells is equivalent to determining the array arrangement of multiple pre-calculated cells that need to be generated in the virtual scene.
在一个实施例中,服务端可以基于虚拟角色在虚拟场景中的站立方向,确定虚拟场景中目标网格在站立方向上的网格平面。可以理解,这些网格平面是目标网格的表面网格平面,也即,用于表征虚拟角色能够到达并接触的平面的网格,例如,地面网格平面、湖面网格平面或者可以攀爬的墙面网格平面,等等。然后,服务端根据网格平面在虚拟场景中的位置信息、以及预计算单元格参数,确定用于覆盖目标网格的多个预计算单元格的单元格位置参数。最后,服务端基于各单元格位置参数,按照相邻的各预计算单元格互不重叠的原则,生成沿站立方向上延伸、并覆盖目标网格的多个预计算单元格。In one embodiment, the server can determine the grid plane of the target grid in the virtual scene in the standing direction based on the standing direction of the virtual character in the virtual scene. It can be understood that these grid planes are the surface grid planes of the target grid, that is, grids used to characterize the planes that the virtual character can reach and contact, such as ground grid planes, lake grid planes, or climbable wall grid planes, etc. Then, the server determines the cell position parameters of multiple pre-calculated cells used to cover the target grid based on the position information of the grid plane in the virtual scene and the pre-calculated cell parameters. Finally, based on the cell position parameters, the server generates multiple pre-calculated cells that extend along the standing direction and cover the target grid in accordance with the principle that adjacent pre-calculated cells do not overlap.
需要说明的是,对应于同一目标网格,通常存在多个网格平面,如图4中地面的导航网格E中的多个三角面。服务端可以针对目标网格的每一网格平面在虚拟场景中的各自位置信息、以及预计算单元格参数,分别确定用于覆盖每一网格平面的预计算单元格,进而获得覆盖目标网格的多个预计算单元格。覆盖目标网格的多个预计算单元格,也即覆盖目标网格的所有网格平面的多个预计算单元格。It should be noted that, corresponding to the same target grid, there are usually multiple grid planes, such as the multiple triangular faces in the ground navigation grid E in FIG4 . The server can determine the pre-calculated cells used to cover each grid plane according to the respective position information of each grid plane of the target grid in the virtual scene and the pre-calculated cell parameters, and then obtain multiple pre-calculated cells covering the target grid. The multiple pre-calculated cells covering the target grid are the multiple pre-calculated cells covering all grid planes of the target grid.
上述实施例中,先确定目标网格的网格平面,再基于网格平面的位置信息、以及预计算单元格参数,确定用于覆盖目标网格的多个预计算单元格的单元格位置参数,再生产互不重叠的覆盖目标网格的多个预计算单元格,可以避免PVS数据的重复计算,有利于提高数据处理效率。In the above embodiment, the grid plane of the target grid is first determined, and then based on the position information of the grid plane and the pre-calculated cell parameters, the cell position parameters of multiple pre-calculated cells used to cover the target grid are determined, and multiple pre-calculated cells covering the target grid that do not overlap are reproduced, which can avoid repeated calculation of PVS data and is conducive to improving data processing efficiency.
在一些实施例中,预计算单元格参数包括预计算单元格的栅格构成、以及用于构成预计算单元格的各栅格在虚拟场景中各自的栅格位置。在该实施例的情形下,根据网格平面在虚拟场景中的位置信息、以及预计算单元格参数,确定用于覆盖目标网格的多个预计算单元格的起始位置和数量,包括:基于网格平面在虚拟场景中的位置信息,确定网格平面在虚拟场景的任一坐标平面的平面投影区域、以及网格平面垂直于该坐标平面的高度区间;根据各栅格在虚拟场景中各自的栅格位置,确定各栅格中与该平面投影区域和该高度区间匹配的目标栅格;根据各目标栅格在虚拟场景中的位置、以及预计算单元格的栅格构成,确定用于覆盖目标网格的多个预计算单元格的起始位置和数量。In some embodiments, the pre-calculated cell parameters include the grid composition of the pre-calculated cell and the respective grid positions of each grid used to constitute the pre-calculated cell in the virtual scene. In the case of this embodiment, according to the position information of the grid plane in the virtual scene and the pre-calculated cell parameters, the starting position and number of multiple pre-calculated cells used to cover the target grid are determined, including: based on the position information of the grid plane in the virtual scene, determining the plane projection area of the grid plane in any coordinate plane of the virtual scene, and the height interval of the grid plane perpendicular to the coordinate plane; according to the respective grid positions of each grid in the virtual scene, determining the target grid in each grid that matches the plane projection area and the height interval; according to the position of each target grid in the virtual scene and the grid composition of the pre-calculated cell, determining the starting position and number of multiple pre-calculated cells used to cover the target grid.
其中,预计算单元格的栅格构成,包括预计算单元格各个方向上的栅格数量和堆叠方式。示例性的,如图12所示,预计算单元格G1可以包括按照2*2*2的方式整齐堆叠的8个栅格,依次为g1-g8(图10中仅示出了g1和g2)。可选地,虚拟场景所在的三维虚拟空间,可以表征成多个栅格构成的空间,且栅格中同一顶点的三条边分别平行于三维虚拟空间的三个坐标轴方向。也即,用于构成预计算单元格的栅格,在虚拟场景中都对应唯一的栅格位置。每一预计算单元格包括各目标栅格中的至少一个。Among them, the grid composition of the pre-calculated cell includes the number and stacking method of the grids in all directions of the pre-calculated cell. Exemplarily, as shown in Figure 12, the pre-calculated cell G1 may include 8 grids neatly stacked in a 2*2*2 manner, namely g1-g8 (only g1 and g2 are shown in Figure 10). Optionally, the three-dimensional virtual space where the virtual scene is located can be characterized as a space composed of multiple grids, and the three edges of the same vertex in the grid are respectively parallel to the three coordinate axis directions of the three-dimensional virtual space. That is, the grids used to constitute the pre-calculated cells correspond to unique grid positions in the virtual scene. Each pre-calculated cell includes at least one of the target grids.
具体地,服务端可以基于网格平面在虚拟场景中的位置信息,确定网格平面在虚拟场景的任一坐标平面的平面投影区域,以及该网格平面在虚拟场景中垂直于该坐标平面的高度区间。该高度区间可以通过高度图描述。高度图是用于描述虚拟场景中网格表面所占据的高度区间的图示,高度图可以通过栅格进行离散化的表达。然后,服务端根据各栅格在虚拟场景中各自的栅格位置,确定各栅格中与该平面投影区域和该高度区间匹配的目标栅格。也即,目标栅格与网格平面在坐标平面的平面投影区域匹配,且目标栅格与网格平面在垂直于该坐标平面的高度区间匹配。目标栅格可以是与网格平面相交、相邻的栅格,也可以是与网格平面之间的距离,小于网格平面垂直于该坐标平面的高度区间的栅格。最后,服务端根据各目标栅格在虚拟场景中的位置、以及预计算单元格的栅格构成,可以确定用 于覆盖目标网格的多个预计算单元格的起始位置和数量。确定的每一预计算单元格包括各目标栅格中的至少一个。Specifically, the server can determine the plane projection area of the grid plane on any coordinate plane of the virtual scene, and the height interval of the grid plane perpendicular to the coordinate plane in the virtual scene based on the position information of the grid plane in the virtual scene. The height interval can be described by a height map. The height map is a diagram used to describe the height interval occupied by the grid surface in the virtual scene, and the height map can be expressed in a discretized manner through a grid. Then, the server determines the target grid in each grid that matches the plane projection area and the height interval based on the grid positions of each grid in the virtual scene. That is, the target grid matches the plane projection area of the grid plane on the coordinate plane, and the target grid matches the grid plane in the height interval perpendicular to the coordinate plane. The target grid can be a grid that intersects and is adjacent to the grid plane, or a grid whose distance to the grid plane is less than the height interval of the grid plane perpendicular to the coordinate plane. Finally, the server can determine the target grid to be used based on the position of each target grid in the virtual scene and the grid composition of the pre-calculated cells. The starting positions and numbers of the plurality of pre-calculated cells covering the target grid are determined. Each pre-calculated cell determined includes at least one of the target grids.
上述实施例中,基于网格平面在任一坐标平面的平面投影区域、以及垂直于该坐标平面的高度区间,确定目标栅格,进而确定至少包括一个目标栅格的,用于覆盖该网格平面所在的目标网格的多个预计算单元格,可以确保预计算单元格对目标网格的覆盖度。In the above embodiment, the target grid is determined based on the plane projection area of the grid plane on any coordinate plane and the height interval perpendicular to the coordinate plane, and then a plurality of pre-calculated cells including at least one target grid for covering the target grid where the grid plane is located are determined, thereby ensuring the coverage of the target grid by the pre-calculated cells.
在一个具体的应用中,根据各栅格在虚拟场景中各自的栅格位置,确定各栅格中与平面投影区域和高度区间匹配的目标栅格,包括:根据各栅格在虚拟场景中各自的栅格位置,确定每一栅格在坐标平面上各自的栅格投影区域;从各栅格投影区域中,确定与平面投影区域的重叠面积满足面积条件的选定栅格投影区域;将虚拟场景中,位于高度区间内的选定栅格确定为目标栅格。In a specific application, a target grid in each grid that matches the plane projection area and the height range is determined according to the respective grid positions of each grid in the virtual scene, including: determining the respective grid projection area of each grid on the coordinate plane according to the respective grid positions of each grid in the virtual scene; determining, from each grid projection area, a selected grid projection area whose overlapping area with the plane projection area satisfies the area condition; and determining the selected grid in the virtual scene that is within the height range as the target grid.
其中,选定栅格在坐标平面上的投影区域为选定栅格投影区域。重叠面积满足面积条件,可以是指重叠面积大于设定面积,或者,重叠面积大于或等于设定面积,也可以是指重叠面积与栅格投影面积的比例大于设定比例,或者,大于或等于设定比例。该面积条件可以由开发人员根据实际场景的需求确定。The projection area of the selected grid on the coordinate plane is the selected grid projection area. The overlapping area satisfies the area condition, which may mean that the overlapping area is greater than the set area, or the overlapping area is greater than or equal to the set area, or the ratio of the overlapping area to the grid projection area is greater than the set ratio, or greater than or equal to the set ratio. The area condition can be determined by the developer according to the needs of the actual scene.
具体地,服务端根据各栅格在虚拟场景中各自的栅格位置,可以确定每一栅格在坐标平面上各自的栅格投影区域。然后,服务端将该栅格投影区域和网格平面的平面投影区域叠加显示,可以确定每一栅格的栅格投影区域与平面投影区域的重叠面积,进而从各栅格投影区域中,确定与平面投影区域的重叠面积满足面积条件的选定栅格投影区域。最后,服务端将虚拟场景中,位于高度区间内的选定栅格确定为目标栅格。示例性的,如图13所示,针对目标网格的某一网格平面,可以将该网格平面投影到XY平面上,以确定该网格平面在XY平面上的选定栅格投影区域,如图13中阴影部分的栅格投影区域,然后,再根据该网格平面在Z方向上的高度区间,从选定投影区域对应的各选定栅格中确定目标栅格。Specifically, the server can determine the grid projection area of each grid on the coordinate plane according to the grid positions of each grid in the virtual scene. Then, the server superimposes and displays the grid projection area and the plane projection area of the grid plane, and can determine the overlapping area of the grid projection area and the plane projection area of each grid, and then determine the selected grid projection area whose overlapping area with the plane projection area meets the area condition from each grid projection area. Finally, the server determines the selected grid in the height range in the virtual scene as the target grid. Exemplarily, as shown in FIG13, for a grid plane of the target grid, the grid plane can be projected onto the XY plane to determine the selected grid projection area of the grid plane on the XY plane, such as the grid projection area of the shaded part in FIG13, and then, according to the height range of the grid plane in the Z direction, the target grid is determined from each selected grid corresponding to the selected projection area.
本实施例中,根据同一坐标平面中栅格投影区域和平面投影区域的重叠面积,确定选定栅格投影区域,再从投影区域为选定栅格投影区域的选定栅格中确定目标栅格,算法简单,有利于提高效率。In this embodiment, the selected grid projection area is determined according to the overlapping area of the grid projection area and the plane projection area in the same coordinate plane, and then the target grid is determined from the selected grids whose projection area is the selected grid projection area. The algorithm is simple and is conducive to improving efficiency.
在一些实施例中,预计算单元格参数包括预计算单元格的栅格构成、以及用于构成该预计算单元格的各栅格在虚拟场景中各自的栅格位置;单元格位置参数包括每一预计算单元格在虚拟场景中各自的单元格位置信息。在该实施例的情形下,根据网格平面在虚拟场景中的位置信息、以及预计算单元格参数,确定用于覆盖所述目标网格的多个预计算单元格的单元格位置参数,包括:基于网格平面在虚拟场景中的位置信息,确定该网格平面在虚拟场景的任意两个坐标平面各自的平面投影区域;针对每一平面投影区域,根据各栅格在虚拟场景中各自的栅格位置,分别确定每一栅格在该平面投影区域所在的坐标平面上各自的栅格投影区域;从各栅格投影区域中,确定与平面投影区域关联的目标栅格投影区域、以及由各目标栅格投影区域共同表征的目标栅格的栅格位置信息;根据各栅格位置信息、以及预计算单元格的栅格构成,确定用于覆盖目标网格的多个预计算单元格中、每一预计算单元格在虚拟场景中各自的单元格位置信息。In some embodiments, the pre-calculated cell parameters include the grid composition of the pre-calculated cell and the grid positions of each grid used to constitute the pre-calculated cell in the virtual scene; the cell position parameters include the cell position information of each pre-calculated cell in the virtual scene. In the case of this embodiment, according to the position information of the grid plane in the virtual scene and the pre-calculated cell parameters, the cell position parameters of multiple pre-calculated cells for covering the target grid are determined, including: based on the position information of the grid plane in the virtual scene, determining the plane projection area of each grid plane in any two coordinate planes of the virtual scene; for each plane projection area, according to the grid positions of each grid in the virtual scene, respectively determining the grid projection area of each grid on the coordinate plane where the plane projection area is located; from each grid projection area, determining the target grid projection area associated with the plane projection area and the grid position information of the target grid jointly represented by each target grid projection area; according to each grid position information and the grid composition of the pre-calculated cell, determining the cell position information of each pre-calculated cell in the virtual scene among the multiple pre-calculated cells for covering the target grid.
其中,每一预计算单元格包括各目标栅格中的至少一个。目标栅格在坐标平面内的栅格投影区域,与该坐标平面内网格平面的平面投影区域相交、相邻或在该平面投影区域内。在一个具体的应用中,目标栅格在坐标平面内的栅格投影区域,与该坐标平面内网格平面的平面投影区域的重叠面积满足面积条件,关于面积条件的具体限定参见上文。Each pre-calculated cell includes at least one of the target grids. The grid projection area of the target grid in the coordinate plane intersects, is adjacent to, or is within the plane projection area of the grid plane in the coordinate plane. In a specific application, the grid projection area of the target grid in the coordinate plane and the overlapping area of the plane projection area of the grid plane in the coordinate plane meet the area condition. For the specific definition of the area condition, see above.
具体地,服务端可以基于网格平面在虚拟场景中的位置信息,确定该网格平面在虚拟场景的任意两个坐标平面各自的平面投影区域。然后,服务端针对每一平面投影区域,根据各栅格在虚拟场景中各自的栅格位置,确定每一栅格在该平面投影区域所在的坐标平面上各自的栅格投影区域。接着,服务端从各栅格投影区域中,确定与平面投影区域关联的 目标栅格投影区域。服务端根据两个坐标平面内各自的目标栅格投影区域,可以确定由各坐标平面各自的目标栅格投影区域共同表征的目标栅格的栅格位置信息。以两个坐标平面为XY平面和XZ平面为例,如图13所示,根据网格平面和各栅格各自在XY平面的投影,可以确定该平面内的目标栅格投影区域,如阴影部分所示,该目标栅格投影区域可以表征目标栅格在X轴方向和Y轴方向上的位置信息。同样的,XZ平面上的目标栅格投影区域可以表征目标栅格在X轴方向和Z轴方向上的位置信息。通过目标栅格在X轴方向上的位置信息,可以建立两个坐标平面上的目标栅格投影区域之间的关联,确定各坐标平面上同一目标栅格的投影区域,这样,就可以确定目标栅格在虚拟场景中的栅格位置信息。最后,服务端可以根据各目标栅格在虚拟场景中各自的栅格位置信息、以及预计算单元格的栅格构成,确定用于覆盖目标网格的多个预计算单元格中、每一预计算单元格在虚拟场景中各自的单元格位置信息。该单元格位置信息用于表征该预计算单元格在X、Y和Z轴方向上各自的位置。Specifically, the server can determine the plane projection area of the grid plane on any two coordinate planes of the virtual scene based on the position information of the grid plane in the virtual scene. Then, for each plane projection area, the server determines the grid projection area of each grid on the coordinate plane where the plane projection area is located according to the grid positions of each grid in the virtual scene. Next, the server determines the grid projection area associated with the plane projection area from each grid projection area. Target grid projection area. The server can determine the grid position information of the target grid represented by the target grid projection areas of each coordinate plane according to the respective target grid projection areas in the two coordinate planes. Taking the two coordinate planes as the XY plane and the XZ plane as an example, as shown in FIG13, the target grid projection area in the plane can be determined according to the grid plane and the projection of each grid on the XY plane. As shown in the shaded part, the target grid projection area can represent the position information of the target grid in the X-axis direction and the Y-axis direction. Similarly, the target grid projection area on the XZ plane can represent the position information of the target grid in the X-axis direction and the Z-axis direction. Through the position information of the target grid in the X-axis direction, the association between the target grid projection areas on the two coordinate planes can be established, and the projection area of the same target grid on each coordinate plane can be determined. In this way, the grid position information of the target grid in the virtual scene can be determined. Finally, the server can determine the cell position information of each pre-calculated cell in the virtual scene among the multiple pre-calculated cells used to cover the target grid according to the grid position information of each target grid in the virtual scene and the grid composition of the pre-calculated cell. The cell position information is used to represent the position of the pre-calculated cell in the X, Y and Z axis directions.
本实施例中,根据网格平面和各栅格分别在任意两个坐标平面中的投影区域,确定多个预计算单元格中每一预计算单元格在虚拟场景中各自的单元格位置信息,对应于网格平面的每一位置,沿虚拟角色的站立方向延伸,都可以确定覆盖该位置的唯一的预计算单元格,可以在确保预计算单元格覆盖网格平面的同时,避免生成多余的预计算单元格,有利于减少内存的占用,提高效率。In this embodiment, the cell position information of each pre-calculated cell in the virtual scene is determined according to the projection areas of the grid plane and each grid in any two coordinate planes respectively. Corresponding to each position of the grid plane, extending along the standing direction of the virtual character, a unique pre-calculated cell covering the position can be determined. While ensuring that the pre-calculated cells cover the grid plane, the generation of redundant pre-calculated cells can be avoided, which is beneficial to reducing memory usage and improving efficiency.
在一些实施例中,如图14所示,提供了一种预计算单元格生成方法,包括以下步骤:In some embodiments, as shown in FIG14 , a method for generating a pre-calculated cell is provided, comprising the following steps:
步骤S1401,获取虚拟角色所在虚拟场景中场景组成元素的可达范围属性参数;Step S1401, obtaining the reachable range attribute parameters of the scene component elements in the virtual scene where the virtual character is located;
其中,可达范围属性参数用于表征虚拟角色在场景组成元素中的空间可达程度,空间可达程度包括部分空间可达和全部空间可达;Among them, the reachable range attribute parameter is used to characterize the spatial reachability of the virtual character in the scene component elements, and the spatial reachability includes partial spatial reachability and full spatial reachability;
步骤S1402,基于可达范围属性参数,确定视角空间的类型参数;基于场景组成元素在虚拟场景中的位置,确定视角空间的位置参数;Step S1402, determining the type parameter of the viewing space based on the reachable range attribute parameter; determining the position parameter of the viewing space based on the position of the scene component elements in the virtual scene;
其中,类型参数用于表征视角空间的空间类型;空间类型包括视角受限类型和全视角类型;位置参数用于表征视角空间在虚拟场景中的空间位置;Among them, the type parameter is used to characterize the spatial type of the viewing space; the spatial type includes the viewing limited type and the full viewing type; the position parameter is used to characterize the spatial position of the viewing space in the virtual scene;
步骤S1403,基于位置参数和类型参数,从虚拟场景中,确定出包含视角受限元素的视角受限空间、以及包含全视角元素的全视角空间;Step S1403, based on the position parameter and the type parameter, determining from the virtual scene a perspective-restricted space including perspective-restricted elements and a full-perspective space including full-perspective elements;
其中,视角受限元素的空间可达程度为部分空间可达;全视角元素的空间可达程度为全部空间可达;Among them, the spatial accessibility of the element with limited viewing angle is partial spatial accessibility; the spatial accessibility of the element with full viewing angle is full spatial accessibility;
步骤S1404,根据视角受限空间和全视角空间在虚拟场景中各自的位置,判断视角受限空间和全视角空间是否存在重叠空间;Step S1404, judging whether there is any overlapping space between the view-limited space and the full view-space according to their respective positions in the virtual scene;
步骤S1405,在视角受限空间和全视角空间不存在重叠空间的情况下,对应于视角受限空间的导航网格和全视角空间的静态网格,生成沿虚拟角色的站立方向延伸,覆盖该导航网格和该静态网格的多个预计算单元格;Step S1405, when there is no overlapping space between the view-limited space and the full view space, corresponding to the navigation mesh of the view-limited space and the static mesh of the full view space, generating a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the navigation mesh and the static mesh;
其中,导航网格,用于表征虚拟角色在视角受限空间的可达区域;静态网格,用于表征空间中静态对象的对象轮廓;Among them, the navigation mesh is used to represent the reachable area of the virtual character in the space with limited viewing angle; the static mesh is used to represent the object outline of the static object in the space;
步骤S1406,在视角受限空间和全视角空间存在重叠空间的情况下,获取视角受限空间和全视角空间各自的优先级参数;Step S1406, when there is an overlapping space between the viewing angle limited space and the full viewing angle space, obtaining priority parameters of the viewing angle limited space and the full viewing angle space respectively;
其中,优先级参数包括空间优先级参数和类型优先级参数;优先级包括空间优先级参数所表征的空间优先级、以及类型优先级参数所表征的类型优先级;The priority parameter includes a space priority parameter and a type priority parameter; the priority includes a space priority represented by the space priority parameter and a type priority represented by the type priority parameter;
步骤S1407,确定视角受限空间和全视角空间中空间优先级最高的选定视角空间;Step S1407, determining a selected viewing angle space with the highest spatial priority among the viewing angle-restricted space and the full viewing angle space;
步骤S1408,若选定视角空间的数量为一个,则将该选定视角空间确定为目标视角空间;若该选定视角空间的数量为多个,则从各选定视角空间中确定类型优先级最高的目标视角空间;Step S1408, if the number of the selected viewing angle spaces is one, then the selected viewing angle space is determined as the target viewing angle space; if the number of the selected viewing angle spaces is multiple, then the target viewing angle space with the highest type priority is determined from among the selected viewing angle spaces;
步骤S1409,基于重叠空间和非目标视角空间在虚拟场景中各自的位置,确定重叠空 间的边界面在非目标视角空间中的延伸面;Step S1409, based on the respective positions of the overlapping space and the non-target viewing space in the virtual scene, determine the overlapping space. The extension surface of the boundary surface between the two in the non-target viewing space;
步骤S1410,基于延伸面拆分目标视角空间,得到非目标视角空间对应的多个非目标子空间;Step S1410, splitting the target viewing angle space based on the extended surface to obtain a plurality of non-target subspaces corresponding to the non-target viewing angle space;
步骤S1411,删除各非目标子空间中与重叠空间重合的重合子空间,得到去重后的更新视角受限空间和更新全视角空间;Step S1411, deleting the overlapping subspaces in each non-target subspace that overlap with the overlapping space, to obtain the updated view-limited space and the updated full view space after deduplication;
步骤S1412,对应于更新视角受限空间的导航网格、以及更新全视角空间的静态网格,生成沿虚拟角色的站立方向延伸、并覆盖该导航网格和该静态网格的多个预计算单元格。Step S1412, corresponding to updating the navigation mesh of the limited viewing angle space and updating the static mesh of the full viewing angle space, generates a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the navigation mesh and the static mesh.
可以理解,在虚拟场景中,通常同时存在视角受限元素和全视角元素。若在划定的预计算可视性体积的范围内,基于静态网格生成PVS的多个预计算单元格,则会在视角受限元素的虚拟角色的不可达区域也生成预计算单元格,造成内存和包体的浪费。例如,图15的左图中,圆台***的装饰物L1为不可达区域,生成的预计算单元格M1为无用单元格。又如,图16的左图中,场景中墙壁上的装饰物件也生成了不必要的单元格。若在划定的预计算可视性体积的范围内,基于导航网格生成PVS的多个预计算单元格,虽然能控制预计算单元格的生成数量,但对于开放世界的场景,又会出现预计算单元格覆盖不全的情况。基于此,本申请中,采用混合策略生成预计算单元格。对应于图3中虚拟角色活动空间受限的房屋内,基于导航网格生成预计算单元格。例如,图15的右图中,只有圆台上覆盖了预计算单元格,避免了在圆台***的装饰物L1等虚拟角色不可达区域生成无效单元格。又如,图16的右图中,只有地面上方覆盖了预计算单元格,避免了在房顶等虚拟角色不可达区域生成无效单元格。而对于房屋外面的空旷地,由于不限制虚拟角色的可达区域,根据地形的静态网格生成预计算单元格。It can be understood that in a virtual scene, there are usually both perspective-restricted elements and full-perspective elements. If multiple pre-calculated cells of PVS are generated based on a static grid within the scope of a pre-calculated visibility volume, pre-calculated cells will also be generated in the unreachable area of the virtual character of the perspective-restricted element, resulting in a waste of memory and package. For example, in the left figure of FIG15, the decoration L1 on the periphery of the truncated cone is an unreachable area, and the generated pre-calculated cell M1 is a useless cell. For another example, in the left figure of FIG16, the decorative objects on the walls of the scene also generate unnecessary cells. If multiple pre-calculated cells of PVS are generated based on a navigation grid within the scope of a pre-calculated visibility volume, although the number of pre-calculated cells generated can be controlled, for open world scenes, the pre-calculated cells will not be fully covered. Based on this, in this application, a hybrid strategy is adopted to generate pre-calculated cells. Corresponding to the house with limited activity space for the virtual character in FIG3, pre-calculated cells are generated based on the navigation grid. For example, in the right picture of Figure 15, only the truncated cone is covered with pre-calculated cells, which avoids the generation of invalid cells in the unreachable areas of the virtual character such as the decoration L1 outside the truncated cone. For another example, in the right picture of Figure 16, only the ground is covered with pre-calculated cells, which avoids the generation of invalid cells in the unreachable areas of the virtual character such as the roof. For the open space outside the house, since there is no restriction on the reachable area of the virtual character, the pre-calculated cells are generated according to the static grid of the terrain.
采用本申请的方案,既能确保预计算单元格对虚拟场景中角色可达区域的覆盖度,又能有效避免无效单元格的生成。将本申请的方案应用于开放大世界的应用场景,由于开发大世界拥有更复杂的美术场景,给玩家提供了广泛的探索空间,是游戏发展的趋势。PVS作为在开发大世界应用的一项重要技术,其关键在于减少虚拟场景中的无效cell生成和增加有效cell的分布,采用本申请的方案可以达到这一目标。进一步地,在一些自由度比较高的玩法中,存在一些较大的区域是不限制虚拟角色的运动轨迹的,即存在非受限场景,此时NavMesh并不能覆盖所有的角色可达区域,可以根据场景中的StaticMesh来生成cell,去覆盖虚拟角色在游戏中所有可能接触到的物件、地形等。此外,将本申请的方案应用于室内和街道等受限场景,虚拟角色在这些地方行走的范围是完全可预知的。具体来说,在多层室内场景里,角色会在每一层楼自由行动,但是一般来说不会攀爬室内的墙壁或者窗户,所以在墙壁或者窗户区域生成的将是无效格子,也会在PVS烘焙期间产生无效的计算。因此在这种场景下,划分出包含室内区域的视角受限空间,并将该视角受限空间的优先级设置为最高即可。The solution of the present application can ensure the coverage of the character's reachable area in the virtual scene by pre-calculated cells, and effectively avoid the generation of invalid cells. The solution of the present application is applied to the application scenario of the open world. Since the development of the large world has more complex art scenes, it provides players with a wide range of exploration space, which is the trend of game development. As an important technology in the development of large world applications, the key of PVS is to reduce the generation of invalid cells in the virtual scene and increase the distribution of valid cells. The solution of the present application can achieve this goal. Furthermore, in some gameplays with relatively high degrees of freedom, there are some larger areas that do not restrict the movement trajectory of the virtual character, that is, there are non-restricted scenes. At this time, NavMesh cannot cover all the character's reachable areas. Cells can be generated according to the StaticMesh in the scene to cover all objects, terrains, etc. that the virtual character may contact in the game. In addition, the solution of the present application is applied to restricted scenes such as indoors and streets, and the range of virtual characters walking in these places is completely predictable. Specifically, in a multi-story indoor scene, characters will move freely on each floor, but generally will not climb indoor walls or windows, so invalid grids will be generated in the wall or window area, which will also produce invalid calculations during PVS baking. Therefore, in this scenario, divide the view-restricted space that includes the indoor area and set the priority of the view-restricted space to the highest.
应该理解的是,虽然如上的各实施例所涉及的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,如上的各实施例所涉及的流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
基于同样的发明构思,本申请实施例还提供了一种用于实现上述所涉及的预计算单元格显示方法的预计算单元格显示装置。该装置所提供的解决问题的实现方案与上述方法中所记载的实现方案相似,故下面所提供的一个或多个预计算单元格显示装置实施例中的具体限定可以参见上文中对于预计算单元格显示方法的限定。Based on the same inventive concept, the embodiment of the present application also provides a pre-calculated cell display device for implementing the pre-calculated cell display method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more pre-calculated cell display device embodiments provided below can refer to the limitations of the pre-calculated cell display method above.
在一些实施例中,如图17所示,提供了一种预计算单元格显示装置1700,包括:视 角空间显示模块1702和预计算单元格显示模块1704,其中:In some embodiments, as shown in FIG. 17 , a pre-calculated cell display device 1700 is provided, comprising: Angle space display module 1702 and pre-calculated cell display module 1704, wherein:
视角空间显示模块1702,用于响应于针对虚拟角色所在虚拟场景触发的视角空间划分事件,在虚拟场景中显示划分的视角受限空间和全视角空间;A viewing space display module 1702 is used to display the divided viewing space and the full viewing space in the virtual scene in response to a viewing space division event triggered for the virtual scene where the virtual character is located;
预计算单元格显示模块1704,用于对应于视角受限空间内第一空间的导航网格,显示沿虚拟角色的站立方向延伸、并覆盖该导航网格的多个预计算单元格,以及,对应于全视角空间内第二空间的静态网格,显示沿虚拟角色的站立方向延伸、并覆盖该静态网格的多个预计算单元格。其中,第一空间为视角受限空间内未与全视角空间重叠的空间;第二空间为全视角空间内未与视角受限空间重叠的空间;导航网格,用于表征虚拟角色在视角受限空间的可达区域;静态网格,用于表征空间中静态对象的对象轮廓。The pre-calculated cell display module 1704 is used to display a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the navigation grid corresponding to the navigation grid of the first space in the view-limited space, and to display a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the static grid corresponding to the static grid of the second space in the full view space. The first space is the space in the view-limited space that does not overlap with the full view space; the second space is the space in the full view space that does not overlap with the view-limited space; the navigation grid is used to represent the reachable area of the virtual character in the view-limited space; and the static grid is used to represent the object outline of the static object in the space.
在一些实施例中,视角空间显示模块1702包括:视角空间参数显示单元,用于响应于空间参数输入事件,显示至少两组视角空间参数;视角空间显示单元,用于按照至少两组视角空间参数,在虚拟场景中显示至少两个视角空间;一组视角空间参数用于表征一个视角空间的空间位置和空间类型;空间类型包括视角受限类型和全视角类型。In some embodiments, the perspective space display module 1702 includes: a perspective space parameter display unit, used to display at least two sets of perspective space parameters in response to a space parameter input event; a perspective space display unit, used to display at least two perspective spaces in a virtual scene according to at least two sets of perspective space parameters; a set of perspective space parameters is used to characterize the spatial position and spatial type of a perspective space; the space type includes a perspective-limited type and a full-perspective type.
在一个实施例中,视角空间参数包括视角空间的位置参数、类型参数以及形状参数。在该实施例的情形下,视角空间显示单元具体用于:按照每一组视角空间参数中的位置参数、类型参数以及形状参数,在虚拟场景中显示视角空间;视角空间的空间位置为位置参数表征的位置,视角空间的空间类型为类型参数表征的类型,视角空间的空间形状为形状参数表征的形状。In one embodiment, the perspective space parameters include the position parameters, type parameters and shape parameters of the perspective space. In the case of this embodiment, the perspective space display unit is specifically used to: display the perspective space in the virtual scene according to the position parameters, type parameters and shape parameters in each group of perspective space parameters; the spatial position of the perspective space is the position represented by the position parameter, the spatial type of the perspective space is the type represented by the type parameter, and the spatial shape of the perspective space is the shape represented by the shape parameter.
在一些实施例中,视角空间显示模块1702还用于:在视角受限空间和全视角空间存在重叠空间的情况下,对应于重叠空间中的导航网格或静态网格,显示沿虚拟角色的站立方向延伸的多个预计算单元格。In some embodiments, the perspective space display module 1702 is also used to: when there is overlapping space between the perspective restricted space and the full perspective space, display multiple pre-calculated cells extending along the standing direction of the virtual character corresponding to the navigation grid or static grid in the overlapping space.
在一个实施例中,视角空间显示模块1702具体用于:响应于视角空间的优先级参数输入事件,显示视角受限空间和全视角空间各自的优先级参数;若视角受限空间的优先级高于全视角空间的优先级,则对应于视角受限空间和全视角空间的重叠空间中的导航网格,显示沿虚拟角色的站立方向延伸、并覆盖重叠空间的导航网格的多个预计算单元格;若全视角空间的优先级高于视角受限空间的优先级,则对应于重叠空间中的静态网格,显示沿虚拟角色的站立方向延伸、并覆盖重叠空间的静态网格的多个预计算单元格。其中,优先级通过优先级参数表征。In one embodiment, the viewing space display module 1702 is specifically used to: in response to the viewing space priority parameter input event, display the priority parameters of the viewing space and the full viewing space; if the priority of the viewing space is higher than the priority of the full viewing space, then corresponding to the navigation grid in the overlapping space of the viewing space and the full viewing space, display multiple pre-calculated cells of the navigation grid extending along the standing direction of the virtual character and covering the overlapping space; if the priority of the full viewing space is higher than the priority of the viewing space, then corresponding to the static grid in the overlapping space, display multiple pre-calculated cells of the static grid extending along the standing direction of the virtual character and covering the overlapping space. The priority is represented by the priority parameter.
在一些实施例中,视角空间显示模块1702还用于:对应于虚拟角色的运动轨迹网格,显示沿虚拟角色的站立方向延伸、并覆盖运动轨迹网格的多个预计算单元格;运动轨迹网格,用于表征虚拟角色在虚拟场景中脱离地面运动的运动轨迹。In some embodiments, the perspective space display module 1702 is also used to: correspond to the motion trajectory grid of the virtual character, display multiple pre-calculated cells extending along the standing direction of the virtual character and covering the motion trajectory grid; the motion trajectory grid is used to represent the motion trajectory of the virtual character moving away from the ground in the virtual scene.
基于同样的发明构思,本申请实施例还提供了一种用于实现上述所涉及的预计算单元格生成方法的预计算单元格生成装置。该装置所提供的解决问题的实现方案与上述方法中所记载的实现方案相似,故下面所提供的一个或多个预计算单元格生成装置实施例中的具体限定可以参见上文中对于预计算单元格生成方法的限定。Based on the same inventive concept, the embodiment of the present application also provides a pre-calculated cell generation device for implementing the pre-calculated cell generation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more pre-calculated cell generation device embodiments provided below can refer to the limitations of the pre-calculated cell generation method above.
在一些实施例中,如图18所示,提供了一种预计算单元格生成装置1800,包括:视角空间确定模块1802、未重叠空间确定模块1804和预计算单元格生成模块1806,其中:In some embodiments, as shown in FIG. 18 , a pre-calculated cell generation device 1800 is provided, comprising: a viewing space determination module 1802, a non-overlapping space determination module 1804, and a pre-calculated cell generation module 1806, wherein:
视角空间确定模块1802,用于获取针对虚拟角色所在虚拟场景的视角空间参数,确定虚拟场景中的视角受限空间和全视角空间;A viewing angle space determination module 1802 is used to obtain viewing angle space parameters for the virtual scene where the virtual character is located, and determine the viewing angle restricted space and the full viewing angle space in the virtual scene;
未重叠空间确定模块1804,用于根据视角受限空间和全视角空间在虚拟场景中各自的位置,确定视角受限空间内未与全视角空间重叠的第一空间、以及全视角空间内未与视角受限空间重叠的第二空间;The non-overlapping space determining module 1804 is used to determine a first space in the perspective-limited space that does not overlap with the full perspective space, and a second space in the full perspective space that does not overlap with the perspective-limited space, according to respective positions of the perspective-limited space and the full perspective space in the virtual scene;
预计算单元格生成模块1806,用于对应于视角受限空间内第一空间的导航网格,生成沿虚拟角色的站立方向延伸、并覆盖该导航网格的多个预计算单元格,以及,对应于全视角空间内第二空间的静态网格,生成沿虚拟角色的站立方向延伸、并覆盖该静态网格的多 个预计算单元格。其中,导航网格,用于表征虚拟角色在视角受限空间的可达区域;静态网格,用于表征空间中静态对象的对象轮廓。The pre-calculated cell generation module 1806 is used to generate a plurality of pre-calculated cells corresponding to the navigation grid of the first space in the limited viewing angle space, extending along the standing direction of the virtual character and covering the navigation grid, and to generate a plurality of pre-calculated cells corresponding to the static grid of the second space in the full viewing angle space, extending along the standing direction of the virtual character and covering the static grid. Pre-computed cells. The navigation mesh is used to represent the reachable area of the virtual character in the space with limited viewing angle; the static mesh is used to represent the object outline of the static object in the space.
在一些实施例中,视角空间确定模块1802包括:可达范围属性参数获取单元,用于获取虚拟角色所在虚拟场景中场景组成元素的可达范围属性参数;可达范围属性参数用于表征虚拟角色在场景组成元素中的空间可达程度,空间可达程度包括部分空间可达和全部空间可达;视角空间参数生成单元,用于基于可达范围属性参数以及场景组成元素在虚拟场景中的位置,生成视角空间参数;视角空间确定单元,用于基于视角空间参数,从虚拟场景中,确定出包含视角受限元素的视角受限空间、以及包含全视角元素的全视角空间;视角受限元素的空间可达程度为部分空间可达;全视角元素的空间可达程度为全部空间可达。In some embodiments, the perspective space determination module 1802 includes: a reachable range attribute parameter acquisition unit, which is used to acquire the reachable range attribute parameters of the scene component elements in the virtual scene where the virtual character is located; the reachable range attribute parameters are used to characterize the spatial reachability of the virtual character in the scene component elements, and the spatial reachability includes partial spatial reachability and full spatial reachability; a perspective space parameter generation unit, which is used to generate perspective space parameters based on the reachable range attribute parameters and the positions of the scene component elements in the virtual scene; a perspective space determination unit, which is used to determine, from the virtual scene based on the perspective space parameters, a perspective restricted space containing perspective restricted elements and a full perspective space containing full perspective elements; the spatial reachability of the perspective restricted elements is partial spatial reachability; the spatial reachability of the full perspective elements is full spatial reachability.
在一个实施例中,视角空间参数包括类型参数和位置参数。在该实施例的情形下,视角空间参数生成单元具体用于:基于可达范围属性参数,确定视角空间的类型参数;类型参数用于表征视角空间的空间类型;空间类型包括视角受限类型和全视角类型;基于场景组成元素在虚拟场景中的位置,确定视角空间的位置参数;位置参数用于表征视角空间在虚拟场景中的空间位置。In one embodiment, the perspective space parameter includes a type parameter and a position parameter. In the case of this embodiment, the perspective space parameter generation unit is specifically used to: determine the type parameter of the perspective space based on the reachable range attribute parameter; the type parameter is used to characterize the space type of the perspective space; the space type includes a perspective-limited type and a full perspective type; determine the position parameter of the perspective space based on the position of the scene component elements in the virtual scene; the position parameter is used to characterize the spatial position of the perspective space in the virtual scene.
在一些实施例中,预计算单元格生成装置1800还包括:优先级参数获取单元,用于在视角受限空间和全视角空间存在重叠空间的情况下,获取视角受限空间和全视角空间各自的优先级参数;目标视角空间确定单元,用于基于各优先级参数各自表征的优先级,从视角受限空间和全视角空间中确定优先级最高的目标视角空间、以及除目标视角空间以外的非目标视角空间;去重单元,用于从非目标视角空间删除重叠空间所在的空间,得到视角空间去重的预计算可视性空间,以在预计算可视性空间中生成多个预计算单元格。In some embodiments, the pre-calculated cell generation device 1800 also includes: a priority parameter acquisition unit, which is used to obtain the priority parameters of the perspective restricted space and the full perspective space respectively when there is overlapping space between the perspective restricted space and the full perspective space; a target perspective space determination unit, which is used to determine the target perspective space with the highest priority and the non-target perspective space other than the target perspective space from the perspective restricted space and the full perspective space based on the priorities represented by each priority parameter; a deduplication unit, which is used to delete the space where the overlapping space is located from the non-target perspective space to obtain a pre-calculated visibility space with deduplication of the perspective space, so as to generate multiple pre-calculated cells in the pre-calculated visibility space.
在一个实施例中,优先级参数包括空间优先级参数和类型优先级参数;优先级包括空间优先级参数所表征的空间优先级、以及类型优先级参数所表征的类型优先级。在该实施例的情形下,目标视角空间确定单元具体用于:确定视角受限空间和全视角空间中空间优先级最高的选定视角空间;若选定视角空间的数量为一个,则将选定视角空间确定为目标视角空间;若选定视角空间的数量为多个,则从各选定视角空间中确定类型优先级最高的目标视角空间。In one embodiment, the priority parameter includes a spatial priority parameter and a type priority parameter; the priority includes a spatial priority represented by the spatial priority parameter and a type priority represented by the type priority parameter. In the case of this embodiment, the target viewing space determination unit is specifically used to: determine a selected viewing space with the highest spatial priority in the viewing restricted space and the full viewing space; if the number of the selected viewing spaces is one, determine the selected viewing space as the target viewing space; if the number of the selected viewing spaces is multiple, determine the target viewing space with the highest type priority from each selected viewing space.
在一个实施例中,去重单元包括:延伸面确定子单元,用于基于重叠空间和非目标视角空间在虚拟场景中各自的位置,确定重叠空间的边界面在非目标视角空间中的延伸面;拆分子单元,用于基于延伸面拆分非目标视角空间,得到非目标视角空间对应的多个非目标子空间;去重子单元,用于删除各非目标子空间中与重叠空间重合的重合子空间。In one embodiment, the deduplication unit includes: an extension surface determination subunit, which is used to determine the extension surface of the boundary surface of the overlapping space in the non-target perspective space based on the respective positions of the overlapping space and the non-target perspective space in the virtual scene; a splitting subunit, which is used to split the non-target perspective space based on the extension surface to obtain multiple non-target subspaces corresponding to the non-target perspective space; and a deduplication subunit, which is used to delete the overlapping subspaces in each non-target subspace that overlap with the overlapping space.
在一个具体的应用中,重叠空间为长方体空间,拆分子单元具体用于:基于重叠空间在非目标视角空间的第一延伸面,拆分非目标视角空间,得到与重叠空间存在重叠的第一重叠子空间、以及与重叠空间不存在重叠的第一独立子空间;第一延伸面为重叠空间垂直于第一坐标轴方向的第一边界面的延伸面;基于重叠空间在第一重叠子空间的第二延伸面,拆分第一重叠子空间,得到与重叠空间存在重叠的第二重叠子空间、以及与重叠空间不存在重叠的第二独立子空间;第二延伸面为重叠空间垂直于第二坐标轴方向的第二边界面的延伸面;基于重叠空间垂直于第三坐标轴方向的第三边界面,拆分第二重叠子空间,得到与重叠空间重合的重合子空间、以及与重叠空间不存在重叠的第三独立子空间;将第一独立子空间、第二独立子空间、重合子空间以及第三独立子空间,确定为非目标视角空间对应的多个非目标子空间。In a specific application, the overlapping space is a rectangular space, and the splitting sub-unit is specifically used to: split the non-target perspective space based on the first extension surface of the overlapping space in the non-target perspective space to obtain a first overlapping subspace that overlaps with the overlapping space and a first independent subspace that does not overlap with the overlapping space; the first extension surface is an extension surface of the first boundary surface of the overlapping space perpendicular to the first coordinate axis; split the first overlapping subspace based on the second extension surface of the overlapping space in the first overlapping subspace to obtain a second overlapping subspace that overlaps with the overlapping space and a second independent subspace that does not overlap with the overlapping space; the second extension surface is an extension surface of the second boundary surface of the overlapping space perpendicular to the second coordinate axis; split the second overlapping subspace based on the third boundary surface of the overlapping space perpendicular to the third coordinate axis to obtain an overlapping subspace that overlaps with the overlapping space and a third independent subspace that does not overlap with the overlapping space; determine the first independent subspace, the second independent subspace, the overlapping subspace and the third independent subspace as multiple non-target subspaces corresponding to the non-target perspective space.
在一些实施例中,预计算单元格生成模块1806包括:网格平面确定单元,用于基于虚拟角色在虚拟场景中的站立方向,确定虚拟场景中目标网格的网格平面;目标网格包括视角受限空间内第一空间的导航网格、以及全视角空间内第二空间的静态网格;单元格位置参数确定单元,用于根据网格平面在虚拟场景中的位置信息、以及预计算单元格参数, 确定用于覆盖目标网格的多个预计算单元格的单元格位置参数;预计算单元格生成单元,用于各单元格位置参数,生成沿站立方向上延伸、并覆盖目标网格的多个预计算单元格;相邻的各预计算单元格互不重叠。In some embodiments, the pre-calculated cell generation module 1806 includes: a grid plane determination unit, which is used to determine the grid plane of the target grid in the virtual scene based on the standing direction of the virtual character in the virtual scene; the target grid includes a navigation grid of a first space in the view-limited space and a static grid of a second space in the full view space; a cell position parameter determination unit, which is used to determine the position information of the grid plane in the virtual scene and the pre-calculated cell parameters, Determine the cell position parameters of multiple pre-calculated cells for covering the target grid; a pre-calculated cell generation unit is used for each cell position parameter to generate multiple pre-calculated cells extending along the standing direction and covering the target grid; adjacent pre-calculated cells do not overlap each other.
在一些实施例中,预计算单元格参数包括预计算单元格的栅格构成、以及用于构成预计算单元格的各栅格在虚拟场景中各自的栅格位置;单元格位置参数包括起始位置和数量。在该实施例的情形下,单元格位置参数确定单元包括:高度区间确定子单元,用于基于网格平面在虚拟场景中的位置信息,确定网格平面在虚拟场景的任一坐标平面的平面投影区域、以及网格平面垂直于坐标平面的高度区间;目标栅格确定子单元,用于根据各栅格在虚拟场景中各自的栅格位置,确定各栅格中与平面投影区域和高度区间匹配的目标栅格;起始位置和数量确定子单元,用于根据各目标栅格在虚拟场景中的位置、以及预计算单元格的栅格构成,确定用于覆盖目标网格的多个预计算单元格的起始位置和数量;每一预计算单元格包括各目标栅格中的至少一个。In some embodiments, the pre-calculated cell parameters include the grid composition of the pre-calculated cell and the grid positions of each grid used to constitute the pre-calculated cell in the virtual scene; the cell position parameters include the starting position and quantity. In the case of this embodiment, the cell position parameter determination unit includes: a height interval determination subunit, which is used to determine the plane projection area of the grid plane in any coordinate plane of the virtual scene and the height interval of the grid plane perpendicular to the coordinate plane based on the position information of the grid plane in the virtual scene; a target grid determination subunit, which is used to determine the target grid in each grid that matches the plane projection area and the height interval according to the grid positions of each grid in the virtual scene; a starting position and quantity determination subunit, which is used to determine the starting position and quantity of multiple pre-calculated cells used to cover the target grid according to the position of each target grid in the virtual scene and the grid composition of the pre-calculated cell; each pre-calculated cell includes at least one of each target grid.
在一个实施例中,目标栅格确定子单元具体用于:根据各栅格在虚拟场景中各自的栅格位置,确定每一栅格在坐标平面上各自的栅格投影区域;从各栅格投影区域中,确定与平面投影区域的重叠面积满足面积条件的选定栅格投影区域;将虚拟场景中,位于高度区间内的选定栅格确定为目标栅格;选定栅格在坐标平面上的投影区域为选定栅格投影区域。In one embodiment, the target grid determination subunit is specifically used to: determine the grid projection area of each grid on the coordinate plane according to the grid position of each grid in the virtual scene; determine, from each grid projection area, a selected grid projection area whose overlapping area with the plane projection area satisfies the area condition; determine the selected grid located within the height range in the virtual scene as the target grid; and the projection area of the selected grid on the coordinate plane is the selected grid projection area.
在一些实施例中,预计算单元格参数包括预计算单元格的栅格构成、以及用于构成预计算单元格的各栅格在虚拟场景中各自的栅格位置;单元格位置参数包括每一预计算单元格在虚拟场景中各自的单元格位置信息。在该实施例的情形下,单元格位置参数确定单元具体用于:基于网格平面在虚拟场景中的位置信息,确定网格平面在虚拟场景的任意两个坐标平面各自的平面投影区域;针对每一平面投影区域,根据各栅格在虚拟场景中各自的栅格位置,分别确定每一栅格在平面投影区域所在的坐标平面上各自的栅格投影区域;从各栅格投影区域中,确定与平面投影区域关联的目标栅格投影区域、以及由各目标栅格投影区域共同表征的目标栅格的栅格位置信息;根据各栅格位置信息、以及预计算单元格的栅格构成,确定用于覆盖目标网格的多个预计算单元格中、每一预计算单元格在虚拟场景中各自的单元格位置信息;每一预计算单元格包括各目标栅格中的至少一个。In some embodiments, the pre-calculated cell parameters include the grid composition of the pre-calculated cell and the grid positions of each grid used to constitute the pre-calculated cell in the virtual scene; the cell position parameters include the cell position information of each pre-calculated cell in the virtual scene. In the case of this embodiment, the cell position parameter determination unit is specifically used to: determine the plane projection area of the grid plane on any two coordinate planes of the virtual scene based on the position information of the grid plane in the virtual scene; for each plane projection area, determine the grid projection area of each grid on the coordinate plane where the plane projection area is located according to the grid positions of each grid in the virtual scene; from each grid projection area, determine the target grid projection area associated with the plane projection area and the grid position information of the target grid represented by each target grid projection area; according to each grid position information and the grid composition of the pre-calculated cell, determine the cell position information of each pre-calculated cell in the virtual scene among the multiple pre-calculated cells used to cover the target grid; each pre-calculated cell includes at least one of each target grid.
上述预计算单元格显示装置和预计算单元格生成装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。Each module in the above-mentioned pre-calculated cell display device and pre-calculated cell generation device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图19所示。该计算机设备包括一个或多个处理器、存储器、输入/输出接口(Input/Output,简称I/O)和通信接口。其中,处理器、存储器和输入/输出接口通过***总线连接,通信接口通过输入/输出接口连接到***总线。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质和内存储器。该非易失性存储介质存储有操作***、计算机可读指令和数据库。该内存储器为非易失性存储介质中的操作***和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储上述方法所涉及的数据。该计算机设备的输入/输出接口用于处理器与外部设备之间交换信息。该计算机设备的通信接口用于与外部的终端通过网络连接通信。该计算机可读指令被一个或多个处理器执行时以实现一种预计算单元格显示方法或预计算单元格生成方法。In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG19. The computer device includes one or more processors, a memory, an input/output interface (Input/Output, referred to as I/O) and a communication interface. The processor, the memory and the input/output interface are connected via a system bus, and the communication interface is connected to the system bus via the input/output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer-readable instruction and a database. The internal memory provides an environment for the operation of the operating system and the computer-readable instructions in the non-volatile storage medium. The database of the computer device is used to store data involved in the above method. The input/output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer-readable instruction is executed by one or more processors, a pre-calculated cell display method or a pre-calculated cell generation method is implemented.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图20所示。该计算机设备包括一个或多个处理器、存储器、输入/输出接口、通信接口、显示单元和输入装置。其中,处理器、存储器和输入/输出接口通过***总线连接,通信接口、显示单元和输入装置通过输入/输出接口连接到***总线。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存 储器。该非易失性存储介质存储有操作***和计算机可读指令。该内存储器为非易失性存储介质中的操作***和计算机可读指令的运行提供环境。该计算机设备的输入/输出接口用于处理器与外部设备之间交换信息。该计算机设备的通信接口用于与外部的终端进行有线或无线方式的通信,无线方式可通过WIFI、移动蜂窝网络、NFC(近场通信)或其他技术实现。该计算机可读指令被一个或多个处理器执行时以实现一种预计算单元格显示方法或预计算单元格生成方法。该计算机设备的显示单元用于形成视觉可见的画面,可以是显示屏、投影装置或虚拟现实成像装置,显示屏可以是液晶显示屏或电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG20. The computer device includes one or more processors, memory, input/output interface, communication interface, display unit and input device. The processor, memory and input/output interface are connected via a system bus, and the communication interface, display unit and input device are connected to the system bus via the input/output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium, a memory The non-volatile storage medium stores an operating system and computer-readable instructions. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer-readable instructions are executed by one or more processors, a pre-calculated cell display method or a pre-calculated cell generation method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device, the display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
本领域技术人员可以理解,图19和图20中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art will understand that the structures shown in FIGS. 19 and 20 are merely block diagrams of partial structures related to the scheme of the present application, and do not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
在一个实施例中,提供了一种计算机设备,包括存储器和一个或多个处理器,存储器中存储有计算机可读指令,该一个或多个处理器执行计算机可读指令时实现上述各方法实施例中的步骤。In one embodiment, a computer device is provided, including a memory and one or more processors, wherein the memory stores computer-readable instructions, and the one or more processors implement the steps in the above-mentioned method embodiments when executing the computer-readable instructions.
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机可读指令,该计算机可读指令被一个或多个处理器执行时实现上述各方法实施例中的步骤。In one embodiment, a computer-readable storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by one or more processors, the steps in the above-mentioned method embodiments are implemented.
在一个实施例中,提供了一种计算机程序产品,包括计算机可读指令,该计算机可读指令被一个或多个处理器执行时实现上述各方法实施例中的步骤。In one embodiment, a computer program product is provided, comprising computer-readable instructions, which implement the steps in the above-mentioned method embodiments when executed by one or more processors.
需要说明的是,本申请所涉及的用户信息(包括但不限于用户设备信息、用户个人信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经用户授权或者经过各方充分授权的信息和数据,且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准。It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、磁带、软盘、闪存、光存储器、高密度嵌入式非易失性存储器、阻变存储器(ReRAM)、磁变存储器(Magnetoresistive Random Access Memory,MRAM)、铁电存储器(Ferroelectric Random Access Memory,FRAM)、相变存储器(Phase Change Memory,PCM)、石墨烯存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器等。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic Random Access Memory,DRAM)等。本申请所提供的各实施例中所涉及的数据库可包括关系型数据库和非关系型数据库中至少一种。非关系型数据库可包括基于区块链的分布式数据库等,不限于此。本申请所提供的各实施例中所涉及的处理器可为通用处理器、中央处理器、图形处理器、数字信号处理器、可编程逻辑器、基于量子计算的数据处理逻辑器等,不限于此。A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a non-volatile computer-readable storage medium. When the computer-readable instructions are executed, they can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchain, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, etc., but are not limited to this.
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说, 在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请的保护范围应以所附权利要求为准。 The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the patent of the present application. It should be pointed out that for ordinary technicians in this field, Without departing from the concept of the present application, several modifications and improvements may be made, which all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims (22)

  1. 一种预计算单元格显示方法,由计算机设备执行,所述方法包括:A pre-calculated cell display method is executed by a computer device, the method comprising:
    响应于针对虚拟角色所在虚拟场景触发的视角空间划分事件,在所述虚拟场景中显示划分的视角受限空间和全视角空间;In response to a perspective space division event triggered for a virtual scene where a virtual character is located, displaying the divided perspective-restricted space and full perspective space in the virtual scene;
    对应于所述视角受限空间内第一空间的导航网格,显示沿所述虚拟角色的站立方向延伸、并覆盖所述导航网格的多个预计算单元格,所述第一空间为所述视角受限空间内未与所述全视角空间重叠的空间,所述导航网格,用于表征所述虚拟角色在所述视角受限空间的可达区域;及A navigation grid corresponding to a first space in the viewing angle-restricted space is displayed, and a plurality of pre-calculated cells extending along a standing direction of the virtual character and covering the navigation grid are displayed, wherein the first space is a space in the viewing angle-restricted space that does not overlap with the full viewing angle space, and the navigation grid is used to represent a reachable area of the virtual character in the viewing angle-restricted space; and
    对应于所述全视角空间内第二空间的静态网格,显示沿所述虚拟角色的站立方向延伸、并覆盖所述静态网格的多个预计算单元格,所述第二空间为所述全视角空间内未与所述视角受限空间重叠的空间,所述静态网格,用于表征空间中静态对象的对象轮廓。A static grid corresponding to a second space in the full-view space displays a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the static grid, wherein the second space is a space in the full-view space that does not overlap with the view-restricted space, and the static grid is used to represent the object outline of a static object in the space.
  2. 根据权利要求1所述的方法,所述响应于针对虚拟角色所在虚拟场景触发的视角空间划分事件,在所述虚拟场景中显示划分的视角受限空间和全视角空间,包括:According to the method of claim 1, in response to a perspective space division event triggered for a virtual scene where a virtual character is located, displaying the divided perspective restricted space and full perspective space in the virtual scene comprises:
    响应于空间参数输入事件,显示至少两组视角空间参数;及In response to a space parameter input event, displaying at least two sets of view space parameters; and
    按照所述至少两组视角空间参数,在所述虚拟场景中显示至少两个视角空间;一组视角空间参数用于表征一个所述视角空间的空间位置和空间类型;所述空间类型包括视角受限类型和全视角类型。According to the at least two groups of viewing space parameters, at least two viewing spaces are displayed in the virtual scene; one group of viewing space parameters is used to characterize the spatial position and spatial type of one of the viewing spaces; the spatial type includes a viewing-limited type and a full-view type.
  3. 根据权利要求2所述的方法,其特征在于,所述视角空间参数包括视角空间的位置参数、类型参数以及形状参数;The method according to claim 2, characterized in that the viewing space parameters include position parameters, type parameters and shape parameters of the viewing space;
    所述按照所述至少两组视角空间参数,在所述虚拟场景中显示至少两个视角空间,包括:The step of displaying at least two viewing spaces in the virtual scene according to the at least two sets of viewing space parameters includes:
    按照每一组视角空间参数中的位置参数、类型参数以及形状参数,在所述虚拟场景中显示视角空间;所述视角空间的空间位置为所述位置参数表征的位置,所述视角空间的空间类型为所述类型参数表征的类型,所述视角空间的空间形状为所述形状参数表征的形状。The perspective space is displayed in the virtual scene according to the position parameters, type parameters and shape parameters in each set of perspective space parameters; the spatial position of the perspective space is the position represented by the position parameters, the spatial type of the perspective space is the type represented by the type parameters, and the spatial shape of the perspective space is the shape represented by the shape parameters.
  4. 根据权利要求1所述的方法,所述方法还包括:The method according to claim 1, further comprising:
    在所述视角受限空间和所述全视角空间存在重叠空间的情况下,对应于所述重叠空间中的导航网格或静态网格,显示沿所述虚拟角色的站立方向延伸的多个预计算单元格。In the case where there is an overlapping space between the view-limited space and the full view space, a plurality of pre-calculated cells extending along the standing direction of the virtual character are displayed corresponding to the navigation grid or the static grid in the overlapping space.
  5. 根据权利要求4所述的方法,所述在所述视角受限空间和所述全视角空间存在重叠空间的情况下,对应于所述重叠空间中的导航网格或静态网格,显示沿所述虚拟角色的站立方向延伸的多个预计算单元格,包括:According to the method of claim 4, when there is an overlapping space between the view-limited space and the full view space, displaying a plurality of pre-calculated cells extending along the standing direction of the virtual character corresponding to the navigation grid or the static grid in the overlapping space comprises:
    响应于视角空间的优先级参数输入事件,显示所述视角受限空间和所述全视角空间各自的优先级参数;In response to a priority parameter input event of a viewing angle space, displaying respective priority parameters of the viewing angle limited space and the full viewing angle space;
    若所述视角受限空间的优先级高于所述全视角空间的优先级,则对应于所述视角受限空间和所述全视角空间的重叠空间中的导航网格,显示沿所述虚拟角色的站立方向延伸、并覆盖所述重叠空间的导航网格的多个预计算单元格,所述优先级通过所述优先级参数表征;及If the priority of the limited viewing angle space is higher than the priority of the full viewing angle space, then corresponding to the navigation grid in the overlapping space of the limited viewing angle space and the full viewing angle space, a plurality of pre-calculated cells of the navigation grid extending along the standing direction of the virtual character and covering the overlapping space are displayed, and the priority is represented by the priority parameter; and
    若所述全视角空间的优先级高于所述视角受限空间的优先级,则对应于所述重叠空间中的静态网格,显示沿所述虚拟角色的站立方向延伸、并覆盖所述重叠空间的静态网格的多个预计算单元格。If the priority of the full viewing space is higher than the priority of the viewing limited space, corresponding to the static grid in the overlapping space, a plurality of pre-calculated cells of the static grid extending along the standing direction of the virtual character and covering the overlapping space are displayed.
  6. 根据权利要求1至5中任意一项所述的方法,所述方法还包括:The method according to any one of claims 1 to 5, further comprising:
    对应于所述虚拟角色的运动轨迹网格,显示沿所述虚拟角色的站立方向延伸、并覆盖所述运动轨迹网格的多个预计算单元格,所述运动轨迹网格,用于表征所述虚拟角色在所述虚拟场景中脱离地面运动的运动轨迹。Corresponding to the motion trajectory grid of the virtual character, a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the motion trajectory grid are displayed, and the motion trajectory grid is used to represent the motion trajectory of the virtual character moving away from the ground in the virtual scene.
  7. 一种预计算单元格生成方法,由计算机设备执行,所述方法包括:A method for generating a pre-calculated cell is performed by a computer device, the method comprising:
    获取针对虚拟角色所在虚拟场景的视角空间参数,确定所述虚拟场景中的视角受限空 间和全视角空间;Obtain the perspective space parameters for the virtual scene where the virtual character is located, and determine the perspective limited space in the virtual scene. and full viewing space;
    根据所述视角受限空间和所述全视角空间在所述虚拟场景中各自的位置,确定所述视角受限空间内未与所述全视角空间重叠的第一空间、以及所述全视角空间内未与所述视角受限空间重叠的第二空间;Determine, according to respective positions of the viewing angle limited space and the full viewing angle space in the virtual scene, a first space in the viewing angle limited space that does not overlap with the full viewing angle space, and a second space in the full viewing angle space that does not overlap with the viewing angle limited space;
    对应于所述第一空间的导航网格,生成沿所述虚拟角色的站立方向延伸、并覆盖所述导航网格的多个预计算单元格,所述导航网格,用于表征所述虚拟角色在所述视角受限空间的可达区域;及Corresponding to the navigation grid of the first space, generating a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the navigation grid, wherein the navigation grid is used to represent a reachable area of the virtual character in the view-limited space; and
    对应于所述第二空间的静态网格,生成沿所述虚拟角色的站立方向延伸、并覆盖所述静态网格的多个预计算单元格,所述静态网格,用于表征空间中静态对象的对象轮廓。Corresponding to the static grid of the second space, a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the static grid are generated, wherein the static grid is used to represent the object outline of the static object in the space.
  8. 根据权利要求7所述的方法,所述获取针对虚拟角色所在虚拟场景的视角空间参数,确定所述虚拟场景中的视角受限空间和全视角空间,包括:According to the method of claim 7, the step of obtaining the perspective space parameters for the virtual scene where the virtual character is located and determining the perspective restricted space and the full perspective space in the virtual scene comprises:
    获取虚拟角色所在虚拟场景中场景组成元素的可达范围属性参数,所述可达范围属性参数用于表征所述虚拟角色在所述场景组成元素中的空间可达程度,所述空间可达程度包括部分空间可达和全部空间可达;Acquire a reachable range attribute parameter of a scene component element in a virtual scene where the virtual character is located, wherein the reachable range attribute parameter is used to characterize the spatial reachability of the virtual character in the scene component element, wherein the spatial reachability includes partial spatial reachability and full spatial reachability;
    基于所述可达范围属性参数以及所述场景组成元素在所述虚拟场景中的位置,生成视角空间参数;及generating a viewing space parameter based on the reachable range attribute parameter and the position of the scene component element in the virtual scene; and
    基于所述视角空间参数,从所述虚拟场景中,确定出包含视角受限元素的视角受限空间、以及包含全视角元素的全视角空间,所述视角受限元素的空间可达程度为部分空间可达,所述全视角元素的空间可达程度为全部空间可达。Based on the perspective space parameters, a perspective restricted space including a perspective restricted element and a full perspective space including a full perspective element are determined from the virtual scene, the spatial accessibility of the perspective restricted element being partially spatially accessible, and the spatial accessibility of the full perspective element being fully spatially accessible.
  9. 根据权利要求8所述的方法,其特征在于,所述视角空间参数包括类型参数和位置参数;The method according to claim 8, characterized in that the viewing space parameters include type parameters and position parameters;
    所述基于所述可达范围属性参数以及所述场景组成元素在所述虚拟场景中的位置,生成视角空间参数,包括:The generating of the viewing space parameter based on the reachable range attribute parameter and the position of the scene component element in the virtual scene comprises:
    基于所述可达范围属性参数,确定视角空间的类型参数,所述类型参数用于表征所述视角空间的空间类型,所述空间类型包括视角受限类型和全视角类型;及Based on the reachable range attribute parameter, determining a type parameter of the viewing angle space, the type parameter being used to characterize a space type of the viewing angle space, the space type including a viewing angle limited type and a full viewing angle type; and
    基于所述场景组成元素在所述虚拟场景中的位置,确定视角空间的位置参数,所述位置参数用于表征所述视角空间在所述虚拟场景中的空间位置。Based on the position of the scene component elements in the virtual scene, position parameters of the viewing space are determined, and the position parameters are used to characterize the spatial position of the viewing space in the virtual scene.
  10. 根据权利要求7所述的方法,所述方法还包括:The method according to claim 7, further comprising:
    在所述视角受限空间和所述全视角空间存在重叠空间的情况下,获取所述视角受限空间和所述全视角空间各自的优先级参数;In the case where there is an overlapping space between the viewing angle limited space and the full viewing angle space, obtaining priority parameters of the viewing angle limited space and the full viewing angle space respectively;
    基于各所述优先级参数各自表征的优先级,从所述视角受限空间和所述全视角空间中确定优先级最高的目标视角空间、以及除所述目标视角空间以外的非目标视角空间;及Based on the priorities represented by the priority parameters, determining a target viewing space with the highest priority and a non-target viewing space other than the target viewing space from the viewing-limited space and the full viewing space; and
    从所述非目标视角空间删除所述重叠空间所在的空间,得到视角空间去重的预计算可视性空间,以在所述预计算可视性空间中生成预计算单元格。The space where the overlapping space is located is deleted from the non-target viewing space to obtain a pre-calculated visibility space with the viewing space deduplicated, so as to generate a pre-calculated cell in the pre-calculated visibility space.
  11. 根据权利要求10所述的方法,所述优先级参数包括空间优先级参数和类型优先级参数;所述优先级包括所述空间优先级参数所表征的空间优先级、以及所述类型优先级参数所表征的类型优先级;According to the method of claim 10, the priority parameter includes a space priority parameter and a type priority parameter; the priority includes a space priority represented by the space priority parameter, and a type priority represented by the type priority parameter;
    所述基于各所述优先级参数各自表征的优先级,从所述视角受限空间和所述全视角空间中确定优先级最高的目标视角空间,包括:The determining of the target viewing space with the highest priority from the viewing angle restricted space and the full viewing angle space based on the priorities represented by the priority parameters includes:
    确定所述视角受限空间和所述全视角空间中空间优先级最高的选定视角空间;Determine a selected viewing angle space having the highest spatial priority between the viewing angle-restricted space and the full viewing angle space;
    若所述选定视角空间的数量为一个,则将所述选定视角空间确定为目标空间;及If the number of the selected viewing angle spaces is one, determining the selected viewing angle space as the target space; and
    若所述选定视角空间的数量为多个,则从各所述选定视角空间中确定类型优先级最高的目标视角空间。If there are multiple selected viewing angle spaces, a target viewing angle space with the highest type priority is determined from among the selected viewing angle spaces.
  12. 根据权利要求10所述的方法,所述从所述非目标视角空间删除所述重叠空间所在的空间,包括: According to the method of claim 10, deleting the space where the overlapping space is located from the non-target viewing space comprises:
    基于所述重叠空间和非目标视角空间在所述虚拟场景中各自的位置,确定所述重叠空间的边界面在所述非目标视角空间中的延伸面;Determining an extension surface of a boundary surface of the overlapping space in the non-target viewing space based on respective positions of the overlapping space and the non-target viewing space in the virtual scene;
    基于所述延伸面拆分所述非目标视角空间,得到所述非目标视角空间对应的多个非目标子空间;及Splitting the non-target viewing angle space based on the extended surface to obtain a plurality of non-target subspaces corresponding to the non-target viewing angle space; and
    删除各所述非目标子空间中与所述重叠空间重合的重合子空间。Delete the overlapping subspaces in each of the non-target subspaces that overlap with the overlapping space.
  13. 根据权利要求12所述的方法,所述重叠空间为长方体空间;The method according to claim 12, wherein the overlapping space is a cuboid space;
    所述基于所述延伸面拆分所述非目标视角空间进行拆分处理,得到所述非目标视角空间对应的多个非目标子空间,包括:The splitting of the non-target viewing angle space based on the extension surface to obtain a plurality of non-target subspaces corresponding to the non-target viewing angle space includes:
    基于所述重叠空间在所述非目标视角空间的第一延伸面,拆分所述非目标空间,得到与所述重叠空间存在重叠的第一重叠子空间、以及与所述重叠空间不存在重叠的第一独立子空间,所述第一延伸面为所述重叠空间垂直于第一坐标轴方向的第一边界面的延伸面;Based on a first extension surface of the overlapping space in the non-target viewing space, splitting the non-target space to obtain a first overlapping subspace that overlaps with the overlapping space and a first independent subspace that does not overlap with the overlapping space, wherein the first extension surface is an extension surface of a first boundary surface of the overlapping space perpendicular to a first coordinate axis direction;
    基于所述重叠空间在所述第一重叠子空间的第二延伸面,拆分所述第一重叠子空间,得到与所述重叠空间存在重叠的第二重叠子空间、以及与所述重叠空间不存在重叠的第二独立子空间;所述第二延伸面为所述重叠空间垂直于第二坐标轴方向的第二边界面的延伸面;Based on the second extension surface of the overlapping space in the first overlapping subspace, splitting the first overlapping subspace to obtain a second overlapping subspace that overlaps with the overlapping space and a second independent subspace that does not overlap with the overlapping space; the second extension surface is an extension surface of the second boundary surface of the overlapping space perpendicular to the second coordinate axis direction;
    基于所述重叠空间垂直于第三坐标轴方向的第三边界面,拆分所述第二重叠子空间,得到与所述重叠空间重合的重合子空间、以及与所述重叠空间不存在重叠的第三独立子空间;及Based on a third boundary surface of the overlapping space perpendicular to a third coordinate axis, splitting the second overlapping subspace to obtain an overlapping subspace overlapping with the overlapping space and a third independent subspace not overlapping with the overlapping space; and
    将所述第一独立子空间、所述第二独立子空间、所述重合子空间以及所述第三独立子空间,确定为所述非目标视角空间对应的多个非目标子空间。The first independent subspace, the second independent subspace, the overlapping subspace, and the third independent subspace are determined as a plurality of non-target subspaces corresponding to the non-target viewing space.
  14. 根据权利要求7至13中任意一项所述的方法,生成预计算单元格的过程,包括:According to the method according to any one of claims 7 to 13, the process of generating a pre-calculated cell comprises:
    基于所述虚拟角色在所述虚拟场景中的站立方向,确定所述虚拟场景中目标网格的网格平面,所述目标网格包括所述视角受限空间内第一空间的导航网格、以及所述全视角空间内第二空间的静态网格;Determining a grid plane of a target grid in the virtual scene based on a standing direction of the virtual character in the virtual scene, wherein the target grid includes a navigation grid of a first space in the view-limited space and a static grid of a second space in the full view space;
    根据所述网格平面在所述虚拟场景中的位置信息、以及预计算单元格参数,确定用于覆盖所述目标网格的多个预计算单元格的单元格位置参数;及Determining cell position parameters of a plurality of pre-calculated cells covering the target grid according to the position information of the grid plane in the virtual scene and the pre-calculated cell parameters; and
    基于各所述单元格位置参数,生成沿所述站立方向上延伸、并覆盖所述目标网格的多个预计算单元格,相邻的各所述预计算单元格互不重叠。Based on the position parameters of each cell, a plurality of pre-calculated cells extending along the standing direction and covering the target grid are generated, and adjacent pre-calculated cells do not overlap each other.
  15. 根据权利要求14所述的方法,所述预计算单元格参数包括预计算单元格的栅格构成、以及用于构成所述预计算单元格的各栅格在所述虚拟场景中各自的栅格位置;所述单元格位置参数包括起始位置和数量;According to the method of claim 14, the pre-calculated cell parameters include the grid composition of the pre-calculated cell and the respective grid positions of each grid used to constitute the pre-calculated cell in the virtual scene; the cell position parameters include the starting position and the number;
    所述根据所述网格平面在所述虚拟场景中的位置信息、以及预计算单元格参数,确定用于覆盖所述目标网格的多个预计算单元格的单元格位置参数,包括:The determining, according to the position information of the grid plane in the virtual scene and the pre-calculated cell parameters, the cell position parameters of a plurality of pre-calculated cells for covering the target grid comprises:
    基于所述网格平面在所述虚拟场景中的位置信息,确定所述网格平面在所述虚拟场景的任一坐标平面的平面投影区域、以及所述网格平面垂直于所述坐标平面的高度区间;Based on the position information of the grid plane in the virtual scene, determining a plane projection area of the grid plane on any coordinate plane of the virtual scene, and a height interval of the grid plane perpendicular to the coordinate plane;
    根据各所述栅格在所述虚拟场景中各自的栅格位置,确定各所述栅格中与所述平面投影区域和所述高度区间匹配的目标栅格;及Determining a target grid in each of the grids that matches the plane projection area and the height interval according to the respective grid positions of each of the grids in the virtual scene; and
    根据各所述目标栅格在所述虚拟场景中的位置、以及预计算单元格的栅格构成,确定用于覆盖所述目标网格的多个预计算单元格的起始位置和数量;每一所述预计算单元格包括各所述目标栅格中的至少一个。According to the position of each target grid in the virtual scene and the grid structure of the pre-calculated cells, the starting position and number of multiple pre-calculated cells used to cover the target grid are determined; each of the pre-calculated cells includes at least one of the target grids.
  16. 根据权利要求15所述的方法,所述根据各所述栅格在所述虚拟场景中各自的栅格位置,确定各所述栅格中与所述平面投影区域和所述高度区间匹配的目标栅格,包括:According to the method of claim 15, determining the target grid in each of the grids that matches the plane projection area and the height interval according to the respective grid positions of each of the grids in the virtual scene comprises:
    根据各所述栅格在所述虚拟场景中各自的栅格位置,确定每一所述栅格在所述坐标平面上各自的栅格投影区域;Determine a grid projection area of each grid on the coordinate plane according to the grid position of each grid in the virtual scene;
    从各所述栅格投影区域中,确定与所述平面投影区域的重叠面积满足面积条件的选定 栅格投影区域;及From each of the grid projection areas, determine the selected area where the overlapping area with the plane projection area satisfies the area condition Grid projection area; and
    将所述虚拟场景中,位于所述高度区间内的选定栅格确定为目标栅格,所述选定栅格在所述坐标平面上的投影区域为所述选定栅格投影区域。A selected grid in the virtual scene that is within the height range is determined as a target grid, and a projection area of the selected grid on the coordinate plane is the selected grid projection area.
  17. 根据权利要求14所述的方法,所述预计算单元格参数包括预计算单元格的栅格构成、以及用于构成所述预计算单元格的各栅格在所述虚拟场景中各自的栅格位置;所述单元格位置参数包括每一预计算单元格在所述虚拟场景中各自的单元格位置信息;According to the method of claim 14, the pre-calculated cell parameters include the grid composition of the pre-calculated cell and the respective grid positions of the grids constituting the pre-calculated cell in the virtual scene; the cell position parameters include the respective cell position information of each pre-calculated cell in the virtual scene;
    所述根据所述网格平面在所述虚拟场景中的位置信息、以及预计算单元格参数,确定用于覆盖所述目标网格的多个预计算单元格的单元格位置参数,包括:The determining, according to the position information of the grid plane in the virtual scene and the pre-calculated cell parameters, the cell position parameters of a plurality of pre-calculated cells for covering the target grid comprises:
    基于所述网格平面在所述虚拟场景中的位置信息,确定所述网格平面在所述虚拟场景的任意两个坐标平面各自的平面投影区域;Based on the position information of the grid plane in the virtual scene, determining the plane projection area of the grid plane on any two coordinate planes of the virtual scene;
    针对每一所述平面投影区域,根据各所述栅格在所述虚拟场景中各自的栅格位置,分别确定每一所述栅格在所述平面投影区域所在的坐标平面上各自的栅格投影区域;For each of the plane projection areas, according to the respective grid positions of the grids in the virtual scene, respectively determine the respective grid projection areas of each of the grids on the coordinate plane where the plane projection area is located;
    从各所述栅格投影区域中,确定与所述平面投影区域关联的目标栅格投影区域、以及由各所述目标栅格投影区域共同表征的目标栅格的栅格位置信息;及Determine, from each of the grid projection areas, a target grid projection area associated with the plane projection area, and grid position information of a target grid commonly represented by each of the target grid projection areas; and
    根据各所述栅格位置信息、以及预计算单元格的栅格构成,确定用于覆盖所述目标网格的多个预计算单元格中、每一所述预计算单元格在所述虚拟场景中各自的单元格位置信息,每一所述预计算单元格包括各所述目标栅格中的至少一个。According to the grid position information and the grid composition of the pre-calculated cells, the cell position information of each of the pre-calculated cells in the virtual scene among the multiple pre-calculated cells used to cover the target grid is determined, and each of the pre-calculated cells includes at least one of the target grids.
  18. 一种预计算单元格显示装置,所述装置包括:A pre-calculated cell display device, the device comprising:
    视角空间显示模块,用于响应于针对虚拟角色所在虚拟场景触发的视角空间划分事件,在所述虚拟场景中显示划分的视角受限空间和全视角空间;A viewing space display module, for responding to a viewing space division event triggered for a virtual scene where a virtual character is located, and displaying the divided viewing space with limited viewing angle and full viewing space in the virtual scene;
    预计算单元格显示模块,用于对应于所述视角受限空间内第一空间的导航网格,显示沿所述虚拟角色的站立方向延伸、并覆盖所述导航网格的多个预计算单元格,所述第一空间为所述视角受限空间内未与所述全视角空间重叠的空间,所述导航网格,用于表征所述虚拟角色在所述视角受限空间的可达区域;及a pre-calculated cell display module, configured to display a plurality of pre-calculated cells corresponding to a navigation grid of a first space in the viewing angle-restricted space, extending along a standing direction of the virtual character and covering the navigation grid, wherein the first space is a space in the viewing angle-restricted space that does not overlap with the full viewing angle space, and the navigation grid is used to represent a reachable area of the virtual character in the viewing angle-restricted space; and
    对应于所述全视角空间内第二空间的静态网格,显示沿所述虚拟角色的站立方向延伸、并覆盖所述静态网格的多个预计算单元格,所述第二空间为所述全视角空间内未与所述视角受限空间重叠的空间,所述静态网格,用于表征空间中静态对象的对象轮廓。A static grid corresponding to a second space in the full-view space displays a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the static grid, wherein the second space is a space in the full-view space that does not overlap with the view-restricted space, and the static grid is used to represent the object outline of a static object in the space.
  19. 一种预计算单元格生成装置,所述装置包括:A pre-calculated cell generation device, the device comprising:
    视角空间确定模块,用于获取针对虚拟角色所在虚拟场景的视角空间参数,确定所述虚拟场景中的视角受限空间和全视角空间;A viewing angle space determination module, used to obtain viewing angle space parameters for a virtual scene where a virtual character is located, and determine a viewing angle restricted space and a full viewing angle space in the virtual scene;
    未重叠空间确定模块,用于根据所述视角受限空间和所述全视角空间在所述虚拟场景中各自的位置,确定所述视角受限空间内未与所述全视角空间重叠的第一空间、以及所述全视角空间内未与所述视角受限空间重叠的第二空间;a non-overlapping space determining module, configured to determine, according to respective positions of the viewing angle limited space and the full viewing angle space in the virtual scene, a first space in the viewing angle limited space that does not overlap with the full viewing angle space, and a second space in the full viewing angle space that does not overlap with the viewing angle limited space;
    预计算单元格生成模块,用于对应于所述第一空间的导航网格,生成沿所述虚拟角色的站立方向延伸、并覆盖所述导航网格的多个预计算单元格,所述导航网格,用于表征所述虚拟角色在所述视角受限空间的可达区域;及a pre-calculated cell generation module, configured to generate, corresponding to the navigation grid of the first space, a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the navigation grid, wherein the navigation grid is used to represent a reachable area of the virtual character in the view-limited space; and
    对应于所述第二空间的静态网格,生成沿所述虚拟角色的站立方向延伸、并覆盖所述静态网格的多个预计算单元格,所述静态网格,用于表征空间中静态对象的对象轮廓。Corresponding to the static grid of the second space, a plurality of pre-calculated cells extending along the standing direction of the virtual character and covering the static grid are generated, wherein the static grid is used to represent the object outline of the static object in the space.
  20. 一种计算机设备,包括存储器和一个或多个处理器,所述存储器存储有计算机可读指令,所述一个或多个处理器执行所述计算机可读指令时实现权利要求1至17中任一项所述的方法的步骤。A computer device comprises a memory and one or more processors, wherein the memory stores computer-readable instructions, and the one or more processors implement the steps of the method according to any one of claims 1 to 17 when executing the computer-readable instructions.
  21. 一种计算机计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被一个或多个处理器执行时实现权利要求1至17中任一项所述的方法的步骤。A computer-readable storage medium having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by one or more processors, implement the steps of the method according to any one of claims 1 to 17.
  22. 一种计算机程序产品,包括计算机可读指令,其特征在于,该计算机可读指令被一个或多个处理器执行时实现权利要求1至17中任一项所述的方法的步骤。 A computer program product, comprising computer-readable instructions, characterized in that when the computer-readable instructions are executed by one or more processors, the steps of the method described in any one of claims 1 to 17 are implemented.
PCT/CN2023/123184 2022-12-23 2023-10-07 Method and apparatus for displaying precomputed cell, and method and apparatus for generating precomputed cell WO2024131205A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211662938.0 2022-12-23
CN202211662938.0A CN115631320B (en) 2022-12-23 2022-12-23 Pre-calculation cell display method, pre-calculation cell generation method and device

Publications (1)

Publication Number Publication Date
WO2024131205A1 true WO2024131205A1 (en) 2024-06-27

Family

ID=84910104

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/123184 WO2024131205A1 (en) 2022-12-23 2023-10-07 Method and apparatus for displaying precomputed cell, and method and apparatus for generating precomputed cell

Country Status (2)

Country Link
CN (1) CN115631320B (en)
WO (1) WO2024131205A1 (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5161256B2 (en) * 2010-03-31 2013-03-13 株式会社バンダイナムコゲームス Program, information storage medium, and image generation apparatus
CN107103639B (en) * 2010-06-30 2021-05-18 巴里·林恩·詹金斯 Method and system for determining a set of mesh polygons or segments of mesh polygons
CN106611436A (en) * 2016-12-30 2017-05-03 腾讯科技(深圳)有限公司 Animation resource display processing method and device
CN111510782A (en) * 2017-04-28 2020-08-07 华为技术有限公司 Video playing method, virtual reality equipment, server and computer storage medium
CN108257103B (en) * 2018-01-25 2020-08-25 网易(杭州)网络有限公司 Method and device for eliminating occlusion of game scene, processor and terminal
CN108376424A (en) * 2018-02-09 2018-08-07 腾讯科技(深圳)有限公司 Method, apparatus, equipment and storage medium for carrying out view angle switch to three-dimensional virtual environment

Also Published As

Publication number Publication date
CN115631320B (en) 2023-02-28
CN115631320A (en) 2023-01-20

Similar Documents

Publication Publication Date Title
JP2021520579A (en) Object loading methods and devices, storage media, electronic devices, and computer programs
US11087052B2 (en) Automatic partitioning of a 3D scene into a plurality of zones processed by a computing resource
CN103093499B (en) A kind of city three-dimensional model data method for organizing being applicable to Internet Transmission
CN112755535B (en) Illumination rendering method and device, storage medium and computer equipment
CN107223269A (en) Three-dimensional scene positioning method and device
CN107886562A (en) Water surface rendering intent, device and readable storage medium storing program for executing
WO2023051671A1 (en) Data processing method based on voxel data, and server, medium and computer program product
WO2023142609A1 (en) Object processing method and apparatus in virtual scene, device, storage medium and program product
CN110070616A (en) Memory, statistical data rendering method, device and equipment based on GIS platform
WO2021227684A1 (en) Method for selecting virtual objects, apparatus, terminal and storage medium
CN109872390A (en) A kind of method for organizing of magnanimity threedimensional model
CN112587921A (en) Model processing method and device, electronic equipment and storage medium
KR102096196B1 (en) How to configure model objects, servers, and systems
CN111445576A (en) Map data acquisition method and device, storage medium and electronic device
CN112685429B (en) Tree structure model generation and loading method and device, storage medium and equipment
US20230281251A1 (en) Object management method and apparatus, device, storage medium, and system
WO2024131205A1 (en) Method and apparatus for displaying precomputed cell, and method and apparatus for generating precomputed cell
CN115984440B (en) Object rendering method, device, computer equipment and storage medium
WO2023061474A1 (en) Voxel data-based data processing method, and server, medium and computer program product
TWI804172B (en) Method and apparatus for generating image, computer device, non-volatile computer-readable storage medium, and computer program product
CN114241096A (en) Three-dimensional model generation method, device, equipment and storage medium
CN114168696A (en) Method, device, equipment and readable medium for dividing and rendering ground grids
WO2022056933A1 (en) Flight simulation method and terminal for racing drone
CN113426131B (en) Picture generation method and device of virtual scene, computer equipment and storage medium
WO2023236645A1 (en) Illumination information loading method and apparatus, and computer device and storage medium