Game scene dynamic display method and device, electronic equipment and storage medium

By constructing symbol distance field data on the graphics processor and performing collision detection, the accuracy and real-time problems of traditional physical simulation technology when dealing with complex geometric shapes are solved, and more efficient and accurate physical simulation is achieved.

CN119733234APending Publication Date: 2025-04-01BEIJING PIXEL SOFTWARE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411925219.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

Traditional 3D scene physics simulation technology is prone to introduce geometric errors when dealing with complex geometric shapes, resulting in a decrease in physical simulation accuracy, and misjudgment or misjudgment of collision detection, which has high calculation cost, insufficient real-time performance, and limited ability to adapt to complex geometry.

Method used

By loading game scenes on the graphics processor, constructing symbol distance field (SDF) data, representing stationary objects, and detecting collision between moving objects and stationary objects based on SDF data, and updating the physical state of the moving objects.

Benefits of technology

It avoids geometric errors caused by meshing, improves the accuracy of physical simulation, can handle complex surfaces and irregular shapes, reduces calculation costs, and improves real-time and adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119733234A_ABST
    Figure CN119733234A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a game scene dynamic display method and device, electronic equipment and a storage medium, and relates to the technical field of game development. The method comprises the following steps: a graphics processor loads a game scene at each moment in a game running process, and constructs sign distance field SDF data for all static objects in the game scene; based on the SDF data, collision detection is carried out on moving objects in the game scene and all static objects, and collision information is obtained; the physical state of the moving object is updated according to the collision information, so that geometric errors caused by gridding are avoided, complex curved surfaces and irregular shapes can be processed, the physical simulation precision is improved, and the display effect of a game scene is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of game development technology, and in particular to a method, device, electronic device and storage medium for dynamically displaying a game scene. Background Art

[0002] 3D scene physics simulation is an important technology in computer graphics and game development, and is widely used in fields such as virtual reality, game engines, and film and television special effects. Through physics simulation, objects in the virtual environment can move and interact according to the laws of physics, providing realistic visual effects and interactive experiences. One of the key technologies of physics simulation is collision detection, which determines how objects interact with each other in the virtual world.

[0003] Traditional 3D scene physics simulations usually rely on triangular meshes to represent the geometric shapes in the scene. These triangular meshes are used as the basis for collision detection and physics calculations, but they are prone to introducing geometric errors, especially when dealing with curved surfaces and irregular shapes, and have low accuracy. Summary of the invention

[0004] In view of this, an object of the present invention is to provide a method, device, electronic device and storage medium for dynamically displaying a game scene.

[0005] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:

[0006] In a first aspect, the present invention provides a method for dynamically displaying a game scene, which is applied to a graphics processor, and the method comprises:

[0007] At each moment during the running of the game, the game scene is loaded, and the signed distance field (SDF) data is constructed for all stationary objects in the game scene;

[0008] Based on the SDF data, collision detection is performed on the moving object in the game scene and all the stationary objects to obtain collision information;

[0009] The physical state of the moving object is updated according to the collision information.

[0010] Optionally, the SDF data includes an SDF value of each position point in the game scene, and the step of constructing SDF data for all stationary objects in the game scene includes:

[0011] For each of the position points in the game scene, calculating the shortest distance between the position point and the surface of each of the stationary objects;

[0012] The minimum value of the shortest distances between the position point and the surface of each of the stationary objects is taken as the SDF value of the position point.

[0013] Optionally, the step of performing collision detection on the moving object in the game scene and all the stationary objects based on the SDF data to obtain collision information includes:

[0014] generating a detection light according to the to-be-detected part and the moving direction of the moving object;

[0015] The detection light is gradually advanced according to a preset number of advancement steps and a preset step length, and each time the detection light is advanced, it is determined whether the moving object collides with a stationary object in the game scene according to an SDF value of a position point on the detection light that is advanced;

[0016] If the number of steps that the detection light has advanced does not reach the preset number of steps, and it is determined that the moving object collides with a stationary object in the game scene when the detection light is currently advanced, the detection light is stopped from being advanced, and the position point on the detection light currently being advanced is used as the collision point;

[0017] The position information of the collision point is used as the collision information.

[0018] Optionally, the step of generating detection light according to the to-be-detected component and the moving direction of the moving object includes:

[0019] Taking each position point on the surface of the to-be-detected component of the moving object as the starting point of the light beam;

