Large-scale terrain variable rate coloring method based on scene texture and motion information

By calculating the relative motion between the camera and the terrain and the pixel block information entropy on the CPU side, and adjusting the shading rate, the problems of visual distortion and latency in large-scale realistic terrain rendering are solved, and efficient rendering effect is achieved.

CN120894485APending Publication Date: 2025-11-04NORTHWEST ELECTROMECHANICAL ENG RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510917882.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-03
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

Real-time rendering of large-scale realistic terrain suffers from visual distortion and texture resource loading delays on devices with high pixel density and high dynamic ratio, especially in near-ground high dynamic application scenarios. Existing variable rate shading technology has high computational complexity and high storage space consumption.

Method used

By calculating the relative motion between the camera and the terrain on the CPU side, and combining pixel block information entropy to measure the amount of local information in the scene, the shading rate is adjusted in a linear weighted manner, which reduces computational complexity and storage requirements, making it suitable for large-scale terrain rendering.

Benefits of technology

It effectively alleviates visual distortion, reduces rendering latency, and improves rendering efficiency, making it suitable for terrain rendering under various graphics engines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120894485A_ABST
    Figure CN120894485A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of computer graphics, and discloses a large-scale terrain variable-rate coloring method based on scene texture and motion information. Depending on the support of NVIDIATuring architecture on variable rate coloring characteristics, the method comprises the following steps: firstly, quickly calculating a motion vector of a segment corresponding to each pixel in a screen space at an application program end according to relative motion of a virtual camera and a terrain object; secondly, approximating a current rendering frame by using a previous frame of rendering image, and calculating information entropy of each pixel block for analyzing the richness of texture features of the pixel block; and finally, respectively mapping the pixel block motion vector and the texture information entropy to an optional coloring rate space, and determining the final coloring rate of the pixel block according to the maximum value of the pixel block motion vector and the texture information entropy and an adjacent frame constraint. According to the method, the coloring rate can be adaptively adjusted by effectively utilizing the characteristics of related applications in the aspects of motion states and texture information, and the calculated amount of the coloring process is reduced at the cost of relatively small rendering image visual distortion.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of computer graphics, and particularly relates to a large-scale terrain variable-rate shading method based on scene texture and motion information. BACKGROUND

[0002] Real-time rendering of large-scale realistic terrain involves dynamic management of terrain detail levels and texture data, optimization of rendering pipelines, support of graphics hardware, and many other key technologies, and is the technical core of real-time interactive applications such as geographic information systems and three-dimensional digital battlefields. With the development of high-pixel density, high dynamic range, and wide field of view of display devices, real-time rendering of large-scale realistic terrain faces many challenges, such as the large consumption of hardware resources caused by the increase in sampling density, and the burden on bandwidth caused by frequent switching of multi-resolution texture data due to camera motion. Although adaptive grid resolution and multi-level fading texture technology can achieve adaptive adjustment of geometric complexity and texture complexity, high-density sampling point shading calculation and high-bandwidth load will cause a delay in texture resource loading and rendering in near-ground high-dynamic application scenarios, such as unmanned aerial vehicle and vehicle simulation applications, thereby causing serious visual distortion.

[0003] With the development of graphics processing software and hardware technologies, Nvidia and AMD have respectively introduced software and hardware architectures that can support variable-rate shading. The core idea is to allocate limited rendering resources to areas that can better improve the quality of rendered images. Specifically, the shading rate can be set for each 16x16 pixel block, such as a 4x4 scheme, in which all pixels in the 4x4 pixel block share one pixel shading value. In theory, this can reduce the computational complexity to 1 / 16, greatly accelerating the rendering speed. However, this operation is equivalent to down-sampling the rendered image to different degrees, which inevitably introduces visual errors, i.e., sacrificing rendering quality to improve speed.

[0004] Scholars in the field of real-time computer graphics have proposed many optimization algorithms to improve rendering speed with minimal quality loss, such as solving the optimal shading rate under bandwidth constraints. Such algorithms can be divided into two technical routes: adaptive rendering based on scene information and multi-objective optimization.

[0005] A. Adaptive rendering based on scene information

