Game scene optimization method and device, equipment and storage medium

By calculating the bounding box size and projection matrix of the rendering components and combining them with the target screen ratio, the clipping distance of the components is automatically calculated, which solves the problem of inaccurate component clipping distance in game scenes and achieves precise control of resource loading and improved rendering efficiency.

CN115671719BActive Publication Date: 2026-06-02NETEASE (HANGZHOU) NETWORK CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NETEASE (HANGZHOU) NETWORK CO LTD
Filing Date
2022-10-17
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

The current game scene lacks accuracy in setting component clipping distance, resulting in redundant resource loading and making it impossible to achieve precise parameterization.

Method used

By calculating the bounding box size of rendering components and the preset projection matrix, combined with the target screen ratio, the clipping distance of components is automatically calculated to optimize the rendering process of game scenes.

Benefits of technology

It enables precise control of component clipping distance, reduces resource loading redundancy, and improves the rendering efficiency of game scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115671719B_ABST
    Figure CN115671719B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of games and discloses a game scene optimization method, device and equipment and a storage medium. The method comprises the following steps: selecting at least one rendering component to be cut in a game scene, and calculating the size of the bounding box of the preset shape corresponding to the rendering component; using a preset projection matrix to demarcate the visual range of the game scene, and calculating the cutting distance of the rendering component in the visual range according to the size of the bounding box and the preset target screen proportion; and optimizing the game scene according to the cutting distance. The application realizes batch calculation and setting of the cutting distance of the components in the game scene, so that the intelligent degree of game scene optimization is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of game technology, and in particular to a method, apparatus, device, and storage medium for optimizing game scenes. Background Technology

[0002] Within an Unreal Engine scene, renderable components have a "maximum clipping distance" property. Artists can manually set the "maximum clipping distance" for each renderable component when editing the scene. During gameplay, components exceeding the "maximum clipping distance" will not be rendered, thus reducing the rendering load on the game scene.

[0003] Currently, clipping distances are set manually, either individually for each component or via a CullDistance Volume array, allowing for batch settings of different component sizes and corresponding distances. Both methods rely on manual specification based on experience, failing to provide accurate, parameterized settings. This results in low accuracy when setting component clipping distances in existing game scenarios. Summary of the Invention

[0004] The main objective of this invention is to solve the technical problem of low accuracy in setting the clipping distance of components in existing game scenes.

[0005] The first aspect of the present invention provides a game scene optimization method, comprising: selecting at least one rendering component to be clipped in the game scene, and calculating the bounding box size of a preset shape corresponding to the rendering component; delineating the visual range of the game scene using a preset projection matrix, and calculating the clipping distance of the rendering component within the visual range based on the bounding box size and a preset target screen ratio;

[0006] The game scene is optimized based on the stated clipping distance.

[0007] Optionally, in a first implementation of the first aspect of the present invention, the step of defining the visual range of the game scene using a preset projection matrix includes: obtaining the camera projection matrix corresponding to the game scene, and adjusting the camera projection matrix and the preset projection matrix according to a preset scaling factor; comparing the matrix values ​​of the adjusted camera projection matrix and the adjusted preset projection matrix; selecting a target projection matrix from the adjusted preset projection matrix and the camera projection matrix based on the comparison result, and determining the corresponding visual range in the game scene based on the target projection matrix.

[0008] Optionally, in a second implementation of the first aspect of the present invention, the step of calculating the clipping distance of the rendering component within the visual range based on the bounding box size and the preset target screen ratio includes: converting the bounding box size into the bounding box size corresponding to the game scene based on the target screen ratio; and calculating the clipping distance of the rendering component projected onto the visual range based on the converted bounding box size.

[0009] Optionally, in a third implementation of the first aspect of the present invention, calculating the bounding box size of the preset shape corresponding to the rendering component includes: identifying the spherical bounding box region corresponding to the rendering component and calculating the radius of the spherical bounding box region, wherein the bounding box size includes the radius; or, identifying the box bounding box region corresponding to the rendering component and calculating the motion boundary of the box bounding box region, wherein the bounding box size includes the motion boundary.