[0020] Taking the moving direction of the moving object as the extending direction of the light;

[0021] A plurality of detection light rays are generated by using each of the light starting points and the light extending directions.

[0022] Optionally, the step of judging whether the moving object collides with a stationary object in the game scene according to the SDF value of the position point pushed forward on the detection light comprises:

[0023] If the SDF value of the position point pushed forward on the detection light is less than a preset threshold, it is determined that the moving object collides with the stationary object in the game scene;

[0024] If the SDF value of the advanced position point on the detection light is not less than the preset threshold, determining whether the number of advanced steps of the detection light reaches the preset number of advanced steps;

[0025] If the number of advancement steps of the detection light has not reached the preset number of advancement steps, continue to advance the detection light according to the preset step length;

[0026] If the number of advancement steps of the detection light reaches the preset number of advancement steps, it is determined that the moving object has not collided with the stationary object in the game scene.

[0027] Optionally, the step of performing collision detection on the moving object in the game scene and all the stationary objects based on the SDF data to obtain collision information further includes:

[0028] If the number of advancement steps of the detection light reaches the preset number of advancement steps, the collision information is set as preset information.

[0029] Optionally, the physical state of the moving object includes speed, position and direction, and the step of updating the physical information of the moving object according to the collision information includes:

[0030] If the collision information is preset information, the speed, position and direction of the moving object are kept unchanged;

[0031] If the collision information is the position information of the collision point, the collision area of ​​the moving object is determined according to the position information of the collision point, and the speed, position and direction of the moving object are adjusted according to the collision area.

[0032] In a second aspect, the present invention provides a method for dynamically displaying a game scene, which is applied to a graphics processor. The device includes a construction module, an acquisition module, and an update module:

[0033] At each moment during the game running process, the construction module is used to load the game scene and construct SDF data for all stationary objects in the game scene; the acquisition module is used to perform collision detection on the moving objects in the game scene and all the stationary objects based on the SDF data to obtain collision information; the update module is used to update the physical state of the moving objects according to the collision information.

[0034] In a third aspect, the present invention provides an electronic device comprising a graphics processor and a memory, wherein the memory stores machine executable instructions that can be executed by the graphics processor, and the graphics processor can execute the machine executable instructions to implement the method for dynamic display of game scenes described in the first aspect.

[0035] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a graphics processor, implements the method for dynamically displaying a game scene as described in the first aspect above.

[0036] The embodiment of the present invention provides a method for dynamically displaying a game scene: at each moment during the running of the game, the graphics processor loads the game scene, and constructs the signed distance field SDF data for all the stationary objects in the game scene; based on the SDF data, the moving objects in the game scene are subjected to collision detection with all the stationary objects to obtain collision information; and the physical state of the moving objects is updated according to the collision information. Since the embodiment of the present invention uses the SDF data corresponding to all the stationary objects in the game scene to perform collision detection on the moving objects in the game scene with all the stationary objects, the geometric errors caused by meshing can be avoided, complex curved surfaces and irregular shapes can be processed, the accuracy of physical simulation can be improved, and the display effect of the game scene can be guaranteed.

[0037] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0039] Figure 1 A schematic structural block diagram of an electronic device provided by an embodiment of the present invention is shown;

[0040] Figure 2 The following is a schematic diagram showing a process of a method for dynamically displaying a game scene provided by an embodiment of the present invention. Figure 1 ;

[0041] Figure 3 A schematic diagram showing a process of implementing step S102 provided in an embodiment of the present invention Figure 1 ;

[0042] Figure 4 A schematic diagram showing a process of implementing step S102 provided in an embodiment of the present invention Figure 2 ;

[0043] Figure 5 A functional unit block diagram of a game scene dynamic display device provided by an embodiment of the present invention is shown.

[0044] Icon: 100 - electronic device; 110 - memory; 120 - processor; 130 - communication module; 200 - game scene dynamic display device; 201 - construction module; 202 - acquisition module; 203 - update module. DETAILED DESCRIPTION

[0045] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0046] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.

[0047] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0048] Please refer to Figure 1 , is a block diagram of an electronic device 100. The electronic device 100 includes a memory 110, a graphics processor 120, and a communication module 130. The memory 110, the graphics processor 120, and the communication module 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.

[0049] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.

[0050] The graphics processor 120 is used to read / write data or programs stored in the memory 110 and execute corresponding functions.