[0006] Common scene information includes motion vector of objects in three-dimensional scene in screen space and texture feature of rendered image. The mechanism behind adaptive algorithm based on motion feature is that the presentation of visual signal by graphic display device in refresh cycle is static, while the retina of human eye shows continuous motion phenomenon in the process of observing dynamic image, thus causing a visual blur effect, which will have a masking effect on visual signal, therefore, reducing the shading rate of moving objects will not cause serious quality loss. The common method of calculating screen space motion vector is derived from the classic time domain anti-aliasing algorithm, that is, related calculation is carried out by using motion continuity principle, and an image with the same size as the rendering screen is maintained to save velocity vector, which has high time complexity and memory occupancy.

[0007] B. Multi-objective optimization problem

[0008] This kind of method describes the adaptive shading problem as an optimization problem with bandwidth or frame rate constraint. For multi-resolution problem, visual error is generated from the whole process of downsampling, texture sampling, device display and eye pursuit, thus the quantitative measure of texture mapping quality can be defined as the objective function of the optimization problem, and then the target value is solved from the discrete shading rate scheme space. This scheme fails to collect information such as illumination and shadow generated after shading calculation. In fact, such information significantly affects the presentation effect of rendered image, and the texture details in strong illumination area are subject to masking effect.

[0009] Considering the unique features of large-scale terrain related applications, that is, the whole terrain as a whole object has relative motion with virtual camera, whether the terrain construction uses planarization processing or is based on spherical coordinate system, the motion speed of the same image segment in screen space can be easily calculated according to the relative motion of the camera, at the same time, since the terrain texture usually uses satellite image, and under non-special demand condition, it does not involve detail performance means such as concave and convex texture and normal texture, therefore, the local shading rate can be adjusted according to the richness of texture feature, so as to achieve the effect of accelerating rendering. SUMMARY

[0010] Therefore, in view of the visual distortion problem existing in real-time rendering of large-scale realistic terrain, the purpose of the present application is to provide a large-scale terrain variable rate shading method based on scene texture and motion information, which is used to alleviate the distortion phenomenon, and belongs to a balance means between rendering quality and rate.

[0011] In order to achieve the above technical purpose, the following technical scheme is adopted in the present application:

[0012] In one aspect of the present application, a large-scale terrain variable rate shading method based on scene texture and motion information is provided, comprising the following steps:

[0013] S1: Reset the shading rate image S before entering the rendering pipeline in the frame cycle, wherein size(S) = (w / 16, h / 16), w and h are the horizontal and vertical resolutions of the rendering window, respectively;

[0014] S2: Convert the previous frame rendering image to a gray space and divide it into a plurality of 16x16 pixel blocks, calculate the texture complexity feature value quantitatively described by the image information entropy of each pixel block, generate a feature map, and calculate a texture complexity feature value pre-selected shading rate sr1 based on the feature map; the shading rate sr1 and the texture complexity feature value are in a positive correlation mapping relationship;

[0015] S3: Obtain the displacement vector and rotation angle of the camera in the frame cycle, calculate the scaling motion vector, rotation motion vector and displacement motion vector of each pixel in the screen space respectively, synthesize the motion vector of each pixel, and calculate the mean value of the motion vector in the 16x16 pixel block to generate a pixel block motion feature vector. Map the amplitude of the motion feature vector in the pixel block to a preset shading rate scheme set N to obtain a per-pixel block motion speed measurement shading rate sr2;

[0016] S4: Transform the NDC coordinates (x, y) to the world coordinate space through the previous frame observation inverse matrix and the projection inverse matrix , and forward transform to NDC through the current frame observation matrix V t and the projection matrix P t to obtain coordinates (x', y');

[0017] S5: Linearly weight sr1 and sr2 using a linear parameter λ to obtain a pre-selected shading rate sr, which is the final shading rate of the corresponding pixel block;

[0018] S6: Set the shading rate image S for shading calculation.

[0019] In an embodiment, the method for converting the rendering image to a gray space is:

[0020] gray = 0.2989xR + 0.5870xG + 0.1140xB;

[0021] wherein R, G and B are the red, green and blue components of the original image, and gray is a single-channel gray value.

[0022] In an embodiment, the calculation of the texture complexity feature value quantitatively described by the image information entropy includes:

[0023] a) Establish a gray histogram h(i) for each block, where i is a 0-255 level gray value;

[0024] b) calculate the statistical probability p(i) of the gray value i, then the information entropy E of the probability distribution p(i) is:

[0025]

[0026] In an embodiment, the texture complexity feature value pre-selected shading rate sr1 is calculated based on the feature map:

[0027] sr1 = floor(Q(x, y) * 7);