[0010] Optionally, in a fourth implementation of the first aspect of the present invention, after defining the visual range of the game scene using a preset projection matrix, the method further includes: obtaining the viewing angle and pixel size input from the front end, and setting the projection matrix according to the viewing angle and the pixel size; and adjusting the visual range of the game scene according to the set projection matrix.

[0011] Optionally, in a fifth implementation of the first aspect of the present invention, optimizing the game scene based on the clipping distance includes: obtaining initial rendering components to be rendered in the game scene, and identifying rendering components to be clipped from the initial rendering components; calculating the real-time distance from the corresponding camera in the game scene to the rendering components to be clipped, and selecting rendering components from the rendering components to be clipped whose clipping distance is greater than the real-time distance; and rendering the initial rendering components other than the selected rendering components into the game scene.

[0012] A second aspect of the present invention provides a game scene optimization device, comprising: a size calculation module, configured to select at least one rendering component to be clipped in a game scene and calculate the bounding box size of a preset shape corresponding to the rendering component; a distance calculation module, configured to define the visual range of the game scene using a preset projection matrix and calculate the clipping distance of the rendering component within the visual range based on the bounding box size and a preset target screen ratio; and an optimization module, configured to optimize the game scene based on the clipping distance.

[0013] Optionally, in a first implementation of the second aspect of the present invention, the distance calculation module includes: a matrix adjustment unit, configured to obtain the camera projection matrix corresponding to the game scene, and adjust the camera projection matrix and the preset projection matrix according to a preset scaling factor; a comparison unit, configured to compare the matrix values ​​of the adjusted camera projection matrix and the adjusted preset projection matrix; and a determination unit, configured to select a target projection matrix from the adjusted preset projection matrix and the camera projection matrix according to the comparison result, and determine the corresponding visual range in the game scene according to the target projection matrix.

[0014] Optionally, in a second implementation of the second aspect of the present invention, the distance calculation module further includes: a conversion unit, configured to convert the bounding box size into the bounding box size corresponding to the game scene based on the target screen ratio; and a distance calculation unit, configured to calculate the clipping distance of the rendering component projected onto the visual range based on the converted bounding box size.

[0015] Optionally, in a third implementation of the second aspect of the present invention, the size calculation module includes: a radius calculation unit, used to identify the sphere bounding box region corresponding to the rendering component and calculate the radius of the sphere bounding box region, wherein the bounding box size includes the radius; or, a boundary calculation unit, used to identify the box bounding box region corresponding to the rendering component and calculate the motion boundary of the box bounding box region, wherein the bounding box size includes the motion boundary.

[0016] Optionally, in a fourth implementation of the second aspect of the present invention, the game scene optimization device further includes a visual adjustment module, used to: obtain the viewing angle and pixel size input from the front end, and set the projection matrix according to the viewing angle and the pixel size; and adjust the visual range of the game scene according to the set projection matrix.

[0017] Optionally, in a fifth implementation of the second aspect of the present invention, the optimization module includes: an identification unit, configured to acquire initial rendering components to be rendered in the game scene, and identify rendering components to be clipped from the initial rendering components; a selection unit, configured to calculate the real-time distance from the corresponding camera in the game scene to the rendering components to be clipped, and select rendering components from the rendering components to be clipped whose clipping distance is greater than the real-time distance; and a rendering unit, configured to render the initial rendering components other than the selected rendering components into the game scene.

[0018] A third aspect of the present invention provides a game scene optimization device, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor invokes the instructions in the memory to cause the game scene optimization device to execute the above-described game scene optimization method.

[0019] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the above-described game scene optimization method.

[0020] The technical solution provided by this invention selects the rendering components to be trimmed, pre-sets a target screen ratio and pre-constructs a projection matrix, and then determines the spatial size by calculating the bounding box size of the rendering component. These three factors are combined to batch calculate the bounding box size of each component at different sizes. That is, after the projection matrix and target screen ratio are fixed, the loading distance is related to the bounding box size of the rendering component, accurately calculating the loading distance of each rendering component. This eliminates the need for manual, experience-based specification; instead, all rendering components are automatically calculated and set in batches. The loading distance of rendering components within the game scene is precisely controlled, reducing resource loading redundancy when rendering the game scene. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of the first embodiment of the game scene optimization method in this invention;

