Method, device and system for realizing light emitting special effect of ground line in three-dimensional map
By acquiring ground line textures at different resolutions, sampling and Gaussian blurring are performed using fragment shaders, and then the Gaussian equation is combined to generate luminous effect data. This data is then mixed with texture data from a preset application scenario, solving the problem that the Cesium engine does not support ground line luminous effects. This enables the implementation of ground line luminous effects in 3D maps and enhances GIS rendering capabilities.
Patent Information
- Application Number
- CN202211339912.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-27
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2042-10-27
AI Technical Summary
The Cesium engine does not support the feature of glowing ground lines in 3D maps.
By acquiring ground line textures at different resolutions, sampling and Gaussian blur processing are performed using fragment shaders, and then the Gaussian equation is combined to generate luminous effect data. This data is then mixed with the texture data of a preset application scenario to achieve the luminous effect of the ground line.
It implements the glowing effect of ground lines in 3D maps, enhancing the capabilities of GIS rendering.
Smart Images

Figure CN115761097B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of three-dimensional maps, and particularly relates to a method, device and system for implementing a glow special effect of a ground-hugging line in a three-dimensional map. BACKGROUND
[0002] A geographic information system (GIS) is also known as a geoinformation system. It is a specific and very important spatial information system. It is a technical system for collecting, storing, managing, calculating, analyzing, displaying and describing relevant geographical distribution data in the entire or part of the earth's surface (including the atmosphere) space under the support of a computer hardware and software system.
[0003] With the continuous development of the domestic three-dimensional GIS industry and the increasing demand for digital earth visualization, the requirements for the rendering quality and performance of three-dimensional digital earth based on WebGL are continuously improving. In the rendering of digital earth, the implementation of the ground-hugging line of the Cesium engine is relatively complex, and the glow special effect function of the ground-hugging line is strongly required but not supported by the Cesium engine. SUMMARY
[0004] In order to solve the problem that the Cesium engine does not support the glow special effect of the ground-hugging line in the prior art, the embodiments of the present application provide the following technical solutions:
[0005] In a first aspect, the present application provides a method for implementing a glow special effect of a ground-hugging line in a three-dimensional map, comprising:
[0006] obtaining ground-hugging line textures of different resolutions of a to-be-processed terrain;
[0007] sampling the ground-hugging line textures of different resolutions in a fragment shader to obtain ground-hugging line texture data of different resolutions after sampling;
[0008] applying a Gaussian equation to perform Gaussian blur processing on the ground-hugging line texture data of different resolutions after sampling to obtain glow special effect data of the ground-hugging line;
[0009] mixing the glow special effect data of the ground-hugging line with texture data of a preset application scenario to obtain a glow special effect result of the ground-hugging line.
[0010] Further, the obtaining of the ground-hugging line textures of different resolutions of the to-be-processed terrain comprises:
[0011] obtaining a plurality of groups of ground-hugging line textures of different resolutions of to-be-processed terrains.
[0012] Further, the light emitting special effect data of the ground line is mixed with the texture data of the preset application scene to obtain a light emitting special effect result of the ground line, including:
[0013] Obtaining light emitting special effect data of a ground line;
[0014] Color superimposition is performed on the light emitting special effect data of the ground line and the texture data of the preset application scene to obtain a light emitting special effect result of the ground line.
[0015] Further, the light emitting special effect data of the ground line is mixed with the texture data of the preset application scene to obtain a light emitting special effect result of the ground line, including:
[0016] The light emitting special effect data of the ground line is processed according to a preset mixing equation to obtain a plurality of groups of ground line light emitting special effect data of different resolutions;
[0017] The plurality of groups of ground line light emitting special effect data of different resolutions are color superimposed with the texture data of the preset application scene in a preset order to obtain a light emitting special effect result of the ground line.
[0018] Further, the light emitting special effect data of the ground line includes color data of ground line texture of different resolutions, and the texture data of the preset application scene includes texture color data of the preset application scene.
[0019] Further, the preset mixing equation is,
[0020] ResultRGB = SourceRGB * 1 + DestinationRGB * 1
[0021] Wherein, ResultRGB is a color superimposition result, SourceRGB is color data of ground line texture of different resolutions, and DestinationRGB is texture color data of the preset application scene.
[0022] Further, before the obtaining of the ground line texture of different resolutions of the to-be-processed terrain, the method further includes:
[0023] A shadow geometry is constructed through a Worker in a Cesium engine, and the shadow geometry covers the to-be-processed terrain.
[0024] The ground line texture of different resolutions of the to-be-processed terrain is drawn according to a preset rendering instruction in the Cesium engine, and the ground line texture of different resolutions is stored.
[0025] In a second aspect, the application provides a device for implementing a light emitting special effect of a ground line in a three-dimensional map, including:
[0026] acquire a ground-hugging line texture of different resolutions of a to-be-processed terrain;
[0027] sample the ground-hugging line texture of different resolutions in a fragment shader to obtain sampled ground-hugging line texture data of different resolutions;
[0028] perform Gaussian blur processing on the sampled ground-hugging line texture data of different resolutions by applying a Gaussian equation to obtain ground-hugging line light-emitting special effect data;
[0029] mix the ground-hugging line light-emitting special effect data with texture data of a preset application scenario to obtain ground-hugging line light-emitting special effect results.
[0030] Further, the method further comprises:
[0031] constructing a shadow geometry by a Worker in a Cesium engine, wherein the shadow geometry covers the to-be-processed terrain;
[0032] drawing and storing the to-be-processed ground-hugging line texture of different resolutions in the Cesium engine according to a preset rendering instruction and storing the ground-hugging line texture of different resolutions.
[0033] In a third aspect, the present application provides a ground-hugging line light-emitting special effect implementation system in a three-dimensional map, comprising:
[0034] a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of the first aspect when executing the computer program.
[0035] The present application has the following advantages:
[0036] The ground-hugging line light-emitting special effect implementation method in a three-dimensional map provided by the present application acquires a ground-hugging line texture of different resolutions of a to-be-processed terrain, samples the ground-hugging line texture of different resolutions in a fragment shader to obtain sampled ground-hugging line texture data of different resolutions, performs Gaussian blur processing on the sampled ground-hugging line texture data of different resolutions by applying a Gaussian equation to obtain ground-hugging line light-emitting special effect data, and mixes the ground-hugging line light-emitting special effect data with texture data of a preset application scenario to obtain ground-hugging line light-emitting special effect results. The present application realizes the function of post-light-emitting special effects of ground-hugging lines in a three-dimensional map and enhances the ability of GIS rendering. BRIEF DESCRIPTION OF DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings described below only show some of the embodiments of the present application, and all other drawings obtained by those of ordinary skill in the art without creative effort based on these drawings also belong to the protection scope of the present application.
[0038] Figure 1 is a three-dimensional map of the ground line of the light effect implementation method steps schematic diagram of an embodiment of the present application.
[0039] Figure 2 is a three-dimensional map of the ground line of the light effect implementation method steps schematic diagram of another embodiment of the present application.
[0040] Figure 3 is a three-dimensional map of the ground line of the light effect implementation method rendering effect diagram of an embodiment of the present application.
[0041] Figure 4 is a shadow geometry constructed in an embodiment of the present application.
[0042] Figure 5 is a three-dimensional map of the ground line of the light effect implementation device structure schematic diagram of an embodiment of the present application.
[0043] Figure 6 is a three-dimensional map of the ground line of the light effect implementation system structure schematic diagram of an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solutions and advantages of the present application more clear, the technical solutions of the present application will be described in detail below. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort belong to the protection scope of the present application.
[0045] Please refer to Figure 1 , Figure 1 is a three-dimensional map of the ground line of the light effect implementation method steps schematic diagram provided by an embodiment of the present application, as Figure 1 shown, comprising:
[0046] Step S11, obtaining the ground line texture of different resolutions of the terrain to be processed;
[0047] In an embodiment, in order to achieve better effect, make the light effect display of the image ground line more delicate, can
[0048] Obtaining different resolution ground line textures of multiple groups of to-be-processed terrains, including:
[0049] 1920*1080 resolution ground line texture, 960*540 resolution ground line texture, 480*270 resolution ground line texture, and 240*135 resolution ground line texture.
[0050] Of course, in actual use, if there is a higher demand, a person skilled in the art can also use more different resolution ground line textures of different resolutions, and the present application does not make specific limitations on the number and format of different resolution ground line textures of different resolutions, and a person skilled in the art can set them according to actual conditions.
[0051] Step S12, sampling the different resolution ground line textures in the fragment shader to obtain sampled different resolution ground line texture data;
[0052] It should be noted that the different resolution ground line textures need to undergo a series of tests, such as depth test and transparency test, before they can be selected and converted into pixels. If a fragment of the different resolution ground line texture is selected as a pixel, it will eventually be converted into a screen pixel containing RGB values after a series of transformations. Thus, the sampled different resolution ground line texture data is obtained.
[0053] Step S13, applying a Gaussian equation to perform Gaussian blur processing on the sampled different resolution ground line texture data to obtain ground line light effect data;
[0054] In an embodiment, the texture blur after Gaussian blur processing cannot reach a relatively delicate degree and still has a pixel feeling, and even if the Gaussian equation is adjusted, the effect is still not very good; therefore, the different resolution ground line textures of different resolutions need to be mixed after Gaussian blur processing, so as to achieve a relatively delicate blur degree.
[0055] Step S14, mixing the ground line light effect data with preset texture data of a preset application scene to obtain ground line light effect results.
[0056] Through Gaussian blur processing, the extracted different resolution ground line textures have been blurred and the colors (i.e., light-emitting parts) have been strengthened. The processed texture is mixed with the original scene, that is, the light-emitting is applied to the entire scene. The light-emitting mixing is performed by using a WebGL-Blending related interface to perform color superposition on the light-emitting texture and the texture of the original scene according to a mixing equation. The mixing equation is as follows:
[0057] ResultRGB = SourceRGB * 1 + DestinationRGB * 1
[0058] wherein, ResultRGB is color superposition result, SourceRGB is color data of ground line texture of different resolutions, and DestinationRGB is texture color data of preset application scene.
[0059] It can be understood that the embodiment of the present application provides a light effect implementation method of ground line in a three-dimensional map. Different resolution ground line textures of a terrain to be processed are obtained. Different resolution ground line texture data after sampling is obtained by sampling the different resolution ground line textures in a fragment shader. The light effect data of the ground line is obtained by applying Gaussian equation to Gaussian blur processing of the different resolution ground line texture data after sampling. The light effect data of the ground line is mixed with the preset texture data of the preset application scene to obtain the light effect result of the ground line. The embodiment of the present application realizes the post-light effect function of the ground line in the three-dimensional map, and enhances the ability of GIS rendering.
[0060] In some embodiments, the light effect data of the ground line is mixed with the texture data of the preset application scene to obtain the light effect result of the ground line, including:
[0061] Obtaining the light effect data of the ground line;
[0062] The light effect data of the ground line is color superimposed with the texture data of the preset application scene to obtain the light effect result of the ground line.
[0063] Specifically, the light effect data of the ground line is color superimposed with the texture data of the preset application scene to obtain the light effect result of the ground line, including:
[0064] According to a preset mixing equation, the light effect data of the ground line is obtained to obtain a plurality of groups of different resolution ground line light effect data;
[0065] The plurality of groups of different resolution ground line light effect data are color superimposed with the texture data of the preset application scene in a preset order to obtain the ground line light effect result.
[0066] In some embodiments, the ground line light effect data includes color data of ground line texture of different resolutions, and the ground line light effect data can also include transparency data of the ground line. The texture data of the preset application scene includes texture color data of the preset application scene, and the texture data of the preset application scene can also include texture transparency data of the preset application scene.
[0067] For example, in one embodiment, please refer toFigure 2 The ground line texture with different resolutions includes a ground line texture with a resolution of 1920*1080, a ground line texture with a resolution of 960*540, a ground line texture with a resolution of 480*270, and a ground line texture with a resolution of 240*135. Gaussian blur processing is performed on the ground line texture data with different resolutions in the four different resolutions respectively by using a Gaussian equation, so that ground line light-emitting special effect data with the four different resolutions is obtained; color superposition is performed on the ground line light-emitting special effect data with the four different resolutions and the texture data of the preset application scene, so that a ground line light-emitting special effect result is obtained.
[0068] It should be noted that the application does not specifically limit the superposition order of the ground line light-emitting special effect data with different resolutions and the scene data, and the superposition order can be customized by a person skilled in the art.
[0069] The ground line light-emitting special effect data with a resolution of 1920*1080 can be superimposed on the texture data of the preset application scene first, then the ground line light-emitting special effect data with a resolution of 960*540 is superimposed, then the ground line light-emitting special effect data with a resolution of 960*540 is superimposed, and finally the ground line light-emitting special effect data with a resolution of 240*135 is superimposed, so that a ground line light-emitting special effect result is finally obtained.
[0070] Please refer to Figure 3 , Figure 3 is a rendering effect diagram of a ground line light-emitting special effect implementation method in a three-dimensional map in an embodiment of the application.
[0071] In some embodiments, before the ground line of the to-be-processed terrain is obtained, the following steps are included:
[0072] A shadow geometry is constructed in a Worker in the Cesium engine, and the shadow geometry covers the to-be-processed terrain.
[0073] It should be noted that the shadow geometry can be used to realize shadows from the name. The upper top surface and the lower top surface of the shadow geometry are higher than the maximum terrain height and less than the minimum terrain depth, in other words, the shadow geometry contains the terrain (or 3DTiles). The intersection of the shadow geometry and the terrain is the ground line.
[0074] The construction process of the shadow geometry can be synchronous or asynchronous, and the construction in the Cesium engine is by default through a Worker. A path array of the line is first given, a rectangular geometry can be created between every two vertices, the shadow geometry has only 8 vertices, then an index array can be calculated by the Cesium engine, and the path array of the line is traversed in turn.
[0075] The ground-hugging line textures of different resolutions of the to-be-processed terrain are drawn according to preset rendering instructions in the Cesium engine, and the ground-hugging line textures of different resolutions are stored.
[0076] In the Cesium engine, the ground-hugging line textures of different resolutions of the to-be-processed terrain are drawn using instructions of the Pass.TERRAIN_CLASSIFICATION type in the process of rendering in sequence according to rendering channels, and the ground-hugging line textures of different resolutions are stored.
[0077] Referring to Figure 4 , Figure 4 is a schematic diagram of a shadow geometry constructed in an embodiment of the present application.
[0078] It can be seen that the light-emitting special effect implementation method of the ground-hugging line in the three-dimensional map provided by the present application can be integrated in the Cesium engine. Of course, the implementation process of the present application is not limited to implementing the light-emitting special effect, but can also be used for other special effects, and has universality. The present application also has very important reference significance for expanding other capabilities of the Cesium engine.
[0079] Referring to Figure 5 , Figure 5 is a schematic diagram of a light-emitting special effect implementation device structure of a ground-hugging line in a three-dimensional map in an embodiment of the present application. The light-emitting special effect implementation device of the ground-hugging line in the three-dimensional map comprises:
[0080] The acquisition module 21 is configured to acquire ground-hugging line textures of different resolutions of a to-be-processed terrain.
[0081] The sampling module 22 is configured to sample the ground-hugging line textures of different resolutions in a fragment shader to obtain ground-hugging line texture data of different resolutions after sampling.
[0082] The Gaussian blur processing module 23 is configured to apply a Gaussian equation to perform Gaussian blur processing on the ground-hugging line texture data of different resolutions after sampling to obtain light-emitting special effect data of the ground-hugging line.
[0083] The mixing module 24 is configured to mix the light-emitting special effect data of the ground-hugging line with texture data of a preset application scenario to obtain a light-emitting special effect result of the ground-hugging line.
[0084] In some embodiments, the light-emitting special effect implementation device of the ground-hugging line in the three-dimensional map further comprises:
[0085] The shadow geometry construction module is configured to construct a shadow geometry through a Worker in the Cesium engine, and the shadow geometry covers the to-be-processed terrain.
[0086] A drawing and storage module is configured to draw the ground-hugging line textures of different resolutions according to preset rendering instructions in the Cesium engine and store the ground-hugging line textures of different resolutions.
[0087] It can be understood that the light-emitting special effect implementation device of the ground-hugging line in the three-dimensional map provided by the present application obtains the ground-hugging line textures of different resolutions of the terrain to be processed through the obtaining module 21; samples the ground-hugging line textures of different resolutions in the fragment shader to obtain the ground-hugging line texture data of different resolutions after sampling through the sampling module; applies a Gaussian equation to perform Gaussian blur processing on the ground-hugging line texture data of different resolutions after sampling through the Gaussian blur processing module 23 to obtain the light-emitting special effect data of the ground-hugging line; and mixes the light-emitting special effect data of the ground-hugging line with the texture data of the preset application scene through the mixing module 24 to obtain the light-emitting special effect result of the ground-hugging line. The present application realizes the post-light-emitting special effect function of the ground-hugging line in the three-dimensional map and enhances the rendering capability of GIS. The light-emitting special effect implementation device of the ground-hugging line in the three-dimensional map provided by the present application can be integrated into the Cesium engine for stable rendering. The implementation process is not only limited to realizing some effects of the rendering object, but also has general applicability and is of great significance for extending other capabilities of the Cesium engine.
[0088] The device module in the embodiment of the present application can be used to execute the steps of the method embodiment, and the working principle and the achieved effects are similar, which will not be described in detail.
[0089] Please refer to Figure 6 , Figure 6 is a three-dimensional map ground-hugging line light-emitting special effect implementation system structure diagram in an embodiment of the present application, comprising:
[0090] The memory 31 stores a computer program, and the processor 32 executes the computer program to realize the steps of the three-dimensional map ground-hugging line light-emitting special effect implementation method according to any one of the above.
[0091] It can be understood that the same or similar parts in the above embodiments can be mutually referred to, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.
[0092] It should be noted that, in the description of the present application, the terms "first", "second", etc. are only used for the purpose of description, and cannot be understood as indicating or implying relative importance. In addition, in the description of the present application, unless otherwise specified, the meaning of "a plurality of" is at least two.
[0093] In the description of the specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are contained in at least one embodiment or example of the present application. In the specification, the illustrative description of the above terms does not necessarily mean the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0094] Although the embodiments of the present application have been shown and described above, it is understood that the above-described embodiments are exemplary, and cannot be construed as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above-described embodiments within the scope of the present application.
Claims
1. A method for implementing a glowing effect on a ground line in a 3D map, characterized in that, include: Obtain ground line textures at different resolutions for the terrain to be processed; The ground line textures at different resolutions are sampled in the fragment shader to obtain ground line texture data at different resolutions after sampling. The Gaussian equation is applied to the sampled ground line texture data at different resolutions to perform Gaussian blurring to obtain the ground line luminescence effect data; The luminous effect data of the ground line is mixed with the texture data of a preset application scenario to obtain the luminous effect result of the ground line; The ground-level illumination effect data is mixed with the texture data of a preset application scenario to obtain the ground-level illumination effect result, including: Obtain the ground-level glow effect data; The luminous effect data of the ground line is superimposed with the texture data of the preset application scenario to obtain the luminous effect result of the ground line; The luminous effect data of the ground line is superimposed with the texture data of a preset application scenario to obtain the luminous effect result of the ground line, including: The ground line luminous effect data is processed according to a preset mixing equation to obtain multiple sets of ground line luminous effect data with different resolutions. The multiple sets of ground-line luminous effect data with different resolutions are superimposed with the texture data of the preset application scenario in a preset order to obtain the ground-line luminous effect result. The preset mixing equation is: ResultRGB = SourceRGB * 1 + DestinationRGB * 1 Among them, ResultRGB is the color overlay result, SourceRGB is the color data of ground line textures at different resolutions, and DestinationRGB is the texture color data of the preset application scenario; Before acquiring ground-line textures of different resolutions of the terrain to be processed, the method further includes: A shadow geometry is constructed using a Worker in the Cesium engine, which covers the terrain to be processed. In the Cesium engine, ground line textures of different resolutions of the terrain to be processed are drawn according to preset rendering instructions, and the ground line textures of different resolutions are stored.
2. The method for achieving luminous effects according to claim 1, characterized in that, The process of acquiring ground-line textures of different resolutions of the terrain to be processed includes: Obtain ground line textures of different resolutions for multiple sets of terrain to be processed.
3. The method for achieving luminous effects according to claim 1, characterized in that, The ground line glow effect data includes color data of ground line textures at different resolutions, and the texture data of the preset application scenario includes texture color data of the preset application scenario.
4. A device for achieving a ground-level luminous effect in a 3D map, characterized in that, include: The acquisition module is used to acquire ground line textures of different resolutions of the terrain to be processed; The sampling module is used to sample the ground line textures of different resolutions in the fragment shader to obtain the sampled ground line texture data of different resolutions. The Gaussian blur processing module is used to apply the Gaussian equation to perform Gaussian blur processing on the sampled ground line texture data of different resolutions to obtain the ground line luminous effect data. The mixing module is used to mix the luminous effect data of the ground line with the texture data of a preset application scenario to obtain the luminous effect result of the ground line; The ground-level illumination effect data is mixed with the texture data of a preset application scenario to obtain the ground-level illumination effect result, including: Obtain the ground-level glow effect data; The luminous effect data of the ground line is superimposed with the texture data of the preset application scenario to obtain the luminous effect result of the ground line; The luminous effect data of the ground line is superimposed with the texture data of a preset application scenario to obtain the luminous effect result of the ground line, including: The ground line luminous effect data is processed according to a preset mixing equation to obtain multiple sets of ground line luminous effect data with different resolutions. The multiple sets of ground-line luminous effect data with different resolutions are superimposed with the texture data of the preset application scenario in a preset order to obtain the ground-line luminous effect result. The preset mixing equation is: ResultRGB = SourceRGB * 1 + DestinationRGB * 1 Among them, ResultRGB is the color overlay result, SourceRGB is the color data of ground line textures at different resolutions, and DestinationRGB is the texture color data of the preset application scenario; Also includes: The Shadow Geometry Module is used to construct shadow geometry via Workers in the Cesium Engine, which covers the terrain to be processed. The rendering and storage module is used to render ground line textures of different resolutions of the terrain to be processed in the Cesium engine according to preset rendering instructions, and to store the ground line textures of different resolutions.
5. A system for achieving a glowing effect on ground lines in a 3D map, characterized in that, include: A memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Method and system for rendering optimization of glow effect
CN112184877A