[0028] wherein Q(x, y) is the feature value at the coordinate (x, y) in the feature map; 7 is the number of elements of the shading rate scheme set N, N = {1x1, 1x2, 2x1, 2x2, 2x4, 4x2, 4x4}.

[0029] In an embodiment, the statistical probability p(i) of the gray value i has 256 values, and the log2(p(i)) value of each value is calculated and stored in the memory.

[0030] In an embodiment, the amplitude of the scaled motion vector is:

[0031]

[0032] wherein w is the horizontal resolution of the screen; f is the frame rate; a is the ratio of the horizontal distance from the point O' to the pixel point Pix(x, y) to w / 2; scale is the camera scaling factor, defined as the ratio of the length of the PO line segment in the current frame to that in the previous frame; P and O are the camera position and the focus of the axis and the ground, respectively; O' is the vertical projection point of the camera rotation center O in the three-dimensional space on the two-dimensional screen plane.

[0033] In an embodiment, the rotation motion vector is the motion vector R generated by the screen space projection of the pixel position Pix(x, y) by the camera rotation angle scr , and the amplitude is:

[0034] Dis(Pix(x, y), O')·R scr .

[0035] In an embodiment, the projection of the displacement vector of the camera in the world space on the screen space is the displacement motion vector of all pixel points.

[0036] In an embodiment, the value of the pre-selected shading rate sr is limited to the vicinity of the value of the previous frame, and the calculation is:

[0037] sr = clamp(sr, sp-1, sp+2);

[0038] sp = S(floor(x' / 16, y' / 16));

[0039] where sp is the coordinate of the previous frame in shading rate image S.

[0040] The beneficial effects of the present application are:

[0041] The traditional large-scale realistic terrain rendering scheme has a serious distortion phenomenon caused by serious local texture resolution switching delay for near-earth motion simulation applications running on consumer-grade GPUs. Although the variable rate shading scheme based on scene content can alleviate this phenomenon, its calculation process depends on the previous frame color buffer, depth buffer, etc., and has high time complexity and high storage space occupancy. The present application utilizes the characteristics of large-scale terrain-related applications, directly calculates the motion vector on the CPU side through the relative motion relationship between the camera and the terrain, and uses pixel block information entropy to measure the amount of local information in the scene. Compared with the traditional calculation model based on image edges and texture differences, it is more suitable for terrain rendering and other scenes without sharp edge features. Finally, the present application has low coupling with specific applications and is suitable for variable shading rate rendering of terrain rendering under various graphics engines. BRIEF DESCRIPTION OF DRAWINGS

[0042] Figure 1 is a large-scale terrain variable rate shading method schematic flowchart of the present application embodiment;

[0043] Figure 2 is a pixel block shading scheme in the 2x2, 2x4 shading rate mode in the present application embodiment;

[0044] Figure 3 is a schematic diagram of virtual camera motion in world space in the present application embodiment;

[0045] Figure 4 is a schematic diagram of screen space defined variables in the present application embodiment;

[0046] Figure 5 is a speed and shading rate scheme mapping relationship in the present application embodiment;

[0047] Figure 6 is a code framework implemented in the osgEarth system in the present application embodiment;

[0048] Figure 7 is a pixel block shading rate calculation result based on texture information, motion vector and comprehensive metric in the present application embodiment;

[0049] Figure 8 is a comparison of different area shading rate schemes and the original shading scheme (1x1) in the present application embodiment. DETAILED DESCRIPTION

[0050] The technical solutions of the present application will be described clearly and completely below in conjunction with specific embodiments, but those skilled in the art will understand that the following described embodiments are part of the embodiments of the present application, not all the embodiments, and are only used to illustrate the present application, and should not be regarded as limiting the scope of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor are within the scope of protection of the present application.

[0051] In one embodiment, a large-scale terrain variable-rate shading method based on scene texture and motion information is provided, referring to Figure 1 As shown, the following steps are implemented:

[0052] Step 1: Before the frame loop enters the rendering pipeline, reset the shading rate image S, wherein size(S) = (w / 16, h / 16), w and h are the horizontal and vertical resolutions of the rendering window, respectively.

[0053] Step 2: Calculate the texture complexity feature value under the shading rate of each 16x16 pixel block of the screen. Convert the previous frame rendering image to grayscale space and divide it into multiple 16x16 pixel blocks, calculate the texture complexity feature value of each pixel block quantitatively described by the image information entropy, generate a normalized feature map, and calculate the texture complexity feature value pre-selected shading rate sr1 based on the normalized feature map; the shading rate sr1 and the texture complexity feature value are in a positive correlation mapping relationship.

[0054] Specifically, the following steps are included:

[0055] Step 2-1: Since the current frame to be rendered has not yet entered the shading stage, considering the continuity of the rendering image under the non-sudden change of the relative motion between the virtual camera and the terrain, the rendering image I t-1 of the previous frame can be used to approximately calculate the information of the current frame, and the rendering image I t-1 is converted from the RGB color space to the grayscale space image I', and divided into m*n 16x16 pixel blocks, wherein the number of pixel blocks (m, n) = size(I`) / 16.

[0056] The calculation method from the RGB color space to the grayscale space is as follows:

[0057] gray = 0.2989 * R + 0.5870 * G + 0.1140 * B;

[0058] Wherein, R, G, B are the red, green and blue components of the original image, and gray is the single-channel gray value.

[0059] Step 2-2: For each 16x16 pixel block, the texture complexity is quantitatively described by its image information entropy, first, a gray histogram h(i) is established for the pixel block, i is the gray value and i∈[0, 255], let p(i) represent the statistical probability of the gray value i, then the information entropy E of the probability distribution p(i) is expressed as:

[0060]

[0061] Wherein, when p(i) is 0, the value of log2(p(i)) is 0, thus, a feature map Q describing the local complexity characteristic value of the image I'(resolution m x n) is obtained, in order to facilitate subsequent calculation, the element value of the feature map Q is normalized to [0, 1].

[0062] Step 2-3: According to the feature map Q, the texture complexity characteristic value pre-selected shading rate sr1 is calculated:

[0063] sr1=floor(Q(x,y)*7);

[0064] Wherein, Q(x,y) is the characteristic value at the coordinate (x,y) in the feature map Q; the multiple 7 is taken from the element number of the shading rate scheme set N supported by NVIDIA Turing architecture N={1x1, 1x2, 2x1, 2x2, 2x4, 4x2, 4x4}.

[0065] Step 3: Calculate the motion speed metric shading rate sr2 of each pixel block.

[0066] The displacement vector and rotation angle of the camera in the frame cycle are obtained, the scaling motion vector, the rotation motion vector and the displacement motion vector of each pixel in the screen space are calculated respectively, the motion vector of each pixel is synthesized, and the motion vector in the 16x16 pixel block is averaged to generate the motion characteristic vector of the pixel block, the amplitude of the motion characteristic vector in the pixel block is mapped to the pre-set shading rate scheme set N, and the corresponding relationship between the motion speed and the shading rate scheme is established.

[0067] Specifically, the following steps are included:

[0068] Step 3-1: In large-scale terrain-related applications, the relative world coordinates of the terrain object are usually in a static state, and the motion vector of the camera relative to the terrain can quickly calculate the motion vector of the graphics fragment in the screen space, the rotation and displacement motion (further decomposed into scaling, rotation and displacement) of the camera can cause the motion vector V s 、V r 、V t of the fragment in the screen space can be calculated respectively as:

[0069] 1) Scaling-V s, set the camera itself position, axis and ground focus point are P, O respectively, when the camera is close to point O, the field of view is reduced, the pixel position Pix(x, y) corresponds to the fragment velocity vector direction is the screen projection point O' of point O points to the pixel point Pix(x, y), define the length ratio of PO line segment in the current frame and the previous frame as the scaling factor scale, then the horizontal direction velocity amplitude of the screen position can be expressed as:

[0070]

[0071] Wherein, w is the horizontal resolution of the screen; α is the horizontal distance from point O' to pixel point Pix(x, y) and w / 2 ratio, f is the frame rate, and the vertical direction velocity can be calculated in the same way. For the case of the camera away from point O, the velocity amplitude calculation formula is the same, and the vector direction is opposite.

[0072] 2) Rotation-V r , the motion vector R scr of the pixel position Pix(x, y) is generated by the camera rotation angle in the screen space. scr The amplitude is Dis(Pix(x, y), O')·R scr , and the direction is perpendicular to the direction of the screen projection point O' pointing to the pixel point Pix(x, y).

[0073] 3) displacement-V t , the projection of the camera displacement vector in the world space in the screen space is the displacement vector of all pixel points.

[0074] Step 3-2: for each pixel, scale V r , rotate V r , and displace V r The motion vector is composed, and the motion vector in each 16x16 pixel block is averaged to generate a pixel block motion feature vector to represent the motion state of the pixel block.

[0075] Step 3-3: discrete mapping of continuous velocity vector to shading rate scheme set N. Specifically, different velocity intervals correspond to a shading rate scheme, when the motion velocity increases, select a coarser shading rate scheme, with the increase of the motion velocity, the visual error masking effect caused by the coarse shading rate is enhanced, which is approximated as a linear relationship here.