[0022] Figure 2 This is a schematic diagram of a second embodiment of the game scene optimization method in this invention;

[0023] Figure 3 This is a schematic diagram of one embodiment of the game scene optimization device in this invention;

[0024] Figure 4 This is a schematic diagram of another embodiment of the game scene optimization device in this invention;

[0025] Figure 5 This is a schematic diagram of one embodiment of the game scene optimization device in this invention. Detailed Implementation

[0026] This invention provides a method, apparatus, device, and storage medium for optimizing game scenes. The method involves selecting at least one rendering component to be clipped in the game scene and calculating the bounding box size of a preset shape corresponding to the rendering component. A preset projection matrix is ​​used to define the visual range of the game scene, and the clipping distance of the rendering component is calculated within the visual range based on the bounding box size and a preset target screen ratio. The game scene is then optimized based on the clipping distance. This invention enables batch calculation and setting of clipping distances for components in a game scene, thereby improving the intelligence level of game scene optimization.

[0027] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0028] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 The first embodiment of the game scene optimization method in this invention includes:

[0029] 101. Select at least one rendering component to be clipped in the game scene, and calculate the bounding box size of the preset shape corresponding to the rendering component;

[0030] It is understood that the executing entity of this invention can be a game scene optimization device, a terminal, or a server; no specific limitation is made here. This embodiment of the invention will be described using a server as an example.

[0031] In this embodiment, the game scene consists of fixed rendering components and dynamically rendered components. Dynamically rendered components refer to those that render or do not render under different conditions. The rendering component to be clipped is a type of dynamically rendered component. Whether to render it into the game scene is determined based on the clipping distance of the component to be clipped. The user selects and marks the rendering component to be clipped on the front-end interface, and then the selection is made here based on the marked rendering component.

[0032] In this embodiment, each rendering component has a set of predefined bounding boxes that define the boundaries of the rendering component. These may include spherical bounding boxes and box bounding boxes. The spherical bounding box is drawn based on the boundaries that the rendering component can reach under dynamic conditions, such as arbitrary rotation, while the box bounding box is drawn based on the boundaries that the rendering component can be enclosed by a polygonal cube under static conditions. Based on these two types of bounding boxes, their dimensions are calculated, such as the radius of the spherical bounding box and the diagonal distance of the box bounding box.

[0033] 102. Delineate the visual range of the game scene using a preset projection matrix, and calculate the clipping distance of the rendering component within the visual range based on the bounding box size and the preset target screen ratio;

[0034] In this embodiment, a projection matrix is ​​pre-constructed based on the virtual camera parameters corresponding to the game scene to define a local visual range within the game scene. Specifically, the size of the visual range can be adjusted by setting the FOV (Field of View) value and the display pixel size of the virtual camera. Once the FOV value and pixel size are set, the visual range of a fixed portion of the game scene can be divided according to the corresponding projection matrix. For example, an FOV value of 180° can be set, with a width and height pixel size of 1920 pixels and 1080 pixels respectively, fixing the defined visual range. Furthermore, this visual range is used to represent the display focus, i.e., the area of ​​user attention.

[0035] In this embodiment, a target screen ratio is preset. This means that when the virtual camera gradually moves away from a rendering component, the proportion of pixels drawn by the rendering component on the screen relative to the total number of pixels on the screen reaches the target screen ratio, and the distance between the rendering component and the camera reaches the maximum loading distance. Then, based on this target screen ratio and the visual range, the bounding box size is converted into the clipping distance in the game scene.

[0036] 103. Optimize the game scene based on the stated clipping distance.

[0037] In this embodiment, as the game scene moves, the rendering components continuously cull and render within the game scene. Optimizing the game scene here means selectively rendering and displaying only the necessary components during the scene's movement, rather than rendering and displaying all of them. This reduces the amount of rendering required for the game scene and improves its rendering efficiency.