[0051] The communication module 130 is used to establish a communication connection between the electronic device 100 and other communication terminals through the network, and to send and receive data through the network.

[0052] It should be understood that Figure 1 The structure shown is only a schematic diagram of the structure of the electronic device 100. The electronic device 100 may also include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0053] 3D scene physics simulation is an important field in computer graphics and game development, and is widely used in virtual reality, game engines, film and television special effects and other fields. Through physical simulation technology, objects in the virtual environment can move and interact according to the laws of physics, thus providing realistic visual effects and interactive experience. At present, physical simulation mainly includes rigid body dynamics, fluid dynamics, cloth simulation, etc., among which collision detection is a key component of physical simulation.

[0054] Existing 3D scene physical simulation technologies include triangle mesh-based geometric representation, bounding box-based collision detection, and physics engine-based simulation.

[0055] "Geometry representation based on triangular meshes" relies on triangular meshes to represent geometric shapes. Each complex geometric body is decomposed into a large number of small triangles. It is widely used in various 3D graphics engines and physical simulation systems, such as game engines, virtual reality systems and other scenarios.

[0056] "Bounding box-based collision detection" relies on simple geometric shapes (such as axis-aligned bounding box AABB, bounding sphere or convex hull), first excludes objects that are unlikely to collide through simple boundary checks, and then further refines the detection. It is widely used in rigid body physics simulation, especially in scenes that need to process a large number of objects quickly.

[0057] "Physics-based simulation" relies on existing physics engines, such as PhysX, Bullet, Havok, etc. These engines use rigid body dynamics models and fluid dynamics models based on mechanical formulas to simulate the movement of objects after being subjected to forces. These physics engines are widely used in game development, virtual reality applications, film special effects production and other fields, usually combining collision detection and dynamics simulation to provide realistic physical effects.

[0058] The defects of the prior art include the following aspects:

[0059] Geometric error: Triangular meshing can easily introduce geometric errors when dealing with complex geometric shapes, resulting in reduced accuracy of physical simulation.

[0060] Collision detection misjudgment / missed detection: Bounding box-based collision detection methods are prone to misjudgment or missed detection, especially in highly dynamic scenes.

[0061] High computational cost: As the number and complexity of objects in the scene increase, the computational complexity of traditional methods increases significantly, affecting real-time performance.

[0062] Insufficient real-time performance: When dealing with complex scenarios or applications that require high real-time performance, traditional methods are difficult to meet performance requirements.

[0063] Poor adaptability to complex geometries: Traditional technologies have limited processing capabilities for complex geometric shapes, and increasing mesh density will significantly increase computational complexity.

[0064] Lack of flexibility: Traditional physics engines are not flexible enough when faced with new or non-standard physical phenomena.

[0065] In order to improve the accuracy of physical simulation and ensure the display effect of game scenes, an embodiment of the present invention provides a method for dynamically displaying game scenes, which will be described in detail below.

[0066] Please refer to Figure 2 The method for dynamically displaying a game scene includes steps S101 to S103.

[0067] S101, at each moment during the running of the game, the game scene is loaded, and SDF (Signed Distance Field) data is constructed for all stationary objects in the game scene.

[0068] In the embodiment of the present invention, the implementation process of constructing SDF data for all stationary objects in the game scene loaded at each moment may be:

[0069] For each position point in the game scene, first, the shortest distance between the position point and the surface of each stationary object is calculated; the minimum value of the shortest distance between the position point and the surface of each stationary object is used as the SDF value of the position point.

[0070] The SDF data includes the SDF value of each position point in the game scene. It can be understood that the SDF value of each position point describes the shortest distance from the position point to the surface of the nearest stationary object.

[0071] Compared with traditional triangle mesh representation, SDF can capture the geometric characteristics of stationary objects more accurately and provide a continuous and smooth geometric representation. Through SDF representation, geometric errors caused by meshing can be avoided, especially when dealing with complex surfaces and irregular shapes. The construction of SDF data provides a solid foundation for subsequent ray stepping and collision detection.

[0072] S102, based on the SDF data, performing collision detection on the moving objects and all stationary objects in the game scene to obtain collision information.

[0073] In a possible implementation, such as Figure 3 As shown, the implementation process of step S102 may include sub-steps S102-1 to S102-4.

[0074] S102-1, generating detection light according to the part to be detected and the moving direction of the moving object.