[0076] Step 4: NDC (normalized device coordinate system) coordinates (x, y) are inversely transformed to the world coordinate space through the previous frame observation inverse matrix And the projection inverse matrix , and forward transformed to NDC through the current frame observation matrix V t , projection matrix P t , to get coordinates (x', y').

[0077] Step 5: Linearly weight sr1 and sr2 by linear parameter λ to sr, which represents the final shading scheme of the corresponding pixel block. Since the selectable shading rate scheme is one of the set N elements, in order to avoid visual errors caused by too large changes in shading rate of the same pixel block in adjacent frames, the value of the pre-selected shading rate is limited to the value near the previous frame, referring to the time domain anti-aliasing algorithm, the calculation is as follows:

[0078] sr = clamp (sr, sp-1, sp+2) ;

[0079] sp = S (floor (x' / 16, y' / 16)) ;

[0080] Wherein, sp is the coordinate of the previous frame in the shading rate image S.

[0081] Step 6: Set the shading rate image S to perform shading calculation;

[0082] Step 7: Repeat steps 1-6 to render the next frame.

[0083] The application will be described in detail below in conjunction with the drawings and examples.

[0084] In conjunction with Figure 2 The corresponding shading calculation amounts of the 2x2 and 2x4 shading rate modes shown in the figure are 1 / 4 and 1 / 8 respectively in the VRS rendering mode, and the essence is to assign values to multiple pixel colors using the results of one shading calculation, which belongs to a kind of multi-resolution rendering technology.

[0085] Step 1: When the application is started on a computer configured with a GPU supporting VRS rendering, a shading rate image S is constructed, and before entering the rendering pipeline in each frame loop, the shading rate image S is reset to the 1x1 shading rate mode (or other user-selected value), size (S) = (w / 16, h / 16), w and h are the horizontal and vertical resolutions of the rendering window respectively.

[0086] Step 2: Render each 16x16 pixel block to calculate the texture complexity characteristic value shading rate sr1.

[0087] Step 2-1: Use the previous frame rendering image I t-1 Approximate the current frame information, I t-1 Convert from RGB color space to grayscale space image I', the conversion formula is:

[0088] gray = 0.2989 * R + 0.5870 * G + 0.1140 * B;

