A scene rendering method, system and electronic device based on a map engine
By combining camera and lighting parameters to transform coordinates in a geographic information system, a set of special effects adaptation parameters is generated, which solves the problem of insufficient support for lighting effects in geographic information systems. This achieves natural integration and smooth interaction between special effects and the geographic environment, enhancing the realism and immersion of the scene.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SUZHOU XUNXI ELECTRONICS SCI & TECH CO LTD
- Filing Date
- 2026-03-23
- Publication Date
- 2026-07-14
AI Technical Summary
In existing technologies, scene rendering in geographic information systems suffers from insufficient support for lighting effects, resulting in limitations in scene realism and immersion. Furthermore, the lack of a unified adaptation mechanism between different effects leads to computational overload and a sharp drop in frame rate, affecting the smoothness of interaction.
By combining camera and lighting parameters, geospatial coordinates are converted into local rendering coordinates, the geographic boundary constraints for special effects rendering are determined, a set of special effects adaptation parameters is generated, and special effects texture information is generated in the view space. The special effects texture is adjusted by monitoring the frame rate threshold to ensure that the special effects blend naturally with the geographic environment, avoid distortion, and optimize performance bottlenecks.
It achieves more realistic lighting and shadow effects and visual presentation, enhances user immersion, ensures the natural integration of special effects with the geographical environment, improves the realism and smoothness of virtual scenes, and meets the needs of high-quality 3D geographic information systems.
Smart Images

