A method and system for designing a driving engine based on a 3D game vehicle
By calculating the three-dimensional coordinates of the viewpoint based on the weight allocation of the field of view azimuth, centerline azimuth, and vehicle deformation contour in 3D games, and combining them with static and dynamic presentation vectors, the problem of vehicle deformation affecting the viewpoint is solved, thereby improving immersion and interactive experience.
Patent Information
- Application Number
- CN202511215125.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2045-08-28
AI Technical Summary
In existing 3D game vehicle driving engine designs, the impact of vehicle deformation on the viewpoint is ignored, resulting in a disconnect between the viewpoint and the vehicle's state, reducing immersion. Furthermore, the dynamic linkage effect of related components is poor, weakening the interactive experience.
Based on the user permissions of the target vehicle, the driving location point is determined and sub-scenes are extracted. The three-dimensional coordinates of the viewpoint are calculated, and the static and dynamic rendering vectors are combined for rendering processing, including the weight allocation of the field of view azimuth, centerline azimuth, and vehicle deformation contour, to optimize the viewpoint range and rendering method.
It achieves a strong binding between the viewpoint and vehicle deformation, reduces unnecessary rendering, enhances immersion, and restores realistic operation feedback by combining static and dynamic vectors, thereby improving the interactive experience.
Smart Images