[0075] In an embodiment of the present invention, each position point on the surface of the component to be detected of the moving object is used as the starting point of the light; the moving direction of the moving object is used as the extending direction of the light; and multiple detection lights are generated using each starting point of the light and the extending direction of the light.

[0076] S102-2, gradually advance the detection light according to a preset number of advancement steps and a preset step length, and each time the detection light is advanced, determine whether the moving object collides with a stationary object in the game scene based on the SDF value of the position point on the detection light being advanced.

[0077] In an embodiment of the present invention, the stepping process of each detection light ray can be executed in parallel on the GPU, and by making full use of the multi-threaded computing capability of the GPU, the calculation process of light propagation is accelerated and efficient real-time response can be maintained when processing complex scenes.

[0078] Each time the detection ray is advanced, the implementation process of "determining whether the moving object collides with the stationary object in the game scene according to the SDF value of the position point advanced on the detection ray" can be as follows:

[0079] First, it is determined whether the SDF value of the pushed position point on the detection light is less than a preset threshold.

[0080] If the SDF value of the pushed position point on the detection light is less than a preset threshold, it is determined that the moving object collides with the stationary object in the game scene.

[0081] If the SDF value of the advanced position point on the detection light is not less than the preset threshold, it is determined whether the number of advanced steps of the detection light reaches the preset number of advanced steps.

[0082] If the number of steps that the detection light has advanced does not reach the preset number of steps, the detection light continues to be advanced according to the preset step length.

[0083] If the number of advancement steps of the detection light reaches the preset number of advancement steps, it is determined that the moving object has not collided with the stationary object in the game scene.

[0084] It can be understood that when the SDF value of the position point on the detection light is less than the preset threshold and the number of steps the detection light has advanced does not reach the preset number of steps, it is determined that the moving object collides with the stationary object in the game scene.

[0085] When the SDF value of the position point on the detection light being advanced is not less than the preset threshold value and the number of advanced steps of the detection light has not reached the preset number of advanced steps, the detection light continues to be advanced.

[0086] When the SDF value of the position point advanced on the detection light is not less than a preset threshold and the number of advanced steps of the detection light reaches a preset number of advanced steps, it is determined that the moving object has not collided with the stationary object in the game scene.

[0087] S102-3, if the number of advancement steps of the detection light has not reached the preset advancement number, and it is determined that the moving object collides with a stationary object in the game scene when the detection light is currently advanced, stop advancing the detection light, and use the position point on the current detection light that is advanced as the collision point.

[0088] It can be understood that the SDF value of the collision point is less than the preset threshold.

[0089] In the embodiment of the present invention, the preset threshold and the preset number of advancement steps may be set according to the accuracy requirement of the collision detection.

[0090] S102-4, taking the position information of the collision point as collision information.

[0091] For further information, see Figure 4 , step S102 also includes step S102-5.

[0092] S102-5: If the number of advancement steps of the detection light reaches the preset number of advancement steps, the collision information is set as the preset information.

[0093] It is understandable that if a collision point is determined during the advancement of the detection light, the advancement will be stopped. When the number of advancement steps detected reaches the preset number of advancement steps, it means that no collision point is determined during the advancement of the detection light.

[0094] The preset information is used to indicate that the physical state of the moving object remains unchanged.

[0095] S103: Update the physical state of the moving object according to the collision information.

[0096] Among them, the physical state of a moving object includes speed, position and direction.

[0097] In a possible implementation, the implementation process of step S103 includes two situations.

[0098] In case 1, if the collision information is preset information, the speed, position and direction of the moving object are kept unchanged.

[0099] In scenario 2, if the collision information is the position information of the collision point, the collision area of ​​the moving object is determined according to the position information of the collision point, and the speed, position and direction of the moving object are adjusted according to the collision area.

[0100] In an embodiment of the present invention, the position, speed, direction, etc. of moving objects in the loaded game scene are collected in real time, and these parameters are dynamically adjusted according to the collision results, thereby ensuring that the physical state in the scene is continuously updated over time, ensuring the consistency and accuracy of the physical simulation, and the physical simulation results can reflect the actual interaction between objects, providing users with a more realistic physical interaction experience.