[0038] In this embodiment, the selected rendering components to be clipped mentioned above can be detected. If the current game scene contains rendering components to be clipped, after calculating the clipping distance for each rendering component, it can be compared with it according to the set clipping distance threshold to determine the rendering components that are farther away and / or closer away, so as to remove the determined rendering components. After removal, they do not need to be rendered into the current game scene, so as to optimize the game scene.

[0039] In this embodiment of the invention, by selecting the rendering components to be trimmed, pre-setting a target screen ratio and pre-constructing a projection matrix, and then calculating the bounding box size of the rendering component to determine its spatial size, the three factors are combined to batch calculate the bounding box size of each component under different dimensions. That is, after the projection matrix and target screen ratio are fixed, the loading distance is related to the bounding box size of the rendering component, and the loading distance of each rendering component is accurately calculated. Instead of relying on manual experience to specify, all rendering components are automatically calculated and set in batches, and the loading distance of rendering components within the game scene is precisely controlled, reducing resource loading redundancy when rendering the game scene.

[0040] Please see Figure 2 The second embodiment of the game scene optimization method in this invention includes:

[0041] 201. Select at least one rendering component to be clipped in the game scene, identify the sphere bounding box region corresponding to the rendering component, and calculate the radius of the sphere bounding box region, wherein the bounding box size includes the radius; or,

[0042] 202. Identify the box bounding box region corresponding to the rendering component, and calculate the motion boundary of the box bounding box region, wherein the bounding box size includes the motion boundary;

[0043] In this embodiment, the bounding box defining the boundary of the rendering component can be selected from one type of bounding box to calculate its size. For a spherical bounding box, the spherical bounding box region can be obtained by identifying the area it surrounds the rendering component, and the radius of the spherical bounding box region can be calculated to represent the bounding box size. In addition to the radius, the bounding box region can also be its area, volume, etc. For a box bounding box, the box bounding box region can be obtained by identifying the planar region where it fits the boundary of the rendering component, and the maximum diagonal length of the box bounding box region can be calculated and used as the motion boundary.

[0044] Additionally, the bounding box area can be customized in the front-end interface, or adjustments can be made to the automatically generated bounding box area. For example, when generating an initial bounding box of a standard size with a preset shape, such as a box bounding box or a spherical bounding box, since its shape will not change, its size can be adjusted by scaling the boundaries. For a spherical bounding box, its radius can be set to adjust its size; for a box bounding box, its length, width, and height can be set to adjust its size, or its transformation ratio can be set directly.

[0045] 203. Obtain the camera projection matrix corresponding to the game scene, and adjust the camera projection matrix and the preset projection matrix according to the preset scaling factor;

[0046] 204. Compare the matrix values ​​of the adjusted camera projection matrix with those of the adjusted preset projection matrix;

[0047] 205. Based on the comparison results, select a target projection matrix from the adjusted preset projection matrix and the camera projection matrix, and determine the corresponding visual range in the game scene based on the target projection matrix;

[0048] In this embodiment, the game scene is displayed by capturing a virtual world using a virtual camera. Based on the captured content, each point, such as the basic components of the rendering components, is sequentially transformed from its initial 3D model space coordinates to standardized device coordinates through model transformation, viewpoint transformation, and projection transformation, thus displaying the game scene on the terminal device. The projection transformation is achieved through the camera projection matrix corresponding to the virtual camera. The camera projection matrix transforms the global visual range of the game scene. A pre-set preset projection matrix, based on the camera projection matrix, selects FOV values ​​and pixel size values ​​to extract a local camera projection matrix, thereby transforming the local visual range of the game scene.

[0049] Specifically, if the target projection matrix P is calculated and the matrix size is 4*4, then two elements are selected from this target projection matrix, the [0][0] element P. 00 and [1][1] element P 11 Among them, for example, P 00 P describes the length of the focal length of a pixel along the x-axis. 11 This describes the focal length of a pixel along the y-axis, and then limits the scaling threshold of each rendered component in the game interface by setting a scaling factor k. Then, it compares with P. 00 and P 11 The larger of the two values ​​is used to determine the length of the focal length along the x-axis or y-axis to define the visual range of the game scene. The specific expression is as follows: Max(k*P 00 ,k*P 11 ).