[0089] Where R, G, and B are the red, green, and blue components of the original image, respectively, and gray is the single-channel gray value. Then, the gray image is divided into m×n 16×16 pixel blocks, where (m,n) = size(I`) / 16.

[0090] Step 2-2: For each pixel block, calculate its information entropy. First, construct a grayscale histogram h(i), where the integer i is the grayscale value and i∈[0,255]. Let p(i) represent the statistical probability of the grayscale value i, and calculate the information entropy E of the probability distribution p(i):

[0091]

[0092] When p(i) is 0, the logarithm is calculated to be 0. The statistical probability p(i) has only 256 possible values. To improve computational efficiency, it is calculated and stored in memory at the beginning of the application startup, thus obtaining a feature map Q that describes the local complexity features of image I′, and its elements are normalized to [0,1].

[0093] Steps 2-3: Calculate the texture metric pre-selected shading rate sr1 based on the feature map Q:

[0094] sr1 = floor(Q(x,y)*7).

[0095] Step 3: Calculate the shading rate sr2, which measures the motion speed of each pixel block.

[0096] Step 3-1: Calculate the motion vector of the graphic segment in screen space using the camera's motion vector relative to the terrain, such as... Figure 3 As shown, let V and R represent the displacement vector and rotation angle around the rotation center generated by the camera in this frame loop, respectively. Then, the motion vector V of the segment in screen space caused by the camera's rotation and displacement motion (further decomposed into scaling, rotation, and displacement) is... s V r V t They can be calculated separately as follows:

[0097] Scaling -V s ,like Figure 4 As shown, the camera's own position, axis, and ground focus are P and O, respectively. When the camera moves closer to point O, the field of view is reduced. The velocity vector of each pixel position Pix(x,y) corresponds to the direction of the segment velocity vector, which is the direction of the screen projection point O′ of point O pointing to that pixel Pix(x,y). Let V ctr Let P' represent the projection component of the displacement vector onto the camera axis, and P' be the projection point of the current frame's camera position onto the axis. Define the scaling factor as the ratio of the lengths of line segments P'O and PO. Then, the magnitude of the horizontal velocity at the screen position (x, y) can be expressed as:

[0098]

[0099] where, a is the ratio of the horizontal distance from point O' to pixel point Pix(x,y) and the horizontal resolution w / 2, f is the frame rate, and the vertical direction velocity can be calculated in the same way For the case that the camera is far away from point O, the velocity amplitude is calculated in the same way, and the vector direction is opposite.

[0100] Rotation-V r The pixel position Pix(x,y) is generated by the motion vector R of the screen space projection of the camera rotation angle R scr The amplitude is Dis(Pix(x,y),O')·R scr The direction is perpendicular to the direction of the screen projection point O' pointing to the pixel point Pix(x,y), and depends on the time direction of the rotation operation.

[0101] Displacement-V t The projection V of the displacement vector of the camera in the world space in the screen space scr is the displacement vector of all pixel points.

[0102] Step 3-2: For each pixel, scale V r , rotate V r , and displace V r The motion vector is synthesized, and then the 16x16 pixel motion vector in each pixel block is averaged to generate a pixel block motion feature vector, representing the motion state of the pixel block.

[0103] Step 3-3: Discretely map the continuous velocity vector to the shading rate scheme set N, such as Figure 5 That is, a velocity interval corresponds to a shading rate selection, and parameters v1, v2, v3, v4 should be modulated according to the application scenario, and the shading rate scheme index {1,2,3,4,5} is {1x1, h(1x2, 2x1), 2x2, h(2x4, 4x2), 4x4}, where the function h(a,b) is defined as: when the angle between the velocity vector and the horizontal axis is greater than 45°, a is taken, otherwise b is taken. Within the upper threshold, as the motion speed increases, the visual error masking effect caused by the coarse shading rate is enhanced, which is approximated as a linear relationship here.

[0104] Step 4: NDC (Normalized Device Coordinate System) coordinates (x,y) are inversely transformed to the world coordinate space through the previous frame observation projection matrix , and are forward transformed to NDC through the current frame observation projection matrix V t , P t to obtain coordinates (x',y').

[0105] Step 5: The final shading scheme of the corresponding pixel block is represented by sr = Max(sr1, sr2), in order to avoid visual errors caused by the large change of shading rate of the same pixel block in adjacent frames, the value of the pre-selected shading rate is limited to the value of the previous frame, which is calculated as:

[0106] sr = clamp(sr, sp-1, sp+2);

[0107] sp = S(floor(x' / 16, y' / 16)).

[0108] Step 6: Set the shading rate image S for shading calculation.

[0109] Step 7: Repeat steps 1-6 for the next frame rendering.

[0110] The specific implementation of the scheme involved in the present application is related to the graphics engine, Figure 6 The software framework for integrating the method in the open source digital earth osgEarth architecture is shown, including VRS support checking, shading rate map generation, adaptive adjustment of shading rate in update callback, and update callback calling interface.

[0111] The selected example scene camera motion is rotation around a fixed point and approach to the ground, Figure 7 The shading rate images under texture information, motion vector, and integrated information metric are shown, respectively. The scene near the peripheral area moves faster due to the rotation motion, and the integrated shading rate image presents a ring-shaped distribution. Combined with Figure 8 The scene content is shown, the mountain area in the center of the scene has more detailed shading rate due to rich texture information and low motion speed. Figure 8 (1) is the original shading scheme (1x1), Figure 8 (2) is the shading scheme of the present application, the latter produces more serious image degradation, but this distortion phenomenon will be partially masked in the dynamic tracking process of the observer's visual system, and the rendering frame shading calculation amount is reduced by 50.7% compared with the VRS-free scheme.

[0112] Optionally, the application user or developer considers the balance of rendering quality and speed, and enhances one of the indicators by adjusting the Figure 5 The parameters shown or the mapping relationship between the pixel block information entropy defined in steps 2-3 and the shading scheme.

[0113] Although the embodiments of the present application have been described above with reference to the accompanying drawings, the present application is not limited to the above-described specific embodiments and areas of application, and the above-described specific embodiments are merely illustrative and instructive, but are not restrictive. Many modifications can be made by those skilled in the art under the teachings of the present specification and without departing from the scope of the present application as defined by the claims.

Claims

1. A large-scale terrain variable-rate shading method based on scene texture and motion information, characterized in that, include: S1: Before the frame loop enters the rendering pipeline, reset the shading rate image S, where size(S) = (w / 16, h / 16), and w and h are the horizontal and vertical resolutions of the rendering window, respectively. S2: Convert the previous frame rendered image to grayscale space and divide it into multiple 16×16 pixel blocks. Calculate the texture complexity feature value of each pixel block, which is quantitatively described by the image information entropy. Generate a feature map. Calculate the texture complexity feature value and preselect the shading rate sr1 based on the feature map. The shading rate sr1 is positively correlated with the texture complexity feature value. S3: Obtain the camera's displacement vector and rotation angle in the frame loop, calculate the scaling motion vector, rotation motion vector and displacement motion vector of each pixel in the screen space, synthesize the motion vector of each pixel, and calculate the mean of the motion vectors in the 16×16 pixel block to generate the pixel block motion feature vector. Map the magnitude of the motion feature vector in the pixel block to the preset shading rate scheme set N, and obtain the shading rate sr2, which measures the motion speed of each pixel block. S4: Transfer the NDC coordinates (x, y) through the inverse matrix observed in the previous frame. and projection inverse matrix Inverse transformation to world coordinate space, and observation matrix V of the current frame. t Projection matrix P t The coordinates (x`, y`) are obtained by forward transformation into NDC; S5: The pre-selected shading rate sr is obtained by linearly weighting sr1 and sr2 using a linear parameter λ, and is used as the final shading rate of the corresponding pixel block; S6: Set the color rate image S for color calculation.

2. The large-scale terrain variable-rate coloring method according to claim 1, characterized in that, The method for converting a rendered image to grayscale is as follows: gray=0.2989×R+0.5870×G+0.1140×B; Where R, G, and B are the red, green, and blue components of the original image, respectively, and gray is the single-channel gray value.

3. The large-scale terrain variable-rate coloring method according to claim 1, characterized in that, The calculation of the texture complexity feature value, which is quantitatively described by the image information entropy, includes: a) Construct a grayscale histogram h(i) for each block, where i is a grayscale value of 0-255 levels; b) Calculate the statistical probability p(i) of the gray value i. Then the information entropy E of the probability distribution p(i) is:

4. The large-scale terrain variable-rate coloring method according to claim 3, characterized in that, There are 256 possible values ​​for the statistical probability p(i) of grayscale value i. The log2(p(i)) value for each value is calculated and stored in memory.

5. The large-scale terrain variable-rate coloring method according to claim 1, characterized in that, Based on the feature map, calculate the texture complexity eigenvalues ​​and pre-select the shading rate sr1: sr1 = floor(Q(x,y)*7); Where Q(x,y) is the eigenvalue at coordinate (x,y) in the feature map; 7 is the number of elements in the coloring rate scheme set N, N={1×1,1×2,2×1,2×2,2×4,4×2,4×4}.

6. The large-scale terrain variable-rate coloring method according to claim 1, characterized in that, The magnitude of the scaling motion vector is: Where w is the screen horizontal resolution; f is the frame rate; α is the ratio of the horizontal distance from point O' to pixel point Pix(x,y) to w / 2; scale is the camera scaling factor, defined as the ratio of the length of line segment PO in the current frame to that in the previous frame; P and O are the camera's own position, the focal point of the axis and the ground, respectively; O' is the vertical projection point of the camera's rotation center O in three-dimensional space onto the two-dimensional screen plane.

7. The large-scale terrain variable-rate coloring method according to claim 1, characterized in that, The rotational motion vector is the motion vector R generated by projecting the pixel position Pix(x,y) onto the screen space from the camera rotation angle. scr The amplitude is: Dis(Pix(x,y),O′)·R scr 。 8. The large-scale terrain variable-rate coloring method according to claim 1, characterized in that, The projection of the camera's displacement vector in world space onto the screen space is the displacement motion vector of all pixels.

9. The large-scale terrain variable-rate coloring method according to claim 1, characterized in that, The value of the preselected shading rate sr is restricted to be near the value of the previous frame, and is calculated as follows: sr = clamp(sr, sp-1, sp+2); sp=S(floor(x′ / 16,y′ / 16)); Where sp is the coordinate of the previous frame in the color rate image S.