A scene destruction and debris real-time generation method and system for action games
Patent Information
- Application Number
- CN202610566983.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-27
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2046-04-27
AI Technical Summary
传统图形处理器在动态光学处理器无法在技术中,现有技术中,现有技术中,现有技术中,现有技术中,现有技术无法在动作游戏中实时渲染管线无法解决的几何体结构破坏事件中,现有技术无法在几何体结构的动态光学属性更新事件中,现有技术中,现有技术无法实现碎片与水面交互的光学渲染一致性,导致画面闪烁和光学物理连续性破坏。
By acquiring the scene destruction trigger signal, extracting the vertex coordinate sequence of the fracture boundary of the reef geometry, determining the projection offset direction vector of the vertex relative to the water surface normal plane, obtaining the dynamic incident angle reference of the newly formed surface of the fragment, traversing the Fresnel optical coefficient mapping queue, overwriting it to the refraction and reflection rendering register, performing synchronous overwrite operation, and outputting real-time rendered frame.
It achieves consistent optical rendering of fragments interacting with the water surface, eliminates the problem of Fresnel coefficient calculation baseline lag, improves frame rate uniformity and rendering stability, and reduces video memory bandwidth consumption.
Smart Images

Figure CN122435121B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of graphics rendering technology, and in particular to a method and system for real-time generation of scene destruction and fragments for action games. Background Technology
[0002] In action game virtual environments, player actions often trigger dynamic destruction events of rocks or building structures. When broken geometry detaches from its original mesh and falls into the surface of water with specular reflection and refraction properties, the real-time graphics rendering pipeline needs to update the surface optical properties of the fragments synchronously.
[0003] Traditional rendering architectures employ static material binding or cross-frame delayed update mechanisms to handle lighting calculations in water interaction areas. Within a single frame time slice where a destruction event occurs, the topology of the newly formed fracture surface undergoes instantaneous displacement, and the rendering pipeline cannot immediately capture the dynamic viewpoint angle between the fracture boundary vertices and the water surface normal plane. The graphics processor uses the baseline normal of the complete reef model from the previous frame for ray casting calculations, causing a lag in the Fresnel optical coefficient calculation baseline. This data synchronization lag results in a spatial misalignment of the critical intra-frame refractive index parameters when the debris contacts the water surface. Consequently, this appears as abrupt changes in highlights at the fracture edge and flickering of the refracted light path on the visual terminal, disrupting the optical-physical continuity between the solid debris and the liquid medium.
[0004] Traditional framebuffering techniques rely on discrete time steps for state interpolation, which cannot complete optical state synchronization within the same clock cycle when the geometric mesh breaks down. This architectural flaw causes the optical rendering of water interaction areas to lose underlying data support, frequently triggering shader retries and intra-frame pixel redraws, consuming additional video memory bandwidth, and directly reducing the throughput stability of the real-time computing pipeline and the uniformity of the frame rate. Summary of the Invention
[0005] In view of the aforementioned problems, this application is hereby filed.
[0006] Therefore, this application provides a method and system for real-time scene destruction and fragment generation in action games, which can solve the problems mentioned in the background art.
[0007] To solve the above-mentioned technical problems, this application provides the following technical solution: In a first aspect, this application provides a method for real-time generation of scene destruction and fragments in action games, including: acquiring scene destruction trigger signals and extracting the vertex coordinate sequence of the fracture boundary of the original reef geometry; Determine the projection offset direction vector of the vertex coordinate sequence relative to the water surface normal plane, and obtain the dynamic incident angle reference of the fragment new surface at the moment of fracture based on the vector operation result of the projection offset direction vector and the camera line of sight. Based on the dynamic incident angle reference, the Fresnel optical coefficient mapping queue is traversed, and the optical values output by the Fresnel optical coefficient mapping queue are overwritten onto the refraction and reflection rendering register of the original reef surface. The pixel coloring instructions of the fragment falling into the water surface contact area are synchronously overwritten, and the real-time rendering frame of the fragment interacting with the water surface is output.
[0008] Preferably, the step of acquiring the scene destruction trigger signal and extracting the vertex coordinate sequence of the fracture boundary of the original reef geometry includes: In response to the stress over-limit notification sent by the physical collision detection node, a topology scan operation is performed on the original reef geometry mesh to extract the local mesh region identifier pointed to by the stress over-limit notification; Based on the local grid region identifier, locate the fracture threshold node of the grid connection line, perform linear interpolation to complete the spatial coordinate data around the fracture threshold node, and generate the initial contour coordinate set of the fracture boundary. The initial contour coordinate set is input into the geometric space transformation matrix. Based on the standardized three-dimensional spatial distribution values output by the matrix operation, redundant background mesh data is stripped to obtain the vertex coordinate sequence of the fracture boundary.
[0009] Preferably, determining the projection offset direction vector of the vertex coordinate sequence relative to the water surface normal plane includes: Obtain the reference value of the vertical direction of the water surface normal plane in the global spatial coordinate system, and map the vertex coordinate sequence point by point to the two-dimensional projection area of the water surface normal plane; The distance difference accumulation operation is performed between the mapped coordinate points in the two-dimensional projection area and the reference point at the center of the water surface to generate an offset distance data stream representing the spatial depth of the fracture location; The projection offset direction vector is constructed by orthogonally combining the offset distance data stream with the reference value in the vertical direction of the water surface, and then the projection offset direction vector is passed to the subsequent optical computing node.
[0010] Preferably, obtaining the dynamic incident angle reference of the newly formed fragment surface at the moment of fracture based on the vector operation result of the projection offset direction vector and the camera's line of sight includes: Obtain the camera's global position coordinates and orientation rotation matrix for the current rendered frame, and parse the three-dimensional spatial unit vector of the camera's line of sight direction based on the orientation rotation matrix; The three-dimensional spatial unit vector and the projection offset direction vector are input into the spatial cross-product operation unit to perform numerical calculation on the spatial angle between the three-dimensional spatial unit vector and the projection offset direction vector, thereby generating instantaneous normal orientation data of the fracture surface. Based on the spatial dot product of the instantaneous normal orientation data of the fractured surface and the camera's line of sight, the dynamic incident angle reference of the newly formed fragment surface at the moment of fracture is determined.
[0011] Preferably, the step of traversing the Fresnel optical coefficient mapping queue according to the dynamic incident angle reference includes: Obtain the historical dynamic incident angle reference value of the previous rendered frame, and perform a difference comparison operation between the current rendered frame's dynamic incident angle reference value and the historical dynamic incident angle reference value. Based on the angle change amplitude data output by the difference comparison operation, compare it with the visual transition judgment threshold range stored in the system to filter the valid timestamps that trigger optical state switching. Perform a segmented read operation on the Fresnel optical coefficient mapping queue pointed to by the valid timestamp, and merge the read historical optical coefficient sequence with the current optical coefficient sequence into a double-buffered interpolation array.
[0012] Preferably, the step of overwriting the optical values output from the Fresnel optical coefficient mapping queue onto the refraction and reflection rendering register of the original reef surface includes: A linear mixing operation is performed based on the historical optical coefficient sequence value allocation ratio stored in the double-buffered interpolation array and the current optical coefficient sequence value allocation ratio to generate smooth transition optical coefficient values. The smooth transition optical coefficient value is input into the reflected light wave simulation channel, and the incident light energy attenuation ratio in the reflected light wave simulation channel is overwritten in real time to update the original specular reflection brightness distribution map of the reef surface. Based on the pixel-level brightness transition detection feedback of the specular reflection brightness distribution map, the coordinates of the high-frequency flicker area are locked, and the abnormal reflection values corresponding to the locked high-frequency flicker area coordinates are replaced with smooth transition optical coefficient values, and a reflection reference correction frame is output.
[0013] Preferably, the step of synchronously overwriting the pixel coloring instructions for the contact area between the fragment and the water surface, and outputting a real-time rendered frame of the fragment interacting with the water surface, includes: Acquire the surface brightness distribution data output by the reflection reference correction frame, and use the surface brightness distribution data as the initial energy source of the refracted light to input into the water surface medium propagation simulation pipeline; Based on the transmittance attenuation curve obtained from the simulated pipeline of water surface medium propagation, the transparency superposition calculation is performed on the sampling command of the bottom reef texture in the contact area to generate an array of refracted light spots inside the water body. The spatial alignment and matching of the refracted light spot distribution array inside the water body with the fragment fracture edge contour data is performed. Based on the matching result of the spatial alignment and matching, the light transmission and refraction angle of the edge pixels is corrected, and a real-time rendered frame of the fragment interacting with the water surface is output.
[0014] Preferably, the real-time rendered frame showing the interaction between the output debris and the water surface includes: Obtain the vertical synchronization pulse signal corresponding to the real-time rendered frame, align and verify the vertical synchronization pulse signal with the timing of the fragment motion trajectory calculated by the physics engine, and output the timing deviation value. Based on the timing deviation value, perform intra-frame delay compensation operation on the graphics processing instruction queue of the current rendering pipeline, adjust the pixel drawing priority of the water surface interaction area and output the adjusted pixel drawing instruction. The adjusted pixel drawing instructions are pushed to the display controller, and the hardware-level signal conversion of the optical rendering frame is completed according to the progressive scan output rules of the display controller to generate the destruction effect image displayed on the terminal screen.
[0015] Preferably, adjusting the pixel rendering priority of the water surface interaction area includes: Obtain the spatial boundary range of the camera's view frustum within the current frame, and map the spatial coordinate data of the fragment geometry to the spatial boundary range for visibility bounding box filtering; Based on the valid fragment facet identifiers filtered by the visibility bounding box, the rendering instruction masking operation is performed on the background mesh elements in the non-interactive area to release the video memory occupied by the graphics processing unit. The freed-up video memory space is redistributed to high-frequency optical computing nodes in the water surface contact area. Based on the redistributed video memory capacity, the sampling accuracy of Fresnel coefficients is improved, and high frame rate scene destruction effects are output.
[0016] Secondly, this application also provides a real-time scene destruction and fragment generation system for action games, including: a fracture vertex sequence extraction module, used to acquire scene destruction trigger signals and extract the vertex coordinate sequence of the fracture boundary of the original reef geometry; The dynamic incident angle reference generation module is used to determine the projection offset direction vector of the vertex coordinate sequence relative to the water surface normal plane, and obtain the dynamic incident angle reference of the fragment new surface at the moment of fracture based on the vector operation result of the projection offset direction vector and the camera line of sight. The fracture surface lighting and shadow control output module is used to traverse the Fresnel optical coefficient mapping queue according to the dynamic incident angle reference, overwrite the optical values output by the Fresnel optical coefficient mapping queue onto the refraction and reflection rendering register of the original reef surface, perform synchronous overwrite operation on the pixel coloring instructions of the fragment falling into the water surface contact area, and output the real-time rendering frame of the fragment interacting with the water surface.
[0017] The method for real-time scene destruction and fragment generation in action games provided in this application has the following beneficial effects: 1. Upon triggering scene destruction, this invention responds to stress over-limit notifications from physical collision detection nodes. Through topological scanning, linear interpolation completion, and geometric space transformation matrix operations, it extracts the vertex coordinate sequence of the fracture boundary within the same frame where the fracture event occurs. This vertex coordinate sequence is then mapped to the water surface normal plane. Combined with the camera orientation rotation matrix, the spatial angle between the projection offset direction vector and the camera's line of sight is calculated, generating a dynamic incident angle reference for the newly formed fragment surface in real time. This dynamic incident angle reference drives the frame-by-frame traversal of the Fresnel optical coefficient mapping queue, directly overwriting the output optical values into the refraction and reflection rendering registers. Compared to traditional architectures that rely on static normals from the previous frame, this invention eliminates the problem of Fresnel coefficient calculation reference lag, corrects refractive index spatial misalignment within keyframes of fragment contact with the water surface, and ensures consistent optical rendering between solid fragments and liquid water surfaces.
[0018] 2. When updating Fresnel optical coefficients, this invention extracts the dynamic incident angle reference difference between the current frame and historical frames. After filtering valid timestamps through a visual transition judgment threshold range, the historical optical coefficient sequence and the current optical coefficient sequence are merged into a double-buffered interpolation array. Linear mixing operations are performed to generate smooth transition optical coefficients. Based on pixel-level brightness jump detection, the coordinates of high-frequency flickering areas are locked for abnormal reflection value replacement, and a reflection reference correction frame is output. Simultaneously, a rendering instruction masking operation is performed on the background mesh in non-interactive areas, and the freed video memory space is redistributed to the high-frequency optical computing nodes in the water surface contact area to improve the sampling accuracy of Fresnel coefficients. By coordinating optical value smoothing and computing power scheduling, optical flicker at fragmented edges is eliminated, reducing the additional video memory bandwidth consumption caused by abnormal shader retries and intra-frame pixel redraws, and improving the throughput stability of the real-time computing pipeline and the uniformity of the frame rate. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart of a method for real-time scene destruction and fragment generation in action games, as described in this application. Figure 2 This is a detailed flowchart of a method for real-time scene destruction and fragment generation in action games, which relates to this application. Figure 3 This is the overall system timing diagram of a scene destruction and fragment real-time generation system for action games, which is involved in this application. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0022] In one exemplary embodiment, such as Figure 1 As shown, a method for real-time scene destruction and debris generation in action games is provided, which is then applied to... Figure 2 Taking the terminal in the example, the explanation includes the following steps S1 to S3. Wherein: Step S1: Obtain the scene destruction trigger signal and extract the vertex coordinate sequence of the original reef geometry at the fracture boundary.
[0023] It should be noted that the scene destruction trigger signal is defined as a hardware-level interrupt instruction generated by the physics engine when it detects that the external force exceeds the geometric structure's tolerance limit. The vertex coordinate sequence is defined as an ordered set of three-dimensional spatial points that constitute the fracture edge of the 3D mesh model. In action game scenes, when rocks are destroyed by impact, the topological structure separates. Based on the interrupt instruction, the system extracts vertex data from the separation boundary from the intact mesh to construct the basic spatial data skeleton for subsequent optical calculations.
[0024] S11, in response to the stress over-limit notification sent by the physical collision detection node, performs a topology scan operation on the original reef geometry mesh to extract the local mesh region identifier pointed to by the stress over-limit notification.
[0025] It should be noted that the stress over-limit notification is defined as a Boolean state reversal signal output when the nodal stress value calculated by the physical collision detection node exceeds the material's yield strength. The local mesh region identifier is defined as an integer code that uniquely identifies a stress-abnormal region within a unified mesh index space. The essence of the topology scan operation is to find the element to which the stress concentration region belongs based on connectivity relationships in the global mesh index table.
[0026] In this embodiment of the application, the force vector queue output by the physical collision detection node is read, and the magnitude of each element in the force vector queue is compared with the preset yield limit value.
[0027] Furthermore, the grid node index numbers that exceed the preset yield limit value are extracted, and the grid node index numbers are used as the starting key to expand the search outwards in the adjacency list to search for a circle of adjacent polygon faces.
[0028] Furthermore, all adjacent polygonal faces found are merged into a connected component, and a unique local mesh region identifier integer code is assigned to the connected component.
[0029] For example, suppose the preset yield strength value is set to The physical collision detection node outputs the force on node A as follows: The force at node B is The system determines that node A is under excessive force and extracts the shared stress around node A. A triangular facet, A connected region composed of triangular facets is marked as a local grid region identifier. This step, through a combination of stress threshold comparison and adjacency list expansion search, achieves the functional goal of quickly isolating the structural failure source region from a massive global grid of nodes, providing spatial constraints for the subsequent steps to accurately cut the fracture boundary.
[0030] S12: Based on the local grid region identifier, locate the fracture threshold node of the grid connection line, perform linear interpolation to complete the spatial coordinate data around the fracture threshold node, and generate the initial contour coordinate set of the fracture boundary.
[0031] It should be noted that the fracture threshold node is defined as the critical vertex on the edge connecting adjacent meshes where the stress value in the local mesh region reaches the failure peak. The initial contour coordinate set is defined as a floating-point array containing all spatial points on the complete closed path of the fracture surface. The principle of linear interpolation completion calculation is to use the spatial coordinates of the known boundary endpoints to generate virtual coordinate points between two points to fill the gaps according to the equation of a straight line, thereby connecting discrete vertices into a continuous geometric contour.
[0032] In this embodiment, the set of force values of all edges in the corresponding connected domain is obtained by looking up a table based on the local grid region identifier, and the endpoint of the edge with the largest force value is selected as the fracture threshold node.
[0033] Furthermore, the absolute coordinates of the fracture threshold node in three-dimensional space are extracted, and the Euclidean distance between the fracture threshold node and the adjacent non-over-limit node is calculated.
[0034] Furthermore, the Euclidean distance is divided into equal parts according to a fixed spatial step size. The three-dimensional coordinates of the interpolation points are calculated by substituting the linear parametric equations at the division points, and the calculated interpolation point coordinates are stored in the initial array.
[0035] For example, assuming the coordinates of the fracture threshold node are (10.0, 5.0, 0.0) and the coordinates of the adjacent non-over-limit nodes are (10.0, 15.0, 0.0), with a spatial step size set to 1.0, the system calculates the distance between the two points as 10.0, divides the area into 10 equal parts, and calculates the coordinates of the intermediate interpolation points sequentially from (10.0, 6.0, 0.0) to (10.0, 14.0, 0.0) using the linear parametric equation. This step uses mathematical interpolation to fill in the spatial point gaps caused by mesh fractures, ensuring geometric continuity in the subsequent calculation of the optical reflecting surface.
[0036] It should be noted that, due to the presence of missing mesh vertices in the spatial coordinate data around the fracture threshold node, the specific method is as follows, and also includes: Step 1: Traverse the adjacent mesh cells of the fracture threshold node, extract the shared vertex spatial coordinates, and construct a local neighborhood coordinate set; ; in, Represents the set of local neighborhood coordinates. Indicates the first The x-coordinates of the shared vertices Indicates the first The y-coordinates of the shared vertices, Indicates the first The vertical coordinates of the shared vertices. This represents the total number of shared vertices. The value range is positive integer, the data type is floating-point, and the unit is meters, which is the internal unit of the game engine.
[0037] Step 2: Calculate the Euclidean distance between adjacent vertices in the local neighborhood coordinate set, and select vertex pairs whose Euclidean distance exceeds the average side length of the grid as the interpolation gap interval; ; in, This represents the Euclidean distance between adjacent pairs of vertices. Indicates the coordinates of the first vertex. This represents the coordinates of the second vertex. The value range is a non-negative floating-point number, the data type is floating-point, and the unit is meters, which is the internal unit of the game engine.
[0038] Step 3: Divide the coordinates of the two vertices within the interpolation gap into equal proportions along the connecting line direction to generate a sequence of candidate coordinate points to fill the missing grid vertices; ; in, Indicates the first 1 candidate coordinate point This represents the coordinate vector of the starting vertex of the gap. This represents the coordinate vector of the terminating vertex of the gap. Indicates the interpolation index, with a value range of 1. arrive integers, This represents the number of segments, with values ranging from positive integers. The data type is a floating-point vector, and the unit is meters, which is the internal unit of the game engine.
[0039] Step 4: Merge the candidate coordinate point sequence with the original local mesh vertices, remove overlapping points whose distance to existing vertices is less than the preset merging distance threshold, and output the initial contour coordinate set of the completed fracture boundary. ; in, This indicates that the output should complete the set of coordinates. Represents the set of local neighborhood coordinates. Indicates the candidate coordinate points, This represents the minimum distance from a candidate point to all points in the local set. This represents the preset merging distance threshold, with a value range of positive floating-point numbers, a data type of floating-point numbers, and a unit of meters (the internal unit of the game engine). The preset merging distance threshold mentioned here can be dynamically adjusted based on the average side length of the reef mesh in the game scene. For example, when the average side length of the mesh is 0.5 meters, the preset merging distance threshold can be set to 0.1 meters to avoid vertex redundancy caused by interpolated candidate coordinate points being too close to the original mesh vertices, ensuring the simplicity and accuracy of the initial contour coordinate set of the fracture boundary.
[0040] The initial contour coordinate set mentioned above can be understood as a set of three-dimensional coordinate points containing the complete topological closed path of the fracture boundary. The candidate coordinate point sequence can be understood as virtual spatial points generated through mathematical interpolation to fill the fracture gaps.
[0041] S13: Input the initial contour coordinate set into the geometric space transformation matrix. Based on the standardized three-dimensional spatial distribution values output by the matrix operation, strip away the redundant background mesh data to obtain the vertex coordinate sequence of the fracture boundary.
[0042] It should be noted that the geometric space transformation matrix is defined as a 4×4 floating-point matrix that transforms the model's local coordinate system to a world-unified coordinate system. The standardized 3D spatial distribution values are defined as a coordinate array that, after matrix multiplication, is at a unified spatial scale. The stripping of redundant background mesh data is defined as a filtering operation that removes irrelevant vertices from all visible vertices in the 3D scene that do not belong to the current fracture contour.
[0043] In this embodiment of the application, each three-dimensional coordinate in the initial contour coordinate set is read and the three-dimensional coordinates are expanded into homogeneous coordinate form.
[0044] Furthermore, by multiplying the homogeneous coordinates by the geometric space transformation matrix, the standardized three-dimensional spatial distribution values are obtained.
[0045] Furthermore, the global scene mesh vertex list is traversed, and the bounding box collision state of each vertex in the global scene mesh vertex list with the standardized 3D spatial distribution values is calculated. Background vertices with a bounding box collision state of no collision are discarded, and vertices with a collision state of collision are retained as the vertex coordinate sequence of the fracture boundary.
[0046] For example, given homogeneous input coordinates (10.0, 5.0, 0.0, 1.0), the geometric transformation matrix includes translations (100.0, 0.0, 0.0). Matrix multiplication yields the standardized 3D spatial distribution values (110.0, 5.0, 0.0). The system uses (110.0, 5.0, 0.0) to generate a bounding box with a spatial radius of 5.0, removing background tree vertex data outside the bounding box. This step, through the input processing and output structure of matrix transformation and spatial bounding box filtering, achieves a precise transformation of fracture boundary vertices from locally isolated data to globally clean data.
[0047] S2, determine the projection offset direction vector of the vertex coordinate sequence of the fracture boundary relative to the water surface normal plane, and obtain the dynamic incident angle reference of the fragment new surface at the moment of fracture based on the vector operation result of the projection offset direction vector and the camera line of sight.
[0048] It should be noted that the projection offset direction vector is defined as a directional spatial vector pointing from the perpendicular projection point of the fracture boundary onto the water surface reference plane to the actual fracture location. The dynamic incident angle reference is defined as the real-time angle formed between the light ray emitted from the camera and the surface normal when it travels to the newly formed surface of the fragment. In the optical rendering of action games, at the moment the fragment detaches from the parent body and falls into the water, the original static normal becomes invalid. The system re-establishes the lighting geometric topology between the newly formed surface of the fragment and the camera by calculating the vector relationship between the projection offset direction vector and the camera's line of sight, thus providing a spatial angular basis for the dynamic updating of Fresnel optical coefficients.
[0049] S21, obtain the reference value of the vertical direction of the water surface normal plane in the global spatial coordinate system, and map the vertex coordinate sequence of the fracture boundary point by point to the two-dimensional projection area of the water surface normal plane.
[0050] It should be noted that the vertical reference value is defined as the unit vector coordinates perpendicular to the horizontal plane in world space. The two-dimensional projection region is defined as the set of planar points obtained by mapping three-dimensional points after removing the height dimension based on the vertical reference value.
[0051] In this embodiment of the application, the system reads the vertical reference value (0.0, 0.0, 1.0) from the global spatial coordinate system configuration parameters.
[0052] Furthermore, each three-dimensional coordinate point in the vertex coordinate sequence of the fracture boundary is read sequentially, and the x and y coordinates of the three-dimensional coordinate points are extracted.
[0053] Furthermore, the extracted x and y coordinates are combined into new two-dimensional coordinates, and all the new two-dimensional coordinates are stored in a two-dimensional projection region array to complete the dimensionality reduction mapping operation from three dimensions to two dimensions.
[0054] For example, the vertex coordinate sequence of the fracture boundary contains the point (110.0, 5.0, 15.0). The system removes the vertical coordinate (15.0) based on the vertical reference value and writes the point (110.0, 5.0) into the two-dimensional projection region array. This step, by strictly extracting the causal action sequence of the horizontal and vertical coordinates in a time sequence, realizes the basic action connection for reducing the complex three-dimensional fracture boundary to a two-dimensional plane.
[0055] S22, perform distance difference accumulation operation on the mapped coordinate points in the two-dimensional projection area and the reference point at the center of the water surface to generate an offset distance data stream representing the spatial depth of the fracture location.
[0056] It should be noted that the water surface center reference point is defined as the coordinates of the center point of the water surface geometric grid on the two-dimensional projection plane. The offset distance data stream is defined as a floating-point queue consisting of multiple distance values representing the degree to which the break point deviates from the water surface center. The logical derivation of the distance difference accumulation operation is expressed as an integral process from the distance of a single point to the overall deviation trend.
[0057] In this embodiment of the application, the two-dimensional coordinates of the water surface center reference point are read, and the mapped coordinate points are extracted sequentially from the two-dimensional projection area.
[0058] Furthermore, the Euclidean distance between the mapped coordinate point and the reference point at the center of the water surface on the two-dimensional plane is calculated, and the Euclidean distance is used as a single offset.
[0059] Furthermore, the individual offset is added to the sum of the previous time step to generate a new sum value, which is then stored in the offset distance data stream queue.
[0060] For example, if the reference point at the center of the water surface is (100.0, 100.0), and the first mapped coordinate point is (110.0, 5.0), then the Euclidean distance is calculated as follows: Store 95.5 at the beginning of the offset distance data stream. This step, through the logical derivation of distance calculation and accumulation operations, transforms discrete planar coordinate points into a one-dimensional data stream representing spatial depth trends, providing a numerical foundation for subsequent vector construction.
[0061] In an optional implementation, the Euclidean distance mentioned above can be obtained through the following specific calculation method, wherein: ; in, Represents Euclidean distance. Represents the x-coordinate of the mapped coordinate point. This represents the ordinate of the mapped coordinate point. The x-coordinate of the reference point at the center of the water surface. The ordinate represents the reference point at the center of the water surface. The value range is a non-negative floating-point number, the data type is floating-point, and the unit is meters, which is the internal unit of the game engine.
[0062] S23, calculate the projection offset direction vector based on the orthogonal combination of the offset distance data stream and the reference value in the vertical direction of the water surface, and then pass the projection offset direction vector to the subsequent optical calculation node.
[0063] It should be noted that orthogonalization combination calculation is defined as a mathematical operation that combines the horizontal offset distance and the vertical reference value into a three-dimensional vector. The properties of the projected offset direction vector include directionality and magnitude. Directionality indicates the direction in which the fracture location deviates from the center, and magnitude indicates the absolute distance of the deviation.
[0064] In this embodiment of the application, the system parses the last accumulated value in the offset distance data stream and uses the accumulated value as the horizontal offset component.
[0065] Furthermore, the reference value in the vertical direction of the water surface is read as the vertical offset component.
[0066] Furthermore, the horizontal and vertical offset components are concatenated into a three-dimensional floating-point array, the three-dimensional floating-point array is marked as the projection offset direction vector attribute, and the three-dimensional floating-point array is written into the input cache address of the subsequent optical computing node.
[0067] For example, the cumulative sum is 0.0, and the direction points to the positive half of the X-axis, with a vertical reference value of (0.0, 0.0, 1.0). The system constructs a projection offset direction vector (95.5, 0.0, 1.0) with the direction pointing to the X-axis and a magnitude of 95.5. This step defines the directionality and magnitude attributes of the vector and uses orthogonal combination calculation to fuse the offsets of different dimensions into a unified three-dimensional vector attribute, thus completing the data transfer.
[0068] S24, obtain the camera's global position coordinates and orientation rotation matrix of the current rendered frame, and parse the three-dimensional spatial unit vector of the camera's line of sight direction based on the rotation matrix.
[0069] It should be noted that the orientation rotation matrix is defined as a 3x3 matrix derived from the quaternion transformation describing the camera's pose in three-dimensional space. A three-dimensional unit vector is defined as having a magnitude that is always equal to... It also indicates the direction of the line of sight. The camera's global position coordinates and orientation rotation matrix together form a unified reference for calculating the direction of the line of sight.
[0070] In this embodiment, the global position coordinates of the current rendered frame are read from the camera component. With orientation rotation matrix .
[0071] Furthermore, in the direction of the rotation matrix Extract the second column of data, which represents the forward direction of the camera's local coordinate system.
[0072] Furthermore, the modulus of the second column of data is calculated, and each element in the second column of data is divided by the modulus value to obtain the three-dimensional spatial unit vector in the direction of the camera's line of sight.
[0073] For example, if the second column of the orientation rotation matrix has values of (0.0, -0.8, -0.6), then the calculated modulus is... The system directly... It was confirmed to be a three-dimensional spatial unit vector. This step, by extracting specific columns of the rotation matrix as a reference, realizes the relative judgment process of converting camera pose data into a standardized line-of-sight vector.
[0074] S25 inputs the three-dimensional spatial unit vector and the projection offset direction vector into the spatial cross-product operation unit, performs numerical calculation on the spatial angle between the two vectors, and generates instantaneous normal orientation data of the fracture surface.
[0075] It should be noted that the spatial cross-product operation unit is defined as a dedicated hardware logic circuit within the graphics processor for handling vector cross-product calculations. The instantaneous normal orientation data of the fracture surface is defined as a unitized vector perpendicular to the plane containing both the viewing direction and the offset direction. The three-dimensional spatial unit vector and the projected offset direction vector change continuously with camera movement and debris falling, driving the instantaneous normal orientation data of the fracture surface to exhibit a dynamic update pattern.
[0076] In this embodiment of the application, the three-dimensional spatial unit vector is used as the first input vector of the cross-product operation unit, and the projection offset direction vector is used as the second input vector.
[0077] Furthermore, the spatial cross-product operation unit calculates the cross product results of the Y-axis and Z-axis components, the cross product results of the Z-axis and X-axis components, and the cross product results of the X-axis and Y-axis components, respectively.
[0078] Furthermore, the three cross product results are combined into an intermediate normal vector, the magnitude of the intermediate normal vector is calculated, and each component in the intermediate normal vector is divided by the magnitude to obtain the normalized instantaneous normal orientation data of the fracture surface.
[0079] For example, the three-dimensional spatial unit vector is (0.0, -0.8, -0.6), and the projection offset direction vector is (95.5, 0.0, 1.0). The system calculates the cross product of Y and Z as -0.8 × 1.0 - (-0.6) × 0.0 = -0.8. The system calculates the cross product of Z and X as -0.6 × 95.5 - 0.0 × 1.0 = -57.3. The system calculates the cross product of X and Y as 0.0 × 0.0 - (-0.8) × 95.5 = 76.4. The system combines the intermediate normal vector (-0.8, -57.3, 76.4) and normalizes it to obtain the instantaneous normal orientation data of the fracture surface. This step, by capturing the law of change of the input vector over time, uses hardware-level cross-product operation to calculate the normal orientation data representing the real physical fracture surface in real time, revealing the intrinsic driving mechanism of fragment surface lighting calculation.
[0080] In an optional implementation, the aforementioned intermediate normal vector can be obtained through the following specific calculation method, wherein: ; ; ; ; in, This represents the intermediate normal vector. Represents a unit vector in three-dimensional space. This represents the projection offset direction vector. Represents the intermediate normal vector Axial components, Represents the intermediate normal vector Axial components, Represents the intermediate normal vector The axis component has a value range from negative floating-point numbers to positive floating-point numbers, a data type of floating-point numbers, and a dimensionless unit.
[0081] S26. Based on the spatial dot product calculation results of the instantaneous normal orientation data of the fracture surface and the camera's line of sight, determine the dynamic incident angle reference of the newly formed fragment surface at the moment of fracture.
[0082] It should be noted that the spatial dot product is defined as the scalar value of the sum of the products of corresponding components of two unit vectors. The key parameter of the dynamic incident angle reference is the angle value obtained by the inverse cosine of the dot product result. The physical meaning of this key parameter represents the incident tilt of light rays striking the surface of the fragment. A larger dot product value indicates a smaller incident angle, and the light rays are more perpendicular to the surface; a smaller dot product value indicates a larger incident angle, and the light rays are more parallel to the surface.
[0083] In this embodiment of the application, the X, Y, and Z components of the instantaneous normal orientation data of the fracture surface are extracted, and the X, Y, and Z components of the camera's line of sight are also extracted.
[0084] Furthermore, the corresponding components of the two sets are multiplied together and the three products are summed to obtain the scalar result of the dot product calculation.
[0085] Furthermore, the system calls the inverse cosine function, uses the scalar result of the dot product calculation as the input variable of the inverse cosine function, converts the calculated radian value into an angle value, and marks the angle value as the dynamic incident angle reference of the fragment's newly formed surface at the moment of fracture.
[0086] For example, the instantaneous normal orientation of the fracture surface is (0.0, -0.6, 0.8), and the camera's line of sight is (0.0, -0.8, -0.6). The system calculates the dot product as 0.0 × 0.0 + (-0.6) × (-0.8) + 0.8 × (-0.6) = 0.0. The system calculates the inverse cosine angle of 0.0 as 90.0°, and sets 90.0° as the dynamic incident angle reference. This step extracts key indicator parameters through dot product calculation and maps these parameters to intuitive angle values using the inverse cosine function, thus realizing the direct determining role of key indicators in the final incident angle judgment.
[0087] In an optional implementation, the result of the dot product calculation mentioned above can be characterized as: ; in, This represents the result of the dot product calculation. The three components represent the instantaneous orientation of the normal to the fracture surface. The three components representing the camera's line of sight range from -1.0 to 1.0, are floating-point numbers, and are dimensionless. The range of the input variable for the inverse cosine function mentioned here can be naturally determined by the range of S from -1.0 to 1.0, since the range of the dot product result is itself limited to this interval. When S = 1.0, the inverse cosine angle is 0.0°, indicating that the light is incident perpendicularly; when S = 0.0, the angle is 90.0°, indicating that the light is incident tangentially; when S = -1.0, the angle is 180.0°, indicating that the light is incident directly behind the surface, at which point the surface is usually in shadow. This mapping relationship precisely transforms the abstract vector relationship into a perceptible illumination angle, providing a clear physical basis for subsequent Fresnel effect calculations.
[0088] S3 traverses the Fresnel optical coefficient mapping queue according to the dynamic incident angle reference, overwrites the optical values output by the queue onto the refraction and reflection rendering registers of the original reef surface, performs synchronous overwrite operation on the pixel coloring instructions of the contact area of the debris falling into the water, and outputs real-time rendering frames of the debris interacting with the water surface.
[0089] It should be noted that the Fresnel optical coefficient mapping queue is defined as a lookup table pre-stored with different reflectivity and refractive index values based on the incident angle. The refraction and reflection rendering register is defined as a high-speed cache area within the graphics processor that stores the current material's optical parameters. The pixel shading instruction is defined as the machine code that controls the graphics processor to calculate the final color value of a single pixel. In water interaction in action games, the system extracts accurate Fresnel coefficients from the mapping queue based on the real-time calculated dynamic incident angle reference, and overwrites the accurate Fresnel coefficients into the rendering register. This ensures that the pixel shading calculation at the moment the fragment enters the water uses the correct optical parameters, thereby outputting flicker-free interactive frame images.
[0090] S31, obtain the historical dynamic incident angle reference value of the previous rendered frame, and perform a difference comparison operation between the dynamic incident angle reference value of the current rendered frame and the historical dynamic incident angle reference value.
[0091] It should be noted that the historical dynamic incident angle reference value is defined as the angle value of the previous moment stored in the double-buffered frame buffer. The difference comparison operation is defined as a subtraction operation that calculates the absolute difference between the current frame value and the historical frame value.
[0092] In this embodiment of the application, the system enters the preparation stage and reads the historical dynamic incident angle reference value from the buffer of the previous rendered frame.
[0093] Further, the system enters the execution phase, reads the dynamic incident angle reference value of the current rendered frame, subtracts the historical value from the current value and takes the absolute value to obtain the angle difference.
[0094] Furthermore, the system enters the verification phase, comparing whether the angle difference is zero and verifying whether the optical state of the current frame has changed compared to historical frames.
[0095] For example, if the historical dynamic incident angle reference value is 45.0° and the current rendered frame's dynamic incident angle reference value is 60.0°, then the difference is calculated as |60.0 - 45.0| = 15.0°. This step, through a three-stage division of preparation reading, execution subtraction, and verification comparison, strings together a complete cross-frame state change detection execution flow.
[0096] S32, based on the angle change amplitude data output by the difference comparison operation, compares it with the visual transition judgment threshold range stored in the system to filter the valid timestamps that trigger optical state switching.
[0097] It should be noted that the angle change amplitude data is defined as the absolute angle difference value output by the difference comparison operation. The visual transition judgment threshold range is defined as the upper and lower limit value range used to distinguish between slow movement of a normal viewpoint and a sudden, disruptive viewpoint jump. The valid timestamp is defined as the clock cycle number that marks the specific rendering frame in which the drastic change in optical state occurs. The threshold criterion for the judgment condition to be met is that the angle change amplitude data is greater than the upper limit value of the visual transition judgment threshold range.
[0098] In this embodiment of the application, the visual transition judgment threshold range stored in the system is read, and the upper limit value and lower limit value of the range are extracted.
[0099] Furthermore, the angle change amplitude data is compared with the upper limit value of the interval.
[0100] Furthermore, if the angle change amplitude data is greater than the upper limit of the interval, the rendering clock cycle number of the current rendered frame is extracted, the rendering clock cycle number is marked as a valid timestamp and output; if the angle change amplitude data is less than or equal to the upper limit of the interval, the system discards the rendering clock cycle number of the current rendered frame.
[0101] For example, the visual transition determination threshold range is set as follows: to The angle change range data is System judgment Greater than the upper limit Extract the current clock cycle number As a valid timestamp. If the angle change amplitude data is The system determines Not exceeding the upper limit The clock cycle sequence number is discarded. This step uses a clear upper limit of the interval as a boundary standard and a single comparison operation to accurately filter valid timestamps, demonstrating the significant difference in data trends on both sides of the boundary. The visual transition judgment threshold interval mentioned in this section can be dynamically adjusted according to the physical destruction characteristics of the game scene and the hardware rendering performance requirements. In practical applications, developers can preset the basic threshold interval through configuration files. During operation, the system will fine-tune it in real time based on the number of fragments generated in the current scene, the camera movement speed, and the GPU load. For example, when the number of fragments exceeds 1000 and the GPU utilization rate is higher than 85%, the system will automatically increase the upper limit of the interval from 10.0° to 15.0° to reduce unnecessary optical state switching and ensure smoothness of the image; while when the number of fragments is less than 200 and the GPU load is low, the upper limit of the interval can be reduced to 8.0°, thereby improving the sensitivity of optical state switching and enhancing visual detail. This dynamic threshold adjustment mechanism achieves an intelligent balance between visual effects and running performance, ensuring stable and high-quality rendering output under different hardware configurations and game scenes.
[0102] S33, perform a segmented read operation on the Fresnel optical coefficient mapping queue pointed to by the valid timestamp, and merge the read historical optical coefficient sequence with the current optical coefficient sequence into a double-buffered interpolation array.
[0103] It should be noted that the segmented read operation is defined as a pointer addressing process that extracts non-contiguous data segments from a contiguous memory block based on a timestamp index. The double-buffered interpolation array is defined as a memory structure containing both old and new sets of optical parameters and supporting atomic reads and writes. The mechanism for selecting a unique output from multiple results involves the system extracting specific weighting factors from the historical and current optical coefficient sequences to lock in a unique hybrid interpolation result.
[0104] In this embodiment of the application, the starting pointer of the historical optical coefficient sequence and the starting pointer of the current optical coefficient sequence are located in the Fresnel optical coefficient mapping queue based on the valid timestamp.
[0105] Furthermore, floating-point numbers of a preset length are read continuously from the two starting pointer addresses and stored in the first buffer and the second buffer, respectively.
[0106] Furthermore, a double-buffered interpolation array is created, with the data in the first buffer as the preceding element and the data in the second buffer as the following element. The arithmetic mean of the preceding and following elements is calculated, and the arithmetic mean is written into the double-buffered interpolation array as the unique interpolation output.
[0107] For example, the historical optical coefficient sequence contains The current optical coefficient sequence contains The system calculates the arithmetic mean as follows: ,Will The result is written as the unique value into the double-buffered interpolation array. This step, through a filtering mechanism that extracts the old and new sequences and calculates the arithmetic mean, locks in a unique average interpolation result from multiple possible interpolation ratios, ensuring the deterministic output of the optical transition state.
[0108] S34: Obtain the historical optical coefficient sequence value allocation ratio and the current optical coefficient sequence value allocation ratio stored in the double-buffered interpolation array, perform linear mixing operation according to the value allocation ratio, and generate smooth transition optical coefficient values.
[0109] It should be noted that the numerical allocation ratio is defined as a floating-point factor that controls the weighting of historical and current optical coefficients in the blending result. The smooth transition optical coefficient value is defined as an optical parameter that eliminates continuous changes in inter-frame abruptness. In traditional rendering architectures, directly replacing optical coefficients at the moment of break will cause abrupt changes in the highlights of the image. This step improves the effect by introducing a numerical allocation ratio to perform linear blending operations, thus transforming the defect into a smooth optical transition effect.
[0110] In this embodiment of the application, the numerical allocation ratio of the historical optical coefficient sequence marked in the double-buffered interpolation array is read, for example... And the current numerical allocation ratio of the optical coefficient sequence, for example .
[0111] Furthermore, extract the historical optical coefficient values and the current optical coefficient values, multiply the historical optical coefficient values by the historical optical coefficient sequence value allocation ratio, and multiply the current optical coefficient values by the current optical coefficient sequence value allocation ratio.
[0112] Furthermore, by adding the two products together, we obtain the value of the smooth transition optical coefficient.
[0113] For example, the historical optical coefficient value is The current optical coefficient value is System calculation The system outputs a smooth transition optical coefficient value. This step, through a weighted summation operation, quantifies and eliminates the abrupt changes caused by direct parameter replacement, thus reducing the variation in specular brightness from... Reduce to This enabled quantitative verification of the degree of defect elimination.
[0114] In an optional implementation, the aforementioned smooth transition optical coefficient value can be characterized as: ; in, This represents the optical coefficient value for smooth transition. This represents the historical optical coefficient values. This indicates the proportion of historical optical coefficient sequence values. This indicates the current optical coefficient value. This indicates the current numerical distribution ratio of the optical coefficient sequence, with a value range of [value range missing]. arrive The data type is floating-point, and the unit is dimensionless. The numerical allocation ratio mentioned in this section can be dynamically adjusted according to the time interval between the current rendered frame and the previous frame. When the time interval is less than or equal to 16ms (corresponding to a standard frame rate of 60fps), the historical optical coefficient sequence numerical allocation ratio is... The numerical distribution ratio of the current optical coefficient sequence decreases linearly over time. The transition time increases linearly with time, forming a complete 0→1 and 1→0 transition curve; when the time interval is greater than 16ms, the system automatically... Forced to be set to 0.0, Forced to 1.0, skipping the blending process and directly applying the current optical coefficients avoids transitional latency at low frame rates. For example, in a 30fps scene (time interval approximately 33ms), if the timestamp of frame N is t and the timestamp of frame N+1 is t+33ms, the system determines that the time interval exceeds the threshold and directly applies the current optical coefficients. = ×1.0 + ×0.0= This ensures that the optical state is updated in a timely manner even when performance fluctuates. This time-interval-based dynamic scaling ensures a smooth transition at high frame rates while avoiding transition lag in low frame rate scenes, further optimizing rendering performance under different performance conditions.
[0115] S35 inputs the smooth transition optical coefficient values into the reflected light wave simulation channel, performs a real-time overwrite operation on the incident light energy attenuation ratio in the channel, and updates the original specular reflection brightness distribution map of the reef surface.
[0116] It should be noted that the incident light energy attenuation ratio is defined as the ratio of the reflected energy to the incident energy after light shines on the surface of an object. The specular reflection brightness distribution map is defined as a two-dimensional array storing the specular intensity of each pixel on the surface in the form of a texture map. The fault-tolerant design under extreme values is reflected in the fact that when the value of the smooth transition optical coefficient exceeds the range of physical norms, the system forcibly clamps the value to prevent calculation overflow errors.
[0117] In this embodiment of the application, the value of the smooth transition optical coefficient is written into the attenuation ratio register of the reflected light wave simulation channel.
[0118] Furthermore, it is determined whether the optical coefficient value for smooth transition is greater than [value missing]. or less .
[0119] Furthermore, if the value is greater than Overwrite the attenuation ratio register to If the value is less than Overwrite the attenuation ratio register to If the value is in arrive The system retains the original values. The system then recalculates the brightness value of each pixel in the specular reflection brightness distribution map using the updated attenuation ratio register.
[0120] For example, the optical coefficient for smooth transition is The system detected a value greater than [value missing]. Overwrite the attenuation ratio register to ,according to The brightness distribution map is recalculated proportionally to avoid pure white screen errors caused by brightness calculation overflow. This step involves setting... arrive Boundary condition detection and forced assignment enable fault-tolerant responses to abnormal optical inputs, ensuring the stability of brightness distribution map updates.
[0121] S36, based on the pixel-level brightness transition detection feedback of the specular reflection brightness distribution map, locks the coordinates of the high-frequency flicker area, replaces the abnormal reflection value corresponding to the locked coordinates with the smooth transition optical coefficient value, and outputs the reflection reference correction frame.
[0122] It should be noted that pixel-level brightness transition detection feedback is defined as a set of Boolean results comparing whether the brightness difference between adjacent pixels exceeds a certain range. The coordinates of a high-frequency flickering region are defined as the screen spatial location of a pixel whose brightness repeatedly flips within multiple consecutive frames. Independent criteria include spatial criteria based on adjacent pixel differences and temporal criteria based on inter-frame differences. The overall logic is that a region is identified as a high-frequency flickering region only when both spatial and temporal criteria are met.
[0123] In this embodiment of the application, the brightness value of the current pixel and the brightness value of the horizontally adjacent pixels are read from the specular reflection brightness distribution map, and the absolute value of the brightness difference in the spatial dimension is calculated.
[0124] Furthermore, the brightness value of the current pixel in the previous frame is read, and the absolute value of the brightness difference over time is calculated.
[0125] Furthermore, the system compares the absolute value of the brightness difference in the spatial dimension with the spatial jump threshold, and simultaneously compares the absolute value of the brightness difference in the temporal dimension with the temporal jump threshold. If both comparison results show that the thresholds are exceeded, the screen space horizontal and vertical coordinates of the current pixel are extracted as the coordinates of the high-frequency flickering area. The brightness value at the coordinates of the high-frequency flickering area is replaced with the value of the smooth transition optical coefficient, and a reflection reference correction frame containing the correction data is output.
[0126] For example, the current pixel brightness is The brightness of horizontally adjacent pixels is Spatial difference is The brightness of the previous frame was The time difference is The system determined that both the spatial and temporal differences exceeded the thresholds and locked the coordinates. , coordinate The numerical values are replaced with the values of the smooth transition optical coefficients. This step, by decomposing spatial and temporal criteria and using logical AND operations for comprehensive judgment, achieves accurate identification and correction of abnormally flickering pixels in the image. The spatial and temporal jump thresholds mentioned here can be configured differently based on the material characteristics and lighting conditions of the game scene. For highly reflective materials such as metal and glass, the spatial jump threshold can be set to 0.3 and the temporal jump threshold to 0.4 to capture the subtle high-gloss flickering that easily occurs on the surface of these materials. For diffuse reflective materials such as rock and concrete, the spatial jump threshold can be increased to 0.5 and the temporal jump threshold to 0.6 to reduce misjudgments of normal diffuse brightness fluctuations. For example, in a scene where metal armor is destroyed, when the brightness difference between adjacent pixels reaches 0.35 (exceeding the spatial threshold of 0.3) and the inter-frame brightness difference reaches 0.42 (exceeding the temporal threshold of 0.4), the system immediately marks the area as a high-frequency flickering zone and corrects it. In a rock scene, the correction mechanism is only triggered when the difference between adjacent pixels exceeds 0.5 and the inter-frame difference exceeds 0.6. This dynamic threshold adjustment based on material type enables flicker detection to accurately capture anomalies in high-gloss materials while avoiding excessive intervention in diffuse materials, further improving the targeting and accuracy of surface reflection correction for different materials.
[0127] S37, acquire the surface brightness distribution data output by the reflection reference correction frame, and input the surface brightness distribution data as the initial energy source of the refracted light into the water surface medium propagation simulation pipeline; It should be noted that the initial energy source of the refracted ray is defined as the basic energy value that determines how deep the light can penetrate after entering the water surface. The water surface medium propagation simulation pipeline is defined as the shader calculation process that simulates the absorption and scattering phenomena that occur when light waves propagate in water.
[0128] In this embodiment of the application, the system extracts a two-dimensional texture array of surface brightness distribution data from the reflection reference correction frame.
[0129] Furthermore, the two-dimensional texture array is bound to the texture sampler unit of the graphics processor.
[0130] Furthermore, after the water surface medium propagation simulation pipeline is started, the texture sampler unit is called to read the surface brightness distribution data based on the current screen pixel coordinates, and the read floating-point value is assigned to the initial energy source variable of the refracted light, thus completing the concrete transformation from abstract texture data to specific pipeline input variables.
[0131] For example, the screen coordinates of the water surface medium propagation simulation pipeline. When the pixel is at a certain position, read the coordinates from the bound 2D texture array. Corresponding data Assign a value to the initial energy source variable of the refracted light. This step demonstrates the detailed implementation process, from logical-level brightness data to hardware-pipeline-readable power source variables, through texture binding and variable assignment operations.
[0132] S38, based on the transmittance attenuation curve obtained from the simulated pipeline of water surface medium propagation, performs transparency superposition calculation on the sampling command of the bottom reef texture in the contact area to generate an array of refracted light spots inside the water body. It should be noted that the transmittance attenuation curve is defined as a function graph describing the relationship between the depth of light penetrating the water and the remaining energy. Transparency superposition calculation is defined as a mathematical operation that mixes the refracted light energy with the original color of the underlying object. The water body internal refracted light spot distribution array is defined as three-dimensional texture data recording the intensity and color of light spots at various locations on the bottom of the water. The mechanism for eliminating uncertainty is manifested in replacing randomly sampled Monte Carlo ray tracing with a deterministic transmittance attenuation curve function, thus transforming uncontrollable water scattering factors into predictable mathematical functions that can be solved.
[0133] In this embodiment of the application, the system obtains the spatial depth value of the contact area of the fragment falling into the water surface, substitutes the spatial depth value into the light transmittance attenuation curve function, and calculates a determined attenuation ratio value.
[0134] Furthermore, the underlying reef texture sampling instruction is read, and the original color RGB values in the underlying reef texture sampling instruction are extracted.
[0135] Furthermore, each channel of the original color RGB value is multiplied by the attenuation ratio to obtain the superimposed transparency RGB value, and the transparency RGB value is stored in the water body refraction spot distribution array according to the spatial coordinates.
[0136] For example, the spatial depth value is The attenuation ratio was calculated using the transmittance attenuation curve function. The original color of the underlying reef texture is... The system calculates the RGB value of transparency as follows: The light is then written into the array. This step eliminates random uncertainties in water scattering calculations by introducing a fixed transmittance attenuation curve function, ensuring an absolutely consistent refracted light spot distribution result at a specific depth input.
[0137] In an optional implementation, the aforementioned attenuation ratio can be characterized as: ; in, This indicates the attenuation ratio. Indicates the water absorption coefficient. This represents the spatial depth value, with a range of values of [value range missing]. arrive The data type is floating-point number, and the unit is dimensionless. The water absorption coefficient mentioned in this section can be configured differently according to different water types. For pure water scenarios, the water absorption coefficient k can be set to 0.15 to simulate the slow attenuation characteristics of light in clear water; for turbid river water scenarios, the k value can be increased to 0.4 to enhance the light absorption and attenuation effect; and for lake water scenarios rich in algae, the k value can be further adjusted to 0.3 to take into account the absorption characteristics of algae for specific wavelengths of light. For example, when the spatial depth H is 3.0m, the attenuation ratio A=e^(-0.15×3.0)≈e^(-0.45)≈0.637 in the pure water scenario, indicating that about 63.7% of the light energy can reach this depth; while in the turbid river water scenario, A=e^(-0.4×3.0)=e^(-1.2)≈0.301, only about 30.1% of the light energy can penetrate, which is more consistent with the optical performance of actual turbid water. This dynamic adjustment of the absorption coefficient based on water type allows the transmittance attenuation curve to accurately match the optical characteristics of different aquatic environments, thereby generating a more realistic distribution of refracted light spots inside the water body.
[0138] S39 spatially aligns and matches the distribution array of refracted light spots inside the water body with the contour data of the broken edge of the fragment. Based on the matching result, it corrects the light transmission and refraction angle of the edge pixels and outputs a real-time rendered frame of the fragment interacting with the water surface.
[0139] It should be noted that spatial alignment matching is defined as the operation of converting spot data and contour data from different coordinate systems to the same view space and comparing their overlapping states. The light refraction angle is defined as the angle at which light rays deflect when they pass through water and strike the edge of a fragment. The premise is that the contour geometry of the fragment's fracture edge directly affects the propagation path of light rays inside the water body; the logical derivation is a vector rotation process that adjusts the refraction angle based on the contour normal direction.
[0140] In this embodiment, the distribution array of refracted light spots inside the water body is converted from world space coordinates to screen space coordinates, and the fragment fracture edge contour data is also converted to screen space coordinates.
[0141] Furthermore, the system traverses the screen space coordinate system, compares the non-zero pixel coordinates in the spot distribution array with the edge coordinates in the fragment fracture edge contour data, and finds the spot pixels within the preset neighborhood of the edge coordinates.
[0142] Furthermore, the world space normal direction corresponding to the identified light spot pixels is extracted, and the normal direction is used as the deflection axis. The new light transmission and refraction angle is calculated according to Snell's law. The light spot color is recalculated using the new light transmission and refraction angle, and the recalculated light spot color is written into the frame buffer. The real-time rendered frame of the fragment interacting with the water surface is then output.
[0143] For example, assuming the normal direction of the edge of the fragment is biased to the left, according to Snell's law, when light enters air from water, it is deflected to the other side of the normal, correcting the angle of light refraction to the right. After recoloring, the output frame is displayed. This step is based on the premise that edge contours affect the light path, and derives the specific operation of correcting the refraction angle according to the normal direction, verifying the logical closed loop from geometric assumptions to changes in optical rendering results.
[0144] In an optional implementation, the aforementioned new light transmission and refraction angle can be obtained through the following specific calculation method, wherein: ; in, This indicates a new angle of light transmission and refraction. Indicates the refractive index of water. Indicates the refractive index of air. Indicates the incident angle, with a value range of 100°. arrive The data type is floating-point, and the unit is degrees. The refractive indices of water and air mentioned in this section can be set according to actual physical parameters. Usually, the refractive index of water, nw, is set to 1.33, and the refractive index of air, na, is set to 1.00. For example, when light travels from water to air at an incident angle of θin = 30.0°, the new angle of refraction θout = arcsin((1.33 / 1.00) × sin(30.0°)) = arcsin(1.33 × 0.5) = arcsin(0.665) ≈ 41.7°, which conforms to the physical law that the angle of refraction is greater than the angle of incidence when light travels from a denser medium to a less dense medium. When the calculated value of (1.33 / 1.00)×sin(θin) is greater than 1.0, total internal reflection occurs. In this case, the system forcibly sets the light refraction angle θout to 90.0° and sets the light spot color to a high-gloss white under total internal reflection conditions to accurately simulate the effect of total internal reflection in actual physics. For example, when θin = 60.0°, (1.33×sin(60.0°)) ≈ 1.33×0.866 ≈ 1.152 > 1.0, the system determines that total internal reflection has occurred, θout = 90.0°, and the light spot exhibits strong high-gloss characteristics. This precise calculation based on Snell's law and the handling of special cases of total internal reflection ensures the physical accuracy of the refraction angle correction at the edge of the fragment, making the light spot deflection effect in the rendered image more consistent with real optical phenomena.
[0145] In an optional implementation, this application further includes the following steps: S41, obtain the vertical synchronization pulse signal corresponding to the real-time rendered frame, and align and verify the vertical synchronization pulse signal with the timing of the fragment motion trajectory calculated by the physics engine.
[0146] It should be noted that the vertical sync pulse signal is defined as the hardware interrupt signal issued by the display hardware when it is ready to start drawing a new frame. The fragment motion trajectory timing is defined as the timestamp sequence of fragment position data calculated by the physics engine according to a fixed time step. The mechanism to ensure consistent results across multiple executions is that the system always uses the vertical sync pulse signal as the sole time reference source, and eliminates clock drift errors between the physics engine and the rendering pipeline through a phase-locked loop mechanism.
[0147] In this embodiment, the system captures the rising edge of the vertical synchronization pulse signal of the current cycle and records the value of the system's high-precision timer at the rising edge.
[0148] Furthermore, read the timestamp corresponding to the fragment motion trajectory time sequence output by the physics engine in the current cycle.
[0149] Furthermore, the system calculates the difference between the system's high-precision timer value and the timestamp. If the difference is within the preset error range, the system marks the alignment check as passed; if the difference exceeds the preset error range, the system discards the current physics engine timestamp and forces the use of the system's high-precision timer value as the benchmark.
[0150] For example, the rising edge time of the vertical synchronization pulse signal is The physics engine timestamp is The difference is Within the preset error range, the timing verification is marked as successful. This step introduces a unified hardware pulse signal as a reference anchor point to align the clock sources of different modules, ensuring the absolute stability of the timing verification results in multiple rendering loops. The preset error range mentioned here can be dynamically adjusted according to hardware configuration and screen refresh rate. For high frame rate display devices, such as 144Hz, the preset error range can be set to ±0.003s to adapt to the fast frame update rhythm; while for standard frame rate devices, i.e., 60Hz, the error range can be widened to ±0.008s to reduce unnecessary timing correction operations. For example, when running on a 144Hz monitor, if the vertical sync pulse time is 20.002s and the physics engine timestamp is 20.005s, the difference of 0.003s reaches the error limit, and the system determines that timing calibration is required; while on a 60Hz monitor, the same 0.003s difference is within the allowable range and no intervention is required. This error range adjustment based on the characteristics of the display device ensures timing accuracy in high frame rate scenarios while avoiding performance loss caused by frequent calibration in low frame rate scenarios.
[0151] S42, based on the timing deviation value output by the alignment check, performs an intra-frame delay compensation operation on the graphics processing instruction queue of the current rendering pipeline, and adjusts the pixel drawing priority of the water surface interaction area.
[0152] It should be noted that timing deviation is defined as the absolute value of the time difference between the vertical synchronization pulse and the physical timing. Intra-frame delay compensation is defined as a hardware control method that compensates for the time difference by inserting null instructions or adjusting the instruction emission time. Pixel rendering priority is defined as the order in which the graphics processor processes pixels in different screen areas. Transforming the abstract timing deviation requirement into specific instruction adjustment rules involves mapping the timing deviation value to a delay counter value, thereby modifying the scheduling order of the instruction queue.
[0153] In this embodiment, the timing deviation value of the alignment check output is read, and the timing deviation value is divided by the clock cycle of the graphics processor to obtain the number of clock cycles that need to be compensated.
[0154] Furthermore, the number of clock cycles is converted into the initial value of the delay counter, and the initial value of the delay counter is written into the no-operation instruction at the head of the graphics processing instruction queue.
[0155] Furthermore, the system scans the graphics processing instruction queue to find pixel drawing instructions containing water surface interaction area identifiers, modifies the priority field of the pixel drawing instructions with water surface interaction area identifiers to the highest level value, and resubmits the modified graphics processing instruction queue to the graphics processor.
[0156] For example, the timing deviation value is The graphics processor clock cycle is The system calculates the number of clock cycles to be... Insert at the head of the queue A no-operation command, and at the same time, the priority of the command to draw the water surface interaction area is changed to This step demonstrates the mechanism for converting abstract timing requirements into specific hardware instructions by using the conversion rules from timing differences to the number of no-operation instructions and the mapping process from region identifiers to priority fields. The highest priority value mentioned in this section can be set to level 0 according to the system's preset priority coding specifications, where a smaller priority value indicates a higher processing priority. When there are multiple drawing instructions for different regions, such as the background sky (priority level 3), land scene (priority level 2), and non-interactive water area (priority level 1), the level 0 priority of the water surface interaction area will ensure that the graphics processor prioritizes the key pixels of the fragment and water surface interaction, avoiding stuttering of interactive screens due to rendering delays in other areas. For example, in a complex scene where there are both explosion effects (priority level 1) and fragment falling into water interaction (priority level 0), the system will prioritize scheduling pixel drawing instructions in the fragment falling into water area to ensure the real-time nature of interactive feedback. This dynamic priority adjustment strategy based on region importance maximizes the rendering efficiency of key interactive screens with limited hardware processing resources, effectively improving the player's immersion in the scene destruction feedback.
[0157] S43, obtain the vertical synchronization pulse signal corresponding to the real-time rendered frame, and align and verify the vertical synchronization pulse signal with the timing of the fragment motion trajectory calculated by the physics engine.
[0158] It should be noted that the abnormal identification and fault tolerance mechanism for abnormal inputs is that when the vertical synchronization pulse signal is lost or the timing data of the physics engine is corrupted, the system adopts a preset safety rollback strategy to maintain the screen output.
[0159] In this embodiment of the application, the system listens for vertical synchronization pulse signals within a preset time window.
[0160] Furthermore, if the system does not receive a vertical synchronization pulse signal within a preset time window, the system identifies it as a signal loss anomaly.
[0161] Furthermore, the system triggers a fault-tolerance mechanism, ignoring the timing of fragment motion trajectories calculated by the physics engine, directly calling the frame buffer data of the previous rendered frame as the current output frame, and sending a fixed-frequency pseudo-synchronization pulse signal to the display controller to maintain screen refresh.
[0162] For example, the preset time window is set as follows: The system is waiting. If no pulse signal is received, the system identifies an anomaly, copies the previous frame's data, and outputs it to prevent the screen from freezing or going black. This step, through a timeout monitoring and data multiplexing security process, achieves stable fault tolerance for abnormal inputs such as hardware signal loss and data corruption. The preset time window mentioned here can be dynamically configured according to the display device's refresh rate. For a 144Hz device, the theoretical single-frame interval is approximately 6.94ms, and the preset time window can be set to 10ms, approximately 1.44 times the frame interval, to ensure timely response to anomalies while avoiding misjudgments. For a 60Hz device, the single-frame interval is approximately 16.67ms, and the time window can be set to 25ms, approximately 1.5 times the frame interval, balancing anomaly detection sensitivity and system stability. For example, if a 144Hz display does not receive a pulse signal for three consecutive theoretical frame cycles (approximately 20.8ms), the system determines this as a persistent anomaly. In addition to reusing frame data, it also triggers the hardware diagnostic module to check the display interface status. Conversely, if a 60Hz device does not receive a signal within the same 20ms window, fault tolerance is immediately activated, as this duration exceeds its single-frame interval, allowing for a rapid response to the anomaly. This dynamic adaptation of the time window based on refresh rate enables the anomaly identification mechanism to adapt to the operating characteristics of different hardware, improving the system's robustness in complex operating environments.
[0163] S44: Obtain the spatial boundary range of the camera's view frustum within the current frame, and map the spatial coordinate data of the fragment geometry to the view frustum boundary range for visibility bounding box filtering.
[0164] It should be noted that the spatial boundary of the view frustum is defined by the six plane equations of the truncated cone region that the camera can observe in 3D space. Visibility bounding box filtering is defined as a spatial collision test operation that removes geometry completely outside the view frustum. The optimization mechanism to reduce redundant computation is manifested by pre-removing invisible background meshes through hexahedral collision tests in spatial planes, avoiding submitting invisible meshes to the expensive pixel shading stage of the graphics processor.
[0165] In this embodiment, the spatial equation parameters of the left plane, right plane, upper plane, lower plane, near clipping plane, and far clipping plane of the camera's view frustum within the current frame are extracted.
[0166] Furthermore, the system calculates the coordinates of the eight vertices of the axially aligned bounding box of the spatial coordinate data of the fragment geometry.
[0167] Furthermore, the coordinates of the eight vertices are substituted into the spatial equation parameters of the six planes to calculate the number of times the coordinates of the eight vertices lie inside all the planes. If the number of times the coordinates of the eight vertices lie inside all the planes is zero, the system determines that the fragment geometry is invisible and discards the rendering instructions for the fragment geometry; if the number of times the coordinates of the eight vertices lie inside all the planes is greater than zero, the system retains the rendering instructions for the fragment geometry.
[0168] For example, if all eight vertices of the bounding box of the background trees are outside the left plane, the system calculates the number of inside vertices as follows: By removing rendering instructions for background trees, the vertex processing overhead of background trees is saved. This step uses a plane-to-point inclusion test optimization mechanism to block invalid background meshes from the rendering pipeline. Compared with the previous method of submitting all meshes, this significantly reduces the vertex processing consumption of the graphics processor.
[0169] S45, based on the valid fragment facet identifiers filtered by the visibility bounding box, performs rendering instruction masking operations on the background mesh elements in the non-interactive area, releasing the video memory occupied by the graphics processing unit.
[0170] It should be noted that a valid fragment facet identifier is defined as the index number of a triangular facet that passes the view frustum test and has a water surface interaction marker. A rendering instruction masking operation is defined as a bitmap modification operation that marks a specific drawing call in the instruction queue as skipped. The logic for prioritizing the judgment criteria is as follows: the system first delineates the reserved area based on the valid fragment facet identifier, then delineates the masked area based on spatial distance, and high-priority interactive faces directly dominate video memory allocation.
[0171] In this embodiment of the application, the set of valid fragment facet identifiers output by the visibility bounding box filter is read.
[0172] Furthermore, an absolute reserved region mask is generated based on the pixel boundaries occupied by the set of valid fragment facet identifiers in the screen space.
[0173] Furthermore, it iterates through all rendering commands in the current scene, compares the spatial coordinates corresponding to the rendering commands with the spatial distance of the absolute reserved area mask, and if the spatial distance is greater than the preset masking distance, it modifies the status bit of the rendering command to the masking state, releasing the video memory occupied by the graphics processing unit.
[0174] For example, if the set of valid fragment facet identifiers occupies the central area of the screen, the system generates a screen center mask. The system compares the data and finds that the background mesh rendering instructions located at the screen edge are extremely far from the mask. It then modifies the edge rendering instruction status to a masked state, releasing the corresponding video memory space. This step, through priority comparison of spatial distances, ensures that high-priority interactive faces receive full video memory resource guarantees, demonstrating the dominant role of priority ranking in resource scheduling. The preset masking distance mentioned in this section can be dynamically adjusted based on the average size of the fragment facets and the camera's viewing angle. For close-up shots, such as a close-up of a fragment falling into water, where the fragment facets occupy a large pixel area in the screen space, the preset masking distance can be set to 1 / 4 of the screen diagonal length, only masking the distant background at the edge of the image. For wide-angle shots, such as panoramic scenes of scene destruction, where the fragment facets are widely distributed, the masking distance can be increased to 1 / 2 of the screen diagonal length to mask more background meshes in non-interactive areas. For example, when the camera is 5 meters away from the fragment interaction area (close-up shot), the preset shielding distance is set to 200 pixels, only shielding background buildings beyond 200 pixels from the interaction area; when the camera is 50 meters away from the interaction area (wide-angle lens), the shielding distance is set to 500 pixels, which can shield background elements such as mountains and clouds at greater distances. This dynamic adaptation of the shielding distance based on the lens perspective can preserve rich environmental details in close-up scenes and maximize the efficiency of video memory release in wide-angle scenes, achieving a balance between visual effects and hardware performance.
[0175] S46 redistributes the freed-up video memory space to high-frequency optical computing nodes in the water surface contact area. Based on the redistributed video memory capacity, it improves the sampling accuracy of Fresnel coefficients and outputs high frame rate scene destruction effects.
[0176] It should be noted that a high-frequency optical computing node is defined as a graphics processing unit computation shader responsible for calculating water surface caustics and refraction shifts. Fresnel coefficient sampling precision is defined as the texture pixel resolution and floating-point bit width used when calculating Fresnel formulas. The intention and measures to improve efficiency or accuracy involve using freed-up redundant video memory space to achieve higher-resolution texture sampling, thereby improving the accuracy of optical rendering while maintaining a high frame rate.
[0177] In this embodiment of the application, the system calculates the size of the freed video memory space and the additional texture resolution that the size of the space can support.
[0178] Furthermore, the system sends a reallocation request to the memory manager, which then loads the freed video memory space into the video memory pool of the high-frequency optical computing node in the water surface contact area.
[0179] Furthermore, the system modifies the resolution parameters and floating-point bit width parameters of the Fresnel coefficient sampling texture in the high-frequency optical computing node, loads high-precision textures using the reallocated video memory capacity, calculates pixel colors based on the high-precision textures, and outputs high-frame-rate scene destruction effects.
[0180] For example, the system released Video memory usage space will The video memory space is allocated to high-frequency optical computing nodes. The resolution of Fresnel coefficient-sampled textures is increased from... Upgraded to Floating-point width from Upgraded to Compared to the jagged edges and color banding caused by low-resolution sampling before the improvement, the improved output features smoother edges on the water surface refraction spots, continuous color transitions, and, because the accuracy is improved only in local interactive areas, the overall rendering frame rate remains at [value missing]. The frame rate did not drop per second. This step, through specific measures such as memory reallocation and texture parameter upgrades, quantitatively compared the rendering quality differences before and after the improvement, achieving a dual improvement in efficiency and accuracy. The additional texture resolution and floating-point bit width parameters mentioned in this section can be dynamically configured according to the non-linear relationship between memory capacity and optical computing requirements. When the freed memory capacity is less than 30MB, the floating-point bit width is preferentially increased to 24 bits (retaining 8 integer bits + 16 fractional bits) to ensure basic calculation accuracy; when the freed memory capacity is in the range of 30-100MB, the resolution is simultaneously increased to 512×512 while maintaining a 24-bit bit width; when the freed memory capacity exceeds 100MB, the resolution can be increased to 2048×2048 and a 32-bit bit width (11 exponent + 5 exponent + 16 fractional bits) can be enabled. For example, in a large-scale explosion scene, the system frees up 120MB of video memory by masking the distant mountain mesh. At this point, the Fresnel sampling texture is upgraded to 2048×2048 resolution and 32-bit width, resulting in a more delicate spectral hierarchy in the rainbow dispersion effect produced when fragments enter the water. In a small-scale glass breakage scene, only 40MB of video memory is freed, and the system selects a 512×512 resolution + 24-bit width combination, ensuring the clarity of the refracted light spots while avoiding resource waste. This tiered configuration strategy based on the amount of video memory released achieves precise allocation of optical computing resources, ensuring that every MB of video memory translates into a perceptible improvement in visual quality.
[0181] In an optional implementation, the additional texture resolution mentioned above can be obtained through the following specific calculation method, wherein: ; in, This represents the number of pixels per side for the additional texture resolution. This indicates the amount of freed video memory. This represents the number of bytes of video memory occupied by a single pixel. The value range is positive integer, the data type is integer, and the unit is the number of pixels.
[0182] In summary, this application proposes a method and system for real-time scene destruction and debris generation in action games. This method acquires the scene destruction trigger signal and extracts the vertex coordinate sequence of the fracture boundary. It determines the projection offset direction vector of the vertex sequence relative to the water surface normal plane and, combined with the camera's line-of-sight direction, obtains the dynamic incident angle reference for the newly formed debris surface. Based on the dynamic incident angle reference, it traverses the Fresnel optical coefficient mapping queue and overwrites the optical values output by the queue onto the refraction and reflection rendering registers of the original reef surface. Simultaneously, it overwrites the pixel shading instructions for the debris's contact area with the water surface, outputting real-time rendered frames of the debris interacting with the water surface. This method eliminates pipeline parameter update delays, corrects refractive index misalignment at the moment of fracture, eliminates optical flicker at the debris edges, and ensures consistent optical rendering of the interaction between the solid medium and the liquid water surface.
[0183] Figure 2 This diagram serves as a summary of the above content, illustrating the complete operational architecture and detailed execution flow of a real-time scene destruction and fragment generation method for action games provided by an embodiment of this application.
[0184] It should be noted that the first part of the diagram corresponds to the execution logic of the fracture vertex sequence extraction module. In this embodiment, when the physics engine outputs a scene destruction trigger signal, the system does not directly destroy the global mesh, but first enters a topology scanning operation. By comparing the modulus of each element in the force vector queue with the preset yield limit value, the local mesh region identifier is extracted. Furthermore, for the missing spatial coordinates around the fracture threshold node, the system uses linear interpolation to complete the calculation and generate an initial contour coordinate set, ensuring the geometric continuity of subsequent optical reflector calculations. Finally, the initial contour coordinate set is input into the geometric space transformation matrix, and redundant background mesh data is stripped away through bounding box collision state detection, realizing the accurate transfer of fracture boundary vertices from local isolated data to global clean data.
[0185] The second part of the diagram corresponds to the computational architecture of the dynamic incident angle reference generation module. It should be noted that in the optical rendering of action games, the original static normal becomes invalid the instant the fragment detaches from the parent body and falls into the water, necessitating the re-establishment of the lighting geometric topology between the newly formed fragment surface and the camera. In this embodiment, the system first maps the three-dimensional vertex coordinate sequence point by point to the two-dimensional projection area of the water surface normal plane, performing distance difference accumulation to generate an offset distance data stream. Further, based on the orthogonal combination of this data stream and the reference value in the vertical direction of the water surface, a projection offset direction vector with directional and modulus attributes is constructed. On this basis, the system extracts the camera orientation rotation matrix to resolve the viewing direction unit vector, and inputs it together with the offset direction vector into the spatial cross-product operation unit to generate the instantaneous normal orientation data of the fractured surface. Finally, key index parameters are extracted through the spatial dot product calculation results, and the inverse cosine function is used to map them into intuitive angle values, thus providing a precise spatial angle basis for the dynamic updating of Fresnel optical coefficients.
[0186] The third part of the diagram corresponds to the control logic and rendering optimization mechanism of the fracture surface light and shadow takeover output module. In this embodiment, the system first performs a difference comparison calculation between the current and historical dynamic incident angle references. During this process, a key judgment process is introduced in the diagram: the system accurately filters the effective timestamps that trigger optical state switching by comparing the angle change amplitude data with the upper limit value of the visual transition judgment threshold range. If the upper limit is not exceeded, the original rendering state is maintained, avoiding redundant calculations when the normal viewpoint moves slowly; if the upper limit is exceeded, subsequent optical takeover operations are triggered. Furthermore, the system generates smooth transition optical coefficient values by reading the mapping queue in segments and performing linear mixing operations, quantifying and eliminating the abrupt defects caused by directly replacing parameters. After updating the specular reflection brightness distribution map, the system locks the coordinates of the high-frequency flickering area and replaces the abnormal values based on two independent criteria of space and time. Subsequently, the surface brightness distribution data is input into the water surface medium propagation simulation pipeline as the initial energy source of the refracted light. The random uncertainty in the water scattering calculation is eliminated by the determined transmittance attenuation curve function, generating a refracted light spot distribution array and correcting the edge transmission refraction angle. Before the final image output, the system also embeds vertical synchronization timing alignment verification and intra-frame delay compensation operations to eliminate clock drift errors, and uses visibility bounding box filtering to remove invisible background grids in advance, and redistributes the freed video memory space to high-frequency optical computing nodes to improve sampling accuracy.
[0187] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0188] Based on the same inventive concept, this application also provides a real-time scene destruction and fragment generation system for action games, as shown in the specific system timing diagram. Figure 3 As shown. The solution provided by this system is similar to the solution described in the above method. Therefore, the specific limitations of one or more embodiments of the real-time scene destruction and debris generation system for action games provided below can be found in the limitations of the real-time scene destruction and debris generation method for action games described above, and will not be repeated here.
[0189] In one exemplary embodiment, a real-time scene destruction and debris generation system for action games includes: The fracture vertex sequence extraction module is used to obtain the scene destruction trigger signal and extract the vertex coordinate sequence of the original reef geometry at the fracture boundary. The dynamic incident angle reference generation module is used to determine the projection offset direction vector of the vertex coordinate sequence relative to the water surface normal plane, and obtain the dynamic incident angle reference of the fragment new surface at the moment of fracture based on the vector operation result of the projection offset direction vector and the camera line of sight. The fracture surface lighting and shadow control output module is used to traverse the Fresnel optical coefficient mapping queue according to the dynamic incident angle reference, overwrite the optical values output by the Fresnel optical coefficient mapping queue onto the refraction and reflection rendering register of the original reef surface, perform synchronous overwrite operation on the pixel coloring instructions of the fragment falling into the water surface contact area, and output the real-time rendering frame of the fragment interacting with the water surface.
[0190] The modules in the aforementioned real-time scene destruction and debris generation system for action games can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, so that the processor can call and execute the corresponding operations of each module.
[0191] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0192] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for real-time scene destruction and fragment generation in action games, characterized in that, include: Obtain the scene destruction trigger signal and extract the vertex coordinate sequence of the original reef geometry at the fracture boundary; Determine the projection offset direction vector of the vertex coordinate sequence relative to the water surface normal plane, and obtain the dynamic incident angle reference of the fragment new surface at the moment of fracture based on the vector operation result of the projection offset direction vector and the camera line of sight. According to the dynamic incident angle reference, the Fresnel optical coefficient mapping queue is traversed, and the optical values output by the Fresnel optical coefficient mapping queue are overwritten to the refraction and reflection rendering register of the original reef surface. The pixel coloring instructions of the fragment falling into the water surface contact area are synchronously overwritten, and the real-time rendering frame of the fragment interacting with the water surface is output. The Fresnel optical coefficient mapping queue is defined as a lookup table based on pre-stored values of different reflectivity and refractive index according to the incident angle; The step of traversing the Fresnel optical coefficient mapping queue according to the dynamic incident angle reference includes: Obtain the historical dynamic incident angle reference value of the previous rendered frame, and perform a difference comparison operation between the current rendered frame's dynamic incident angle reference value and the historical dynamic incident angle reference value. Based on the angle change amplitude data output by the difference comparison operation, the system compares it with the visual transition judgment threshold range stored internally to filter the valid timestamps that trigger optical state switching; the visual transition judgment threshold range is defined as the upper and lower limit numerical range used to distinguish between slow movement of normal viewpoint and sudden and violent viewpoint jump of destruction. Perform a segmented read operation on the Fresnel optical coefficient mapping queue pointed to by the valid timestamp, and merge the read historical optical coefficient sequence with the current optical coefficient sequence into a double-buffered interpolation array.
2. The method for real-time scene destruction and fragment generation in action games as described in claim 1, characterized in that: The process of acquiring the scene destruction trigger signal and extracting the vertex coordinate sequence of the fracture boundary of the original reef geometry includes: In response to the stress over-limit notification sent by the physical collision detection node, a topology scan operation is performed on the original reef geometry mesh to extract the local mesh region identifier pointed to by the stress over-limit notification; Based on the local grid region identifier, locate the fracture threshold node of the grid connection line, perform linear interpolation to complete the spatial coordinate data around the fracture threshold node, and generate the initial contour coordinate set of the fracture boundary. The initial contour coordinate set is input into the geometric space transformation matrix. Based on the standardized three-dimensional spatial distribution values output by the matrix operation, redundant background mesh data is stripped to obtain the vertex coordinate sequence of the fracture boundary.
3. The method for real-time scene destruction and fragment generation in action games as described in claim 2, characterized in that: Determining the projection offset direction vector of the vertex coordinate sequence relative to the water surface normal plane includes: Obtain the reference value of the vertical direction of the water surface normal plane in the global spatial coordinate system, and map the vertex coordinate sequence point by point to the two-dimensional projection area of the water surface normal plane; The distance difference accumulation operation is performed between the mapped coordinate points in the two-dimensional projection area and the reference point at the center of the water surface to generate an offset distance data stream representing the spatial depth of the fracture location; The projection offset direction vector is constructed by orthogonally combining the offset distance data stream with the reference value in the vertical direction of the water surface, and then the projection offset direction vector is passed to the subsequent optical computing node.
4. The method for real-time scene destruction and fragment generation in action games as described in claim 3, characterized in that: The step of obtaining the dynamic incident angle reference of the newly formed fragment surface at the moment of fracture based on the vector operation result of the projection offset direction vector and the camera's line of sight includes: Obtain the camera's global position coordinates and orientation rotation matrix for the current rendered frame, and parse the three-dimensional spatial unit vector of the camera's line of sight direction based on the orientation rotation matrix; The three-dimensional spatial unit vector and the projection offset direction vector are input into the spatial cross-product operation unit to perform numerical calculation on the spatial angle between the three-dimensional spatial unit vector and the projection offset direction vector, thereby generating instantaneous normal orientation data of the fracture surface. Based on the spatial dot product of the instantaneous normal orientation data of the fractured surface and the camera's line of sight, the dynamic incident angle reference of the newly formed fragment surface at the moment of fracture is determined.
5. The method for real-time scene destruction and fragment generation in action games as described in claim 4, characterized in that: The step of overwriting the optical values output from the Fresnel optical coefficient mapping queue onto the refraction and reflection rendering register of the original reef surface includes: A linear mixing operation is performed based on the historical optical coefficient sequence value allocation ratio stored in the double-buffered interpolation array and the current optical coefficient sequence value allocation ratio to generate smooth transition optical coefficient values. The smooth transition optical coefficient value is input into the reflected light wave simulation channel, and the incident light energy attenuation ratio in the reflected light wave simulation channel is overwritten in real time to update the original specular reflection brightness distribution map of the reef surface. Based on the pixel-level brightness transition detection feedback of the specular reflection brightness distribution map, the coordinates of the high-frequency flicker area are locked, and the abnormal reflection values corresponding to the locked high-frequency flicker area coordinates are replaced with smooth transition optical coefficient values, and a reflection reference correction frame is output.
6. The method for real-time scene destruction and fragment generation in action games as described in claim 5, characterized in that: The synchronous overwrite operation of the pixel coloring instructions for the contact area between the fragment and the water surface, and the output of real-time rendered frame of the fragment interacting with the water surface, includes: Acquire the surface brightness distribution data output by the reflection reference correction frame, and use the surface brightness distribution data as the initial energy source of the refracted light to input into the water surface medium propagation simulation pipeline; Based on the transmittance attenuation curve obtained from the simulated pipeline of water surface medium propagation, the transparency superposition calculation is performed on the sampling command of the bottom reef texture in the contact area to generate an array of refracted light spots inside the water body. The spatial alignment and matching of the refracted light spot distribution array inside the water body with the fragment fracture edge contour data is performed. Based on the matching result of the spatial alignment and matching, the light transmission and refraction angle of the edge pixels is corrected, and a real-time rendered frame of the fragment interacting with the water surface is output.
7. The method for real-time scene destruction and fragment generation in action games as described in claim 6, characterized in that: The output frames showing the real-time rendering of the interaction between the debris and the water surface include: Obtain the vertical synchronization pulse signal corresponding to the real-time rendered frame, align and verify the vertical synchronization pulse signal with the timing of the fragment motion trajectory calculated by the physics engine, and output the timing deviation value. Based on the timing deviation value, perform intra-frame delay compensation operation on the graphics processing instruction queue of the current rendering pipeline, adjust the pixel drawing priority of the water surface interaction area and output the adjusted pixel drawing instruction. The adjusted pixel drawing instructions are pushed to the display controller, and the hardware-level signal conversion of the optical rendering frame is completed according to the progressive scan output rules of the display controller to generate the destruction effect image displayed on the terminal screen.
8. The method for real-time scene destruction and fragment generation in action games as described in claim 7, characterized in that: The adjustment of pixel rendering priority in the water surface interaction area includes: Obtain the spatial boundary range of the camera's view frustum within the current frame, and map the spatial coordinate data of the fragment geometry to the spatial boundary range for visibility bounding box filtering; Based on the valid fragment facet identifiers filtered by the visibility bounding box, the rendering instruction masking operation is performed on the background mesh elements in the non-interactive area to release the video memory occupied by the graphics processing unit. The freed-up video memory space is redistributed to high-frequency optical computing nodes in the water surface contact area. Based on the redistributed video memory capacity, the sampling accuracy of Fresnel coefficients is improved, and high frame rate scene destruction effects are output.
9. A real-time scene destruction and fragment generation system for action games, employing the real-time scene destruction and fragment generation method for action games as described in any one of claims 1 to 8, characterized in that, include: The fracture vertex sequence extraction module is used to obtain the scene destruction trigger signal and extract the vertex coordinate sequence of the original reef geometry at the fracture boundary. The dynamic incident angle reference generation module is used to determine the projection offset direction vector of the vertex coordinate sequence relative to the water surface normal plane, and obtain the dynamic incident angle reference of the fragment new surface at the moment of fracture based on the vector operation result of the projection offset direction vector and the camera line of sight. The fracture surface lighting and shadow control output module is used to traverse the Fresnel optical coefficient mapping queue according to the dynamic incident angle reference, overwrite the optical values output by the Fresnel optical coefficient mapping queue onto the refraction and reflection rendering register of the original reef surface, perform synchronous overwrite operation on the pixel coloring instructions of the fragment falling into the water surface contact area, and output the real-time rendering frame of the fragment interacting with the water surface. The Fresnel optical coefficient mapping queue is defined as a lookup table of different reflectivity and refractive index values pre-stored based on the incident angle.
Citation Information
Patent Citations
Mobile phone energy consumption optimization method
CN121008919A
Dynamic light and shadow interaction design optimization method and system based on AR (Augmented Reality) virtual-real fusion
CN121213840A