[0050] 206. Obtain the viewing angle and pixel size input from the front end, and set the projection matrix according to the viewing angle and pixel size;

[0051] 207. Adjust the visual range of the game scene according to the set projection matrix;

[0052] In this embodiment, the projection matrix is ​​constructed by setting the FOV value and pixel size based on the camera projection matrix. The FOV can be set by adjusting the viewing angle at the front end, and the width and height pixel sizes can be set by adjusting the pixel size of the projection matrix. A larger FOV corresponds to a larger planar visual range of the local game scene, and vice versa. Similarly, a larger pixel size corresponds to a larger depth visual range of the local game scene, and vice versa. For example, setting the FOV from 180° to 150° will reduce the visual range of the corresponding local game scene.

[0053] 208. Based on the target screen ratio, convert the bounding box size into the bounding box size corresponding to the game scene;

[0054] 209. Calculate the clipping distance of the rendering component projected onto the visual range based on the converted bounding box size;

[0055] In this embodiment, the bounding box size is drawn based on the actual size of the rendering component. As the game scene scales, the bounding box size also scales with the game interface. For example, if the game scene expands, the pixel ratio of the bounding box to the overall game scene also decreases. By using the target screen ratio, the bounding box size is transformed from game scenes of different sizes to the standard bounding box size of the current standard game scene. Then, the previously calculated length Max(k*P) using the focal length along the x-axis or y-axis is added to this standard bounding box size. 00 ,k*P 11 The visual range of the rendering component is represented by ), which is used to calculate the clipping distance of the rendering component under the target projection matrix.

[0056] Specifically, for example, in the rendering component M calculated earlier, its bounding box size is r. m The target screen ratio is set to R. s If we take the scaling factor k = 0.5, then the clipping distance of the corresponding rendering component M is...

[0057] 210. Obtain the initial rendering components to be rendered in the game scene, and identify the rendering components to be clipped in the initial rendering components;

[0058] 211. Calculate the real-time distance from the corresponding camera in the game scene to the rendering component to be clipped, and select the rendering component whose clipping distance is greater than the real-time distance from the rendering components to be clipped;

[0059] 212. Render the initial rendering components, excluding the selected rendering components, into the game scene.

[0060] In this embodiment, in response to operation commands in the game scene, such as dragging, scaling, and flipping, the game scene undergoes corresponding changes. During the game, the rendering components are updated in real time in response to changes in the game scene, and the scene within the game interface is selectively removed and rendered accordingly.

[0061] In this embodiment, for each initial rendering component in each game interface, some initial rendering components are rendered at a fixed time. As the distance between the previously selected rendering components to be clipped and the virtual camera in the game scene gets closer and / or farther away, they are considered to be outside the visual range or reach the boundary of the visual range. Therefore, they are considered to be outside the display focus and not the content that the user cares about. At this time, the rendering component can be removed to reduce the rendering amount of the game scene.

[0062] Specifically, the clipping distance calculated earlier is used to measure the display focus. Based on the real-time distance between the rendering component and the virtual camera in the current game scene, if the clipping distance of the corresponding rendering component is exceeded, it is considered that it is not outside the display focus. At this time, the rendering component can be removed. Therefore, only the rendering components within the display focus are selected to be rendered onto the game scene.

[0063] The game scene optimization method in the embodiments of the present invention has been described above. The game scene optimization device in the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 3 One embodiment of the game scene optimization device in this invention includes:

[0064] The size calculation module 301 is used to select at least one rendering component to be clipped in the game scene and calculate the bounding box size of the preset shape corresponding to the rendering component.

[0065] The distance calculation module 302 is used to define the visual range of the game scene using a preset projection matrix, and to calculate the clipping distance of the rendering component within the visual range based on the bounding box size and the preset target screen ratio.

[0066] The optimization module 303 is used to optimize the game scene based on the clipping distance.