[0101] The technical solution of the embodiment of the present invention is a loop execution mechanism. Each time a game scene is loaded, ray stepping and collision detection are performed on the loaded game scene, and the physical state of the moving object is updated. The loop process continues until a predetermined end condition is met, such as reaching the simulation time or reaching the scene target state, etc., so that the physical simulation process has high consistency and dynamic adaptability, ensuring that the physical state of the moving objects in the scene is continuously updated and adjusted over time, so as to achieve a more realistic simulation effect.

[0102] The method provided by the embodiment of the present invention is applicable to complex 3D scenes that require high precision and high real-time performance, such as large-scale games, virtual reality (VR) and augmented reality (AR) systems. Through GPU-accelerated ray-stepping technology, the system can provide real-time physical simulation and collision detection in these complex scenes.

[0103] Since the detection ray stepping is executed in parallel on the GPU, the method provided in the embodiment of the present invention performs well when processing large-scale scenes, can effectively utilize the computing power of the GPU, and provide efficient physical simulation services.

[0104] For example, in a beach racing game, players control a car to race on a complex beach terrain, which includes slopes, sand dunes, and obstacles (such as rocks, wood piles, etc.). The car needs to detect collisions with the terrain and obstacles in real time while driving at high speed, and simulate the physical reactions of the car (such as jumping, rolling, sharp turns, etc.).

[0105] First, generate SDF data for the entire beach scene, including every dune, slope, and obstacle in the game (such as rocks, wood piles, etc.).

[0106] For the racing car itself, its SDF data is also generated to represent the geometric shapes of the racing car's tires, chassis and other components, so as to accurately calculate the contact between the racing car's tires, chassis and other components and the terrain and obstacles.

[0107] The relevant pseudo code is as follows:

[0108]

[0109] In the game, the player controls a car to drive at high speed on the beach. The GPU gradually advances the light according to the SDF data to simulate the trajectory of the car and detect whether the car will hit an obstacle or fall into a sand pit in front.

[0110] The relevant pseudo code is as follows:

[0111]

[0112] When the chassis or wheels of the car are detected to collide with the beach or obstacles, the system adjusts the physical state of the car in real time according to the location and angle of the collision point. For example:

[0113] Car rollover: When a car rushes to the top of a sand dune at high speed, if its front wheels leave the ground, the system will simulate the car's take-off and rollover effects.

[0114] Slowdown and Jump: When the car hits an obstacle, the system will adjust the speed and jump height of the car according to the angle of the collision point. For example, when the car hits a wooden stake, the system will slow down the car or even make it jump.

[0115] Drift effect: When the car turns sharply on the beach, the system will simulate the drift effect of the car by adjusting the contact point between the wheel and the beach surface.

[0116] pseudocode:

[0117]

[0118] The physics simulation and collision detection in the game are continuously executed through a feedback loop. In each frame, the car's collision with the terrain or obstacles is detected, and the car's physical state is updated according to the collision result to ensure that the car's physics simulation and control feel in the game are real-time and continuous. The feedback loop ensures that after each collision, the car's state is updated in time, and the player can feel the car's reaction in real time.

[0119] The relevant pseudo code is as follows:

[0120]

[0121]

[0122] The embodiments of the present invention can simulate the physical behavior of a car in real time in a complex beach terrain by using GPU-accelerated ray marching and SDF data, including collision detection with sand dunes and obstacles and dynamic changes of the vehicle in jumping, rolling and drifting. Players can experience a more realistic racing experience, and the changes in the beach and the interaction between the car and the environment are more realistic and smooth.

[0123] In order to execute the corresponding steps in the above embodiments and various possible methods, a method for implementing the game scene dynamic display device 200 is given below. Figure 5 , Figure 5 The functional module diagram of a game scene dynamic display device 200 provided in an embodiment of the present invention. It should be noted that the basic principle and technical effects of the game scene dynamic display device 200 provided in this embodiment are the same as those of the above embodiments. For the sake of brief description, for the parts not mentioned in this embodiment, reference can be made to the corresponding contents in the above embodiments. The game scene dynamic display device 200 includes a construction module 201, an acquisition module 202 and an update module 203.

[0124] At each moment during the game running process, the construction module 201 is used to load the game scene and construct SDF data for all stationary objects in the game scene; the acquisition module 202 is used to perform collision detection on the moving objects in the game scene and all the stationary objects based on the SDF data to obtain collision information; the update module 203 is used to update the physical state of the moving objects according to the collision information.