Figure CN120733348B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of 3D game design, and in particular to a driving engine design method and system based on a 3D game vehicle. BACKGROUND
[0002] With the continuous development of 3D game technology, players have increasingly high requirements for vehicle driving experience in games, not only pursuing high definition and high fidelity of pictures, but also expecting scene rendering to be deeply adapted to vehicle dynamics, player operations, etc. However, the existing 3D game vehicle driving engine design has many deficiencies as follows:
[0003] When the prior art determines the viewpoint, it often only considers the field of view azimuth and the middle line azimuth, ignoring the influence of vehicle deformation, such as collision deformation and accelerated head tilting, on the first viewpoint. After the vehicle deforms, the physical position and angle of the actual field of view of the player have changed, but the engine does not adapt in time, causing the viewpoint to be disconnected from the vehicle state, reducing the sense of immersion. For example, after a racing car collides, the player's viewpoint is still calculated according to the un-deformed cockpit, and the picture is jarring. Moreover, the prior art does not deeply associate the behavior operations of the viewpoint, such as the player's switching of the vehicle lights and the turning on of the wiper, and does not adequately consider the combination of dynamically associated components, such as the poor linkage effect of water splashing and road wetness reflection when the vehicle drives at high speed. Therefore, the visual presentation changes at the scene point cannot be accurately reflected, leading to non-intuitive feedback and weakening the interactive experience.
[0004] Therefore, the present application proposes a driving engine design method and system based on a 3D game vehicle. SUMMARY
[0005] The present application provides a driving engine design method and system based on a 3D game vehicle to solve the above technical problems.
[0006] The present application provides a driving engine design method based on a 3D game vehicle, comprising:
[0007] Step 1: determining a driving position point in a 3D game scene based on the user rights of a target vehicle, and performing scene point extraction to obtain a sub-scene;
[0008] Step 2: determining the three-dimensional coordinates of the viewpoint of the target vehicle at each driving position point in the sub-scene based on different combinations of field of view azimuth, middle line azimuth and vehicle deformation profile, with the target vehicle as the first viewpoint;
[0009] Step 3: determining the static presentation vector of each first presentation point in the standard visual range under each behavior operation in the behavior operation list according to the standard visual range of each viewpoint at the same scene point and the behavior operation list of the corresponding viewpoint;
[0010] Step 4: determining a dynamic presentation vector of the corresponding first presentation point under each dynamic associated component combination according to the dynamic associated component list of the first presentation point;
[0011] Step 5: determining a rendering mode of each first presentation point and performing driving rendering according to the static presentation vector and the dynamic presentation vector, and combining a straight-line distance between the first presentation point and the viewpoint and a game permission of the target vehicle.
[0012] Preferably, step 2 comprises:
[0013] determining a real-time dynamic parameter of the target vehicle at the driving position point, and predicting a next-instant parameter according to the real-time dynamic parameter, determining a first weight based on a field-of-view azimuth angle, a second weight based on a centerline azimuth angle, and a third weight based on a vehicle deformation profile, wherein the real-time dynamic parameter comprises a driving acceleration, a steering curvature, and a body roll angle;
[0014] determining a first initial point of a first azimuth angle combination based on the real-time dynamic parameter, and simultaneously determining a second initial point of a second azimuth angle combination based on the predicted next-instant parameter, wherein the first azimuth angle combination, the second azimuth angle combination, and the third azimuth angle combination are used to obtain a first vertical line based on the field-of-view azimuth angle, a second vertical line based on the centerline azimuth angle, and a third vertical line based on the vehicle deformation profile, and the first initial point, the second initial point, and a preset cockpit reference coordinate called based on a vehicle model parameter of the target vehicle are used to obtain a corresponding initial point;
[0015] determining a viewpoint range corresponding to the driving position point according to the first initial point and the second initial point, and performing a setback processing on the viewpoint range according to the first weight, the second weight, and the third weight to obtain a three-dimensional coordinate of the viewpoint.
[0016] Preferably, the static presentation vector of each first presentation point in the standard visualizable range under each behavior operation in the behavior operation list is determined in sequence, comprising:
[0017] taking each viewpoint as a reference and obtaining a rotation region set of the corresponding viewpoint according to a 0.1° rotation, and taking each region point in each rotation region in the rotation region set as a scene point;
[0018] performing type division on the first presentation points in the standard visualizable range to obtain a presentation point type set comprising a road surface type, a vegetation type, a building type, and a dynamic object type, and configuring a basic static attribute vector for each type of presentation point;
[0019] generate a static rendering vector of each first rendering point based on a preset association influence weight of each behavior operation in the behavior operation list with a rendering point type, a field of view weight coefficient of the first rendering point based on each behavior operation, and a basic static attribute vector corresponding to the rendering point type, wherein the static rendering vector includes a color channel value, a texture mapping coordinate, and a transparency parameter.
[0020] Preferably, the field of view weight coefficient of the first rendering point based on each behavior operation is determined, including:
[0021] determine a field of view dynamic attenuation reference value based on the real-time dynamic parameter and the real-time torque, wherein the absolute value of the driving acceleration is negatively correlated with the reference value, the steering curvature is negatively correlated with the attenuation gradient of the reference value along the steering direction, and the body roll angle is negatively correlated with the reference value;
[0022] perform a saliency grading of the first rendering points in the standard visualization range according to a spatial included angle between the rendering points and the driving path, a collision risk coefficient of the rendering points, and a texture complexity of the rendering points, to obtain a high saliency rendering point set, a medium saliency rendering point set, and a low saliency rendering point set;
[0023] establish radial grid lines at an interval of 0.03° along the polar coordinate angle and establish layered height grid surfaces along the field of view depth direction to form a three-dimensional grid with the viewpoint as the origin, and perform corresponding attenuation processing on the grid cells where the different saliency rendering point sets are located;
[0024] perform an intersection operation on the grid after the attenuation processing and the boundary of the rotating area, start an edge compensation factor for the grid cells in the boundary transition area, and finally generate the field of view weight coefficient of each first rendering point in the standard visualization range, wherein the edge compensation factor is related to the square of the speed of the target vehicle and the relative influence relationship of the first rendering point based on the corresponding behavior operation.
[0025] Preferably, the edge compensation factor is started for the grid cells in the boundary transition area, including:
[0026] divide the grid cells in the boundary transition area into sub-grids and parent grids according to the spatial relationship with the target vehicle and the standard visualization range;
[0027] calculate a first compensation factor for the corresponding parent grid based on the square of the instantaneous speed of the vehicle and a steering angular velocity direction correction coefficient;
[0028] if the intersection-union ratio of the corresponding sub-grid and its parent grid is 1, calculate a second compensation factor for the corresponding sub-grid based on the first compensation factor;
[0029] If the intersection ratio of the corresponding sub-grid with the plurality of parent grids is greater than 0, a third compensation factor of the corresponding sub-grid is calculated based on the first compensation factor and the average of the intersection ratio with the plurality of parent grids;
[0030] The dynamic compensation factors of all sub-grids and parent grids involved in the grid cell in the boundary transition zone are weighted and superimposed, and an edge compensation factor is obtained in combination with the relative influence of the current behavior operation on the vehicle state.
[0031] Preferably, according to the dynamic associated component list of the first presentation point, the dynamic presentation vector of the corresponding first presentation point under each dynamic associated component combination is determined, including:
[0032] The dynamic associated component list of the first presentation point is hierarchically weighted and ordered, the dynamic associated component including a physical collision component, a light and shadow projection component, a particle special effect component and a material deformation component, and the hierarchical weight order being determined according to the influence intensity of the component on the visual change of the presentation point;
[0033] A component interaction coefficient matrix is constructed, wherein the matrix element value represents the synergistic influence coefficient when different types of dynamic associated component combinations are combined;
[0034] Based on each dynamic associated component combination, an initial dynamic vector is calculated based on the component hierarchical weight and the component interaction coefficient matrix, the initial dynamic vector including a position offset, a rotation angular velocity and a texture stretching coefficient;
[0035] The interaction behavior type of the physical collision component based on each dynamic associated component combination is determined, and the feature change amount of the physical collision component before and after the corresponding dynamic associated component combination is determined, to obtain a collision warning index, wherein the interaction behavior type includes an irrelevant interaction type, an allowed interaction type and a prohibited interaction type;
[0036] According to the correlation between the collision warning index and each dynamic element, and in combination with the collision warning index, the initial dynamic vector is modified to generate a dynamic presentation vector containing a dynamic change rate and a decay boundary parameter, and the dynamic presentation vector is incrementally updated according to the real-time state change of the component combination.
[0037] Preferably, the rendering mode of each first presentation point is determined, including:
[0038] Based on the static presentation vector and the dynamic presentation vector, a visual importance coefficient of the corresponding first presentation point is determined, and a visual decay factor is determined according to the straight-line distance between the corresponding first presentation point and the viewpoint, wherein the minimum value of the visual decay factor is not lower than the set value of the lowest authority in the game authority;
[0039] matching a rendering mode with the visual importance coefficient and the visual attenuation factor.
[0040] The application provides a driving engine design system based on a 3D game vehicle, comprising:
[0041] A point extraction module is configured to determine driving position points in a 3D game scene based on user permissions of a target vehicle, and perform scene point extraction to obtain a sub-scene.
[0042] A coordinate determination module is configured to determine, with the target vehicle as a first visual angle, three-dimensional coordinates of a viewpoint of each driving position point in the sub-scene based on a different visual field azimuth, a centerline azimuth and a vehicle deformation profile combination.
[0043] A static vector construction module is configured to determine, according to a standard visualization range of each viewpoint at a same scene point and a behavior operation list of the corresponding viewpoint, a static presentation vector of each first presentation point in the standard visualization range under each behavior operation in the behavior operation list.
[0044] A dynamic vector construction module is configured to determine, according to a dynamic associated component list of the first presentation point, a dynamic presentation vector of the corresponding first presentation point under each dynamic associated component combination.
[0045] A mode determination module is configured to determine a rendering mode of each first presentation point and perform driving rendering according to the static presentation vector and the dynamic presentation vector, and in combination with a straight-line distance between the first presentation point and the viewpoint and game permissions of the target vehicle.
[0046] Compared with the prior art, the application has the following beneficial effects:
[0047] Based on the strong binding of the visual angle and the vehicle deformation and the player operation, the driving experience is more realistic; based on the sub-scene interception and the frustum clipping, invalid rendering is reduced; based on the permission layering, different device performances are adapted; the combination of the static and dynamic vectors covers color, light and shadow, physical interaction, restores the operation feedback chain of the real world and creates a high-immersion 3D vehicle driving experience.
[0048] Other features and advantages of the present application will be further described in the following description, and partly become obvious from the description, or understood by implementing the present application. The purposes and other advantages of the present application can be achieved and obtained by the structures particularly pointed out in the written description and the accompanying drawings.
[0049] The technical solutions of the present application will be further described in detail below with the aid of the accompanying drawings and embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0050] The accompanying drawings are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and are used to explain the application, but are not intended to limit the application. In the drawings:
[0051] Figure 1 A flow chart of a driving engine design method based on a 3D game vehicle in an embodiment of the application;
[0052] Figure 2 A structural diagram of a driving engine design system based on a 3D game vehicle in an embodiment of the application. DETAILED DESCRIPTION
[0053] The preferred embodiments of the application are described below in conjunction with the accompanying drawings, and it should be understood that the preferred embodiments described here are only used to explain and illustrate the application, and are not intended to limit the application.
[0054] The application provides a driving engine design method based on a 3D game vehicle, as shown in the accompanying drawings, comprising: Figure 1
[0055] Step 1: determining a driving position point in a 3D game scene based on the user authority of a target vehicle, and performing scene point extraction to obtain a sub-scene;
[0056] Step 2: determining the three-dimensional coordinates of the view point of the target vehicle in the sub-scene at each driving position point based on different visual azimuth angles, median azimuth angles and vehicle deformation profiles, respectively, with the target vehicle as the first visual angle;
[0057] Step 3: sequentially determining the static presentation vector of each first presentation point in the standard visualization range under each behavior operation in the behavior operation list according to the standard visualization range of each view point at the same scene point and the behavior operation list of the corresponding view point;
[0058] Step 4: determining the dynamic presentation vector of the corresponding first presentation point under each dynamic association component combination according to the dynamic association component list of the first presentation point;
[0059] Step 5: determining the rendering mode of each first presentation point and performing driving rendering according to the static presentation vector and the dynamic presentation vector, and combining the straight-line distance between the first presentation point and the view point and the game authority of the target vehicle.
[0060] In this embodiment, the target vehicle is a vehicle controlled by a player in the game, such as a racing car or an off-road vehicle, which contains a unique ID and an authority configuration. The user authority is the scene access authority bound to the player account, such as that an ordinary player can only enter a novice race track, and a VIP player can unlock a hidden mountain road, etc. The authority-scene mapping table is obtained in advance, such as that the authority Lv3 corresponds to the scene ID007.
[0061] In this embodiment, the driving position point is a set of coordinate points in the 3D scene where the vehicle can drive, such as road coordinates on a race track or mountain coordinates in an off-road scene.
[0062] In this embodiment, scene point extraction is the use of a spatial cutting algorithm to extract a region matching the authority from a large scene, such as extracting terrain, vegetation, and building point cloud data for a hidden mountain road when a VIP player enters, and the sub-scene is the local scene data corresponding to the authority, such as extracting only the track segment containing the hidden mountain road.
[0063] In this embodiment, the first perspective is the observation perspective of the player sitting in the vehicle, the field of view azimuth is the horizontal offset angle of the player's line of sight, and the centerline azimuth is the reference angle of the vehicle driving direction.
[0064] In this embodiment, the vehicle deformation profile is the morphological change caused by vehicle collision, acceleration, etc., such as the concave of the car head after the car collision and the stretching of the suspension of the off-road vehicle when climbing.
[0065] In this embodiment, the viewpoint three-dimensional coordinate is the spatial position of the player's virtual eyes, and the viewpoint coordinate is obtained based on the cockpit reference coordinate, deformation compensation vector, and perspective offset vector. The standard visualization range is the space region that the viewpoint can see. The behavior operation list is the player's interactive operation on the vehicle, such as turning on the light, honking, switching the wiper, etc., which is pre-stored.
[0066] In this embodiment, the first presentation point is the smallest unit that needs to be rendered in the scene, such as a piece of asphalt on the road or a leaf on the tree.
[0067] In this embodiment, the static presentation vector is data describing the basic visual attributes of the presentation point, including color RGB, texture coordinates, and transparency.
[0068] In this embodiment, the visual range is defined using a view frustum clipping algorithm to mark the presentation points within the view frustum. The implementation method of operation-presentation association is as follows: a mapping table of operation and presentation point change is established, such as the light-on operation corresponding to a 20% increase in the brightness of the road presentation point, and the wiper operation corresponding to a 30% attenuation in the transparency of the windshield presentation point, wherein the color vector is the base color × (1 + operation brightness coefficient).
[0069] In this embodiment, the dynamic association component is a module that affects the dynamic performance of the presentation point, such as the physical collision component, the particle special effect component, and the light projection component. The dynamic presentation vector is data describing the dynamic change of the presentation point, including position offset, angular velocity of rotation, particle emission rate, etc.
[0070] In this embodiment, the rendering method is the strategy for final picture output, such as real-time light and shadow rendering, baked texture rendering, and low-precision simplified rendering.
[0071] The beneficial effects of the above technical solutions are: based on the strong binding of the view angle and the vehicle deformation and the player operation, the driving experience is more realistic; based on the sub-scene interception and the view cone clipping, the invalid rendering is reduced, and based on the permission layering, different device performances are adapted; the combination of static and dynamic vectors covers color, light and shadow, physical interaction, restores the operation feedback chain of the real world, and creates a high-immersive 3D vehicle driving experience.
[0072] The application provides a driving engine design method based on a 3D game vehicle, and step 2 comprises the following steps.
[0073] Real-time dynamic parameters of the target vehicle at a driving position point are determined, and a next moment parameter is predicted according to the real-time dynamic parameters, a first weight based on a field of view azimuth angle, a second weight based on a centerline azimuth angle and a third weight based on a vehicle deformation profile are determined, wherein the real-time dynamic parameters comprise driving acceleration, steering curvature and vehicle body roll angle.
[0074] A first initial point of a first azimuth angle combination based on the real-time dynamic parameters is determined, and a second initial point of a second azimuth angle combination based on the predicted next moment parameter is determined, wherein the first, second and third vertical lines based on the azimuth angle combination are obtained, and the corresponding initial points are obtained by relying on the first, second and third vertical lines and a preset cockpit reference coordinate called according to vehicle model parameters of the target vehicle.
[0075] A view point range of the corresponding driving position point is determined according to the first initial point and the second initial point, and the view point range is processed by indentation according to the first weight, the second weight and the third weight, so as to obtain three-dimensional coordinates of the view point.
[0076] In this embodiment, the real-time dynamic parameters are instantaneous motion state data of the target vehicle at the current driving position point, reflecting the current dynamic characteristics of the vehicle, and the core includes three types of driving acceleration, steering curvature and vehicle body roll angle. For example, when the vehicle accelerates, the driving acceleration can be , when the vehicle suddenly brakes, the driving acceleration can be , when the vehicle turns left through a sharp curve, the steering curvature is , and when the vehicle turns right at high speed, the vehicle body tilts to the left side, and the roll angle is 8°.
[0077] The next moment parameter is the motion state parameter of the vehicle in a short time based on the current real-time dynamic parameter, which is obtained by a prediction algorithm, wherein the prediction algorithm is obtained by training a neural network model based on historical current real-time dynamic parameters and dynamic parameters at the next moment as samples, such as motion state parameters after 0.1 seconds, which are used to adapt the view angle and scene rendering in advance. For example, when the current real-time driving acceleration is At that time, it was predicted that the acceleration would change due to the decay of power after 0.1 seconds. The current steering curvature is At that time, it was predicted that the player would change their position 0.1 seconds later due to continuous turning. The acceleration at the next instant is equal to the current acceleration plus (current acceleration - acceleration of the previous frame) × 0.8, where 0.8 is the prediction coefficient, which can be adjusted according to the vehicle type.
[0078] The first weight is a coefficient used to quantify the influence of the field of view azimuth angle on subsequent viewpoint calculations. It is implemented based on a pre-established mapping table of field of view azimuth angle change rate and first weight. When the absolute value of the azimuth angle difference in each frame is <1°, the weight is set to 0.2; when 1° ≤ absolute value of the azimuth angle difference is <3°, the weight is set to 0.3; when the change rate is ≥3°, the weight is set to 0.5. For example, when the player is driving smoothly on a straight road, the first weight can be set to 0.2; when frequently turning the head to observe on complex road sections, the first weight can be increased to 0.5.
[0079] The centerline azimuth is the horizontal angle corresponding to the direction of travel of the target vehicle. It serves as the reference direction for vehicle movement and ranges from 0° to 360°, where 0° represents directly forward and 90° represents directly to the right. For example, when a vehicle is traveling directly forward on a beginner's track, the centerline azimuth is 0°, and it adjusts to 95° after turning right into a side road. The centerline azimuth is calculated based on the forward vector of the vehicle's Transform component. The forward vector is projected onto a horizontal plane, and the angle between this forward vector and the vector directly forward in the scene is the centerline azimuth. Simultaneously, real-time corrections are made in conjunction with steering operations to ensure that the azimuth is perfectly synchronized with the vehicle's heading.
[0080] The second weight is a coefficient used to quantify the influence of the centerline azimuth angle on subsequent viewpoint calculations. It is implemented based on a pre-established driving speed-second weight mapping table. For example, when the speed is <30km / h, the weight is set to 0.3.
[0081] Vehicle deformation profile is the shape change profile of the target vehicle caused by collision, load, and extreme motion such as rapid acceleration and sudden braking. It uses a combination of skeletal animation and physical deformation to set key deformation skeletons such as the front of the car and the suspension in the vehicle model. The physics engine calculates the collision force / pressure and drives the skeleton displacement. At the same time, the vertex shader modifies the vertex coordinates of the vehicle model in real time to present subtle deformations and reflect the real-time state of the vehicle's physical structure.
[0082] The third weight is a coefficient for quantifying the influence degree of the vehicle deformation profile on the subsequent view point calculation. First, define the deformation degree coefficient, i.e., deformation degree = actual deformation size / maximum allowed deformation size of the vehicle. Then, establish a linear relationship between the deformation degree coefficient and the third weight, i.e., third weight = deformation degree coefficient * 0.8 + 0.1, to ensure that the weight is 0.1 when there is no deformation and the weight is 0.9 when there is complete deformation. For example, when the vehicle is not deformed, i.e., normal driving, the third weight can be set to 0.1. When the vehicle's front end is severely depressed after a collision, i.e., the deformation degree > 0.15 meters, the third weight can be increased to 0.7.
[0083] The first azimuth angle combination is a parameter combination of the field of view azimuth angle, the centerline azimuth angle, and the vehicle deformation profile based on real-time dynamic parameters, which is used to calculate the initial view point reference point in the current state. For example, when the real-time dynamic parameters are driving acceleration , steering curvature , and vehicle body roll angle 5°, the corresponding first azimuth angle combination can be: field of view azimuth angle -15°, centerline azimuth angle 10°, and no depression of the front end of the vehicle. Based on the pre-established real-time dynamic parameter-azimuth angle / deformation profile correlation table, steering curvature corresponds to centerline azimuth angle 10°, and vehicle body roll angle 5° corresponds to field of view azimuth angle -15°. Each frame matches the corresponding parameters from the correlation table according to the real-time dynamic parameters to form the first azimuth angle combination.
[0084] The first initial point is the initial reference point of the view point obtained based on the first azimuth angle combination and geometric calculation, which is the basic coordinate point for determining the view point range. For example, after geometric relationship calculation based on the first azimuth angle combination, the coordinates of the first initial point in the scene coordinate system can be (120.6, 1.3, 350.3), where Y = 1.3 indicates that the reference point is 1.3 meters above the ground. Specifically, first calculate the first vertical line, the second vertical line, and the third vertical line based on the field of view azimuth angle, the centerline azimuth angle, and the vehicle deformation profile in the first azimuth angle combination. Then, solve the intersection of the three vertical lines, and combine the preset cockpit reference coordinates based on the target vehicle model parameters to calculate the first initial point by vector superposition. The first initial point = intersection of vertical lines + cockpit reference coordinate offset, where the offset is pre-set according to the vehicle model, such as (0, 0.2, 0) for a sports car.
[0085] The second azimuth angle combination is a parameter combination of the field of view azimuth angle, the centerline azimuth angle, and the vehicle deformation profile based on the predicted next instantaneous parameters, which is used to predict the view point reference direction after a short time. For example, when the predicted next instantaneous parameters are driving acceleration , steering curvature , and vehicle body roll angle 7°, the corresponding second azimuth angle combination can be field of view azimuth angle -20°, centerline azimuth angle 15°, and slight depression of the front end of the vehicle 0.05 meters.
[0086] The second initial point is based on the second azimuth angle combination, and the viewpoint prediction reference point obtained by geometric calculation forms the boundary of the viewpoint range together with the first initial point. For example, after geometric calculation corresponding to the second azimuth angle combination, the second initial point coordinates can be (120.7, 1.35, 350.4), and the first initial point (120.6, 1.3, 350.3) forms a slight deviation. First, the first vertical line, the second vertical line and the third vertical line corresponding to the field of view azimuth angle, the center line azimuth angle and the vehicle deformation contour are calculated respectively; then the intersection of the three vertical lines is solved, and the preset cockpit reference coordinate offset is added to obtain the second initial point, so as to ensure that the calculation method is unified with the first initial point and avoid errors caused by method differences.
[0087] The first vertical line is a straight line perpendicular to the direction corresponding to the field of view azimuth angle, which is a vertical line in 3D space, that is, parallel to the Y axis of the scene coordinate system, and is used to position the geometric boundary of the field of view direction. For example, when the field of view azimuth angle is -15°, that is, the left deviation is 15°, the corresponding field of view direction vector is (sin(-15°), 0, cos(-15°)), and the first vertical line is a vertical line perpendicular to the vector, which is expressed as a straight line along the Y axis direction and perpendicular to the player's left field of view in the scene. In the Cartesian coordinate system, first, the field of view direction vector (X1, 0, Z1) is calculated according to the field of view azimuth angle; then the direction vector of the first vertical line is determined as (-Z1, 0, X1, 0), which can ensure that the first vertical line is perpendicular to the field of view direction vector; at the same time, the first vertical line passes through the projection point of the driving position point on the horizontal plane, such as the projection point of the driving position point (120.5, 0.8, 350.2) being (120.5, 0, 350.2), and then the specific position of the first vertical line is determined through the straight line equation.
[0088] The second vertical line is a straight line perpendicular to the direction corresponding to the center line azimuth angle, which is also a vertical line parallel to the Y axis, and is used to position the geometric boundary of the vehicle driving direction. For example, when the center line azimuth angle is 10°, that is, the vehicle head is right 10° to the front, the corresponding driving direction vector is (sin10°, 0, cos10°), and the second vertical line is a vertical line perpendicular to the vector and passes through the projection point of the driving position point on the horizontal plane. First, the driving direction vector (X2, 0, Z2) is obtained according to the center line azimuth angle; then the direction vector of the second vertical line is determined as (-Z2, 0, X2, 0), and the specific position of the second vertical line is determined through the straight line equation combined with the horizontal projection point of the driving position point.
[0089] The third vertical line is a straight line perpendicular to the reference plane corresponding to the vehicle deformation profile, parallel to the Y axis, and used to correct the geometric offset caused by vehicle deformation. For example, when the left side of the vehicle head is recessed by 0.05 meters, and the deformation reference plane is the front surface of the vehicle head when it is not deformed, the third vertical line is a vertical line perpendicular to the reference plane, and the horizontal projection of the center point of the deformed area, such as the center point of the vehicle head recessed area, is (120.4, 0, 350.1). First, a reference plane model is established when the vehicle is not deformed, such as the front surface of the vehicle head being set as a plane perpendicular to the Z axis; then the normal vector (X3, Y3, Z3) of the deformed reference plane is calculated according to the vehicle deformation profile, and since the third vertical line is parallel to the Y axis, its direction vector is set as (0, 1, 0); finally, the third vertical line passes through the horizontal projection point of the center point of the deformed area, and the specific position of the third vertical line is determined by the straight line equation.
[0090] The vehicle model parameters are inherent attribute parameters of the target vehicle, reflecting the physical size and structural characteristics of the vehicle, and the core includes the cockpit position, wheelbase, body height, etc., which are used to call the preset cockpit reference coordinates. The vehicle model parameter configuration file is stored separately in the vehicle resource package, and the file contains key data such as cockpit position, wheelbase, body height, etc.; when the target vehicle is determined, the corresponding configuration file is called through the vehicle ID to read the required vehicle model parameters.
[0091] The preset cockpit reference coordinates are the standard coordinates of the player's virtual eyes in the cockpit based on the vehicle model parameters, and are the core reference for calculating the initial point. The vehicle's own coordinate system, i.e. the origin, is set as the reference point, and the coordinates are preset in combination with the vehicle model parameters; then the reference coordinates in the vehicle's own coordinate system are converted into coordinates in the scene coordinate system through the rotation matrix and translation matrix of the vehicle driving position point, ensuring alignment with the 3D game scene space.
[0092] The view point range is a region formed in the 3D space with the first initial point and the second initial point as boundaries, and this range contains all possible view point candidate positions, which is the basis for subsequent indentation processing. For example, when the first initial point coordinate is (120.6, 1.3, 350.3) and the second initial point coordinate is (120.7, 1.35, 350.4), the view point range is a cuboid region with these two points as opposite vertices, where the X axis range is 120.6~120.7, the Y axis range is 1.3~1.35, and the Z axis range is 350.3~350.4. First, calculate the maximum and minimum values of the first initial point and the second initial point in the X, Y, and Z axes to determine the boundaries of the cuboid region; then use the axis-aligned bounding box algorithm to store the view point range, which can quickly realize subsequent calculation and adjustment of the range, improving processing efficiency.
[0093] The indentation processing is a process of proportionally reducing or offset adjusting the X, Y and Z axis boundaries of the viewpoint range based on the first weight, the second weight and the third weight, and the purpose is to screen the optimal viewpoint position from the viewpoint range, wherein the greater the weight, the greater the indentation amplitude in the corresponding direction.
[0094] The three-dimensional coordinates of the viewpoint are the final spatial coordinates of the virtual eyes of the player determined in the adjusted viewpoint range after the indentation processing, and the coordinates are the observation origin of subsequent scene rendering.
[0095] The beneficial effects of the above technical scheme are: through the whole process design of real-time dynamic parameter acquisition, next instant parameter prediction, multi-dimensional weight distribution, geometric initial point calculation and range indentation optimization, the depth binding of the viewpoint three-dimensional coordinates and the vehicle dynamic state is realized, the problem of fixed viewpoint in the traditional 3D game vehicle driving engine and the disconnection with the actual state of the vehicle is effectively solved, and through the combination of quantitative weight and geometric calculation, the accuracy and stability of the viewpoint coordinates are ensured, which lays a foundation for subsequent high-quality driving rendering from the source.
[0096] The application provides a driving engine design method based on a 3D game vehicle.
[0097] Each region point in each rotation region in the rotation region set is regarded as a scene point;
[0098] The first presentation points in the standard visual range are classified by types to obtain a presentation point type set containing a road surface type, a vegetation type, a building type and a dynamic object type, and basic static attribute vectors are configured for each type of presentation point.
[0099] Based on a preset association influence weight of each behavior operation in the behavior operation list and a presentation point type, a first presentation point based on a field of view weight coefficient of each behavior operation and a basic static attribute vector corresponding to the presentation point type, a static presentation vector of each first presentation point is generated, wherein the static presentation vector includes a color channel value, a texture mapping coordinate and a transparency parameter.
[0100] In this embodiment, the 0.1° rotation is performed around the vertical axis or the horizontal axis of the scene with the viewpoint as the vertex at an angle interval of 0.1° per step to form a continuous angle coverage range for finely dividing the visible area of the viewpoint. For example, the rotation is performed around the vertical axis from -60° to +60°, and a new angle direction is generated every 0.1°, and 1200 steps are required. Here, the setting of 0.1° is a preliminary division of the complete field of view area, and the setting of 0.03° in the subsequent step is a fine division of the area in the standard visualization range on the basis of the coarse screening. Both the insufficient precision caused by the coarse granularity in the whole process and the excessive computing power caused by the fine granularity in the whole process are avoided, and the core demand of smooth operation and natural vision in the 3D game vehicle driving scene is perfectly adapted.
[0101] The rotation region set is a set composed of all independent regions formed after 0.1° rotation. Each independent region is a sector region or a conical region with the viewpoint as the vertex and a corresponding angle range, and the whole covers the complete visible range of the viewpoint. The frustum discretization algorithm is adopted, the direction vector corresponding to each rotation angle is taken as the central axis of the frustum, the fixed region depth and the horizontal / vertical opening angle are set, and the independent 3D region is generated. All independent regions are integrated to form the rotation region set, and the spatial boundary coordinates of each region are stored.
[0102] The region point refers to the smallest spatial coordinate point contained in each rotation region, which is the constituting unit of the rotation region, and the scene point is directly defined as the scene point by the region point in the rotation region set.
[0103] The standard visualization range refers to the 3D space range actually visible to the player defined by the frustum clipping algorithm with the viewpoint as the reference, which is usually defined by the horizontal field of view angle, the vertical field of view angle, the near clipping plane and the far clipping plane. For example, in the off-road game scene, the standard visualization range of the viewpoint is: horizontal 120°, vertical 90°, near clip 0.1 meters, far clip 800 meters. The road surface, trees and rocks in this range are visible elements, and the distant mountains outside the range are not rendered for the time being. In the game engine, the standard visualization range is configured by the field of view angle, the near clipping plane and the far clipping plane parameters of the Camera component; and the scene points in the range are filtered in real time by the built-in frustum clipping interface of the engine, and the scene points outside the range are excluded to optimize the computing power.
[0104] The first rendering point refers to the minimum visual unit selected from the scene points within the standard visualization range that needs to be rendered, which can correspond to object fragments in the scene such as a piece of asphalt on the road surface, a piece of brick on the wall surface, model vertices such as the vertices of tree leaves, the vertices of car lights, or pixel-level coordinates, which are direct objects for subsequent static / dynamic rendering vector calculations. For example, the coordinate point (125.3, 0.8, 355.1) belonging to the road asphalt block and the coordinate point (126.2, 1.5, 354.8) belonging to the tree leaves in the scene points within the standard visualization range are both first rendering points.
[0105] The rendering point type set is a collection formed by classifying all first rendering points according to the categories of the scene objects they belong to, which includes four categories: road surface, vegetation, building, and dynamic object, each corresponding to a group of first rendering points with similar visual attributes. During the game scene production stage, type labels are added to each object model such as road surface models and tree models; when generating first rendering points, the type labels of the object models they belong to are inherited, and they are automatically classified into corresponding types, and finally integrated to form the rendering point type set.
[0106] The basic static attribute vector is a preset basic visual attribute data set for each type of rendering point, which reflects the inherent visual characteristics of the rendering point of that type without any player operation influence, and includes basic color, basic texture coordinates, basic transparency, and other parameters, stored in vector form as {basic RGB, basic texture UV, basic transparency}. In the game resource management system, a basic attribute configuration table is created for each type of rendering point, with corresponding vector parameters associated by type labels; parameter values are set by art designers according to scene style, and vector parameters are bound to model materials through the engine's material sphere system to ensure consistency of basic visual effects.
[0107] The preset associated influence weight is a pre-set influence degree coefficient of a single behavior operation on the visual attributes of a certain type of rendering point, with a value between 0 and 1. The greater the weight, the more obvious the visual change of the operation on this type of rendering point, which is used to quantify the association strength of the operation and the rendering point type. For example, the associated influence weight of the near light operation on the road surface type rendering point is set to 0.8, and the weight on the vegetation type rendering point is set to 0.3; the weight of the wiper operation on the windshield rendering point is set to 0.9, and the weight on the road surface type rendering point is set to 0. Based on the pre-established three-dimensional association matrix of operation-type-weight, the row dimension is the behavior operation, the column dimension is the rendering point type, and the cell value is the associated influence weight.
[0108] The static presentation vector is a final static visual attribute data set of the first presentation point calculated by combining the preset correlation influence weight, the field of view weight coefficient, and the basic static attribute vector. The color channel value is a parameter for describing the color of the presentation point in the static presentation vector, which is usually represented by RGB three-channel values, and some scenes contain an Alpha channel, the value of which is the basic color x (1 + correlation influence weight x field of view weight coefficient). For example, the basic RGB of the road surface type presentation point is (100, 100, 100), the correlation influence weight of the near light operation is 0.8, and the field of view weight coefficient is 1.0, and then the final color channel value is: {100 x (1 + 0.8 x 1.0), 100 x (1 + 0.8 x 1.0), 100 x (1 + 0.8 x 1.0)} = (180, 180, 180), which corresponds to the bright gray color of the road surface illuminated by the light.
[0109] The texture mapping coordinate is a parameter for describing the position of the corresponding texture map of the presentation point in the static presentation vector, which is usually represented by UV coordinates, U is the horizontal position of the texture, and V is the vertical position of the texture, and the value is: basic texture UV + UV offset of the operation correlation. For example, the basic texture UV of the vegetation type presentation point is (0.2, 0.7), and the texture mapping coordinate remains (0.2, 0.7) when there is no operation, which corresponds to the middle position of the leaf texture map; if there is a correlation operation of wind blowing vegetation, the correlation influence weight is 0.3, and the UV offset is set to (0.02 x 0.3, 0) = (0.006, 0), and then the final texture mapping coordinate is (0.2 + 0.006, 0.7) = (0.206, 0.7), which simulates the texture effect of slight offset of the leaves.
[0110] The transparency parameter is a parameter for describing the transparency of the presentation point in the static presentation vector, the value range of which is 0 to 1, 0 is completely transparent, and 1 is completely opaque, and the value is: basic transparency x (1 - correlation influence weight x field of view weight coefficient), wherein, if the operation makes the presentation point more transparent, the weight takes a positive value; if it is more opaque, the weight takes a negative value. For example, the basic transparency of the windshield presentation point is 0.7, the correlation influence weight of the wiper operation is 0.9, and the field of view weight coefficient is 0.8, and then the final transparency parameter is 0.7 x (1 + 0.9 x 0.8) = 1.204, which is limited to 1.0 (completely opaque) due to the range, which simulates the clear effect of the wiper wiping the glass clean.
[0111] The beneficial effects of the above technical scheme are: by generating a rotation region set with a 0.1° rotation, the scene point coverage is comprehensive and the field of view position is accurate, and visual omission caused by traditional rough division is avoided; basic static attribute vectors are configured according to types, so that the visual features of different scene elements are more consistent with real attributes, and the discomfort caused by uniform configuration is reduced; by combining operation correlation weight and field of view weight, the static presentation vector can respond to player operations and adapt to the field of view position in real time. While improving the realism of the 3D game vehicle driving scene, the rendering computing power distribution is effectively optimized, and experience and performance are considered.
[0112] The application provides a driving engine design method based on a 3D game vehicle, determines a field of view weight coefficient of a first presentation point based on each behavior operation, and comprises the following steps:
[0113] A field of view dynamic attenuation reference value is determined based on the real-time dynamic parameter and the real-time torque, wherein the driving acceleration absolute value is negatively correlated with the reference value, the steering curvature is negatively correlated with the attenuation gradient of the reference value along the steering direction, and the body roll angle is negatively correlated with the reference value.
[0114] The first presentation points in the standard visualization range are subjected to significance grading, the significance grading is based on a space included angle between the presentation points and the driving path, a collision risk coefficient of the presentation points and a texture complexity of the presentation points, and a high-significance presentation point set, a medium-significance presentation point set and a low-significance presentation point set are obtained.
[0115] A radial grid line with an interval of 0.03° is established along the polar coordinate angle with the viewpoint as the origin, a three-dimensional grid is formed by establishing a layered height grid surface along the field of view depth direction, and the grid units in which the different-significance presentation points are located are subjected to corresponding attenuation processing.
[0116] The grid subjected to the attenuation processing and the boundary of the rotation region are subjected to intersection operation, an edge compensation factor is started for the grid units in the boundary transition zone, and finally the field of view weight coefficient of each first presentation point in the standard visualization range is generated, wherein the edge compensation factor is related to the square of the speed of the target vehicle and the relative influence relationship of the first presentation point based on the corresponding behavior operation.
[0117] In this embodiment, the real-time torque refers to the instantaneous torque value output by the engine of the vehicle, reflecting the power output strength of the vehicle, and is obtained through a preset throttle opening-torque mapping relationship, for example, a throttle opening of 80% corresponds to a torque of 400 N·m, and the real-time data output by the player's throttle operation is associated.
[0118] The field of view dynamic attenuation reference value is a basic value for controlling the visual attenuation degree of the presentation points in the standard visualization range, and is a core reference for subsequent attenuation processing. Specifically, the reference value is realized based on a multivariate function model of the established real-time dynamic parameter and real-time torque, and the reference value = ((0.5-0.1 Normalization coefficient of driving acceleration) + (0.3 - 0.02 Normalization coefficient of steering curvature) + (0.2 - 0.01 Normalization coefficient of vehicle body roll) + 0.001 Normalization coefficient of real-time torque, ensuring that the reference value changes dynamically with the vehicle state.
[0119] Significance grading is the process of dividing the importance of the player's driving decisions according to the first presentation point into different levels, and the higher the level, the higher the visual priority. A multi-factor weighted scoring model is established to score each first presentation point according to pre-set criteria. Assuming a total score of 10, 8-10 is high significance, 4-7 is medium significance, and 0-3 is low significance.
[0120] The spatial angle between the presentation point and the driving path is the horizontal angle of the first presentation point relative to the current driving path of the vehicle. The smaller the angle, the higher the significance. For example: a road presentation point 5° in front, spatial angle 5°; a guardrail presentation point 90° to the side, spatial angle 90°. Through vector calculation, the angle between the driving path direction vector and the vector pointing from the presentation point to the viewpoint is the spatial angle, i.e. .
[0121] The collision risk coefficient of the presentation point is the possibility of collision between the first presentation point corresponding object such as other vehicles, roadblocks and the target vehicle, with a value range of 0 to 1. The higher the risk, the higher the significance. Risk coefficient = where the safety distance is dynamically adjusted according to the vehicle speed, and the faster the speed, the larger the safety distance.
[0122] The texture complexity of the presentation point is the richness of the texture details of the surface of the object where the first presentation point is located, with a value range of 0 to 1. It is calculated by a texture analysis algorithm, which counts the proportion of adjacent pixel RGB difference exceeding the threshold value in the texture map corresponding to the presentation point. The higher the proportion, the higher the texture complexity.
[0123] The high significance presentation point set is the set of presentation points with the highest score in the significance grading, usually including: spatial angle < 30°, collision risk coefficient > 0.6, and texture complexity > 0.7.
[0124] The medium significance presentation point set is the set of presentation points with medium scores, usually including: 30° ≤ spatial angle ≤ 60°, 0.3 ≤ collision risk coefficient ≤ 0.6, and 0.3 ≤ texture complexity ≤ 0.7.
[0125] The low significance presentation point set is the set of presentation points with the lowest score, usually including: spatial angle > 60°, collision risk coefficient < 0.3, and texture complexity < 0.3.
[0126] Polar angle is the angle parameter of the coordinate system that describes the spatial position with angle and distance in the horizontal plane with the viewpoint as the origin.
[0127] Radial grid lines are rays drawn from the viewpoint at fixed intervals along the polar angle, used to divide the field of view region horizontally, and each two adjacent radial grid lines form an angle interval of 0.03°.
[0128] Layered height grid planes are horizontal planes perpendicular to the Y-axis set at fixed intervals of 5 meters along the depth direction of the field of view, used to divide the field of view region vertically, and each plane is a height layer. Sampling points are set in the polar r direction, and a horizontal plane Z=r is generated at each sampling point, where Z is the depth coordinate, and the plane height covers the vertical range of the scene, such as Y=-10 meters to Y=100 meters.
[0129] The stereoscopic grid is a 3D grid structure formed by the intersection of radial grid lines divided horizontally by angle and layered height grid planes divided vertically by depth, and each grid cell is a small cube with an angle of 0.03°, a depth of 5 meters, and a height range, used to accurately locate the field of view position of the first rendering point. By connecting the intersection points of radial grid lines and layered height grid planes through the spatial partition function of the game engine, grid cells are generated, and the boundary coordinates of each cell are stored.
[0130] The grid cell is the smallest 3D unit in the stereoscopic grid that cannot be further divided, and is the basic unit of attenuation processing, each cell contains several first rendering points.
[0131] Attenuation processing is to apply visual attenuation to the grid cell where the first rendering point belongs according to the saliency set it belongs to, and the grid cell of the high saliency set is attenuated weakly, and the low saliency set is attenuated strongly. Attenuation coefficient = 1 - (saliency level weight x field of view dynamic attenuation reference value), where the high, medium, and low saliency level weights are set to 0.9, 0.6, and 0.3 respectively; the attenuation coefficient is applied by Shader during rendering, such as final brightness = base brightness x (1-attenuation coefficient).
[0132] Intersection operation is a mathematical operation to calculate the boundary overlap between the stereoscopic grid after attenuation processing and the rotation region set in the previous section, the purpose is to filter out the effective grid cells that are both in the stereoscopic grid and in the rotation region.
[0133] The boundary transition zone refers to the grid cell region near the boundary of the rotation region after the intersection operation, these cells are in the transition zone between completely visible and completely invisible, and need special processing to avoid visual discontinuity.
[0134] The edge compensation factor is a parameter used to adjust the visual effect of the grid cells in the boundary transition zone, with a value range of 0 to 1, which compensates for the visual discontinuity caused by boundary division and makes the transition more natural, the higher the factor value, the stronger the compensation.
[0135] The field of view weight coefficient is the final weight coefficient generated for each first presentation point after comprehensive attenuation processing, intersection operation and edge compensation, and the value range is 0 to 1.
[0136] The relative influence relationship of the first presentation point based on the corresponding behavior operation is the degree of influence of the first presentation point by an operation in the behavior operation list compared with other presentation points, and the value range is 0 to 1. The operation-presentation point type-relative influence mapping table is established, the relative influence value is multiplied by the edge compensation factor, and the dynamic adjustment of the operation on the compensation is realized.
[0137] The beneficial effects of the above technical solutions are: through the four-level processing of the dynamic reference value associated with the vehicle motion state, the significant hierarchical focus on key scene elements, the stereoscopic grid for fine attenuation, and the edge compensation for optimizing the boundary transition, the generated field of view weight coefficient can accurately adapt to the real-time state of the vehicle and the importance of the presentation point, so that the visual effect of the 3D game vehicle driving scene not only conforms to the visual focusing logic of real driving, but also optimizes the rendering performance, and realizes the balance between experience and efficiency.
[0138] The application provides a driving engine design method based on a 3D game vehicle, and an edge compensation factor is started for a grid unit in a boundary transition area, including:
[0139] The grid unit in the boundary transition area is divided into a sub-grid and a parent grid according to the spatial relationship with the target vehicle and the standard visual range;
[0140] The first compensation factor of the corresponding parent grid is calculated based on the square of the instantaneous speed of the vehicle and the steering angular velocity direction correction coefficient;
[0141] If the intersection union ratio of the corresponding sub-grid and the parent grid is 1, the second compensation factor of the corresponding sub-grid is calculated based on the first compensation factor;
[0142] If the intersection union ratio of the corresponding sub-grid and the multiple parent grids is greater than 0, the third compensation factor of the corresponding sub-grid is calculated based on the first compensation factor and the average value of the intersection union ratio of the multiple parent grids;
[0143] The dynamic compensation factors of all the sub-grids and parent grids involved in the grid unit in the boundary transition area are subjected to weighted superposition processing, and the edge compensation factor is obtained in combination with the relative influence relationship of the current behavior operation on the vehicle state.
[0144] In the embodiment, a coordinate point set G of an attenuation grid unit and a coordinate point set R of a rotation area corresponding to the attenuation grid unit are defined, an intersection union ratio IOg is determined, and wherein, the volume of the spatial intersection of G and R; min(V(G),V(R)) is the smaller one of V(G) and V(R);
[0145] When IOg=1, it is determined that the attenuation grid cell is completely in the corresponding rotation region, and it is determined that no compensation is needed.
[0146] Otherwise, it is determined that the attenuation grid cell is in a boundary transition zone, and compensation is needed.
[0147] The first compensation factor Bc1 is calculated as follows:
[0148] ;
[0149] Wherein, a1 is the steering angular velocity direction correction coefficient; b1 is the scene content importance level weight;
[0150] The second compensation factor Bc2 is calculated as follows:
[0151] ;
[0152] The third compensation factor Bc3 is calculated as follows:
[0153] ;
[0154] Wherein, IOa is the average value of the intersection union ratio with multiple parent grids;
[0155] The calculation of the edge compensation factor is based on the multiplication of the weight superposition of the compensation factors of the involved child grid and parent grid in the corresponding transition zone grid and the behavior operation correction coefficient of the relative influence of the current behavior operation on the vehicle state.
[0156] In this embodiment, the spatial relationship with the target vehicle and the standard visual range is the core basis for dividing the parent and child grids. Specifically, the straight-line distance of the grid cell to the target vehicle, that is, the closer the distance, the higher the level, is preferentially used as the parent grid, and the position of the grid cell in the standard visual range, that is, the closer to the center of the visual range, the more likely to be the parent grid. Based on the pre-established distance-level mapping rule, the distance < 20 meters is the parent grid level, 20 meters≤distance<50 meters is the child grid level, combined with the angle of the grid cell in the visual range, distance center<30° is the parent grid candidate, and the parent and child grids are automatically determined and divided.
[0157] The parent grid is a grid unit with high level and high visual priority in the boundary transition area, is a reference unit of the child grid, the child grid is a grid unit with low level and dependent on the parent grid in the boundary transition area, is usually far away from the vehicle and close to the edge of the visual range, the size can be the same as or smaller than the parent grid, and is used for refining the compensation effect of the parent grid area.
[0158] The angular velocity direction correction coefficient is obtained based on a previously established steering direction-steering angular velocity-correction coefficient mapping table, and direct matching can be performed.
[0159] The scene content importance level weight is obtained based on a previously established rendering point type-importance weight mapping table, and direct matching can be performed.
[0160] The beneficial effects of the above technical solutions are that: through the logical of parent-child grid hierarchical division, multi-parameter dynamic calculation compensation factor and behavior operation linkage correction, the edge compensation factor is bound with the instantaneous state of the vehicle, the spatial overlapping relationship and the operation depth of the player: the parent-child grid division solves the hierarchical refinement problem of the boundary transition area, and avoids the roughness of single grid compensation; the speed square and the steering correction coefficient make the compensation adapt to the driving dynamics; the IOU determination ensures that the compensation only acts on the real transition area, and reduces invalid calculation; the behavior operation correction makes the compensation interact with the player. The visual immersion and picture fluency of the driving of the 3D game vehicle are improved.
[0161] The application provides a driving engine design method based on a 3D game vehicle.
[0162] The dynamic associated component list of the first rendering point is hierarchically weighted and ordered, the dynamic associated components include: a physical collision component, a light and shadow projection component, a particle special effect component and a material deformation component, and the hierarchical weight order is determined according to the influence intensity of the components on the visual change of the rendering point;
[0163] A component interaction coefficient matrix is constructed, wherein the matrix element value represents the cooperative influence coefficient when different types of dynamic associated component combinations are combined;
[0164] Based on each dynamic associated component combination, based on the component hierarchical weight and the component interaction coefficient matrix, an initial dynamic vector is calculated, the initial dynamic vector includes a position offset, a rotation angular velocity and a texture stretching coefficient;
[0165] The physical collision component is determined based on the interaction behavior type under each dynamic association component combination, and the feature change amount of the physical collision component before and after the action of the corresponding dynamic association component combination is determined to obtain a collision warning index, wherein the interaction behavior type includes: irrelevant interaction type, allowed interaction type and prohibited interaction type.
[0166] According to the correlation between the collision warning index and each dynamic element, and in combination with the collision warning index, the initial dynamic vector is corrected to generate a dynamic presentation vector containing dynamic change rate and attenuation boundary parameters, and the dynamic presentation vector is incrementally updated according to the real-time state change of the component combination.
[0167] In this embodiment, the physical collision component is a component responsible for detecting the collision interaction of the first presentation point with other objects such as vehicles and obstacles, and triggering the visual changes such as position offset and shape change after the collision.
[0168] The light and shadow projection component is a component that controls the light and shadow changes such as brightness and shadow of the first presentation point after being irradiated by a light source such as a car light or sunlight.
[0169] The particle special effect component is a component responsible for generating particle effects such as dust, water splashes and falling leaves when the first presentation point triggers a specific event such as collision or wind blowing. The material deformation component is a component that controls the deformation of the material form of the first presentation point under external actions such as pressure and tension, such as stretching, wrinkling and concave.
[0170] The hierarchical weight ordering is to assign priority weights to the components according to the influence intensity of the dynamic association components on the visual changes of the first presentation point, with the value range being 0 to 1, for example: the component ordering of the road surface presentation point is that the weight of the physical collision component is 0.4, the weight of the light and shadow projection group is 0.3, the weight of the particle special effect group is 0.2, and the weight of the material deformation component is 0.1; the ordering of the leaf presentation point is that the weight of the particle special effect component is 0.35, the weight of the material deformation component is 0.3, the weight of the light and shadow projection component is 0.2, and the weight of the physical collision component is 0.15, a presentation point type-component weight table is established, the weight value is set according to the scene requirement, and is stored in a configuration file, and the components are processed according to the weight priority during rendering.
[0171] The influence intensity of the component on the visual changes of the presentation point is to quantify the visual change amplitude of the first presentation point after the action of the component, such as position offset, brightness change rate and particle quantity, and the greater the change amplitude, the higher the influence intensity. For example: after the action of the physical collision component, the position offset of the road surface presentation point is 0.5 meters, and the influence intensity is high; after the action of the light and shadow projection component, the brightness change rate is 20%, and the influence intensity is second. The threshold range of the visual change parameters such as offset and brightness difference, such as offset>0.3m, is high intensity, and the influence intensity level is set for each component as the basis for weight ordering.
[0172] The component interaction coefficient matrix is a two-dimensional matrix constructed with dynamic correlation components as rows and columns. The element values of the matrix range from -1 to 1, representing the degree of synergistic influence when the row component and the column component act together. The specific values are shown in Table 1:
[0173] Table 1
[0174]
[0175] Different types of dynamic correlation component combinations refer to the combination of two or more different dynamic correlation components acting on the first presentation point simultaneously, such as physical collision components and light projection components, particle special effect components and material deformation components, etc.
[0176] The synergistic influence coefficient is the element value in the component interaction coefficient matrix, quantifying the synergistic effect of component combination.
[0177] The initial dynamic vector is a vector calculated for each component combination based on the component hierarchy weight and the interaction coefficient matrix, describing the basic dynamic change of the first presentation point. It contains three core parameters: position offset, angular velocity, and texture stretching coefficient, reflecting the initial dynamic trend under the action of component combination. Each parameter is calculated by formula, such as position offset, which is the sum of each component weight and the offset of the corresponding component acting alone × (1 + synergistic coefficient), where the offset of the component acting alone is provided by the physics engine (such as the displacement corresponding to the collision force).
[0178] The position offset is a parameter in the initial dynamic vector that describes the position movement of the first presentation point in 3D space, containing offset values in X, Y, and Z directions. A positive value indicates movement in the positive direction of the axis, and a negative value indicates movement in the negative direction of the axis.
[0179] The angular velocity is a parameter in the initial dynamic vector that describes the rotation speed of the first presentation point around its own axis, containing angular velocities around pitch, yaw, and roll.
[0180] The texture stretching coefficient is a parameter in the initial dynamic vector that describes the stretching degree of the surface texture of the first presentation point (unitless, 1 for no stretching, >1 for stretching, <1 for compression), reflecting the texture deformation of the material under the action of force.
[0181] The interaction behavior type refers to the classification of the permissibility of interaction between the physical collision component and other components when they act together, divided into three categories: irrelevant, allowed, and prohibited, used to determine whether the collision is reasonable and whether a warning needs to be triggered. For example:
[0182] Irrelevant interaction type: combination of physical collision component and light projection component, with no direct interaction between the two, such as collision and light combination.
[0183] Allowed interaction type: the combination of physical collision component and particle effect component, material deformation component, the interaction is allowed and is the expected effect, such as collision and splash particle, collision and road deformation.
[0184] Prohibited interaction type: the combination of physical collision component and itself or components that do not meet physical logic, the interaction is prohibited, such as the combination of vehicle model and self collision component, the collision combination of road surface and underground soil.
[0185] Based on the pre-established physical collision component-other component-interaction type mapping table.
[0186] The feature change amount is the state change amount of the feature such as road surface and obstacle before and after the combination of physical collision component and corresponding dynamic association component, which is:
[0187] ;
[0188] Wherein, R1 is the feature point vector of the first rendering point before collision; R2 is the feature point vector of the first rendering point after collision; X0 is the scaling factor, which is used to convert the radian angle into the basic change amount value that meets the scene requirements; Bc is the feature change amount; R1·R2 is the vector dot product.
[0189] The collision warning index is an index calculated based on the interaction behavior type and the feature change amount, reflecting the collision risk or abnormality degree: index = interaction type weight × (feature change amount / maximum allowed change amount), wherein, the prohibited interaction type weight = 1, the allowed interaction type weight = 0.5, and the irrelevant = 0; the maximum allowed change amount is set by the scene.
[0190] The correlation relationship refers to the positive or negative influence degree of the collision warning index on each parameter in the initial dynamic vector, such as position offset, rotation angular velocity and texture stretching coefficient, and a warning index-dynamic element correlation coefficient table is established, such as the correlation coefficient = 0.5 when the interaction is allowed and =-1 when the interaction is prohibited, which is used for correction calculation.
[0191] Dynamic change rate is a parameter in the dynamic rendering vector that describes the speed of change of the initial dynamic vector parameters over time, reflecting the duration intensity of the dynamic effect, the higher the warning index, the greater or smaller the rate.
[0192] The decay boundary parameter is a parameter in the dynamic rendering vector that limits the dynamic change range, such as the maximum distance of position offset and the maximum angle of rotation, which ensures that the dynamic effect is within a reasonable range and avoids excessive deformation.
[0193] The dynamic presentation vector is a final dynamic parameter vector obtained by modifying the initial dynamic vector by the collision warning index, and contains the dynamic change rate and the attenuation boundary parameter, which fully describes the dynamic visual change rule of the first presentation point.
[0194] The real-time state change of the component combination refers to the real-time change of the action strength of the dynamically associated component combination with time, for example, the vehicle gradually leaves the road presentation point, and the action strength of the physical collision component decreases from 100N to 0N.
[0195] The incremental update is a step-by-step adjustment mechanism of the dynamic presentation vector with the real-time state change of the component combination, rather than complete recalculation, and only updates the vector parameters based on the state difference between the current and the last frame, uses the inter-frame difference calculation, only processes the state change amount each frame, and updates the dynamic presentation vector parameters through the difference x coefficient.
[0196] The beneficial effects of the above technical solutions are: through the component weight ordering to clearly affect the priority, the interaction matrix quantization synergistic effect, the initial vector to lay the dynamic foundation, the collision warning correction exception, the incremental update to adapt to the real-time change process, the generated dynamic presentation vector can accurately reflect the real dynamic of the first presentation point under the action of multiple components, so that the dynamic visual effect of the 3D game vehicle driving scene conforms to the physical law and user perception, and the picture realism and interactive immersion are improved.
[0197] The application provides a driving engine design method based on a 3D game vehicle, which determines the rendering mode of each first presentation point, comprising:
[0198] Based on the static presentation vector and the dynamic presentation vector, the visual importance coefficient of the corresponding first presentation point is determined, and at the same time, the visual attenuation factor is determined according to the straight line distance between the corresponding first presentation point and the viewpoint, wherein the minimum value of the visual attenuation factor is not lower than the set value of the lowest permission in the game permission.
[0199] According to the coefficient-factor-mode correspondence table, the rendering mode matched with the visual importance coefficient and the visual attenuation factor is matched.
[0200] In this embodiment,
[0201] In this embodiment, the coefficient-factor-mode contrast table is a preset mapping table of visual importance coefficients and visual attenuation factors → rendering modes, with table row dimensions of visual importance coefficient classification, such as high: 0.7~1, medium: 0.3~0.7, and low: 0~0.3, column dimensions of visual attenuation factor classification, such as high: 0.8~1, medium: 0.5~0.8, and low: 0~0.5, and cells containing corresponding rendering modes, such as real-time light and shadow rendering, baked texture rendering, and color blending rendering, for quickly matching optimal rendering strategies for presentation points. For example, Table 2:
[0202] Table 2
[0203]
[0204] The rendering mode is a specific strategy of the game engine for picture output of the first presentation point, including configuration of rendering resources (such as texture precision and light and shadow calculation mode) and rendering effects (such as dynamic blur and anti-aliasing), and different modes correspond to different picture quality and computing power consumption, which need to be matched according to the visual importance coefficient and the attenuation factor to balance experience and performance.
[0205] In this embodiment, the visual importance coefficient VIC is calculated as follows:
[0206] ;
[0207] wherein R, G, and B represent color channel values of three channels; Tc is the texture complexity in the static presentation vector; an is the normalized value of transparency in the static presentation vector, with a value range of 0 to 1, 0 being completely opaque and 1 being completely transparent; the maximum allowed change rate and the maximum boundary range are set by the scene, and different scenes have different values, for example, the maximum allowed change rate of road surface offset is 1 m / s, and the maximum boundary of road surface offset is 1 m; Cu is the collision warning index, with a value range of 0 to 1.
[0208] The visual attenuation factor VAF is calculated as follows:
[0209] ;
[0210] wherein d is the straight-line distance between the first presentation point and the viewpoint; Dmax is the maximum visible distance of the scene; γ0 is the attenuation power coefficient, with γ0>1 indicating that the farther the distance, the faster the attenuation, and the value is usually 2; Ssig is the significance level of the presentation point, with high being 1, medium being 0.5, and low being 0; the maximum speed is obtained according to the scene setting, for example, the maximum speed is 30 m / s; and Vmin is the set value of the lowest authority in the game authority, such as 0.5.
[0211] The beneficial effects of the above technical solutions are that the logic of visual importance quantitative presentation point priority, visual attenuation factor adaptive distance definition, and contrast table accurate matching rendering mode realizes intelligent allocation of rendering resources, ensures that the lowest-privilege player can also obtain basic clear experience based on the privilege lower limit constraint of the visual attenuation factor, and avoids visual discontinuity caused by privilege difference.
[0212] The application provides a driving engine design system based on a 3D game vehicle, as shown in the accompanying drawings, comprising: Figure 2
[0213] A point extraction module is configured to determine driving position points in a 3D game scene based on user privileges of a target vehicle and perform scene point extraction to obtain a sub-scene.
[0214] A coordinate determination module is configured to determine three-dimensional coordinates of a viewpoint of the target vehicle at each driving position point in the sub-scene based on different field of view azimuth angles, median azimuth angles and vehicle deformation profiles in combination, with the target vehicle as a first perspective.
[0215] A static vector construction module is configured to determine a static presentation vector of each first presentation point in the standard visualization range under each behavior operation in the behavior operation list according to the standard visualization range of each viewpoint at the same scene point and the behavior operation list of the corresponding viewpoint.
[0216] A dynamic vector construction module is configured to determine a dynamic presentation vector of the corresponding first presentation point under each dynamic association component combination according to a dynamic association component list of the first presentation point.
[0217] A mode determination module is configured to determine a rendering mode of each first presentation point and perform driving rendering according to the static presentation vector and the dynamic presentation vector, and in combination with a straight-line distance between the first presentation point and the viewpoint and the game privileges of the target vehicle.
[0218] The beneficial effects of the above technical solutions are that the strong binding of the perspective, the vehicle deformation and the player operation makes the driving experience more realistic, the sub-scene interception and the frustum clipping reduce invalid rendering, the privilege stratification adapts to different device performance, the combination of the static and dynamic vectors covers color, light and shadow, physical interaction, restores the real-world operation feedback chain, and creates a high-immersion 3D vehicle driving experience.
[0219] Obviously, those skilled in the art can make various modifications and variations to the application without departing from the spirit and scope of the application. Thus, if these modifications and variations of the application fall within the scope of the claims of the application and their equivalent technologies, the application also intends to include these modifications and variations.
Claims
1. A method for designing a driving engine based on a 3D game vehicle, characterized in that, The method comprises the following steps: Step 1: determining driving position points in a 3D game scene based on user permissions of a target vehicle, and performing scene point extraction to obtain a sub-scene; Step 2: determining three-dimensional coordinates of a viewpoint of the target vehicle at each driving position point in the sub-scene based on different combinations of a field of view azimuth angle, a centerline azimuth angle and a vehicle deformation profile, with the target vehicle as a first perspective; Step 3: sequentially determining a static presentation vector of each first presentation point in the standard visualization range under each behavior operation in the behavior operation list according to a standard visualization range of each viewpoint at the same scene point and the behavior operation list of the corresponding viewpoint, wherein the first presentation point is the smallest unit that needs to be rendered in the scene; Step 4: determining a dynamic presentation vector of the corresponding first presentation point under each dynamic association component combination according to a dynamic association component list of the first presentation point; Step 5: determining a rendering mode of each first presentation point and performing driving rendering according to the static presentation vector and the dynamic presentation vector, and combining the straight-line distance between the first presentation point and the viewpoint and the game permissions of the target vehicle.
2. The 3D game vehicle based driving engine design method of claim 1, wherein, Step 2 comprises: determining real-time dynamic parameters of the target vehicle at the driving position point, and predicting next instantaneous parameters according to the real-time dynamic parameters, to determine a first weight based on the field of view azimuth angle, a second weight based on the centerline azimuth angle and a third weight based on the vehicle deformation profile, wherein the real-time dynamic parameters include driving acceleration, steering curvature and vehicle body roll angle; determining a first initial point of a first azimuth angle combination based on the real-time dynamic parameters, and simultaneously determining a second initial point of a second azimuth angle combination based on the predicted next instantaneous parameters, wherein the first, second and third vertical lines based on the azimuth angle combination are obtained, and the corresponding initial points are obtained by relying on the first, second and third vertical lines and a preset cockpit reference coordinate called based on the vehicle type parameters of the target vehicle; determining a viewpoint range of the corresponding driving position point according to the first initial point and the second initial point, and performing indentation processing on the viewpoint range according to the first weight, the second weight and the third weight to obtain the three-dimensional coordinates of the viewpoint.
3. The method of claim 2, wherein the 3D game vehicle-based driving engine is designed based on a 3D game vehicle-based driving engine design method, the method comprising: The method comprises the following steps: taking each viewpoint as a reference and rotating by 0.1° to obtain a rotation region set of the corresponding viewpoint, and regarding each region point in each rotation region in the rotation region set as a scene point; performing type division on the first presentation points in the standard visualization range to obtain a presentation point type set containing road surface types, vegetation types, building types and dynamic object types, and configuring a basic static attribute vector for each type of presentation point; Generate a static rendering vector of each first rendering point based on a preset association influence weight of each behavior operation in the behavior operation list with a rendering point type, a field of view weight coefficient of the first rendering point based on each behavior operation, and a basic static attribute vector corresponding to the rendering point type, wherein the static rendering vector includes a color channel value, a texture mapping coordinate, and a transparency parameter.
4. The method of claim 3, wherein the 3D game vehicle-based driving engine is designed to, Determining the field of view weight coefficient of the first rendering point based on each behavior operation comprises: Determining a field of view dynamic attenuation reference value based on the real-time dynamic parameter and the real-time torque, wherein the absolute value of the driving acceleration is negatively correlated with the reference value, the steering curvature is negatively correlated with the attenuation gradient of the reference value along the steering direction, and the body roll angle is negatively correlated with the reference value; Performing a saliency grading on the first rendering point in the standard visualization range, wherein the saliency grading is determined according to a spatial angle between the rendering point and the driving path, a collision risk coefficient of the rendering point, and a texture complexity of the rendering point, to obtain a high-saliency rendering point set, a medium-saliency rendering point set, and a low-saliency rendering point set; Establishing a radial grid line with an interval of 0.03° along the polar coordinate angle and a three-dimensional grid by establishing a layered height grid surface along the depth direction of the field of view with the viewpoint as the origin, and performing a corresponding attenuation processing on the grid units in which the rendering points of different saliency sets are located; Performing an intersection operation on the grid after the attenuation processing and the boundary of the rotating area, starting an edge compensation factor for the grid units in the boundary transition area, and finally generating the field of view weight coefficient of each first rendering point in the standard visualization range, wherein the edge compensation factor is related to the square of the speed of the target vehicle and the relative influence relationship of the first rendering point based on the corresponding behavior operation.
5. The method of claim 4, wherein the 3D game vehicle-based driving engine is designed to, Starting the edge compensation factor for the grid units in the boundary transition area comprises: Dividing the grid units in the boundary transition area into child grids and parent grids according to the spatial relationship with the target vehicle and the standard visualization range; Calculating a first compensation factor for the corresponding parent grid based on the square of the instantaneous speed of the vehicle and a steering angular velocity direction correction coefficient; If the intersection union ratio of the corresponding child grid and its parent grid is 1, calculating a second compensation factor for the corresponding child grid based on the first compensation factor; If the intersection union ratio of the corresponding child grid and multiple parent grids is greater than 0, calculating a third compensation factor for the corresponding child grid based on the first compensation factor and the average value of the intersection union ratios of the multiple parent grids; Performing a weighted superposition processing on the dynamic compensation factors of all child grids and parent grids involved in the grid units in the boundary transition area, and obtaining the edge compensation factor in combination with the relative influence relationship of the current behavior operation on the vehicle state.
6. The 3D game vehicle based driving engine design method of claim 1, wherein, Determining a dynamic rendering vector of the corresponding first rendering point under each dynamic association component combination according to the dynamic association component list of the first rendering point comprises: Performing a hierarchical weight ordering on the dynamic association component list of the first rendering point, wherein the dynamic association component includes a physical collision component, a light and shadow projection component, a particle special effect component, and a material deformation component, and the hierarchical weight ordering is determined according to the influence intensity of the component on the visual change of the rendering point; Constructing a component interaction coefficient matrix, wherein a matrix element value represents a synergistic influence coefficient when different types of dynamic associated component combinations are combined; Based on each dynamic associated component combination, based on the component level weight and the component interaction coefficient matrix, an initial dynamic vector is calculated, which includes a position offset, a rotation angular velocity and a texture stretching coefficient; Determine the interaction behavior type of the physical collision component under each dynamic associated component combination, and determine the feature change amount of the physical collision component before and after the interaction with the corresponding dynamic associated component combination, to obtain a collision warning index, wherein the interaction behavior type includes: irrelevant interaction type, allowed interaction type and prohibited interaction type; According to the correlation between the collision warning index and each dynamic element, and combining the collision warning index, the initial dynamic vector is corrected to generate a dynamic presentation vector containing dynamic change rate and decay boundary parameters, and the dynamic presentation vector is incrementally updated according to the real-time state change of the component combination.
7. The 3D game vehicle based driving engine design method of claim 1, wherein, Determine the rendering mode of each first presentation point, including: Based on the static presentation vector and the dynamic presentation vector, determine the visual importance coefficient of the corresponding first presentation point, and according to the straight line distance between the corresponding first presentation point and the viewpoint, determine the visual attenuation factor, wherein the minimum value of the visual attenuation factor is not lower than the set value of the lowest authority in the game authority; According to the coefficient-factor-mode correspondence table, match the rendering mode matched with the visual importance coefficient and the visual attenuation factor.
8. A 3D game vehicle based driving engine design system, characterized by, Including: Point extraction module, for determining the driving position point of the target vehicle in the 3D game scene based on the user authority of the target vehicle, and performing scene point extraction to obtain a sub-scene; Coordinate determination module, for determining the three-dimensional coordinates of the viewpoint of the target vehicle at each driving position point in the sub-scene based on different field angles, median angles and vehicle deformation contour combinations from the first perspective of the target vehicle; Static vector construction module, for determining the static presentation vector of each first presentation point in the standard visualization range under each behavior operation in the behavior operation list according to the standard visualization range of each viewpoint at the same scene point and the behavior operation list of the corresponding viewpoint, wherein the first presentation point is the smallest unit that needs to be rendered in the scene; Dynamic vector construction module, for determining the dynamic presentation vector of the corresponding first presentation point under each dynamic associated component combination according to the dynamic associated component list of the first presentation point; Mode determination module, for determining the rendering mode of each first presentation point and performing driving rendering according to the static presentation vector and the dynamic presentation vector, and combining the straight line distance between the first presentation point and the viewpoint and the game authority of the target vehicle.
Citation Information
Patent Citations
Drive simulation apparatus, wide-angle camera image simulation apparatus and image deformation combination apparatus
JP2010129063A
Terrain deformation method and device, and non-transitory computer-readable storage medium
US20230249070A1