A method, system, device and storage medium for streamer enhancement of three-dimensional graphics
By converting three-dimensional graphics into a digital space scene and determining the processing method based on the streamer change function, the problem of blunt edge fusion of streamers in the three-dimensional graphics model is solved, and the improvement and natural transition of streamer enhancement effects are achieved.
Patent Information
- Application Number
- CN202410840451.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-06-27
AI Technical Summary
The edge fusion of streamer performance in existing three-dimensional graphics models is relatively rigid, resulting in poor streamer enhancement effects.
Convert three-dimensional graphics into a digital space scene, and determine whether it is a linear or curved change based on the exponential power of the streamer change function, thereby deciding to perform non-curvilinear or curved streamer enhancement processing, and perform streamer processing through the offset distance, color intensity and texture value of the pixel point Enhance processing to form a natural transitional streamer effect.
The streamer enhancement effect has been improved, and the streamer transition at the edges is natural, forming a flexible streamer sweeping the surface of the object, and solving the problem of stiff edge fusion.
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of three-dimensional graphics processing, and in particular to a streamer enhancement method, system, device and storage medium for three-dimensional graphics. Background Art
[0002] As 3D image visualization becomes more and more mature, the demand for digital space effect display is increasing, and the requirements for model visual effects are becoming more and more diverse. Streamer, as a specific visual effect, can generally refer to visual performance with flowing, flickering or luminous characteristics in digital space.
[0003] Currently, most model streamer performance is achieved by moving the UV value (the value of the texture mapped to the model surface). However, in the streamer performance results of this method, the edge fusion is relatively stiff, resulting in poor streamer enhancement effect. Summary of the invention
[0004] The object of the present invention is to provide a method, system, device and storage medium for streamer enhancement of three-dimensional graphics with natural streamer transition at the edge and good streamer enhancement effect.
[0005] The technical solution of the present invention is as follows:
[0006] A method for streamer enhancement of three-dimensional graphics, comprising the following operations:
[0007] S1, converting the three-dimensional graphics into a digital space scene composed of a number of space points; each space point in the digital space scene is a pixel; obtaining the streamer width of the digital space scene and the exponential power of the streamer change function; judging whether the exponential power of the streamer change function is equal to the first threshold; if equal, executing S2; if not equal, executing S3;
[0008] S2. According to the pixel processing order of the digital space scene, each pixel is sequentially subjected to streamer enhancement processing of non-curved streamers to obtain a streamer-enhanced space scene; S2.1. Based on the world space coordinates and streamer width of the current pixel in the digital space scene of the previous pixel, it is determined whether the current pixel is within the streamer range; if so, S2.2 is executed; S2.2. Based on the offset distance between the current pixel and the reference line, the streamer width, the streamer color intensity, and the current pixel's own texture color value, the current streamer intensity interpolation is obtained; S2.3. Based on the current streamer intensity interpolation, the streamer change function, the streamer range, and the corresponding reference line moving path, the current pixel neighborhood range is subjected to streamer assignment to obtain a streamer-enhanced space scene for the current pixel; S2.1-S2.3 are repeated for the next pixel until all pixels complete the streamer enhancement processing of non-curved streamers to obtain a streamer-enhanced space scene;
[0009] S3. According to the pixel processing order of the digital space scene, each pixel is subjected to streamer enhancement processing of the curve streamer in turn to obtain the streamer enhanced space scene; S3.1. Based on the normalized relative offset between the current pixel and the reference line in the digital space scene of the previous pixel, it is determined whether the current pixel is within the streamer range; if so, S3.2 is executed; S3.2. Based on the clamp value of the normalized relative offset, the exponential power of the streamer change function, the streamer color intensity, and the current pixel's own map color value, the current streamer intensity interpolation is obtained; S3.3. Based on the current streamer intensity interpolation, the streamer change function, the streamer range and the corresponding reference line moving path, the streamer value is assigned to the neighborhood range of the current pixel to obtain the streamer enhanced space scene of the current pixel; S3.1-S3.3 are repeated for the next pixel until all pixels complete the streamer enhancement processing of the curve streamer to obtain the streamer enhanced space scene.
[0010] The specific operation of S2.1 is: determine whether the horizontal coordinate value of the world space coordinate of the current pixel point is within the streamer range centered on the reference line and with half the streamer width on both sides of the reference line; if so, the current pixel point is within the streamer range; if not, the current pixel point is not within the streamer range.
[0011] The specific operation of obtaining the current streamer intensity interpolation in S2.2 is: taking the difference between the horizontal coordinate of the current pixel point's world space coordinate and the horizontal coordinate of the reference line as the offset distance between the current pixel point and the reference line; taking the absolute value of the difference between the offset distance between the current pixel point and the reference line and the streamer width, and the ratio of the streamer width, as the streamer enhancement degree of the current pixel point; multiplying the current pixel point's streamer enhancement degree by the streamer color coefficient, and then fusing it with the current pixel point's own map color value to obtain the current streamer intensity interpolation.
[0012] In S2.3 or S3.3, the operation of obtaining the streamer-enhanced spatial scene of the current pixel point is specifically as follows: the current streamer intensity is interpolated and input into the streamer change function, and the streamer value of each position point within the neighborhood of the current pixel point is calculated according to the moving path of the corresponding reference line within the streamer range, and the streamer value of each position point is assigned to each position point to obtain the streamer-enhanced spatial scene of the current pixel point.
[0013] The specific operation of S3.1 is: taking the distance between the current pixel and the reference line as the relative offset; normalizing the relative offset of the current pixel based on the relative offsets corresponding to all pixels in the digital space scene to obtain a normalized relative offset; judging whether the normalized relative offset is within the offset range; if so, the current pixel is within the light stream range; if not, the current pixel is not within the light stream range.
[0014] The specific operation of obtaining the current streamer intensity interpolation in S3.2 is: taking the difference between the first value and the clamped value of the normalized relative offset as the streamer complement; obtaining the streamer transition value based on the streamer complement and the exponential power of the streamer change function; multiplying the streamer transition value with the streamer color coefficient, and then merging it with the current pixel's own map color value to obtain the current streamer intensity interpolation.
[0015] The method for obtaining the clamp value of the normalized relative offset is specifically as follows: the maximum value between the normalized relative offset and the second value is used as the offset to be processed; the minimum value between the offset to be processed and the third value is used as the clamp value of the normalized relative offset.
[0016] A streamer enhancement system for three-dimensional graphics, used to implement the streamer enhancement method for three-dimensional graphics, comprising:
[0017] The exponential power judgment module of the streamer change function is used to convert the three-dimensional graphics into a digital space scene composed of a number of space points; each space point in the digital space scene is a pixel point; obtain the streamer width of the digital space scene, and the exponential power of the streamer change function; judge whether the exponential power of the streamer change function is equal to the first threshold; if it is equal, execute the streamer enhancement processing module of the non-curve streamer; if it is not equal, execute the streamer enhancement processing module of the curve streamer;
[0018] A streamer enhancement processing module for non-curved streamers, which is used to perform streamer enhancement processing of non-curved streamers on each pixel point in turn according to the pixel point processing order of the digital space scene, so as to obtain a streamer enhanced space scene;
[0019] The streamer enhancement processing module for non-curved streamers includes:
[0020] A first pixel position determination module is used to determine whether the current pixel is within the streamer range based on the world space coordinates and streamer width of the current pixel in the previous pixel digital space scene; if so, execute the first streamer intensity interpolation generation module;
[0021] A first streamer intensity interpolation generation module is used to obtain a current streamer intensity interpolation based on an offset distance between a current pixel and a reference line, a streamer width, a streamer color intensity, and a self-texture color value of the current pixel;
[0022] The first pixel streamer enhanced spatial scene generation module is used to perform streamer assignment on the current pixel neighborhood range based on the current streamer intensity interpolation, streamer change function, streamer range and corresponding reference line moving path to obtain the current pixel streamer enhanced spatial scene;
[0023] The next pixel point repeatedly executes the first pixel point position determination module, the first streamer intensity interpolation generation module and the first pixel point streamer enhancement space scene generation module until all pixel points complete the streamer enhancement processing of the non-curved streamer to obtain the streamer enhancement space scene;
[0024] The streamer enhancement processing module of the curved streamer is used to perform streamer enhancement processing of the curved streamer on each pixel point in turn according to the pixel point processing order of the digital space scene to obtain a streamer enhanced space scene;
[0025] The streamer enhancement processing module of the curve streamer includes:
[0026] A second pixel position determination module is used to determine whether the current pixel is within the streamer range based on the normalized relative offset between the current pixel and the reference line in the previous pixel digital space scene; if so, execute the second streamer intensity interpolation generation module;
[0027] A second streamer intensity interpolation generation module is used to obtain a current streamer intensity interpolation based on a clamp value of a normalized relative offset, an exponential power of a streamer change function, a streamer color intensity, and a self-texture color value of a current pixel point;
[0028] The second pixel streamer enhanced spatial scene generation module is used to perform streamer assignment on the current pixel neighborhood range based on the current streamer intensity interpolation, streamer change function, streamer range and corresponding reference line moving path to obtain the current pixel streamer enhanced spatial scene;
[0029] The next pixel point repeatedly executes the second pixel point position judgment module, the second streamer intensity interpolation generation module and the second pixel point streamer enhancement space scene generation module until all pixel points complete the streamer enhancement processing of the curve streamer to obtain the streamer enhancement space scene.
[0030] A streamer enhancement device for three-dimensional graphics comprises a processor and a memory, wherein the processor implements the above-mentioned streamer enhancement method for three-dimensional graphics when executing a computer program stored in the memory.
[0031] A computer-readable storage medium, characterized in that it is used to store a computer program, wherein the computer program implements the above-mentioned streamer enhancement method for three-dimensional graphics when executed by a processor.
[0032] The beneficial effects of the present invention are:
[0033] The present invention provides a streamer enhancement method for three-dimensional graphics. After converting the three-dimensional graphics into a digital space scene that is easy to process and analyze, the streamer requirement is judged to be a linear streamer with linear changes or a curved streamer with curved changes according to the exponential power of the streamer change function and the size of a first threshold value, so as to decide whether to perform streamer enhancement processing of non-curved streamer or streamer enhancement processing of curved streamer; in the streamer enhancement processing of non-curved streamer, the streamer enhancement processing is performed on the current pixel point based on the offset distance between the current pixel point and the reference line, the streamer width, the streamer color intensity, the self-map color value, etc.; in the curved streamer enhancement processing, the streamer enhancement processing is performed on the current pixel point based on the offset distance between the current pixel point and the reference line, the streamer width, the streamer color intensity, the self-map color value, etc. In the streamer enhancement processing of light, the current pixel is subjected to streamer enhancement processing based on the clamp value of the normalized relative offset between the current pixel and the reference line, the exponential power of the streamer change function, the streamer color intensity, the color value of its own texture, etc.; and the streamer enhancement spatial scene of the current pixel will be used as the input for the streamer enhancement processing of the next pixel; this method can not only provide a flexible streamer enhancement mode, forming an effect in which the streamer sweeps across the surface of the object and the streamer value presents different changes, but also solves the problem of relatively stiff edge fusion, making the streamer transition at the edge natural, thereby improving the streamer enhancement effect. DETAILED DESCRIPTION
[0034] This embodiment provides a method for streamer enhancement of three-dimensional graphics, including the following operations:
[0035] S1, converting the three-dimensional graphics into a digital space scene composed of a number of space points; each space point in the digital space scene is a pixel; obtaining the streamer width of the digital space scene and the exponential power of the streamer change function; judging whether the exponential power of the streamer change function is equal to the first threshold; if equal, executing S2; if not equal, executing S3;
[0036] S2. According to the pixel processing order of the digital space scene, each pixel is sequentially subjected to streamer enhancement processing of non-curved streamers to obtain a streamer-enhanced space scene; S2.1. Based on the world space coordinates and streamer width of the current pixel in the digital space scene of the previous pixel, it is determined whether the current pixel is within the streamer range; if so, S2.2 is executed; S2.2. Based on the offset distance between the current pixel and the reference line, the streamer width, the streamer color intensity, and the current pixel's own texture color value, the current streamer intensity interpolation is obtained; S2.3. Based on the current streamer intensity interpolation, the streamer change function, the streamer range, and the corresponding reference line moving path, the current pixel neighborhood range is subjected to streamer assignment to obtain a streamer-enhanced space scene for the current pixel; S2.1-S2.3 are repeated for the next pixel until all pixels complete the streamer enhancement processing of non-curved streamers to obtain a streamer-enhanced space scene;
[0037] S3. According to the pixel processing order of the digital space scene, each pixel is subjected to streamer enhancement processing of the curve streamer in turn to obtain the streamer enhanced space scene; S3.1. Based on the normalized relative offset between the current pixel and the reference line in the digital space scene of the previous pixel, it is determined whether the current pixel is within the streamer range; if so, S3.2 is executed; S3.2. Based on the clamp value of the normalized relative offset, the exponential power of the streamer change function, the streamer color intensity, and the current pixel's own map color value, the current streamer intensity interpolation is obtained; S3.3. Based on the current streamer intensity interpolation, the streamer change function, the streamer range and the corresponding reference line moving path, the streamer value is assigned to the neighborhood range of the current pixel to obtain the streamer enhanced space scene of the current pixel; S3.1-S3.3 are repeated for the next pixel until all pixels complete the streamer enhancement processing of the curve streamer to obtain the streamer enhanced space scene.
[0038] S1. Convert the three-dimensional graphics into a digital space scene composed of a number of spatial points; each spatial point in the digital space scene is a pixel; obtain the streamer width of the digital space scene and the exponential power of the streamer change function; determine whether the exponential power of the streamer change function is equal to the first threshold; if equal, execute S2; if not equal, execute S3.
[0039] After converting the three-dimensional graphics into a digital space scene that is easy to process and analyze, the exponential power of the streamer change function and the size of the first threshold are used to determine whether the streamer is required to be a linear streamer with linear changes or a curved streamer with curved changes, thereby deciding whether to execute S2 or S3, providing a flexible streamer enhancement method.
[0040] First, a 3D engine is used to convert the 3D graphics into a digital space scene composed of several space points. Each space point in the digital space scene is a pixel.
[0041] Then, obtain the streamer width of the digital space scene and the exponential power of the streamer change function. The streamer width is used to adjust the streamer width. The larger the value, the larger the streamer range, and vice versa. The exponential power of the streamer change function is used to adjust the steepness of the curve corresponding to the streamer change function. The larger the value, the faster the curve rises or falls at both ends, and the greater the corresponding streamer change degree, and vice versa. The streamer width of the digital space scene and the exponential power of the streamer change function can be preset according to actual needs, or calculated based on the streamer statistical information in the template streamer enhancement space scene.
[0042] Finally, determine whether the exponential power of the streamer change function is equal to the first threshold (preferably 1); if it is equal, the streamer change function is a linear change function, and the corresponding streamer is required to be a linear streamer with linear change, then execute S2; if it is not equal, the streamer change function is a curve change function, and the corresponding streamer change is required to be a curve streamer with curve change, then execute S3.
[0043] S2. If the exponential power of the streamer change function is equal to the first threshold value, and the corresponding streamer is required to be a linear streamer with linear changes, then according to the pixel processing order of the digital space scene, each pixel is sequentially subjected to streamer enhancement processing of the non-curved streamer to obtain a streamer-enhanced space scene.
[0044] In the process of streamer enhancement processing of non-curved streamer, the streamer enhancement spatial scene of the current pixel point is obtained after the streamer enhancement processing of the current pixel point based on the digital spatial scene of the previous pixel point, which is used as the input for the streamer enhancement processing of the next pixel point, and the execution is carried out in sequence. When the streamer enhancement processing of the non-curved streamer is completed for the last pixel point, the final result is obtained as the streamer enhancement spatial scene.
[0045] S2.1. Based on the world space coordinates and streamer width of the current pixel in the digital space scene of the previous pixel, determine whether the current pixel is within the streamer range; if not, the current pixel does not perform streamer enhancement processing for non-curved streamers, and can be assigned a value based on its own color; if so, execute S2.2.
[0046] The specific operation of judging whether the current pixel is within the streamer range is as follows: judging whether the horizontal coordinate value of the world space coordinate of the current pixel is within the streamer range centered on the reference line and half the streamer width on both sides of the reference line; if so, the current pixel is within the streamer range; if not, the current pixel is not within the streamer range. The world space coordinate of the current pixel is the position coordinate of the current pixel in the 3D engine.
[0047] S2.2. Based on the offset distance between the current pixel and the reference line, the streamer width, the streamer color intensity, and the current pixel's own texture color value, the current streamer intensity interpolation is obtained.
[0048] Specifically, the difference between the horizontal coordinate of the current pixel's world space coordinate and the horizontal coordinate of the reference line is used as the offset distance between the current pixel and the reference line. The absolute value of the difference between the offset distance between the current pixel and the reference line and the streamer width, and the ratio of the streamer width, are used as the streamer enhancement degree of the current pixel. The range of the streamer enhancement degree of the current pixel is [0,1]. The closer the current pixel is to the reference line, the closer the streamer enhancement degree of the current pixel is to 1; the farther the current pixel is from the reference line, the closer the streamer enhancement degree of the current pixel is to 0. After multiplying the streamer enhancement degree of the current pixel by the streamer color coefficient, it is fused with the current pixel's own map color value to obtain the current streamer intensity interpolation. The fusion process can be achieved by numerical addition, and can also be achieved by weighted summation.
[0049] The current streamer intensity interpolation can be achieved through the following formula: maincol+lightcol·((halfWidth-abs(worldPosX-centerX)) / halfWidth), where maincol represents the color value of the map itself, lightcol represents the preset streamer color coefficient, halfWidth represents the streamer width, worldPosX represents the horizontal coordinate value of the world space coordinate of the current pixel point, and centerX represents the horizontal coordinate value of the reference line.
[0050] S2.3. Based on the current streamer intensity interpolation, streamer change function, streamer range and corresponding reference line moving path, streamer value is assigned to the neighborhood range of the current pixel point to obtain the streamer enhanced spatial scene of the current pixel point.
[0051] Specifically, the current streamer intensity interpolation is input into the streamer change function, and the streamer value of each position point in the neighborhood of the current pixel is calculated according to the moving path of the corresponding reference line in the streamer range (moving starting position and moving distance), and the streamer value of each position point is assigned to each position point to obtain the streamer enhanced spatial scene of the current pixel point. The neighborhood range of the current pixel point is obtained based on the moving path of the corresponding reference line (moving starting position and moving distance). In this way, all position points in the reference line moving area within the streamer range will form a linear change in the streamer value in the moving direction of the reference line, forming an effect in which the streamer sweeps across the surface of the object and the streamer value changes linearly, thereby enhancing the streamer rendering effect and having a good streamer enhancement effect.
[0052] The next pixel point repeats S2.1-S2.3 until all pixels have completed the streamer enhancement processing of non-curve streamers, and a streamer enhancement space scene is obtained. That is, the streamer enhancement space scene of the current pixel point will be used as the input for the streamer enhancement processing of non-curve streamers of the next pixel point, and S2.1, S2.2 and S2.3 are repeatedly executed in this way, which can ensure that the problem of stiff edge fusion of three-dimensional images in the streamer enhancement process is solved, so that the streamer transition at the edge is natural; when the last pixel point completes the streamer enhancement processing of non-curve streamers, a streamer enhancement space scene is obtained.
[0053] S3. If the exponential power of the streamer change function is not equal to the first threshold value, and the corresponding streamer is required to be a curved streamer with a curved change, then according to the pixel processing order of the digital space scene, streamer enhancement processing of the curved streamer is performed on each pixel point in turn to obtain a streamer enhanced space scene.
[0054] In the process of streamer enhancement processing of curved light flow, the streamer enhancement processing of the current pixel point is performed on the current pixel point based on the digital spatial scene of the previous pixel point, and the streamer enhancement spatial scene of the current pixel point is obtained, which is used as the input for the streamer enhancement processing of the next pixel point. This is executed in sequence. When the streamer enhancement processing of the curved light flow is completed on the last pixel point, the final result is obtained as the streamer enhancement spatial scene.
[0055] S3.1. Based on the normalized relative offset between the current pixel and the reference line in the digital space scene of the previous pixel, determine whether the current pixel is within the streamer range; if not, the current pixel does not perform streamer enhancement processing of the curve streamer, and can be assigned a value based on its own color; if so, execute S3.2.
[0056] Specifically, the distance between the current pixel and the reference line is used as the relative offset; based on the relative offsets corresponding to all pixels in the digital space scene, the relative offset of the current pixel is normalized to obtain a normalized relative offset. The operation of obtaining the normalized relative offset is specifically as follows: obtaining the relative offset of each pixel in the digital space scene and the reference line, and all relative offsets form a relative offset set; the ratio of the difference between the relative offset corresponding to the current pixel and the minimum value in the relative offset set and the difference between the maximum value and the minimum value in the relative offset set is used as the normalized relative offset. Determine whether the normalized relative offset is within the offset range; if so, the current pixel is within the streamer range; if not, the current pixel is not within the streamer range. The offset range is [-1,1], -1 represents the left boundary of the streamer range, 1 represents the right boundary of the streamer range, and 0 represents the position of the reference line.
[0057] S3.2. Based on the clamp value of the normalized relative offset, the exponential power of the streamer change function, the streamer color intensity, and the self-map color value of the current pixel, the current streamer intensity interpolation is obtained.
[0058] Specifically, the difference between the first value and the clamped value of the normalized relative offset is used as the streamer complement; the streamer transition value is obtained based on the streamer complement and the exponential power of the streamer change function; the streamer transition value is multiplied by the streamer color coefficient and then merged with the current pixel's own map color value to obtain the current streamer intensity interpolation.
[0059] The method for obtaining the clamp value of the normalized relative offset is as follows: the maximum value between the normalized relative offset and the second value is used as the offset to be processed; the minimum value between the offset to be processed and the third value is used as the clamp value of the normalized relative offset. This can be achieved by the following formula: output value = min(max(input value, 0), 1).
[0060] The fusion process can be achieved by numerical addition or weighted summation. The exponential power value of the streamer change function of the streamer complement is the streamer transition value.
[0061] In addition, in order to prevent problems such as division by zero or numerical underflow during calculation, which reduces the stability of streamer enhancement, when the exponential power of the streamer change function is less than 0.01, the exponential power of the streamer change function is updated to 0.01, and the exponential power of the updated streamer change function (with a value of 0.01) is obtained for the operations in S3.2 and S3.3.
[0062] S3.3. Based on the current streamer intensity interpolation, streamer change function, streamer range and corresponding reference line moving path, streamer value is assigned to the neighborhood range of the current pixel point to obtain the streamer enhanced spatial scene of the current pixel point.
[0063] Specifically, the current streamer intensity interpolation is input into the streamer change function, and the streamer value of each position point in the neighborhood of the current pixel is calculated according to the moving path of the corresponding reference line in the streamer range, and the streamer value of each position point is assigned to each position point to obtain the streamer enhanced spatial scene of the current pixel point. The neighborhood range of the current pixel point is obtained based on the moving path of the corresponding reference line. In this way, all position points in the reference line moving area within the streamer range will form a streamer value curve change in the moving direction of the reference line, forming an effect that the streamer sweeps across the surface of the object and the streamer value changes in a curve, thereby enhancing the streamer rendering effect and having a good streamer enhancement effect.
[0064] The next pixel point repeats S3.1-S3.3 until all pixels have completed the streamer enhancement processing of the curved streamer, and a streamer enhancement space scene is obtained. That is, the streamer enhancement space scene of the current pixel point is used to perform the streamer enhancement processing of the curved streamer of the next pixel point, that is, the streamer enhancement space scene of the current pixel point will be used as the input of the streamer enhancement processing of the curved streamer of the next pixel point, and S3.1, S3.2 and S3.3 are repeatedly executed in this way, which can ensure that the problem of the relatively stiff edge fusion of the three-dimensional image in the streamer enhancement process is solved, so that the streamer transition at the edge is natural; when the last pixel point completes the streamer enhancement processing of the curved streamer, the streamer enhancement space scene is obtained.
[0065] In order to further enhance the realism and sense of division of the streamer-enhanced spatial scene and improve the streamer-enhanced effect, a light is created in the 3D engine, and the preset light streamer color value and light streamer intensity value are assigned to the light. Based on the distance between the light and each pixel point in the streamer-enhanced spatial scene, the light streamer color value and the light streamer intensity value are respectively fused with the pixel value of each pixel point to obtain an optimized streamer-enhanced spatial scene.
[0066] This embodiment further provides a streamer enhancement system for three-dimensional graphics, which is used to implement the streamer enhancement method for three-dimensional graphics, including:
[0067] The exponential power judgment module of the streamer change function is used to convert the three-dimensional graphics into a digital space scene composed of a number of space points; each space point in the digital space scene is a pixel point; obtain the streamer width of the digital space scene, and the exponential power of the streamer change function; judge whether the exponential power of the streamer change function is equal to the first threshold; if it is equal, execute the streamer enhancement processing module of the non-curve streamer; if it is not equal, execute the streamer enhancement processing module of the curve streamer;
[0068] A streamer enhancement processing module for non-curved streamers, which is used to perform streamer enhancement processing of non-curved streamers on each pixel point in turn according to the pixel point processing order of the digital space scene, so as to obtain a streamer enhanced space scene;
[0069] The streamer enhancement processing module for non-curved streamers includes:
[0070] A first pixel position determination module is used to determine whether the current pixel is within the streamer range based on the world space coordinates and streamer width of the current pixel in the previous pixel digital space scene; if so, execute the first streamer intensity interpolation generation module;
[0071] A first streamer intensity interpolation generation module is used to obtain a current streamer intensity interpolation based on an offset distance between a current pixel and a reference line, a streamer width, a streamer color intensity, and a self-texture color value of the current pixel;
[0072] The first pixel streamer enhanced spatial scene generation module is used to perform streamer assignment on the current pixel neighborhood range based on the current streamer intensity interpolation, streamer change function, streamer range and corresponding reference line moving path to obtain the current pixel streamer enhanced spatial scene;
[0073] The next pixel point repeatedly executes the first pixel point position determination module, the first streamer intensity interpolation generation module and the first pixel point streamer enhancement space scene generation module until all pixel points complete the streamer enhancement processing of the non-curved streamer to obtain the streamer enhancement space scene;
[0074] The streamer enhancement processing module of the curved streamer is used to perform streamer enhancement processing of the curved streamer on each pixel point in turn according to the pixel point processing order of the digital space scene to obtain a streamer enhanced space scene;
[0075] The streamer enhancement processing module of the curve streamer includes:
[0076] A second pixel position determination module is used to determine whether the current pixel is within the streamer range based on the normalized relative offset between the current pixel and the reference line in the previous pixel digital space scene; if so, execute the second streamer intensity interpolation generation module;
[0077] A second streamer intensity interpolation generation module is used to obtain a current streamer intensity interpolation based on a clamp value of a normalized relative offset, an exponential power of a streamer change function, a streamer color intensity, and a self-texture color value of a current pixel point;
[0078] The second pixel streamer enhanced spatial scene generation module is used to perform streamer assignment on the current pixel neighborhood range based on the current streamer intensity interpolation, streamer change function, streamer range and corresponding reference line moving path to obtain the current pixel streamer enhanced spatial scene;
[0079] The next pixel point repeatedly executes the second pixel point position judgment module, the second streamer intensity interpolation generation module and the second pixel point streamer enhancement space scene generation module until all pixel points complete the streamer enhancement processing of the curve streamer to obtain the streamer enhancement space scene.
[0080] This embodiment further provides a streamer enhancement device for three-dimensional graphics, including a processor and a memory, wherein the processor implements the above-mentioned streamer enhancement method for three-dimensional graphics when executing a computer program stored in the memory.
[0081] This embodiment further provides a computer-readable storage medium, characterized in that it is used to store a computer program, wherein the computer program implements the above-mentioned three-dimensional graphics streamer enhancement method when executed by a processor.
[0082] The embodiment provides a method for streamer enhancement of three-dimensional graphics. After converting the three-dimensional graphics into a digital space scene that is easy to process and analyze, the method determines whether the streamer requirement is a linear streamer with linear changes or a curved streamer with curved changes according to the exponential power of the streamer change function and the size of the first threshold, thereby deciding whether to perform streamer enhancement processing of non-curved streamer or streamer enhancement processing of curved streamer; in the streamer enhancement processing of non-curved streamer, the streamer enhancement processing is performed on the current pixel point based on the offset distance between the current pixel point and the reference line, the streamer width, the streamer color intensity, the self-map color value, etc.; in the curved streamer enhancement processing, the streamer enhancement processing is performed on the current pixel point based on the offset distance between the current pixel point and the reference line, the streamer width, the streamer color intensity, the self-map color value, etc. In the streamer enhancement processing of light, the current pixel is subjected to streamer enhancement processing based on the clamp value of the normalized relative offset between the current pixel and the reference line, the exponential power of the streamer change function, the streamer color intensity, the color value of its own texture, etc.; and the streamer enhancement spatial scene of the current pixel will be used as the input for the streamer enhancement processing of the next pixel; this method can not only provide a flexible streamer enhancement mode, forming an effect in which the streamer sweeps across the surface of the object and the streamer value presents different changes, but also solves the problem of relatively stiff edge fusion, making the streamer transition at the edge natural, thereby improving the streamer enhancement effect.
Claims
1. A method for streamer enhancement of three-dimensional graphics, characterized in that: The following operations are included: S1. Converting a three-dimensional graphic into a digital space scene composed of a plurality of space points; each space point in the digital space scene is a pixel point; Obtaining the streamer width of the digital space scene and the exponential power of the streamer change function; the streamer width is used to adjust the streamer width, and the larger the value, the larger the streamer range; the exponential power of the streamer change function is used to adjust the steepness of the curve corresponding to the streamer change function, and the larger the value, the faster the curve rises or falls at both ends, and the greater the degree of change of the corresponding streamer; Determining whether the exponential power of the streamer change function is equal to a first threshold; If they are equal, execute S2; if they are not equal, execute S3; S2. According to the pixel processing order of the digital space scene, each pixel is sequentially subjected to streamer enhancement processing of non-curve streamer to obtain a streamer enhanced space scene; S2.1, based on the world space coordinates and streamer width of the current pixel in the previous pixel digital space scene, determine whether the current pixel is within the streamer range; if so, execute S2.2; S2.2, based on the offset distance between the current pixel and the reference line, the streamer width, the streamer color intensity, and the current pixel's own texture color value, obtain the current streamer intensity interpolation; S2.3, based on the current streamer intensity interpolation, streamer change function, streamer range and corresponding reference line moving path, streamer value is assigned to the neighborhood range of the current pixel point to obtain the streamer enhanced spatial scene of the current pixel point; S2.1-S2.3 are repeated for the next pixel point until all pixels complete the streamer enhancement processing of non-curved streamers to obtain the streamer enhanced spatial scene; S3, according to the pixel processing order of the digital space scene, each pixel point is sequentially subjected to streamer enhancement processing of the curve streamer to obtain a streamer enhanced space scene; S3.1, based on the normalized relative offset between the current pixel and the reference line in the digital space scene of the previous pixel, determine whether the current pixel is within the streamer range; if so, execute S3.2; S3.2, based on the clamp value of the normalized relative offset, the exponential power of the streamer change function, the streamer color intensity, and the self-map color value of the current pixel, obtain the current streamer intensity interpolation; S3.
3. Based on the current streamer intensity interpolation, streamer change function, streamer range and corresponding reference line moving path, streamer value is assigned to the neighborhood range of the current pixel point to obtain the streamer enhanced spatial scene of the current pixel point; S3.1-S3.3 are repeated for the next pixel point until all pixel points complete the streamer enhancement processing of the curve streamer to obtain the streamer enhanced spatial scene.
2. The method for streamer enhancement of three-dimensional graphics according to claim 1, characterized in that: The operation of S2.1 is specifically as follows: Determine whether the horizontal coordinate value of the world space coordinate of the current pixel point is within a streamer range centered on the reference line and having half the streamer width on both sides of the reference line; If it is, the current pixel is within the streamer range; If not, the current pixel is not within the light streamer range.
3. The method for streamer enhancement of three-dimensional graphics according to claim 1, characterized in that: The operation of obtaining the current streamer intensity interpolation in S2.2 is specifically as follows: The difference between the horizontal coordinate of the world space coordinate of the current pixel and the horizontal coordinate of the reference line is used as the offset distance between the current pixel and the reference line; The absolute value of the difference between the offset distance of the current pixel point and the reference line and the streamer width, and the ratio of the streamer width, are used as the streamer enhancement degree of the current pixel point; After multiplying the current pixel streamer enhancement degree by the streamer color coefficient, the resultant is merged with the current pixel's own texture color value to obtain the current streamer intensity interpolation.
4. The method for streamer enhancement of three-dimensional graphics according to claim 1, characterized in that: In S2.3 or S3.3, the operation of obtaining the current pixel point streamer enhanced spatial scene is specifically: The current streamer intensity interpolation is input into the streamer change function, and the streamer value of each position point within the neighborhood of the current pixel is calculated according to the moving path of the corresponding reference line within the streamer range, and the streamer value of each position point is assigned to each position point to obtain the streamer enhanced spatial scene of the current pixel point.
5. The method for streamer enhancement of three-dimensional graphics according to claim 1, characterized in that: The operation of S3.1 is specifically as follows: The distance between the current pixel and the reference line is used as the relative offset; Based on the relative offsets corresponding to all pixels in the digital space scene, the relative offset of the current pixel is normalized to obtain a normalized relative offset; Determining whether the normalized relative offset is within an offset range; If it is, the current pixel is within the streamer range; If not, the current pixel is not within the light streamer range.
6. The method for streamer enhancement of three-dimensional graphics according to claim 1, characterized in that: In S3.2, the operation of obtaining the current streamer intensity interpolation is specifically as follows: The difference between the first value and the clamped value of the normalized relative offset is used as the streamer complement; Based on the streamer complement and the exponential power of the streamer change function, a streamer transition value is obtained; After multiplying the streamer transition value by the streamer color coefficient, the result is merged with the current pixel's own texture color value to obtain the current streamer intensity interpolation value.
7. A streamer enhancement system for three-dimensional graphics, used to implement the streamer enhancement method for three-dimensional graphics according to claim 1, characterized in that: include: The exponential power judgment module of the streamer change function is used to convert the three-dimensional graphics into a digital space scene composed of several space points; Each spatial point in the digital space scene is a pixel point; the streamer width of the digital space scene and the exponential power of the streamer change function are obtained; the streamer width is used to adjust the streamer width, and the larger the value, the larger the streamer range; the exponential power of the streamer change function is used to adjust the steepness of the curve corresponding to the streamer change function, and the larger the value, the faster the curve rises or falls at both ends, and the greater the degree of change of the corresponding streamer; determine whether the exponential power of the streamer change function is equal to a first threshold; If they are equal, the streamer enhancement processing module of the non-curved streamer is executed; If not, executing the streamer enhancement processing module of the curve streamer; A streamer enhancement processing module for non-curved streamers, which is used to perform streamer enhancement processing of non-curved streamers on each pixel point in turn according to the pixel point processing order of the digital space scene, so as to obtain a streamer enhanced space scene; The streamer enhancement processing module of the curved streamer is used to perform streamer enhancement processing of the curved streamer on each pixel point in turn according to the pixel point processing order of the digital space scene to obtain a streamer enhanced space scene.
8. The three-dimensional graphics streamer enhancement system according to claim 7, characterized in that: The streamer enhancement processing module of the non-curved streamer includes: A first pixel position determination module is used to determine whether the current pixel is within the streamer range based on the world space coordinates and streamer width of the current pixel in the previous pixel digital space scene; if so, execute the first streamer intensity interpolation generation module; A first streamer intensity interpolation generation module is used to obtain a current streamer intensity interpolation based on an offset distance between a current pixel and a reference line, a streamer width, a streamer color intensity, and a self-texture color value of the current pixel; A first pixel streamer enhanced spatial scene generation module is used to perform streamer assignment on the current pixel neighborhood range based on the current streamer intensity interpolation, streamer change function, streamer range and corresponding reference line moving path to obtain the current pixel streamer enhanced spatial scene; The next pixel point repeatedly executes the first pixel point position determination module, the first streamer intensity interpolation generation module and the first pixel point streamer enhancement space scene generation module until all pixel points complete the streamer enhancement processing of the non-curved streamer to obtain the streamer enhancement space scene; The streamer enhancement processing module of the curved streamer includes: A second pixel position determination module is used to determine whether the current pixel is within the streamer range based on the normalized relative offset between the current pixel and the reference line in the previous pixel digital space scene; if so, execute the second streamer intensity interpolation generation module; A second streamer intensity interpolation generation module is used to obtain a current streamer intensity interpolation based on a clamp value of a normalized relative offset, an exponential power of a streamer change function, a streamer color intensity, and a self-texture color value of a current pixel point; A second pixel streamer enhanced spatial scene generation module is used to perform streamer assignment on the current pixel neighborhood range based on the current streamer intensity interpolation, streamer change function, streamer range and corresponding reference line moving path to obtain the current pixel streamer enhanced spatial scene; The next pixel point repeatedly executes the second pixel point position judgment module, the second streamer intensity interpolation generation module and the second pixel point streamer enhancement space scene generation module until all pixel points complete the streamer enhancement processing of the curve streamer to obtain the streamer enhancement space scene.
9. A streamer enhancement device for three-dimensional graphics, characterized in that: The method comprises a processor and a memory, wherein the processor implements the streamer enhancement method for three-dimensional graphics as described in any one of claims 1 to 6 when executing the computer program stored in the memory.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the streamer enhancement method for three-dimensional graphics according to any one of claims 1 to 6 is implemented.