[0067] In this embodiment of the invention, by selecting the rendering components to be trimmed, pre-setting a target screen ratio and pre-constructing a projection matrix, and then calculating the bounding box size of the rendering component to determine its spatial size, the three factors are combined to batch calculate the bounding box size of each component under different dimensions. That is, after the projection matrix and target screen ratio are fixed, the loading distance is related to the bounding box size of the rendering component, and the loading distance of each rendering component is accurately calculated. Instead of relying on manual experience to specify, all rendering components are automatically calculated and set in batches, and the loading distance of rendering components within the game scene is precisely controlled, reducing resource loading redundancy when rendering the game scene.

[0068] Please see Figure 4 Another embodiment of the game scene optimization device in this invention includes:

[0069] The size calculation module 301 is used to select at least one rendering component to be clipped in the game scene and calculate the bounding box size of the preset shape corresponding to the rendering component.

[0070] The distance calculation module 302 is used to define the visual range of the game scene using a preset projection matrix, and to calculate the clipping distance of the rendering component within the visual range based on the bounding box size and the preset target screen ratio.

[0071] The optimization module 303 is used to optimize the game scene based on the clipping distance.

[0072] Specifically, the distance calculation module 302 includes:

[0073] The matrix adjustment unit 3021 is used to obtain the camera projection matrix corresponding to the game scene, and adjust the camera projection matrix and the preset projection matrix according to the preset scaling factor respectively;

[0074] The comparison unit 3022 is used to compare the matrix values ​​of the adjusted camera projection matrix with those of the adjusted preset projection matrix;

[0075] The determining unit 3023 is used to select a target projection matrix from the adjusted preset projection matrix and the camera projection matrix based on the comparison results, and determine the corresponding visual range in the game scene based on the target projection matrix.

[0076] Specifically, the distance calculation module 302 further includes:

[0077] The conversion unit 3024 is used to convert the bounding box size into the bounding box size corresponding to the game scene based on the target screen ratio;

[0078] The distance calculation unit 3025 is used to calculate the clipping distance of the rendering component projected onto the visual range based on the converted bounding box size.

[0079] Specifically, the size calculation module 301 includes:

[0080] A radius calculation unit 3011 is used to identify the sphere bounding box region corresponding to the rendering component and calculate the radius of the sphere bounding box region, wherein the bounding box size includes the radius; or,

[0081] Boundary calculation unit 3012 is used to identify the box bounding box region corresponding to the rendering component and calculate the motion boundary of the box bounding box region, wherein the bounding box size includes the motion boundary.

[0082] Specifically, the game scene optimization device also includes a visual adjustment module 304, used for:

[0083] Obtain the viewing angle and pixel size input from the front end, and set the projection matrix according to the viewing angle and pixel size;

[0084] Adjust the visual range of the game scene according to the set projection matrix.

[0085] Specifically, the optimization module 303 includes:

[0086] The identification unit 3031 is used to obtain the initial rendering component to be rendered in the game scene, and to identify the rendering component to be clipped in the initial rendering component;

[0087] The selection unit 3032 is used to calculate the real-time distance from the corresponding camera in the game scene to the rendering component to be clipped, and to select the rendering component whose clipping distance is greater than the real-time distance from the rendering component to be clipped.

[0088] Rendering unit 3033 is used to render initial rendering components other than the selected rendering components into the game scene.

[0089] above Figure 3 and Figure 4 The game scene optimization device in this embodiment of the invention will be described in detail from the perspective of modular functional entities. The game scene optimization device in this embodiment of the invention will be described in detail from the perspective of hardware processing.

[0090] Figure 5This is a schematic diagram of the structure of a game scene optimization device 500 provided in an embodiment of the present invention. The game scene optimization device 500 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 510 (e.g., one or more processors) and a memory 520, and one or more storage media 530 (e.g., one or more mass storage devices) for storing applications 533 or data 532. The memory 520 and storage media 530 can be temporary or persistent storage. The program stored in the storage media 530 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the game scene optimization device 500. Furthermore, the processor 510 may be configured to communicate with the storage media 530 and execute the series of instruction operations in the storage media 530 on the game scene optimization device 500.

[0091] The game scene optimization device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input / output interfaces 560, and / or one or more operating systems 531, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 5 The illustrated game scene optimization device structure does not constitute a limitation on the game scene optimization device. It may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.