[0125] Optionally, the above modules can be stored in the form of software or firmware. Figure 1 The memory shown in the figure or solidified in the operating system (OS) of the electronic device, and can be Figure 1 Meanwhile, the data and program codes required for executing the above modules can be stored in the memory.

[0126] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0127] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

[0128] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, electronic device, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

[0129] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for dynamically displaying a game scene, characterized in that: Applied to a graphics processor, the method comprises: At each moment during the running of the game, the game scene is loaded, and the signed distance field (SDF) data is constructed for all stationary objects in the game scene; Based on the SDF data, collision detection is performed on the moving object in the game scene and all the stationary objects to obtain collision information; The physical state of the moving object is updated according to the collision information.

2. The method for dynamically displaying a game scene according to claim 1, characterized in that: The SDF data includes the SDF value of each position point in the game scene, and the step of constructing SDF data for all stationary objects in the game scene includes: For each of the position points in the game scene, calculating the shortest distance between the position point and the surface of each of the stationary objects; The minimum value of the shortest distances between the position point and the surface of each of the stationary objects is taken as the SDF value of the position point.

3. The method for dynamically displaying a game scene according to claim 2, characterized in that: The step of performing collision detection on the moving object in the game scene and all the stationary objects based on the SDF data to obtain collision information comprises: generating a detection light beam according to the to-be-detected component and the moving direction of the moving object; The detection light is gradually advanced according to a preset number of advancement steps and a preset step length, and each time the detection light is advanced, it is determined whether the moving object collides with a stationary object in the game scene according to an SDF value of a position point on the detection light that is advanced; If the number of steps that the detection light has advanced does not reach the preset number of steps, and it is determined that the moving object collides with a stationary object in the game scene when the detection light is currently advanced, the detection light is stopped from being advanced, and the position point on the detection light currently being advanced is used as the collision point; The position information of the collision point is used as the collision information.

4. The method for dynamically displaying a game scene according to claim 3, characterized in that: The step of generating detection light according to the to-be-detected component and the moving direction of the moving object comprises: Taking each position point on the surface of the to-be-detected component of the moving object as the starting point of the light beam; Taking the moving direction of the moving object as the extending direction of the light; A plurality of detection light rays are generated by using each of the light starting points and the light extending directions.

5. The method for dynamically displaying a game scene according to claim 3, characterized in that: The step of judging whether the moving object collides with a stationary object in the game scene according to the SDF value of the position point pushed forward on the detection light comprises: If the SDF value of the position point pushed forward on the detection light is less than a preset threshold, it is determined that the moving object collides with the stationary object in the game scene; If the SDF value of the advanced position point on the detection light is not less than the preset threshold, determining whether the number of advanced steps of the detection light reaches the preset number of advanced steps; If the number of advancement steps of the detection light has not reached the preset number of advancement steps, continue to advance the detection light according to the preset step length; If the number of advancement steps of the detection light reaches the preset number of advancement steps, it is determined that the moving object has not collided with the stationary object in the game scene.

6. The method for dynamically displaying a game scene according to claim 5, characterized in that: The step of performing collision detection on the moving object in the game scene and all the stationary objects based on the SDF data to obtain collision information further includes: If the number of advancement steps of the detection light reaches the preset number of advancement steps, the collision information is set as preset information.

7. The method for dynamically displaying a game scene according to claim 1, characterized in that: The physical state of the moving object includes speed, position and direction, and the step of updating the physical information of the moving object according to the collision information includes: If the collision information is preset information, the speed, position and direction of the moving object are kept unchanged; If the collision information is the position information of the collision point, the collision area of ​​the moving object is determined according to the position information of the collision point, and the speed, position and direction of the moving object are adjusted according to the collision area.

8. A game scene dynamic display device, characterized in that: Applied to a graphics processor, the device includes a construction module, an acquisition module and an update module: At each moment during the game running process, the construction module is used to load the game scene and construct SDF data for all stationary objects in the game scene; the acquisition module is used to perform collision detection on the moving objects in the game scene and all the stationary objects based on the SDF data to obtain collision information; the update module is used to update the physical state of the moving objects according to the collision information.

9. An electronic device, characterized in that: It includes a graphics processor and a memory, wherein the memory stores machine executable instructions that can be executed by the graphics processor, and the graphics processor can execute the machine executable instructions to implement the game scene dynamic display method described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a graphics processor, the method for dynamically displaying a game scene as described in any one of claims 1 to 7 is implemented.