Figure CN122391440A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of scene rendering technology, and in particular to a scene rendering method, system and electronic device based on a map engine. Background Technology
[0002] With the development of digital mapping and 3D graphics rendering technologies, users have increasingly higher demands for the realism and interactivity of scenes in virtual globes or Geographic Information Systems (GIS). Traditional two-dimensional map display methods are no longer sufficient to meet the needs of complex application scenarios, such as urban planning, environmental simulation, and disaster early warning. Therefore, how to efficiently and realistically render scenes in 3D geographic information systems has become an important research direction.
[0003] Current mainstream open-source 3D geographic information engines (such as CesiumJS) are widely used in fields such as digital twins, smart cities, and land planning, with their core capabilities being the efficient loading and visualization of massive geospatial data (including terrain, imagery, 3D tile models, etc.). However, their rendering pipelines are mainly geared towards the geometric and textural representation of geographic features, and have significant shortcomings in supporting realistic lighting effects: they natively only provide basic lighting and simple post-processing, and cannot achieve physically based visual effects such as godray, lens flare, volumetric cloud, and atmospheric scattering, resulting in limitations in scene realism and immersion.
[0004] On the other hand, while game engines (such as Unreal Engine and Unity) have maturely integrated the aforementioned advanced special effects systems and can generate highly realistic atmospheric and lighting effects through technologies such as light stepping, multiple scattering models, and noise-driven dynamic simulation, they lack native support for geospatial data and have excessively high requirements for computer hardware configurations. They are unable to efficiently process global terrain, high-precision remote sensing images, and large-scale 3D city models based on the WGS84 coordinate system. Furthermore, their coordinate systems, projection methods, and data organization logic are fundamentally different from those of geographic information engines, and direct porting can lead to data misalignment, performance crashes, or functional failures.
[0005] In existing technologies, some solutions attempt to bridge GIS engines and game engines by integrating different WebGL renderers or middleware. However, such methods usually introduce additional data conversion overhead and rendering context switching latency, which disrupts the continuity of the rendering pipeline. At the same time, the integrated special effects are often superimposed on the scene as a general post-processing layer without establishing a semantic relationship with the geographic environment. This results in the special effects being disconnected from geographic elements such as terrain elevation and ground object occlusion, leading to distortions such as volumetric light penetrating mountains, clouds floating on the ground, and sunlight halos ignoring terrain occlusion.
[0006] Furthermore, even when special effects are enhanced within a single engine, existing geographic visualization solutions generally suffer from isolated effects and a lack of a unified adaptation mechanism: different effects need to handle common logic such as coordinate transformation, lighting synchronization, and boundary clipping separately, resulting in redundant code and difficult maintenance; more importantly, there is a lack of dynamic adjustment strategies based on real-time performance feedback, which can easily lead to a sharp drop in frame rate due to overload of special effects calculation in complex scenarios, affecting the smoothness of interaction. Summary of the Invention
[0007] This application provides a scene rendering method, system, and electronic device based on a map engine, to at least solve problems in related technologies such as how to enhance special effects and geographic information adaptability. The technical solution of this application is as follows: According to a first aspect of the embodiments of this application, a scene rendering method based on a map engine is provided, comprising: Acquire target geographic scene information and current frame buffer information; the current frame buffer information includes camera parameters and illumination parameters. Based on the camera parameters and the lighting parameters, the geospatial coordinates in the target geographic scene information are converted into local rendering coordinates; Based on the terrain elevation data in the target geographic scene information, determine the geographic boundary constraints for special effects rendering, and generate a set of special effects adaptation parameters based on the geographic boundary constraints. Based on the special effects shader, the special effects adaptation parameter set, and the rendering local coordinates, special effects texture information is generated in the view space of the target geographic scene information. The special effects texture information is fused with the scene texture information in the target geographic scene information to generate the target rendered image; The frame rate threshold of the target rendering image is monitored to obtain the current frame rate information of the target rendering image; and the special effects texture information of the target rendering image is adjusted according to the comparison result between the frame rate information and the preset frame rate threshold.
[0008] According to a second aspect of the embodiments of this application, a scene rendering system based on a map engine is provided, comprising: The acquisition module is used to acquire target geographic scene information and current frame buffer information; the current frame buffer information includes camera parameters and illumination parameters. The coordinate transformation module is used to convert the geospatial coordinates in the target geographic scene information into rendering local coordinates based on the camera parameters and the lighting parameters; The parameter set determination module is used to determine the geographical boundary constraints for special effects rendering based on the terrain elevation data in the target geographical scene information, and to generate a special effects adaptation parameter set based on the geographical boundary constraints. The special effects texture information generation module is used to generate special effects texture information in the view space of the target geographic scene information based on the special effects shader, the special effects adaptation parameter set and the rendering local coordinates. The target rendering image generation module is used to perform scene fusion processing on the special effects texture information and the scene texture information in the target geographic scene information to generate the target rendering image. The special effects texture adjustment module is used to monitor the frame rate threshold of the target rendering screen to obtain the current frame rate information of the target rendering screen; and to adjust the special effects texture information of the target rendering screen according to the comparison result between the current frame rate information and the preset frame rate threshold.
[0009] According to a third aspect of the embodiments of this application, an electronic device is provided, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method as described in any one of the first aspects above.
[0010] According to a fourth aspect of the present application, a computer-readable storage medium is provided, wherein when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform any of the methods described in the first aspect of the present application.
[0011] According to a fifth aspect of the embodiments of this application, a computer program product is provided, including computer instructions that, when executed by a processor, cause a computer to perform the method described in any one of the first aspects of the embodiments of this application.
[0012] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this application.
[0013] The technical solutions provided by the embodiments of this application bring at least the following beneficial effects: By combining camera parameters and lighting parameters, the geospatial coordinates in the target geographic scene information can be accurately converted into local rendering coordinates, which helps to achieve more realistic lighting effects and visual presentation, and enhances the user's immersion. The geographical boundary constraints for special effects rendering are determined based on topographic elevation data, and a set of special effects adaptation parameters is generated to ensure the natural integration between special effects and geographical environment, avoid distortion phenomena such as volumetric light penetrating mountains and clouds floating on the ground, and enhance geographical adaptability. The frame rate threshold is monitored for the target rendering screen, and the special effects texture information is adjusted according to the frame rate information. This effectively solves the performance bottleneck problem caused by complex special effects calculations and ensures the smoothness and stability of the interaction. By using a unified set of special effects adaptation parameters to handle the common logic between different special effects, code redundancy is reduced, development and maintenance costs are lowered, and the coordination and consistency between special effects are improved. Furthermore, through the above technical means, not only is the realism and immersion of the virtual scene enhanced, but also a smooth interactive experience is ensured in various complex scenarios, meeting users' needs for a high-quality 3D geographic information system.
[0014] Other features and aspects of this application will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0015] To more clearly illustrate the technical solutions and advantages in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a flowchart illustrating a scene rendering method based on a map engine, according to an exemplary embodiment.
[0017] Figure 2 This is a schematic diagram illustrating a volumetric light rendering result according to an exemplary embodiment.
[0018] Figure 3 This is an example diagram illustrating a lens flare rendering result according to an exemplary embodiment.
[0019] Figure 4 This is an example diagram illustrating a global volumetric cloud rendering result according to an exemplary embodiment.
[0020] Figure 5 This is an example diagram illustrating an atmospheric scattering rendering result according to an exemplary embodiment.
[0021] Figure 6 This is a system block diagram illustrating a scene rendering system based on a map engine, according to an exemplary embodiment.
[0022] Figure 7 This is a frame of an electronic device for scene rendering based on a map engine, illustrated according to an exemplary embodiment. Figure 1 .
[0023] Figure 8This is a frame of an electronic device for scene rendering based on a map engine, illustrated according to an exemplary embodiment. Figure 2 . Detailed Implementation
[0024] To enable those skilled in the art to better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments in the specification, and not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0026] Various exemplary embodiments, features, and aspects of the present invention will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.
[0027] The term "exemplary" as used herein means "serving as an example, embodiment, or illustration." Any embodiment illustrated herein as "exemplary" is not necessarily to be construed as superior to or better than other embodiments. The term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships may exist, for example, A and / or B, which can represent: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more of a plurality, for example, including at least one of A, B, and C, which can represent including any one or more elements selected from the set consisting of A, B, and C.
[0028] Unless otherwise specified, the directions in this article should be understood as follows: the direction closer to the user is forward, and the direction farther from the user is backward.
[0029] Furthermore, to better illustrate the present invention, numerous specific details are set forth in the following detailed embodiments. Those skilled in the art will understand that the present invention can be practiced without certain specific details. In some instances, methods, means, elements, and circuits well known to those skilled in the art have not been described in detail in order to highlight the spirit of the invention.
[0030] It should be noted that the following diagram shows one possible sequence of steps, and it is not strictly necessary to follow this order. Some steps can be executed in parallel without interdependence.
[0031] Before introducing the method embodiments provided by the present invention, a brief introduction will be given on the application scenarios, related terms or nouns that may be involved in the method embodiments of the present invention, so as to facilitate the understanding of those skilled in the art.
[0032] Current scene rendering methods primarily separate the geographic information engine from the general graphics rendering pipeline, with special effects simply overlaid on the basic scene as a post-processing layer, lacking deep coupling with geospatial semantics. Specifically, this manifests in three typical modes: pure geographic information engine rendering (such as the native CesiumJS approach), game engine-driven special effects rendering (such as Unreal Engine + GIS plugin), and plug-in hybrid rendering architecture (GIS engine + external special effects modules). All of these suffer from problems such as missing geographic semantics, fragmented rendering pipelines, coarse performance tuning, and poor scalability.
[0033] To address the aforementioned technical issues, this application proposes a scene rendering method, system, and electronic device based on a map engine. This avoids distortions such as volumetric light penetrating mountains and clouds floating on the ground, enhancing geographic adaptability. Simultaneously, it improves the realism and immersion of virtual scenes, ensuring a smooth interactive experience in various complex scenarios and meeting users' demands for high-quality 3D geographic information systems. While CesiumJS can be used as an example of a map engine, this application is equally applicable to other geographic information visualization engines that support WebGL, and is not limited thereto.
[0034] Figure 1 This is a flowchart illustrating a scene rendering method based on a map engine, according to an exemplary embodiment. For example... Figure 1 As shown, it may include the following steps.
[0035] In step S101, target geographic scene information and current frame buffer information are obtained.
[0036] In the embodiments of this specification, a map engine can refer to a software system used for loading, managing, and visualizing geospatial data, supporting the rendering of 3D terrain, remote sensing imagery, vector features, and 3D models (such as 3D Tiles). Typical examples include CesiumJS and ArcGIS API for JavaScript. Preferably, the map engine in this application can be an open-source or commercial geographic information engine with WebGL rendering capabilities. Target geographic scene information can refer to a multi-source spatial data set corresponding to the geographic area to be rendered, including but not limited to topographic elevation data (DEM), satellite / aerial image textures, 3D building models (such as 3D Tiles format), and geographic coordinate system information (such as WGS84). This application does not limit this.
[0037] The current frame buffer information can refer to the set of parameters required when simulating a virtual camera to capture a geographic scene, used to construct the view and lighting context, including camera parameters and lighting parameters; among which, camera parameters may include camera position, orientation, field of view (FOV), near and far clipping planes, etc.; lighting parameters may include the direction, intensity, color temperature of the main light source (such as the sun), and ambient light coefficients, etc.
[0038] For example, the 3D geographic scene to be rendered is first loaded and initialized by a map engine (such as CesiumJS). The target geographic scene information includes, but is not limited to, the following data: Digital Elevation Model (DEM) data, used to describe the surface undulations; remote sensing image textures, such as satellite images or aerial photographs, as the base surface texture; 3D feature models, such as urban buildings, bridges, vegetation, and other elements encoded in 3D Tiles format; and geographic coordinate system metadata, such as the WGS84 coordinate system definition, used for unified spatial reference.
[0039] Simultaneously, the system acquires the current frame buffer information, which simulates the virtual camera's shooting state of the geographical scene, specifically including: Camera parameters: including the camera's position in the world coordinate system (latitude, longitude, and altitude), orientation (pitch angle, yaw angle), field of view (FOV), and distance between the near and far clipping planes; Lighting parameters: provided by the map engine's time system or ambient light module, including the direction vector of the main light source (usually the sun), illuminance (unit: lux or normalized brightness value), color temperature, and ambient light coefficient. All of the above information can be obtained directly through the map engine's API.
[0040] In step S103, based on camera parameters and lighting parameters, the geospatial coordinates in the target geographic scene information are converted into rendering local coordinates; In the embodiments described in this specification, geospatial coordinates can refer to latitude-longitude (LLE) coordinates based on an Earth ellipsoid model (such as WGS84), used to describe the absolute location of geographic features in the real world. Rendering local coordinates can refer to a local Cartesian coordinate system established with the current camera or effect center as the origin, used for efficient calculations in the GPU shader. This coordinate system is obtained by projecting geospatial coordinates onto camera parameters, avoiding the numerical accuracy issues of large-scale WGS84 coordinates.
[0041] After acquiring the target geographic scene information and the current frame buffer information, coordinate system unification is performed to resolve the contradiction between large-scale geographic coordinates and the numerical precision of GPU rendering. Specifically, geospatial coordinates are represented using the Longitude-Latitude-Elevation (LLE) coordinate system under the WGS84 ellipsoidal coordinate system, which is suitable for storing and indexing geographic data globally. However, when this coordinate system is directly used for GPU shader calculations, it can cause rendering jitter and depth test errors due to floating-point precision limitations (especially in areas far from the origin).
[0042] To this end, this application introduces a rendering local coordinate system. The construction process is as follows: First, a local origin is determined: the current virtual camera's position (calculated from the latitude, longitude, and altitude in the camera parameters) is used as the origin of the local coordinate system. Further, local axes are established: an ENU (East-North-Up) right-handed coordinate system is adopted: the X-axis points towards geographic east, the Y-axis points towards geographic north, and the Z-axis is vertically upward (along the local normal direction). Finally, a coordinate transformation is performed: for any geospatial coordinate point in the target geographic scene information, it is first converted to geocentric and geofixed coordinates, and then mapped to the ENU local coordinate system centered on the camera using translation and rotation matrices to obtain the rendering local coordinates. This application does not limit the specific content of the coordinate transformation.
[0043] In step S105, the geographical boundary constraints for special effects rendering are determined based on the terrain elevation data in the target geographic scene information, and a set of special effects adaptation parameters is generated based on the geographical boundary constraints. In the embodiments described in this specification, geographical boundary constraints can refer to the effective spatial range for special effects rendering determined based on terrain elevation data and the distribution of ground features. For example, the vertical range of volumetric clouds is limited to the lower limit of the cloud base elevation to the upper limit of the cloud top elevation.
[0044] The special effects adaptation parameter set can refer to a set of structured parameters derived from geographic boundary constraints, camera parameters, lighting parameters, etc., used to drive the special effects shader.
[0045] For example, after completing the conversion from geospatial coordinates to rendering local coordinates, the terrain elevation data in the target geographic scene information is further utilized to construct a spatial constraint mechanism for special effects rendering, so as to ensure that various visual effects can be physically and consistently integrated with the real geographic environment.
[0046] Specifically, the system first queries the map engine (such as CesiumJS) for the terrain elevation distribution within the current view frustum coverage area. For example, by calling the sampleTerrain or Globe.getHeight interface, it obtains the surface elevation values of several key locations (such as directly below the camera, the far corner of the view frustum, the projection point of the light source, etc.).
[0047] Based on this elevation data, the geographical boundary constraints for special effects rendering are determined. The form of these constraints varies depending on the type of special effects; a typical example is as follows: For volumetric cloud effects, the average surface elevation of the region should be considered. The lower limit of cloud base elevation is set as = +Δh1, the upper limit of the cloud top altitude is = +Δh2 ensures that the clouds remain suspended above the ground and do not penetrate the mountains.
[0048] For volumetric lighting effects, a terrain occlusion mask is constructed. By testing the intersection of rays with terrain elevations, it is determined whether the path from the fragment to the light source is blocked by mountains or buildings, thereby generating light source visibility information.
[0049] For atmospheric scattering effects, the elevation of the current fragment's corresponding surface location will be used. It serves as a benchmark for atmospheric density attenuation and is used for compensation calculations of near-ground scattering intensity.
[0050] Based on the aforementioned geographical boundary constraints, the system further generates a structured set of special effects adaptation parameters.
[0051] In step S107, based on the special effects shader, the special effects adaptation parameter set, and the rendering local coordinates, special effects texture information is generated in the view space of the target geographic scene information; In the embodiments described in this specification, the effects shader can be a custom GPU shader program written based on WebGL / GLSL, used to generate specific visual effects in real time in view space, such as volumetric lighting, lens flare, volumetric clouds, and atmospheric scattering. Each type of effect corresponds to an independent shader module.
[0052] View controls can refer to a right-handed coordinate system with the camera position as the origin and the camera orientation as the Z-axis. All effect textures are generated in this space for easy alignment with the CesiumJS native rendering pipeline. Effect texture information can refer to RGBA textures output by the effect shader, containing color and transparency information of the effects, such as the translucent clouds of volumetric clouds and the glowing spots of lens flares, used for subsequent blending with scene textures.
[0053] In one possible implementation, the effects shader is a volumetric light shader, and the effects texture information is a volumetric light effects texture. The volumetric light shader is then invoked to filter light source visibility information, terrain occlusion mask information, and illumination intensity information from the effects adaptation parameter set. Based on the local rendering coordinates, the viewing direction of the current fragment in the view space and the position of the light source in the view space are determined. Based on the light source visibility information, illumination intensity information, the viewing direction of the current fragment in the view space, and the position of the light source in the view space, a view space sampling ray is constructed from the current fragment to the light source. Based on the view space sampling ray, multi-step ray stepping sampling processing is performed to obtain multiple ray sampling point information. Based on the terrain occlusion mask information, terrain occlusion sampling point information is removed from the multiple ray sampling point information to obtain unoccluded sampling point information. Based on Burmester noise, the transmittance of the unoccluded sampling point information is perturbed to obtain a noise-modulated transmittance sequence. Based on the transmittance sequence, the volumetric light intensity is determined, and based on the volumetric light intensity, the volumetric light effects texture is determined.
[0054] In the embodiments described in this specification, the volumetric light shader is a custom GPU fragment shader program written based on WebGL / GLSL, used to simulate visible light beams formed by particle scattering as light propagates through the atmosphere or medium in view space. This shader receives parameters such as the light source position, viewing direction, and occlusion information, and generates a semi-transparent volumetric light texture by calculating the light step and transmittance integral.
[0055] Volumetric lighting effect textures can refer to RGBA textures output by the volumetric lighting shader, where the RGB channels represent the color and intensity of the volumetric light, and the A channel represents the transparency. This texture only contains the luminous information of the beam region and will be subsequently blended and overlaid onto the main scene using alpha blending.
[0056] The light source visibility flag can be a Boolean or integer parameter indicating whether the main light source (such as the sun) in the current frame is within the camera's view frustum and is not completely obscured by terrain or buildings. If it is "invisible," volumetric lighting rendering is skipped to save performance; if it is "visible," the sampling process continues.
[0057] Terrain occlusion mask information can refer to a spatial occlusion data structure used to identify whether there are terrain obstacles on the path from the fragment to the light source. In this application, the mask can be generated based on a depth buffer or a pre-computed terrain height field, and is used to remove sampling points occluded by mountains, buildings, etc. during the light stepping process.
[0058] View-space sampling rays refer to rays originating from the current fragment position and pointing towards the light source, used to simulate the light path of the observer's line of sight tracing back to the light source. Terrain occlusion sampling point information refers to sampling points located above the terrain elevation but obscured by the ground or buildings during the light's movement. Their occlusion status is determined by terrain occlusion mask information. Unoccluded sampling point information refers to the set of sampling points retained after terrain occlusion removal, representing areas where light can propagate freely, used for subsequent transmittance calculations. Berlin noise is a gradient noise function used to generate continuous, natural pseudo-random perturbations. In volumetric lighting rendering, it is used as a 3D noise texture sample to modulate transmittance, simulating the variations in beam brightness caused by uneven distribution of dust and water vapor in the atmosphere.
[0059] The noise-modulated transmittance sequence can refer to the process of adjusting the medium density based on the local three-dimensional noise value at each unobstructed sampling point, then calculating the cumulative transmittance to form a transmittance array distributed along the ray, which is used for the final light intensity integration. Volumetric light intensity can refer to the final beam brightness determined by both the transmittance sequence and the illumination intensity information.
[0060] Figure 2 This is a schematic diagram illustrating a volumetric lighting rendering result according to an exemplary embodiment. For example... Figure 2 As shown, to achieve God Ray rendering for geographic environment awareness, the system performs the following steps: First, at the start of frame rendering, the volumetric light shader is invoked, and parameters related to volumetric light are extracted from the effect adaptation parameter set pre-generated by the effect adaptation layer, including: Light source visibility information: Output by the occlusion detection module of the previous or current frame, indicating whether the sun is within the camera's field of view and is not completely obscured by terrain or buildings; Terrain occlusion mask information: a type of spatial occlusion data constructed based on depth buffers or terrain elevation fields, used to identify whether each location in the scene is occluded by the ground surface; Light intensity information: The current brightness value from the main light source (such as the sun), usually calculated by the map engine's time system in conjunction with the atmospheric model.
[0061] If the light source visibility information indicates that the light source is not visible (e.g., the sun is below the horizon or completely blocked by mountains), the volumetric lighting rendering process is skipped directly, and a completely black texture is output to save GPU resources; otherwise, subsequent processing continues.
[0062] Next, based on the rendering local coordinates of the current fragment, the GPU shader, namely the volumetric light shader, calculates: the viewing direction of the current fragment in view space, that is, the direction vector from the camera origin to the fragment; the position of the light source, such as the sun in view space, is usually regarded as a parallel light source at infinity, and its position is represented by a direction vector, which is normalized and used for ray construction.
[0063] Based on the above information, a view space sampling ray is constructed from the current fragment toward the light source. This ray is used to simulate the medium scattering behavior of light propagating from the light source to the observer's path. Since volumetric light is essentially astigmatic light viewed in reverse, the sampling direction is from the fragment toward the light source.
[0064] Subsequently, multi-step ray sampling is performed along the sampling ray. Specifically, the ray is divided into N steps (e.g., N=32), and at each step, its world coordinates are obtained, and it is queried whether the point is located within the effective atmosphere (e.g., altitude 0-10 km). This process generates information on multiple ray sampling points, each containing attributes such as location and potential density.
[0065] Then, terrain occlusion masking information is used to eliminate sampling points. The system calculates the geographic coordinates of each sampling point using local coordinates and compares them with the terrain elevation data. If the point is located below the ground surface or is obscured by a known building, it is marked as a terrain-occluded sampling point and eliminated in subsequent calculations. The remaining points are the unobstructed sampling points, representing areas where light can propagate freely.
[0066] To further enhance realism, 3D Perlin noise is introduced to perturb the transmittance. Specifically, the local coordinates of each unobstructed sampling point are used as input to sample a pre-loaded 3D Perlin noise texture, resulting in a noise value within the range [0,1]. This value is used to modulate the dielectric density. .For example, = (1+k) -0.5), where Given the base atmospheric density and k as the perturbation intensity coefficient, the cumulative transmittance is calculated based on the modulated density, thus obtaining the noise-modulated transmittance sequence T. Finally, the volumetric light intensity I is determined based on this transmittance, for example, I = (1-T). Among them... This provides light intensity information. I is used as the RGB color value (the hue can be adjusted based on the light source's color temperature), and the Alpha channel is set to 1-T to generate a volumetric light effect texture.
[0067] The volumetric light effect texture is then passed to the blending module and superimposed onto the main scene through additive blending, creating a realistic beam effect that penetrates through gaps in clouds or forests. Because terrain elevation and occlusion information are integrated throughout the process, the volumetric light does not penetrate mountains or appear incorrectly at night, achieving geographic semantic-driven realistic rendering.
[0068] In one possible implementation, the effect shader is a lens flare shader, and the effect texture information is a lens flare effect texture. The lens flare shader is then invoked to obtain light source visibility information and illumination intensity information from the effect adaptation parameter set. If the light source visibility information indicates that the light source is invisible, a completely black effect texture is generated and identified as the lens flare effect texture. If the light source visibility information indicates that the light source is visible, the projection coordinates of the light source in the view space are determined based on the rendering local coordinates and the position of the light source in the view space. Based on the projection coordinates, a preset geometric texture is superimposed in the view space to form an initial lens flare image. The brightness of the initial lens flare image is adjusted according to the illumination intensity information to generate the lens flare effect texture.
[0069] In the embodiments of this specification, the lens flare shader can refer to a custom GPU fragment shader program written based on WebGL / GLSL, used to simulate the optical diffraction, scattering, and reflection phenomena produced when a strong light source (such as the sun) shines on a camera lens in screen space or view space, generating composite visual effects including light spots, starbursts, and halo rings. The lens flare effect texture can refer to an RGBA texture output by the lens flare shader, containing the color, brightness, and transparency information of the lens flare. This texture is usually a semi-transparent luminous image, which is subsequently superimposed onto the main scene image through alpha blending or additive blending.
[0070] The projected coordinates of a light source in view space can refer to the two-dimensional position of the light source after its direction is transformed from view space through perspective projection and mapped to the normalized device coordinate (NDC) or screen UV coordinate system. If the coordinates fall within the [0,1]×[0,1] screen range, the light source is visible in the image and can be used to locate the center of the halo.
[0071] Preset geometric textures can refer to a set of pre-made 2D texture resources used to construct the visual elements of lens flares, including: circular Gaussian spots (main flare), polygonal starbursts (simulating aperture blade diffraction), concentric rings (simulating reflections from the inner wall of the lens barrel), and radial stripes (simulating scattered light). These textures are superimposed around the projection coordinates in the form of sprites. The initial lens flare image can refer to an intermediate image created before brightness adjustment, composed of multiple preset geometric textures superimposed with fixed offsets, scaling, and blending modes, the structure of which is determined by the projection coordinates of the light source.
[0072] Figure 3 This is an example diagram illustrating a lens flare rendering result according to an exemplary embodiment. For example... Figure 3 As shown, to achieve geographic environment-aware lens flare rendering, the system performs the following steps during each frame rendering process: First, the lens flare shader is invoked, and key parameters are extracted from the effect adaptation parameter set pre-generated by the effect adaptation layer, including: Light source visibility indicator information: This indicator is output by the illumination and occlusion analysis module of the previous stage, taking into account whether the sun is above the horizon, whether it is within the current camera's field of view, and whether it is obstructed by terrain or buildings; Light intensity information: This indicates the brightness value of the current main light source (usually the sun). Its value changes dynamically with the time of day, atmospheric transparency, and weather conditions. For example, the value is close to 1.0 at noon and drops below 0.2 at dusk.
[0073] If the light source visibility indicator detects that the light source is not visible, such as when the sun has set, it is completely blocked by a mountain, or it is outside the camera's field of view, the lens flare shader directly outputs a completely black texture (RGBA=(0,0,0,0)) and identifies it as the lens flare effect texture. This strategy effectively avoids unnecessary calculations and improves rendering efficiency.
[0074] If the light source visibility indicator information is detected, indicating that the light source is visible, then continue with the halo generation process: Based on the rendering local coordinate system of the current fragment, and combined with the position of the light source in view space (usually represented by a direction vector), the light source direction is transformed to normalized device coordinates (NDC) using a standard perspective projection matrix. Then, through viewport transformation, the two-dimensional projection coordinates (u,v) of the light source in the screen's UV space are obtained, which are the projection coordinates of the light source in view space. If u,v∈[0,1], it indicates that the light source is visible in the current image and can be used as the center position of the halo.
[0075] In the GPU shader, specifically the lens flare shader, multiple preset geometric textures are superimposed in screen space, centered on the projected coordinates. These textures may include, but are not limited to: a Gaussian-distributed circular main spot; multiple radially offset hexagonal starburst textures (simulating camera aperture diffraction); concentric ring-shaped scattering textures; and horizontal / vertical stripe textures (simulating internal reflections of the lens barrel). Each texture is scaled and rotated according to a preset ratio and superimposed using additive blending to generate the initial lens flare image.
[0076] The illumination intensity information is used as a multiplier factor to linearly modulate the RGB channels of the initial lens flare image, while the alpha channel can remain unchanged or be scaled synchronously to control the overall transparency. This results in the final lens flare effect texture.
[0077] The texture is then passed to the scene blending module and synthesized with the main scene texture through screen space overlay. Because the entire process relies on geographic semantics-driven light source visibility judgment (combining horizon, terrain occlusion, and view frustum), lens flare only appears when the sun is actually visible, and its brightness changes naturally with the intensity of sunlight, avoiding distortions such as lens flare appearing through mountains or glowing at night, which are common in traditional post-processing.
[0078] In one possible implementation, the effect shader is a volumetric cloud shader, and the effect texture information is a volumetric cloud effect texture. The volumetric cloud shader is invoked to obtain the lower limit of cloud base elevation, upper limit of cloud top elevation, lighting direction, lighting intensity, scattering coefficient, and absorption coefficient from the effect adaptation parameter set. A local voxel mesh is constructed based on the local rendering coordinates. The vertical range of the local voxel mesh is between the lower limit of cloud base elevation and the upper limit of cloud top elevation. Ray step sampling is performed on the local voxel mesh along the current fragment's viewing direction to obtain multiple volumetric cloud sampling points. Based on the wind speed parameters, the sampling coordinates of the 3D Berlin noise texture are subjected to temporal dynamic offset processing to obtain offset noise values. The cloud density of each volumetric cloud sampling point is determined based on the offset noise values. The multiple scattering colors of each volumetric cloud sampling point are determined based on the cloud density, the scattering coefficient, the absorption coefficient, the lighting direction, and the lighting intensity information. The multiple scattering colors of multiple volumetric cloud sampling points are accumulated along the viewing direction to generate the volumetric cloud effect texture.
[0079] In the embodiments of this specification, the volumetric cloud shader can refer to a custom GPU fragment shader program written based on WebGL / GLSL, used to simulate the lighting, scattering, and dynamic shape of a 3D cloud in view space, generating realistic volumetric cloud visual effects through ray stepping and noise-driven density modeling. The volumetric cloud effect texture can refer to an RGBA texture output by the volumetric cloud shader, where the RGB channels represent the cumulative multiple scattering colors of the cloud in the current viewing direction, and the A channel represents the transmittance or occlusion degree. This texture is subsequently blended with the main scene to present a semi-transparent, deep cloud layer.
[0080] A local voxel mesh can refer to a finite three-dimensional spatial mesh constructed in the local rendering coordinate system, covering only the intersection area of the current camera's view frustum and the cloud layer. Its horizontal range is determined by view frustum clipping, and its vertical range is strictly limited between the lower limit of the cloud base elevation and the upper limit of the cloud top elevation to reduce invalid sampling. Wind speed parameters can be vector parameters characterizing the overall speed and direction of cloud movement, and can be provided by meteorological data or preset animation curves. In this invention, they are used to drive the dynamic offset of noise textures to achieve the cloud drifting effect. The offset noise value can refer to the scalar value obtained by sampling the three-dimensional Berlin noise texture of the coordinates after time-series offset, and is used to map it to local cloud density. Cloud density can refer to a scalar value representing the concentration of water vapor or particles per unit volume, determining the intensity of light scattering and absorption at that point.
[0081] The scattering coefficient refers to the probability parameter of light being scattered in a cloud medium, affecting the brightness and transparency of the cloud. Rayleigh scattering dominates short-wavelength (blue light), while Mie scattering dominates long-wavelength (white light). In this application, they can be uniformly modeled as empirical scattering coefficients. The absorption coefficient describes the proportion of light absorbed (rather than scattered) in the cloud medium, controlling the depth and thickness of the dark areas of the cloud. A high absorption coefficient makes the cloud appear thicker and less transparent. Multiple scattering color can refer to the color contribution of a single sampling point to the observer, calculated after comprehensively considering the incident light direction, cloud density, and scattering / absorption coefficients. Typical models include the single scattering approximation or simplified multiple scattering integral.
[0082] Figure 4 This is an example diagram illustrating a global volumetric cloud rendering result according to an exemplary embodiment. For example... Figure 4 As shown, to achieve a geographically perceptible volumetric cloud, the system performs the following steps during each frame rendering process: First, the volumetric cloud shader is invoked, and parameters related to the volumetric cloud are extracted from the effect adapter parameter set pre-generated by the effect adapter layer, including: Cloud base elevation lower limit: dynamically calculated based on the average elevation of the ground surface within the current view cone area, for example, set to ground surface elevation + 500 meters; Cloud top elevation upper limit: usually set to ground surface elevation + 3000 meters to ensure that cloud distribution conforms to real meteorological patterns; Illumination direction and intensity information: provided by the map engine's time system and solar position model to simulate sunlight incidence; Scattering coefficient and absorption coefficient: preset empirical optical parameters that control the brightness and density of clouds, respectively.
[0083] Next, a local voxel mesh is constructed in the GPU shader based on the local rendering coordinates of the current fragment. This mesh only covers the spatial region where the camera's view frustum intersects with the cloud layer, with its vertical range strictly limited between the lower limit of the cloud base elevation and the upper limit of the cloud top elevation, and its horizontal range determined by view frustum clipping. This design significantly reduces invalid sampling and improves rendering efficiency.
[0084] Subsequently, ray step sampling is performed on the local voxel mesh along the viewing direction of the current fragment. Specifically, the viewing direction is divided into N steps (e.g., N=64), and the three-dimensional coordinates of the local voxel mesh are obtained at each step position, forming multiple volumetric cloud sampling points.
[0085] Furthermore, a wind-driven dynamic cloud morphology simulation is introduced. The system acquires the wind speed parameters of the current frame, which can be provided by meteorological data or animation curves; this application does not limit this. Based on this, the coordinates of each sampling point are dynamically offset over time. The offset coordinates are used to sample a pre-loaded 3D Berlin noise texture to obtain the offset noise value n∈[0,1]. After thresholding and exponential mapping, this value determines the cloud density ρ of each sampling point, thereby constructing a natural, non-uniform cloud structure.
[0086] Furthermore, based on cloud density, scattering coefficient, absorption coefficient, illumination direction, and illumination intensity information, the multiple scattering color of each sampling point is calculated. This application does not limit the calculation model for the multiple scattering color. Finally, the multiple scattering colors of all sampling points are accumulated along the line of sight. For example, using a forward alpha synthesis formula, the final output is a volumetric cloud effect texture. This volumetric cloud effect texture has a realistic three-dimensional depth, dynamic floating effect, and lighting interaction characteristics. Because the vertical range of the cloud layer is constrained by the terrain elevation (cloud base not lower than the ground surface + safety margin), volumetric clouds will not appear at the bottom of valleys or penetrate high mountains, achieving a deep integration of geographic semantics and visual effects.
[0087] In one possible implementation, the special effects shader is an atmospheric scattering shader, and the special effects texture information is an atmospheric scattering effect texture. The atmospheric scattering shader is invoked to obtain the solar zenith angle, atmospheric thickness, Rayleigh scattering coefficient, Mie scattering coefficient, and Earth's surface elevation from the special effects adaptation parameter set. Based on the local rendering coordinates, the viewing direction of the current fragment and the entry and exit points of the viewing direction relative to the Earth's outer shell are determined. Multi-step ray stepping sampling is performed along the viewing direction at the entry and exit points to obtain multiple atmospheric sampling points. This is based on the Rayleigh scattering model and the Mie scattering model. The Rayleigh scattering color component and the Mie scattering color component are calculated from the solar zenith angle, Rayleigh scattering coefficient, and Mie scattering coefficient. The Rayleigh scattering color component and the Mie scattering color component are weighted to obtain the atmospheric scattering color corresponding to each atmospheric sampling point. The atmospheric scattering color of each atmospheric sampling point is accumulated along the line of sight to obtain the accumulated atmospheric scattering color. The accumulated atmospheric scattering color is compensated for near-ground attenuation according to the surface altitude to obtain the compensated scattering color. The compensated scattering color is then determined as the atmospheric scattering effect texture.
[0088] In the embodiments of this specification, the atmospheric scattering shader can refer to a custom GPU fragment shader program written based on WebGL / GLSL, used to simulate Rayleigh scattering and Mie scattering that occur when sunlight passes through the Earth's atmosphere in the view space, generating an atmospheric optical model that includes effects such as sky color, horizon gradation, and distant fogging.
[0089] Atmospheric scattering textures can refer to RGBA textures output by an atmospheric scattering shader, representing the accumulated atmospheric scattering color and transmittance along the current viewing direction. This texture is used to blend with the main scene, achieving a realistic sky background, atmospheric perspective, and sunrise / sunset color changes. The solar zenith angle is the angle between sunlight and the local zenith direction (i.e., vertically upward), used to characterize the sun's altitude. A zenith angle of 0° indicates the sun is overhead (noon), and 90° indicates the sun is on the horizon. This angle directly affects atmospheric path length and scattering intensity. Atmospheric thickness can refer to the vertical distance from the Earth's surface to the outer edge of the atmosphere, typically taken as an empirical value (e.g., 80 km). In this application, it is used to construct a concentric spherical shell model centered on the Earth's core, defining the sampling range of light stepping.
[0090] The entry and exit points can refer to the two points where the line of sight intersects the outer shell of the Earth's atmosphere (usually modeled as a sphere with a radius equal to the Earth's radius plus the thickness of its atmosphere). The entry point can be the location where the line of sight first enters the atmosphere. The exit point can be the location where the line of sight leaves the atmosphere (if the line of sight is pointing towards space) or the point where it intersects with the Earth's surface (if the line of sight is pointing towards the ground). Together, they define the effective range of light travel.
[0091] Rayleigh scattering color components can refer to the RGB color values calculated based on the Rayleigh scattering model, emphasizing the blue channel and reflecting the selective enhancement of short-wavelength light by molecular-level scattering. Mie scattering color components can refer to the RGB color values calculated based on the Mie scattering model, approaching white or warm yellow, reflecting the forward scattering characteristics of aerosols on light across the entire wavelength range. Cumulative atmospheric scattering color can refer to the total scattering contribution of the entire optical path by integrating the scattered colors at all atmospheric sampling points along the line of sight (usually using exponential decay weighted summation).
[0092] Figure 5 This is an example diagram illustrating an atmospheric scattering rendering result according to an exemplary embodiment. For example... Figure 5 As shown, to achieve atmospheric scattering for geographic environment perception, the system performs the following steps during each frame rendering process: First, the atmospheric scattering shader is invoked, and key atmospheric optical parameters are extracted from the set of effects adapter parameters pre-generated by the effects adapter layer, including: Solar zenith angle: calculated from the current time and geographical location, reflecting the sun's altitude; Atmospheric thickness: An empirical value (e.g., 80 km) is used to construct the model of the large balloon shell; Rayleigh scattering coefficient and Mie scattering coefficient: characterize the ability of molecules and aerosols to scatter light of different wavelengths, respectively; Surface elevation: Query the elevation value (in meters) of the current fragment's location using topographic elevation data (DEM).
[0093] Next, based on the local rendering coordinates of the current fragment, the following is determined in the GPU shader: Line of sight: the normalized ray direction from the virtual camera through the pixel; The entry and exit points of the line of sight and the Earth's spherical shell: The Earth is modeled as a sphere with a radius of [radius value missing], and the outer edge of the atmosphere is a concentric spherical shell with a radius equal to the Earth's model plus the radius of the atmospheric thickness. By solving for the geometric intersection of the line of sight ray and the spherical shell, the effective range for the light to enter (entry point) and leave (exit point) the atmosphere is obtained.
[0094] Subsequently, multi-step light sampling is performed along the line of sight between the entrance and exit points. For example, the path is divided into 32-64 steps, and the three-dimensional coordinates, altitude, and atmospheric density of the sampling point are obtained at each step to form multiple atmospheric sampling points.
[0095] For each atmospheric sampling point, the Rayleigh scattering color component and the Mie scattering color component are calculated based on the Rayleigh scattering model and the Mie scattering model, combined with the solar zenith angle, Rayleigh scattering coefficient, and Mie scattering coefficient. Then, the two scattering color components are weighted to synthesize the atmospheric scattering color of that sampling point. The weights can be determined by the scattering coefficient ratio or visual optimization parameters; this application does not limit this. Furthermore, the scattering colors of all atmospheric sampling points are accumulated along the line of sight to obtain the final accumulated atmospheric scattering color, which includes the combined effects of sky background, distant haze, and solar glow.
[0096] Furthermore, near-ground attenuation compensation is introduced by incorporating ground elevation. Since atmospheric density is higher in low-altitude areas (such as basins and sea level), directly using the standard model would result in excessive scattering and a washed-out image. Therefore, the system constructs a compensation factor based on the ground elevation. The accumulated color is multiplied by this factor to obtain the compensated scattering color.
[0097] Ultimately, the compensated scattering color was determined to be an atmospheric scattering effect texture. This texture not only accurately reproduces the sky colors at different solar altitudes (such as azure at noon and orange-red at dusk), but also presents a consistent atmospheric perspective effect in different landform regions such as plateaus, plains, and basins by incorporating real terrain elevation information, thus avoiding the visual distortion caused by the one-size-fits-all approach of traditional models.
[0098] In step S109, the special effects texture information and the scene texture information in the target geographic scene information are fused together to generate the target rendering image; In the embodiments of this specification, scene texture information may refer to the basic geographic scene color texture generated by the native rendering pipeline of the map engine, including the final pixel colors of elements such as terrain, images, and 3D models. The target rendered image may refer to the final output image generated after all fusion and post-processing steps, which has geographic accuracy, optical realism, and visual smoothness, and can be directly presented to users or used for downstream applications such as screen recording and screenshots.
[0099] In one possible implementation, the special effects texture information is subjected to color correction or edge softening to obtain preprocessed texture information; the preprocessed texture information is then combined with the scene texture information in the target geographic scene information through multi-channel texture fusion to generate an intermediate composite image; global tone mapping and anti-aliasing post-processing are performed on the intermediate composite image to generate the target rendered image.
[0100] In the embodiments of this specification, the preprocessed texture information may refer to the special effects texture after color correction and / or edge softening, which serves as intermediate data before fusion to ensure good visual compatibility and spatial continuity in subsequent compositing.
[0101] Intermediate composite frames can refer to incomplete rendered frames generated after multi-channel fusion, containing the initial overlay results of the basic geographic scene and all special effects, but without global image enhancement processing.
[0102] For example, to integrate various advanced special effects, such as volumetric lighting, lens flare, volumetric clouds, and atmospheric scattering, into the geographical scene naturally and with high quality, the system executes the following scene fusion processing flow: First, the special effects texture information output by each effects shader is preprocessed. Because different effects have different generation mechanisms and dynamic ranges, direct overlay may lead to color imbalance or abrupt edges. Therefore, the system performs the following steps sequentially: Based on the overall lighting atmosphere of the current scene (such as warm colors at sunrise and cool colors at noon), adjust the white balance or shift the RGB channels of the special effects texture. For example, in a dusk scene, shift the default blue tone of the volumetric light towards orange-red to make it match the sky background; Apply Gaussian blur or distance field feathering to the alpha channel or brightness gradient of the special effects texture to eliminate hard edges, flickering or jagged edges caused by insufficient light step sampling or geometric alignment errors.
[0103] After the above processing, preprocessed texture information is obtained, and its visual style and spatial continuity are adapted to the main scene.
[0104] Next, the preprocessed texture information is fused with the scene texture information natively rendered by the map engine using a multi-channel texture fusion process. This fusion is completed during the GPU post-processing stage and specifically includes: Volumetric lighting and lens flare are additively blended to preserve high-brightness luminescence; volumetric clouds are blended using alpha to achieve a semi-transparent occlusion effect; atmospheric scattering textures, which inherently contain sky and distant fog, are typically used as a background layer or blended and overlaid using depth perception. All effects channels are blended in parallel according to priority or physical meaning to generate an intermediate composite image. This image already contains complete geographic features and effects, but global image optimization has not yet been performed.
[0105] Finally, perform global image post-processing on the intermediate composite images: Global tone mapping is mainly used because special effects calculations are often performed in high dynamic range (HDR), while display devices only support low dynamic range (LDR). The system uses Reinhard or ACES tone mapping operators to non-linearly compress brightness values to the [0,1] range, while preserving details of bright areas such as sunlight halos and cloud highlights, and avoiding overexposure or loss of dark areas.
[0106] Anti-aliasing post-processing mainly involves applying lightweight screen-space anti-aliasing algorithms (such as FXAA) to detect and smooth high-frequency color edges (such as building outlines and cloud boundaries), significantly reducing jagged edges and improving the overall smoothness of the image, without increasing geometric complexity or multi-sampling overhead.
[0107] After the above steps, the final target rendered image is generated. This image combines geographical accuracy, optical realism, visual consistency, and real-time interactive performance. This fusion strategy effectively solves problems such as superficial special effects, coarse image quality, and fragmented colors in existing technologies, providing a cinematic visual experience for high-end geographic visualization applications.
[0108] In step S111, the frame rate threshold is monitored for the target rendering screen to obtain the current frame rate information of the target rendering screen; and the special effects texture information of the target rendering screen is adjusted according to the comparison result between the frame rate information and the preset frame rate threshold.
[0109] In the embodiments described in this specification, the current frame rate information may refer to the average or instantaneous frame rate value of the most recent few frames, such as 5-10 frames within a sliding window, in FPS. This information reflects the actual pressure on the rendering pipeline caused by the current effects and scene complexity. The preset frame rate threshold may refer to a target performance indicator preset by the system, such as 30 FPS or 60 FPS, as a basis for determining whether to adjust the quality of effects.
[0110] In one possible implementation, if the current frame rate information is less than the preset frame rate threshold, at least one type of effect shader is selected, and the effect texture information of the current frame is downgraded according to the at least one type of effect shader; if the current frame rate information is greater than or equal to the preset frame rate threshold, scene rendering exit judgment processing is performed to obtain a scene rendering exit result; if the scene rendering exit result indicates exiting scene rendering, the rendering loop is stopped; if the scene rendering exit result indicates not exiting scene rendering, the next frame target rendering image is rendered.
[0111] For example, in order to optimize system resource usage while ensuring smooth interaction, the system executes a performance feedback-driven dynamic adjustment process after each frame is rendered, which specifically includes the following steps: First, the system monitors the frame rate threshold of the target rendered image that has just been rendered and calculates the current frame rate information. This frame rate information is then compared with a preset frame rate threshold to determine the processing strategy for the next frame.
[0112] When the system load is detected to be too high, i.e. the current frame rate is lower than the preset frame rate threshold, such as when the frame rate drops to 2 FPS due to complex terrain and multiple layers of volumetric clouds, the system enters a degradation adjustment mode: Choose at least one type of effects shader for simplification. The selection strategy can be based on preset priorities, such as reducing volumetric clouds first, then atmospheric scattering, or real-time cost assessment, such as disabling the most time-consuming effects; Perform downgrade adjustment processing on special effects texture information that has been generated in the current frame or will be generated in the next frame, including: The number of ray steps in the volumetric cloud shader was reduced from 64 to 32; temporal offsets for 3D Burmester noise were disabled, and cloud morphology was fixed to save texture sampling; the atmospheric scattering model was simplified from multiple scattering to a single scattering approximation; and low-resolution geometric textures were used for lens flares. These adjustments took effect in the next frame to ensure a smooth transition in visual quality and avoid abrupt flickering.
[0113] When the system runs smoothly, meaning the current frame rate is greater than or equal to the preset frame rate threshold, it indicates that the current effects load is acceptable. In this case, the system does not degrade performance but instead performs a scene rendering exit check to assess whether the rendering loop should continue. This check is based on at least one of the following contextual information: Has the user or AI system switched browser tabs or minimized the window? Is the map view container hidden? Has a pause rendering command been received from the application layer? Has the current scene been without user interaction and without animation update requirements for an extended period of time?
[0114] Based on the above judgment, the scene rendering exit result is generated as follows: If the result is "exit scene rendering" (e.g., the page is out of focus for more than 10 seconds), the rendering termination interface of the map engine is called to stop the rendering loop and release GPU and CPU resources; if the result is "not exiting scene rendering" (e.g., the user is still operating or the scene is in the foreground), the rendering processing of the next frame of the target rendering screen is scheduled normally to maintain high-quality special effects output.
[0115] Figure 6 This is a system block diagram illustrating a scene rendering system based on a map engine, according to an exemplary embodiment. (Refer to...) Figure 6 The system may include: The acquisition module 601 is used to acquire target geographic scene information and current frame buffer information; the current frame buffer information includes camera parameters and illumination parameters. The coordinate transformation module 603 is used to convert the geospatial coordinates in the target geographic scene information into rendering local coordinates based on the camera parameters and the lighting parameters. The parameter set determination module 605 is used to determine the geographical boundary constraints of the special effects rendering based on the terrain elevation data in the target geographical scene information, and generate a special effects adaptation parameter set based on the geographical boundary constraints. The special effects texture information generation module 607 is used to generate special effects texture information in the view space of the target geographic scene information based on the special effects shader, the special effects adaptation parameter set and the rendering local coordinates. In one possible implementation, the special effects texture information generation module 607 includes: The volumetric light shader invocation unit is used to invoke the volumetric light shader to filter out light source visibility flag information, terrain occlusion mask information and light intensity information from the effect adaptation parameter set. The viewing direction determination unit is used to determine the viewing direction of the current fragment in the view space and the position of the light source in the view space based on the rendering local coordinates. The sampling ray construction unit is used to construct a view space sampling ray from the current fragment to the light source based on the light source visibility indicator information, the light intensity information, the viewing direction of the current fragment in the view space, and the position of the light source in the view space; The ray sampling point determination unit is used to perform multi-step ray step sampling processing based on the sampled rays in the view space to obtain multiple ray sampling point information; An unobstructed sampling point determination unit is used to remove terrain-obstructed sampling point information from the multiple light sampling point information based on the terrain occlusion mask information to obtain unobstructed sampling point information; The transmittance sequence intensity unit is used to perturb the transmittance of the unobstructed sampling point information based on Burmester noise to obtain a noise-modulated transmittance sequence. A volumetric light effect texture determination unit is used to determine the volumetric light intensity based on the transmittance sequence, and to determine the volumetric light effect texture according to the volumetric light intensity.
[0116] In one possible implementation, the special effects texture information generation module 607 includes: The lens flare shader invocation unit is used to invoke the lens flare shader to obtain light source visibility information and light intensity information from the special effects adaptation parameter set. The all-black special effect texture generation unit is used to generate an all-black special effect texture when the light source visibility indicator information indicates that the light source is not visible, and to determine the all-black special effect texture as the lens flare special effect texture. A light source visibility indicator unit is used to determine the projection coordinates of the light source in the view space based on the rendering local coordinates and the position of the light source in the view space if the light source visibility indicator information indicates that the light source is visible. An initial lens flare image forming unit is used to overlay a preset geometric texture in the view space based on the projection coordinates to form an initial lens flare image; The lens flare effect texture generation unit is used to adjust the brightness of the initial lens flare image according to the illumination intensity information, and generate the lens flare effect texture.
[0117] In one possible implementation, the special effects texture information generation module 607 includes: The volumetric cloud shader invocation unit is used to invoke the volumetric cloud shader to obtain the lower limit of cloud base elevation, upper limit of cloud top elevation, illumination direction, illumination intensity information, scattering coefficient and absorption coefficient from the effect adaptation parameter set. A local voxel mesh construction unit is used to construct a local voxel mesh based on the rendering local coordinates; the vertical range of the local voxel mesh is between the lower limit of the cloud base elevation and the upper limit of the cloud top elevation. The volume cloud sampling point determination unit is used to perform ray step sampling processing on the local voxel mesh along the viewing direction of the current fragment to obtain multiple volume cloud sampling points; The offset noise value determination unit is used to perform temporal dynamic offset processing on the sampling coordinates of the three-dimensional Berlin noise texture based on the wind speed parameter to obtain the offset noise value; and to determine the cloud density of each volumetric cloud sampling point according to the offset noise value. A multiple scattering color determination unit is used to determine the multiple scattering color of each volumetric cloud sampling point based on the cloud density, the scattering coefficient, the absorption coefficient, the illumination direction, and the illumination intensity information. The volumetric cloud effect texture generation unit is used to accumulate the multiple scattering colors of multiple volumetric cloud sampling points along the viewing direction to generate the volumetric cloud effect texture.
[0118] In one possible implementation, the special effects texture information generation module 607 includes: The atmospheric scattering shader invocation unit is used to invoke the atmospheric scattering shader to obtain the solar zenith angle, atmospheric thickness, Rayleigh scattering coefficient, Mie scattering coefficient, and surface elevation from the special effects adaptation parameter set. The entry and exit point determination unit determines the viewing direction of the current fragment and the entry and exit points of the viewing line with the shell of the Earth balloon based on the rendered local coordinates. An atmospheric sampling point determination unit is used to perform multi-step light stepping sampling processing at the entrance point and the exit point along the line of sight to obtain multiple atmospheric sampling points. The scattering color component determination unit is used to calculate the Rayleigh scattering color component and the Mie scattering color component based on the Rayleigh scattering model, the Mie scattering model, the solar zenith angle, the Rayleigh scattering coefficient, and the Mie scattering coefficient. An atmospheric scattering color determination unit is used to weight the Rayleigh scattering color component and the Mie scattering color component to obtain the atmospheric scattering color corresponding to each atmospheric sampling point. The cumulative atmospheric scattering color determination unit is used to accumulate the atmospheric scattering colors of each atmospheric sampling point along the line of sight to obtain the cumulative atmospheric scattering color. The near-ground attenuation compensation unit is used to perform near-ground attenuation compensation on the accumulated atmospheric scattering color according to the surface elevation to obtain the compensated scattering color; and to determine the compensated scattering color as the atmospheric scattering effect texture.
[0119] The target rendering image generation module 609 is used to perform scene fusion processing on the special effects texture information and the scene texture information in the target geographic scene information to generate the target rendering image.
[0120] In one possible implementation, the target rendering image generation module 609 includes: A preprocessing texture information determination unit is used to perform color correction or edge softening processing on the special effects texture information to obtain preprocessing texture information; The intermediate composite image generation unit is used to perform multi-channel texture fusion processing on the preprocessed texture information and the scene texture information in the target geographic scene information to generate an intermediate composite image. The target rendering image generation unit is used to perform global tone mapping and anti-aliasing post-processing on the intermediate composite image to generate the target rendering image.
[0121] The special effects texture adjustment module 611 is used to monitor the frame rate threshold of the target rendering screen to obtain the current frame rate information of the target rendering screen; and to adjust the special effects texture information of the target rendering screen according to the comparison result between the current frame rate information and the preset frame rate threshold.
[0122] In one possible implementation, the special effects texture adjustment module 611 includes: The downgrade adjustment unit is used to select at least one type of effect shader when the current frame rate information is less than the preset frame rate threshold, and to perform downgrade adjustment processing on the current frame effect texture information according to the at least one type of effect shader. The scene rendering exit unit is used to perform scene rendering exit judgment processing when the current frame rate information is greater than or equal to the preset frame rate threshold, and obtain the scene rendering exit result. The rendering loop stop unit is used to stop the rendering loop if the scene rendering exit result indicates that the scene rendering is exiting. The rendering processing unit is used to perform rendering processing on the next frame target rendering screen when the scene rendering exit result indicates that scene rendering has not exited.
[0123] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0124] Figure 7 This is a block diagram illustrating an electronic device for scene rendering based on a map engine, according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown, the electronic device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a scene rendering method based on a map engine. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or mouse.
[0125] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0126] Figure 8This is a block diagram illustrating an electronic device for scene rendering based on a map engine, according to an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown, the electronic device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a scene rendering method based on a map engine.
[0127] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0128] In an exemplary embodiment, an electronic device is also provided, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement a map engine-based scene rendering method as described in the embodiments of this application.
[0129] In an exemplary embodiment, a computer-readable storage medium is also provided, which, when executed by a processor of an electronic device, enables the electronic device to perform the map engine-based scene rendering method of this application embodiment. The computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device, etc.
[0130] In an exemplary embodiment, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute the map engine-based scene rendering method in the embodiments of this application.
[0131] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0132] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0133] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A scene rendering method based on a map engine, characterized in that, include: Obtain target geographic scene information and current frame buffer information; The current frame buffer information includes camera parameters and lighting parameters; Based on the camera parameters and the lighting parameters, the geospatial coordinates in the target geographic scene information are converted into local rendering coordinates; Based on the terrain elevation data in the target geographic scene information, determine the geographic boundary constraints for special effects rendering, and generate a set of special effects adaptation parameters based on the geographic boundary constraints. Based on the special effects shader, the special effects adaptation parameter set, and the rendering local coordinates, special effects texture information is generated in the view space of the target geographic scene information. The special effects texture information is fused with the scene texture information in the target geographic scene information to generate the target rendered image; The frame rate threshold of the target rendered image is monitored to obtain the current frame rate information of the target rendered image; Based on the comparison between the frame rate information and the preset frame rate threshold, the special effects texture information of the target rendered image is adjusted.
2. The scene rendering method based on a map engine according to claim 1, characterized in that, The special effects shader includes a volumetric light shader; the special effects texture information includes a volumetric light effect texture. The generation of special effects texture information in the view space of the target geographic scene information based on the special effects shader, the special effects adaptation parameter set, and the rendering local coordinates includes: The volumetric light shader is invoked to filter out light source visibility information, terrain occlusion mask information, and light intensity information from the set of special effects adaptation parameters. Based on the rendered local coordinates, determine the viewing direction of the current fragment in the view space and the position of the light source in the view space; Based on the light source visibility information, the light intensity information, the current fragment's line of sight in the view space, and the light source's position in the view space, a view space sampling ray is constructed from the current fragment to the light source; Based on the view space sampling ray, multi-step ray step sampling processing is performed to obtain multiple ray sampling point information; Based on the terrain occlusion mask information, the terrain occlusion sampling point information in the multiple light sampling point information is removed to obtain the unoccluded sampling point information; Based on the Berlin noise, the transmittance of the unobstructed sampling point information is perturbed to obtain a noise-modulated transmittance sequence. Based on the transmittance sequence, the volumetric light intensity is determined, and based on the volumetric light intensity, the volumetric light effect texture is determined.
3. The scene rendering method based on a map engine according to claim 1, characterized in that, The special effects shader includes a lens flare shader; the special effects texture information includes a lens flare effect texture. The generation of special effects texture information in the view space of the target geographic scene information based on the special effects shader, the special effects adaptation parameter set, and the rendering local coordinates includes: The lens flare shader is invoked to obtain light source visibility information and light intensity information from the effect adaptation parameter set; When the light source visibility indicator information indicates that the light source is not visible, a completely black special effect texture is generated, and the completely black special effect texture is identified as the lens flare special effect texture. If the light source visibility flag information indicates that the light source is visible, the projected coordinates of the light source in the view space are determined based on the rendered local coordinates and the position of the light source in the view space. Based on the projection coordinates, a preset geometric texture is superimposed in the view space to form an initial lens flare image; Based on the light intensity information, the brightness of the initial lens flare image is adjusted to generate the lens flare effect texture.
4. The scene rendering method based on a map engine according to claim 1, characterized in that, The special effects shader includes a volumetric cloud shader; the special effects texture information includes a volumetric cloud effect texture. The generation of special effects texture information in the view space of the target geographic scene information based on the special effects shader, the special effects adaptation parameter set, and the rendering local coordinates includes: The volumetric cloud shader is invoked to obtain the lower limit of cloud base elevation, upper limit of cloud top elevation, direction of illumination, intensity of illumination, scattering coefficient and absorption coefficient from the effect adaptation parameter set; A local voxel mesh is constructed based on the local rendering coordinates; the vertical range of the local voxel mesh is between the lower limit of the cloud base elevation and the upper limit of the cloud top elevation. The local voxel mesh is subjected to ray step sampling along the line of sight of the current fragment to obtain multiple volumetric cloud sampling points; Based on the wind speed parameters, the sampling coordinates of the three-dimensional Berlin noise texture are subjected to temporal dynamic offset processing to obtain the offset noise value; and the cloud density of each volumetric cloud sampling point is determined according to the offset noise value. The multiple scattering color of each volumetric cloud sampling point is determined based on the cloud density, scattering coefficient, absorption coefficient, illumination direction, and illumination intensity information. Along the line of sight, the multiple scattering colors of multiple volumetric cloud sampling points are accumulated to generate the volumetric cloud effect texture.
5. The scene rendering method based on a map engine according to claim 1, characterized in that, The special effects shader includes an atmospheric scattering shader; the special effects texture information includes an atmospheric scattering effect texture. The generation of special effects texture information in the view space of the target geographic scene information based on the special effects shader, the special effects adaptation parameter set, and the rendering local coordinates includes: The atmospheric scattering shader is invoked to obtain the solar zenith angle, atmospheric thickness, Rayleigh scattering coefficient, Mie scattering coefficient, and Earth's surface elevation from the special effects adaptation parameter set; The view direction of the current fragment and the entry and exit points of the view with respect to the Earth's giant balloon shell are determined based on the rendered local coordinates. Multiple atmospheric sampling points are obtained by performing multi-step light stepping sampling processing at the entrance point and the exit point along the line of sight. Based on the Rayleigh scattering model, the Mie scattering model, the solar zenith angle, the Rayleigh scattering coefficient, and the Mie scattering coefficient, the Rayleigh scattering color components and the Mie scattering color components are calculated. The Rayleigh scattering color component and the Mie scattering color component are weighted to obtain the atmospheric scattering color corresponding to each atmospheric sampling point. The atmospheric scattering color of each atmospheric sampling point is accumulated along the line of sight to obtain the accumulated atmospheric scattering color; The cumulative atmospheric scattering color is compensated for near-ground attenuation based on the surface elevation to obtain a compensated scattering color; and the compensated scattering color is determined as the atmospheric scattering effect texture.
6. The scene rendering method based on a map engine according to claim 1, characterized in that, The step of adjusting the texture information of the next frame of the target rendered image based on the comparison result between the current frame rate information and the preset frame rate threshold includes: If the current frame rate information is less than the preset frame rate threshold, at least one type of effect shader is selected, and the current frame effect texture information is downgraded and adjusted according to the at least one type of effect shader. If the current frame rate information is greater than or equal to the preset frame rate threshold, a scene rendering exit judgment process is performed to obtain a scene rendering exit result. If the scene rendering exit result indicates that scene rendering is exiting, then the rendering loop stops; If the scene rendering exit result indicates that scene rendering has not exited, the next frame of the target rendering image will be rendered.
7. The scene rendering method based on a map engine according to claim 1, characterized in that, The step of performing scene fusion processing on the special effects texture information and the scene texture information in the target geographic scene information to generate the target rendered image includes: The special effects texture information is subjected to color correction or edge softening to obtain preprocessed texture information; The preprocessed texture information and the scene texture information in the target geographic scene information are subjected to multi-channel texture fusion processing to generate an intermediate composite image; Global tone mapping and anti-aliasing post-processing are performed on the intermediate composite image to generate the target rendered image.
8. A scene rendering system based on a map engine, characterized in that, include: The acquisition module is used to acquire target geographic scene information and current frame buffer information; The current frame buffer information includes camera parameters and lighting parameters; The coordinate transformation module is used to convert the geospatial coordinates in the target geographic scene information into rendering local coordinates based on the camera parameters and the lighting parameters; The parameter set determination module is used to determine the geographical boundary constraints for special effects rendering based on the terrain elevation data in the target geographical scene information, and generate a special effects adaptation parameter set based on the geographical boundary constraints. The special effects texture information generation module is used to generate special effects texture information in the view space of the target geographic scene information based on the special effects shader, the special effects adaptation parameter set and the rendering local coordinates. The target rendering image generation module is used to perform scene fusion processing on the special effects texture information and the scene texture information in the target geographic scene information to generate the target rendering image. The special effects texture adjustment module is used to monitor the frame rate threshold of the target rendering image and obtain the current frame rate information of the target rendering image; Based on the comparison between the current frame rate information and the preset frame rate threshold, the special effects texture information of the target rendering screen is adjusted.
9. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the scene rendering method based on the map engine as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the scene rendering method based on the map engine as described in any one of claims 1 to 7.