[0092] The present invention also provides a game scene optimization device, wherein the computer device includes a memory and a processor, the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor performs the steps of the game scene optimization method in the above embodiments.

[0093] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the steps of the game scene optimization method.

[0094] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0095] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0096] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for optimizing game scenes, characterized in that, The game scene optimization methods include: Select at least one rendering component to be clipped in the game scene, and calculate the bounding box size of the preset shape corresponding to the rendering component; The visual range of the game scene is defined using a preset projection matrix, and the clipping distance of the rendering component is calculated within the visual range based on the bounding box size and the preset target screen ratio. The game scene is optimized based on the stated clipping distance; The step of calculating the clipping distance of the rendering component within the visual range based on the bounding box size and the preset target screen ratio includes: Based on the target screen ratio, the bounding box size is converted to the bounding box size corresponding to the game scene. Based on the converted bounding box size, calculate the clipping distance of the rendering component projected onto the visual range; Defining the visual range of the game scene using a preset projection matrix includes: adjusting the size of the viewing angle range by setting the FOV value of the virtual camera and the size of the displayed pixels; once the FOV value and pixel size are set, dividing the visual range of a fixed part of the game scene according to the preset projection matrix.

2. The game scene optimization method according to claim 1, characterized in that, The calculation of the bounding box size of the preset shape corresponding to the rendering component includes: Identify the sphere bounding box region corresponding to the rendering component, and calculate the radius of the sphere bounding box region, wherein the bounding box size includes the radius; or, Identify the box bounding box region corresponding to the rendering component, and calculate the motion boundary of the box bounding box region, wherein the bounding box size includes the motion boundary.

3. The game scene optimization method according to any one of claims 1-2, characterized in that, After defining the visual range of the game scene using a preset projection matrix, the method further includes: Obtain the viewing angle and pixel size input from the front end, and set the projection matrix according to the viewing angle and pixel size; Adjust the visual range of the game scene according to the set projection matrix.

4. The game scene optimization method according to any one of claims 1-2, characterized in that, The optimization of the game scene based on the clipping distance includes: Obtain the initial rendering components to be rendered in the game scene, and identify the rendering components to be clipped in the initial rendering components; Calculate the real-time distance from the corresponding camera in the game scene to the rendering component to be clipped, and select the rendering component whose clipping distance is greater than the real-time distance from the rendering components to be clipped; Render the initial rendering components, excluding the selected rendering components, into the game scene.

5. A game scene optimization device, characterized in that, The game scene optimization device includes: The size calculation module is used to select at least one rendering component to be clipped in the game scene and calculate the bounding box size of the preset shape corresponding to the rendering component. The distance calculation module is used to define the visual range of the game scene using a preset projection matrix, and to calculate the clipping distance of the rendering component within the visual range based on the bounding box size and the preset target screen ratio. An optimization module is used to optimize the game scene based on the clipping distance; The distance calculation module also includes: The conversion unit is used to convert the bounding box size into the bounding box size corresponding to the game scene based on the target screen ratio. The distance calculation unit is used to calculate the clipping distance of the rendering component projected onto the visual range based on the converted bounding box size; When the distance calculation module is used to define the visual range of the game scene using a preset projection matrix, it includes: adjusting the size of the viewing angle range by setting the FOV value corresponding to the virtual camera and the size of the displayed pixels; and dividing the visual range of a fixed part of the game scene according to the preset projection matrix after the FOV value and pixel size are set.

6. The game scene optimization device according to claim 5, characterized in that, The game scene optimization device also includes a visual adjustment module, used for: Obtain the viewing angle and pixel size input from the front end, and set the projection matrix according to the viewing angle and pixel size; Adjust the visual range of the game scene according to the set projection matrix.

7. A game scene optimization device, characterized in that, The game scene optimization device includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor invokes the instructions in the memory to cause the game scene optimization device to perform the steps of the game scene optimization method as described in any one of claims 1-4.

8. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions are executed by the processor, they implement the various steps of the game scene optimization method as described in any one of claims 1-4.