Scene switching method and device, vehicle and electronic equipment
By maintaining the rendering of the first scene during 3D car model scene transitions and utilizing gradient and tweening animation techniques, the visual interruption problem was solved, achieving a seamless scene transition experience.
Patent Information
- Application Number
- CN202511660287.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-13
- Publication Date
- 2026-03-13
AI Technical Summary
Existing technologies suffer from visual interruptions or abrupt transitions when switching between 3D car model scenes, making it difficult to meet users' needs for a seamless switching experience.
By maintaining the rendering of the first scene, the target image is generated and rendered in a gradient on the full-screen bulletin board. Combined with tweening animation technology, the camera parameters are adjusted synchronously to ensure visual continuity and smooth transition.
It achieves visual continuity and smooth transition in 3D car model scene switching, avoiding black screen interruptions and dizziness, and improving the user experience.
Smart Images

Figure CN121650447A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent cockpit technology, specifically to a scene switching method, device, vehicle, and electronic equipment. Background Technology
[0002] With the rapid development of smart cockpit technology, in-vehicle desktop systems have become the core carrier of human-computer interaction. Currently, users mainly use in-vehicle desktops for high-frequency functions such as desktop, navigation, and music. Among these, three-dimensional (3D) car models are a key element in enhancing the user's visual immersion. If they can maintain continuous display during scene transitions, they will significantly enhance the continuity and smoothness of the user experience.
[0003] However, existing technologies generally suffer from visual interruptions or abrupt transitions when switching between 3D car model scenes, failing to meet users' demands for a seamless switching experience. For example, some in-vehicle desktop systems use a black screen gradual transition method when switching scenes, that is, covering the current scene with a black screen and then gradually revealing the target scene. Although this method can achieve a basic transition effect, the black screen process creates a visual interruption, disrupting the continuity of the user experience.
[0004] Therefore, how to achieve visual continuity of 3D car models during scene switching has become a key issue that urgently needs to be addressed. Summary of the Invention
[0005] In view of the shortcomings of the prior art, the purpose of this application is to provide a scene switching method, device, vehicle and electronic device, which aims to solve the problem of visual interruption or abrupt transition in the scene switching process of 3D car models in the prior art.
[0006] In a first aspect, embodiments of this application provide a scene switching method, the method comprising: in response to a scene switching instruction that a target object switches from its current location in a first scene to a second scene, maintaining the rendering of a first scene image in the first scene; generating a target image; wherein the target image is used to characterize the image corresponding to background objects other than the target object in the second scene image of the second scene; the image area corresponding to the target object in the first scene image and the second scene image are consistent; and performing gradient rendering from completely transparent to completely opaque on a full-screen bulletin board on the target image, so as to achieve scene switching from the first scene to the second scene by superimposing the gradient target image on the first scene image.
[0007] Based on the aforementioned technical means, this application does not immediately destroy the first scene when switching scenes, but maintains the normal rendering of the first scene as the underlying image. This not only provides a foundation for subsequent rendering but also fundamentally avoids the interruption caused by black screens or sudden image disappearances. Subsequently, by pre-eliminating the target object, a background image containing only the second scene image is generated. This ensures that the target object itself will not exhibit double images or sudden jumps during transition animations. Furthermore, by setting the image area corresponding to the target object in both the first and second scene images to be consistent, the screen proportion and position of the target object are completely identical in both scenes. This avoids dizziness caused by sudden changes in perspective during scene switching. Finally, a full-screen bulletin board covering the entire screen is created, and the target image is pasted as a texture onto the bulletin board. Then, by changing the transparency value of this texture, a gradient effect from completely transparent (100% visible of the first scene) to completely opaque (100% visible of the second scene background) is achieved, improving the user's visual continuity.
[0008] One possible approach is to perform a gradient rendering of the target image from completely transparent to completely opaque on a full-screen bulletin board, including: using tweening animation techniques to perform a linear gradient rendering of the target image from completely transparent to completely opaque on a full-screen bulletin board.
[0009] Based on the above technical means, this application can directly utilize tween animation technology to quickly calculate the transparency of intermediate transition frames (i.e., tween frames) according to the pre-set animation duration, the animation's start state (completely transparent), and the animation's end state (completely opaque). This ensures that the intervals between frames where transparency changes are uniform, thereby avoiding jumps or stutters that may be caused by manual control and ensuring the smoothness of the animation.
[0010] One possible approach involves rendering a target image on a full-screen bulletin board with a gradient from completely transparent to completely opaque, including: determining first camera parameters for a camera in a first scene; determining second camera parameters for a camera in a second scene; and employing tweening animation techniques to simultaneously perform a linear gradient adjustment of the camera parameters from the first to the second camera parameters and to render the target image on the full-screen bulletin board with a gradient from completely transparent to completely opaque, wherein the rendering position of objects in the target image on the full-screen bulletin board changes with the changes in the camera parameters.
[0011] Based on the aforementioned technical means, because the camera is moving, the user will perceive not only a change in the background image, but also a movement of the entire viewing angle in space. Therefore, this application utilizes tweening animation technology to calculate an intermediate value between the first and second camera parameters based on the current animation progress (e.g., 30%), and updates the camera parameters in real time. Simultaneously, the transparency of the target image on the full-screen bulletin board is adjusted according to the same animation progress (e.g., 30% progress corresponds to 30% opacity). By using the same tweening animation controller to drive these two processes, absolute synchronization is ensured, meaning the camera's movement rhythm and the transparency change rhythm are completely consistent, avoiding visual illusions that may occur due to asynchrony (e.g., the camera is almost in place before the new background has just begun to appear).
[0012] One possible approach involves employing tweening animation technology, simultaneously adjusting the camera's parameters linearly from a first set of parameters to a second set, and rendering the target image on the full-screen bulletin board with a gradient from completely transparent to completely opaque. This includes: for each animation frame generated by the tweening animation technology, determining the corresponding transparency and target buffer image; wherein the target buffer image represents the rendering position of objects in the target image on the full-screen bulletin board as the target camera parameters change; the target camera parameters are the camera parameters at the time of the animation frame. Based on the transparency and the target buffer image, the target image is rendered on the full-screen bulletin board to obtain the animation frame.
[0013] Based on the aforementioned techniques, since the target buffer image is regenerated for each frame according to the current camera parameters, it can be ensured that the image always maintains the correct perspective that perfectly matches the current viewpoint. When the camera rotates, objects in the background will undergo correct parallax shift; when the camera moves forward, objects will have the correct size changes. The blending of each frame is based on the current transparency and the target buffer image, thereby achieving pixel-level precise visual fusion. This ensures that every frame of the transition animation is visually harmonious, without any tearing or flickering.
[0014] In one possible approach, generating the target image includes: loading scene resources of a second scene; wherein the scene resources include the spatial position of a background object relative to the target object and the shape information of the background object. The target image is then generated based on the scene resources and the image region corresponding to the target object in the first scene image.
[0015] Based on the aforementioned technical means, upon receiving a switching instruction, the system does not immediately perform a visual switch. Instead, it first loads the scene resources necessary to constitute the second scene in the background (or asynchronously). This avoids stuttering caused by suddenly loading large resources during a smooth gradient animation, and is a key technical guarantee for achieving a seamless experience. Subsequently, the scene resources and the image region corresponding to the target object in the first scene image can be quickly used to generate a target image that excludes the target object and only contains the background of the second scene.
[0016] In one possible approach, the process of rendering the first scene image of the first scene includes: rendering a first image region corresponding to the target object in the first scene image on a first layer, and rendering a second image region in the first scene image other than the first image region on a second layer. Based on this, the scene switching method further includes: after switching to the second scene, rendering the target image on the second layer, and stopping the rendering of the target image on the full-screen bulletin board.
[0017] Based on the aforementioned technical means, this application separates the first scene image into a first layer and a second layer for rendering, which can achieve separation of rendering concerns and improve rendering efficiency and flexibility. Furthermore, once the transition animation from the first scene to the second scene is complete, rendering the target image on the full-screen bulletin board stops, immediately releasing relevant memory and computing resources (such as video memory for storing textures), avoiding resource waste. Moreover, since the target image rendered on the bulletin board is exactly the same as the image to be set on the second layer, users will not see any flickering or jumping on the screen, ensuring visual consistency and achieving a seamless transition.
[0018] One possible approach to the scene switching method also includes: after rendering the target image on the second layer, destroying the second image region.
[0019] Based on the above technical means, after rendering the target image on the second layer, this application destroys the second image area, which can immediately release the relevant memory and computing resources (such as the video memory for saving textures), thus avoiding resource waste.
[0020] In one possible approach, camera parameters include: position, rotation, and field of view.
[0021] Secondly, embodiments of this application provide a scene switching device, which includes a processing unit, a generation unit, and a rendering unit.
[0022] The processing unit is used to maintain the rendering of the first scene image of the first scene in response to a scene switching instruction from the target object to the second scene.
[0023] The generation unit is used to generate a target image. The target image represents the image corresponding to background objects other than the target object in the second scene image of the second scene; the image region corresponding to the target object is the same in both the first scene image and the second scene image.
[0024] The rendering unit is used to perform gradient rendering of the target image from completely transparent to completely opaque on the full-screen bulletin board, so as to achieve scene switching from the first scene to the second scene by overlaying the gradient target image on the first scene image.
[0025] In one possible approach, the rendering unit is specifically used to render a target image on a full-screen bulletin board using a tweening technique, with a linear gradient from completely transparent to completely opaque.
[0026] In one possible implementation, the rendering unit includes: a first determining unit, a second determining unit, and a rendering subunit. The first determining unit determines first camera parameters for a camera in a first scene. The second determining unit determines second camera parameters for a camera in a second scene. The rendering subunit employs tweening animation techniques to simultaneously perform a linear gradient adjustment of the camera parameters from the first to the second camera parameters and to perform a gradient rendering of the target image on a full-screen bulletin board from completely transparent to completely opaque. The rendering position of objects in the target image on the full-screen bulletin board changes with the camera parameters.
[0027] In one possible approach, a rendering subunit is specifically used to determine the transparency and target buffer image corresponding to each animation frame generated by the tweening technique. The target buffer image represents the rendering position of objects in the target image on the full-screen bulletin board as the target camera parameters change. The target camera parameters are the camera parameters of the camera in the animation frame. Based on the transparency and target buffer image, the target image is rendered on the full-screen bulletin board to obtain the animation frame.
[0028] In one possible approach, the generation unit includes a loading subunit and a generation subunit. The loading subunit loads scene resources from a second scene; these scene resources include the spatial position of background objects relative to the target object and the morphological information of the background objects. The generation subunit generates a target image based on the scene resources and the image region corresponding to the target object in the first scene image.
[0029] In one possible approach, the processing unit includes a first processing subunit and a second processing subunit. The first processing subunit is used to render a first image region corresponding to the target object in a first scene image on a first layer, and to render a second image region in the first scene image other than the first image region on a second layer. Based on this, in the scene switching method, the second processing subunit is used to render the target image on the second layer after switching to the second scene, and to stop rendering the target image on the full-screen bulletin board.
[0030] In one possible approach, the processing unit is also used to destroy the second image region after rendering the target image on the second layer.
[0031] Thirdly, embodiments of this application provide a vehicle equipped with the scene switching device described in the second aspect above.
[0032] Fourthly, embodiments of this application provide an electronic device, including: a processor; and a memory for storing processor-executable instructions. The processor is configured to execute instructions to implement the scene switching method described in the first aspect and any possible implementation thereof.
[0033] Fifthly, this application provides a computer-readable storage medium that, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform the scene switching method described in the first aspect and any of its possible implementations.
[0034] Sixthly, embodiments of this application provide a computer program product, which includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the scene switching method described in the first aspect and any possible implementation thereof.
[0035] It should be noted that the technical effects of any of the implementation methods in aspects two through six can be found in the technical effects of the corresponding implementation methods in aspect one, and will not be repeated here.
[0036] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of this application or the background art, the accompanying drawings used in the embodiments of this application will be described below.
[0038] Figure 1 This is a schematic diagram of the structure of a scene switching system provided in an embodiment of this application; Figure 2A flowchart illustrating a scene switching method provided in an embodiment of this application; Figure 3 This is a schematic diagram illustrating how a 3D car model switches from its current desktop scene to a navigation scene or an advanced driver assistance scene, as provided in an embodiment of this application. Figure 4 This is a schematic diagram of the structure of a scene switching device provided in an embodiment of this application; Figure 5 This is a block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0039] To enable those skilled in the art to better understand the technical solutions of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0040] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application 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 this application described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0041] In the embodiments of this application, the words "exemplary," "for example," or "for instance" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the words "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a specific manner.
[0042] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0043] The scene switching method provided in this application can be applied to vehicles. Vehicles can also be referred to as vehicles, mobile carriers, electric vehicles (EVs), hybrid electric vehicles (HEVs), plug-in hybrid electric vehicles (PHEVs), fuel cell vehicles (FCVs), autonomous vehicles, intelligent and connected vehicles (ICVs), driverless vehicles, etc.
[0044] In this application, the vehicle can be a sedan, a sport utility vehicle (SUV), a truck, an electric vehicle, a motorcycle, a tricycle, a special vehicle (such as an ambulance, fire truck, police car, etc.), a driverless taxi, an intelligent connected bus, an autonomous logistics vehicle, an electric truck, etc. Furthermore, this method is also applicable to various special-purpose vehicles, such as agricultural vehicles, mining vehicles, forestry vehicles, airport vehicles, and port vehicles. This application does not impose specific limitations in this regard.
[0045] like Figure 1 As shown in the figure, a scene switching system provided in this application embodiment includes: a cockpit domain controller (CDC) 101 and a central control screen 102 deployed in a vehicle 100. The CDC 101 and the central control screen 102 are communicatively connected.
[0046] In some embodiments, users can send scene switching commands to CDC101 by touching the scene switching icon on the central control screen 102 or by using a voice assistant. The scene switching command instructs the target object to switch from its current first scene to a second scene. Accordingly, in response to the scene switching command indicating that the target object is switching from its current first scene to the second scene, CDC101 can maintain the rendering of the first scene image using a camera, so that the central control screen 102 displays the first scene image and the target object.
[0047] Next, the CDC101 can generate a target image, which represents the background objects (excluding the target object) in the second scene image of the second scene. The image area corresponding to the target object in the first scene image and the second scene image are the same. Finally, the CDC101 can perform a gradient rendering of the target image from completely transparent to completely opaque on a full-screen bulletin board set directly in front of the camera, so as to achieve scene switching from the first scene to the second scene by overlaying the gradient target image on the first scene image.
[0048] For ease of understanding, the scene switching method provided in the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0049] like Figure 2 As shown in the embodiments of this application, a scene switching method includes: S201. In response to a scene switching instruction that the target object switches from the current first scene to the second scene, maintain the rendering of the first scene image of the first scene.
[0050] The scenarios can include, but are not limited to, 3D scenarios such as 3D desktop scenarios, advanced driver assistance scenarios (or navigation scenarios), and music scenarios. For example, the first scenario can be a 3D desktop scenario and the second scenario can be an advanced driver assistance scenario, or the first scenario can be an advanced driver assistance scenario and the second scenario can be a 3D desktop scenario.
[0051] The target objects may include, but are not limited to: 3D car models, in-vehicle virtual assistants, 3D robots, 3D virtual characters and game characters, without any limitation.
[0052] In some embodiments, users can send scene switching commands to CDC101 by touching the scene switching icon on the central control screen or by using a voice assistant. The scene switching command is used to instruct the target object to switch from the current first scene to the second scene.
[0053] Accordingly, the CDC can maintain the rendering of the first scene image in the first scene in response to a scene switching command that causes the target object to switch from its current location in the first scene to the second scene. Specifically, the CDC can use the camera to render the first image region corresponding to the target object in the first scene image on the first layer, and render the second image region in the first scene image excluding the first image region on the second layer. That is, the first layer is used to display the target object, and the second layer is used to display the scene image in the first scene image excluding the target object.
[0054] For example, suppose the first scene is a 3D desktop scene, the target object is a 3D car model, and the first scene image includes the 3D car model, the in-vehicle 3D rotating display stand, and desktop UI components (such as speedometer, map cards, etc.). In this case, the camera can render the 3D car model on the first layer, and render the in-vehicle 3D rotating display stand and desktop UI components on the second layer. The final image output to the central control screen is the first scene image.
[0055] S202. Generate the target image.
[0056] The target image is used to represent the background objects in the second scene image, excluding the target object. Essentially, the target image is an image with a transparent hole in the center containing the shape of the target object (such as a 3D car model).
[0057] In this scenario, the image regions corresponding to the target object in the first scene image and the second scene image are identical. That is, the position, camera viewpoint, focal length, and other rendering parameters of the target object (such as a 3D car model) are completely consistent in both the first and second scene images. This ensures that the outline of the target image obtained after removing the target object is perfectly aligned with the target object in the underlying first scene image.
[0058] In some embodiments, the CDC can load scene resources of a second scene in the background. Then, the CDC can generate a target image based on the scene resources and the image region corresponding to the target object in the first scene image. In this embodiment, the scene resources may include the spatial position of background objects relative to the target object and the morphological information of the background objects. The background objects may include, but are not limited to, environmental elements such as buildings, vegetation, road surfaces (e.g.), sky, streetlights, and the target object display stand.
[0059] The morphological information of the background object refers to the geometric shape and appearance information of the background object itself, which defines the visual appearance of the background object. Appearance information may include the texture and material of the background object (such as specular intensity, normal map, and diffuse color), etc., which are not limited in this application.
[0060] The spatial position of a background object relative to the target object refers to the relative orientation and distance between the background object and the target object in three-dimensional / two-dimensional space. This defines the composition and layout of the background object, which is crucial for achieving consistency between the image areas corresponding to the target object in the first and second scene images. Specifically, using the target object as a reference, the CDC needs to know the position of the background objects in the second scene. For example, the road should be laid below the 3D car model, the vegetation should be positioned a certain distance to the left of the 3D car model, and the sky should appear above the 3D car model. The coordinates of all these background objects are defined based on a common reference frame (usually the initial position and orientation of the 3D car model).
[0061] For example, CDC can capture a second scene image of the second scene using a scene capture component (such as the SceneCapture2D component), and perform image calibration between the second scene image and the first scene image to ensure that the image area corresponding to the 3D car model in the first scene image and the second scene image are consistent. When rendering the first scene image using a camera, CDC can use stencil buffering technology or specific shader technology to mark the pixel area occupied by the 3D car model in the stencil buffer (for example, setting the stencil value of all 3D car model areas to 1, and setting the background area of the first scene image other than the 3D car model to 0), thus obtaining the stencil buffer image corresponding to the first scene.
[0062] Afterwards, CDC can use image processing techniques (such as template testing and mask rendering) to set the pixel area corresponding to the 3D car model in the second scene image to transparent (Alpha value is 0) based on the template buffer image corresponding to the first scene, and only retain the background part of the second scene image, and finally obtain the target image where the 3D car model area is completely transparent and the background area is completely opaque.
[0063] For example, the CDC can generate a target image by referring to the following steps (1)-(6), wherein the image regions corresponding to the 3D car model in the first scene image and the second scene image are consistent.
[0064] (1) float2 UV=ScreenPosition.ViewportUV; Among them, UV is a temporary variable declared as a two-dimensional floating-point number (float2); ScreenPosition is a set of nodes representing the screen position built into Unreal Engine; this step can obtain the two-dimensional coordinates (UV) of any pixel in the first image scene on the central control screen through ScreenPosition.ViewportUV.
[0065] (2) float3 Color=Texture2DSample(CaptureTexture, CaptureTextureSampler, UV); Here, Color is a temporary variable of type 3 floating-point number (float3); CaptureTexture represents the second scene image (i.e., texture image); CaptureTextureSampler represents the texture sampler; through this step, the texture sampling function Texture2DSample can be used to sample the color value Color corresponding to any pixel from CaptureTexture based on the 2D coordinates UV of any pixel.
[0066] (3) float StencilValue=Texture2DSample(CustomStencilTexture, CustomStencilTextureSampler, UV); Here, StencilValue is a temporary variable of type float; CustomStencilTextureSampler represents the stencil buffer image corresponding to the first scene, with the stencil value of each pixel in the 3D car model area set to 1, and the stencil value of each pixel in the background area of the first scene image other than the 3D car model set to 0; CustomStencilTextureSampler represents the stencil value sampler; through this step, the texture sampling function Texture2DSample can be used to sample the stencil value of the current pixel from CustomStencilTexture based on the two-dimensional coordinates UV of the current pixel; (4) float StencilAlpha=step(1-1e-5,StencilValue); Here, `StencilAlpha` is a temporary variable of type `float`; the `step(a, x)` function is a step function. `StencilValue ≤ 1 - 1e-5 (0.9999)`, `StencilAlpha` is 1; `StencilValue > 1 - 1e-5 (0.9999)`, `StencilAlpha` is 0. That is, if `StencilValue` (the sampled template value) is greater than 1 - 1e-5, it means the current pixel belongs to the 3D car model region, and the `step` function returns 0. If `StencilValue` is less than or equal to 1 - 1e-5, it means the current pixel belongs to a background region other than the 3D car model region, and the `step` function returns 0. This step uses the `step` function to invert the template values of each pixel in the 3D car model region and other background regions in the template buffer image corresponding to the first scene, thus obtaining the target template buffer image.
[0067] (5) float FinalAlpha=Alpha*StencilAlpha; Here, FinalAlpha is a temporary variable of type floating-point (float); Alpha represents the transparency image of the second scene image, and StencilAlpha represents the stencil buffer image. This step determines the target buffer image using the transparency image of the second scene image and the stencil buffer image. For example, for the background pixels in areas other than the 3D car model: StencilAlpha is 0, so FinalAlpha = Alpha * 0 = 0 (completely transparent); for the pixels in the 3D car model area: StencilAlpha is 1, so FinalAlpha = Alpha * 1 = Alpha (Alpha increases linearly from 0 to 1 during scene switching).
[0068] (6) return float4(Color, FinalAlpha); This step outputs a target image, in which the 3D car model area is transparent (Alpha=0), while the background area is opaque and contains the color of the second scene image.
[0069] S203. Perform gradient rendering on the target image from completely transparent to completely opaque on the full-screen bulletin board, so as to achieve scene switching from the first scene to the second scene by overlaying the gradient target image on the first scene image.
[0070] In some embodiments, CDC can create a full-screen bulletin board covering the camera viewport directly in front of the camera, and set the transparency (Alpha) of the full-screen bulletin board to 0 (i.e., completely transparent). The full-screen bulletin board is a rectangular panel that always faces the camera, much like placing a full-screen transparent glass panel in front of a screen. Based on this, after generating the target image, CDC can use tweening animation techniques to perform a linear gradient rendering of the target image from completely transparent to completely opaque on the full-screen bulletin board, thereby achieving scene switching from the first scene to the second scene.
[0071] For example, CDC can use 0-1 second tween animation interpolation to linearly increase the transparency value alpha of the target image (e.g., linearly increasing from 0 to 1) to render a linear gradient of the target image from completely transparent to completely opaque onto a full-screen bulletin board.
[0072] In some embodiments, after switching to the second scene, the CDC can use the camera to render the target image on the second layer and stop rendering the target image on the full-screen bulletin board. Furthermore, after rendering the target image on the second layer, the second image area and the full-screen bulletin board are destroyed. Finally, the CDC can use the camera to render the target image and the target object, so that the central control screen ultimately displays the target object and the background image of the second scene.
[0073] Based on the above technical solution, when switching scenes, the first scene is not immediately destroyed, but its normal rendering is maintained. As the underlying image, it not only provides a foundation for subsequent rendering but also fundamentally avoids the interruption caused by black screens or sudden image disappearances. Then, by pre-eliminating the target object, a background image containing only the second scene image is generated. This ensures that the target object itself does not appear as a double image or abruptly change during transition animations. Furthermore, setting the image area corresponding to the target object in both the first and second scene images to be consistent ensures that the target object's screen proportion and position are exactly the same in both scenes, avoiding dizziness caused by sudden changes in perspective during scene transitions. Finally, a full-screen bulletin board covering the entire screen is created, and the target image is pasted as a texture onto it. Then, by changing the transparency value of this texture, a gradient effect is achieved from completely transparent (100% visible of the first scene) to completely opaque (100% visible of the second scene background), improving the user's visual continuity.
[0074] In an optional implementation, S203 may further include: the CDC determining first camera parameters for the camera in a first scene and second camera parameters for the camera in a second scene. Subsequently, the CDC may employ tweening animation techniques to simultaneously perform linear gradient adjustments on the camera parameters from the first to the second camera parameters and to perform gradient rendering on the target image on the full-screen bulletin board from completely transparent to completely opaque.
[0075] The camera parameters include position, rotation, and field of view (FOV). Position represents the camera's coordinate position in space; rotation represents the camera's orientation; and FOV represents the range of the camera lens's field of view. For example, a larger FOV means a wider field of view, and a smaller FOV means a smaller field of view.
[0076] In the full-screen bulletin board, the rendering position of objects in the target image changes with the camera parameters.
[0077] In some embodiments, the CDC can determine a first camera parameter for the camera in a first scene, which is the starting point of the animation transition from the first scene to the second scene. The CDC can determine a second camera parameter corresponding to the second scene from a mapping dataset, which is the ending point of the animation transition from the first scene to the second scene. Then, for each animation frame generated by the tweening technique, the CDC can perform linear interpolation on each camera parameter based on the first camera parameter, the second camera parameter, and the animation progress to obtain the target camera parameter corresponding to that animation frame, and adjust the camera parameters to the target camera parameter.
[0078] Meanwhile, for each animation frame generated by the tweening technique, CDC can determine the transparency corresponding to the animation frame, that is, the transparency increases linearly from 0 to 1, and can refer to (1)-(6) in S202 above to determine the target buffer image corresponding to the animation frame, which will not be elaborated here. After that, CDC can render the target image on the full-screen bulletin board based on the transparency and the target buffer image to obtain the animation frame.
[0079] Among them, the target buffer image is used to represent the rendering position of objects in the target image of the full-screen bulletin board as the target camera parameters change. That is, when the scene changes, the camera parameters change and the target buffer image also changes accordingly.
[0080] Among them, the target camera parameters are the camera parameters of the camera in the animation frame.
[0081] For example, the CDC can refer to the following steps (a)-(g) to determine the camera parameters and transparency for any animation frame.
[0082] (a) FVector CurLocation=FMath::Lerp(CameraPos1, CameraPos2, TweenValue); Here, CurLocation declares a temporary variable of type FVector; CameraPos1 represents the first position in the first camera parameter; CameraPos2 represents the second position in the second camera parameter; TweenValue represents the tween animation progress; this step can obtain the target position of the camera in the current frame using the standard linear interpolation function FMath::Lerp in the virtual engine.
[0083] (b) FRotator CurRotator=TCustomLerp <frotator>::Lerp(CameraRot1, CameraRot2, TweenValue); Here, CurRotator is a temporary variable of type FRotator; CameraRot1 represents the first rotation in the first camera parameter; CameraRot2 represents the second rotation in the second camera parameter; TweenValue represents the tween animation progress; this step can be performed using the standard linear interpolation function TCustomLerp in the Virtual Engine. <frotator>::Lerp, gets the target rotation that the camera should be in at the current frame.
[0084] (c) float CurFov=FMath::Lerp(CameraFov1, CameraFov2, TweenValue); Here, CurFov is a temporary variable with a floating-point number; CameraFov1 represents the first field of view in the first camera parameter; CameraFov2 represents the second field of view in the second camera parameter; TweenValue represents the tweening animation progress; this step can obtain the target field of view that the camera should be in in the current frame using the standard linear interpolation function FMath::Lerp in the virtual engine.
[0085] (d) MainCameraComponent->SetRelativeLocationAndRotation(CurLocation, CurRotator); This step involves using the function SetRelativeLocationAndRotation to assign the target location CurLocation and target rotation CurRotator to a camera component named MainCameraComponent.
[0086] (e) MainCameraComponent->SetFieldOfView(CurFov); This step involves using the SetFieldOfView function to assign the target field of view, CurFov, to a camera component named MainCameraComponent.
[0087] (f) float CurAlpha=FMath::Lerp(0, 1, TweenValue); Here, CurAlpha is a temporary variable declared as a floating-point number. This step can use the standard linear interpolation function FMath::Lerp to perform floating-point interpolation on the current tween animation progress TweenValue (0 to 100%) to obtain the transparency CurAlpha of the target image.
[0088] (g) PanelMaterialMID->SetScalarParameter("Alpha", CurAlpha); This step involves assigning the transparency CurAlpha to a full-screen bulletin board named PanelMaterialMID using the function SetScalarParameter.
[0089] For example, Figure 3 This is a schematic diagram illustrating how a 3D car model switches from its current desktop scene to a navigation scene or an advanced driver assistance system scene, as provided in an embodiment of this application. Figure 3 (a) in the diagram represents the scene transition at the 0-second mark; Figure 3 (b) in the diagram represents the scene transition at the 0.4-second mark; Figure 3 (c) in the diagram represents the scene transition at the 0.6-second mark; Figure 3 (d) in the diagram represents the first second of the scene transition.
[0090] Based on the above technical solution, this application utilizes tweening animation technology to calculate an intermediate value between the first and second camera parameters based on the current animation progress (e.g., 30%), and updates the camera parameters in real time. Simultaneously, the transparency of the target image on the full-screen bulletin board is adjusted according to the same animation progress (e.g., 30% progress corresponds to 30% opacity). Using the same tweening animation controller to drive these two processes ensures absolute synchronization. The camera movement rhythm and the transparency change rhythm are completely consistent, avoiding visual illusions that may occur due to asynchrony (e.g., the camera is almost in place before the new background just begins to appear).
[0091] like Figure 4 As shown in the figure, a scene switching device provided in this application embodiment includes: a processing unit 401, a generation unit 402 and a rendering unit 403.
[0092] The processing unit 401 is used to maintain the rendering of the first scene image of the first scene in response to a scene switching instruction from the target object to the second scene.
[0093] The generation unit 402 is used to generate a target image. The target image represents the image corresponding to background objects other than the target object in the second scene image of the second scene; the image region corresponding to the target object is the same in both the first scene image and the second scene image.
[0094] The rendering unit 403 is used to perform gradient rendering of the target image from completely transparent to completely opaque on the full-screen bulletin board, so as to realize the scene switching from the first scene to the second scene by superimposing the gradient target image on the first scene image.
[0095] In one possible approach, the rendering unit is specifically used to render a target image on a full-screen bulletin board using a tweening technique, with a linear gradient from completely transparent to completely opaque.
[0096] In one possible embodiment, the rendering unit 403 includes: a first determining unit, a second determining unit, and a rendering subunit. The first determining unit is used to determine first camera parameters for the camera in a first scene. The second determining unit is used to determine second camera parameters for the camera in a second scene. The rendering subunit is used to employ tweening animation techniques to simultaneously perform linear gradient adjustments on the camera parameters from the first to the second camera parameters and to perform gradient rendering on the target image on a full-screen bulletin board from completely transparent to completely opaque. The rendering position of objects in the target image on the full-screen bulletin board changes with the camera parameters.
[0097] In one possible approach, a rendering subunit is specifically used to determine the transparency and target buffer image corresponding to each animation frame generated by the tweening technique. The target buffer image represents the rendering position of objects in the target image on the full-screen bulletin board as the target camera parameters change. The target camera parameters are the camera parameters of the camera in the animation frame. Based on the transparency and target buffer image, the target image is rendered on the full-screen bulletin board to obtain the animation frame.
[0098] In one possible implementation, the generation unit 402 includes a loading subunit and a generation subunit. The loading subunit loads scene resources of the second scene; the scene resources include the spatial position of background objects relative to the target object and the morphological information of the background objects. The generation subunit generates a target image based on the scene resources and the image region corresponding to the target object in the first scene image.
[0099] In one possible implementation, processing unit 401 includes a first processing subunit and a second processing subunit. The first processing subunit is configured to render a first image region corresponding to the target object in a first scene image on a first layer, and to render a second image region in the first scene image other than the first image region on a second layer. Based on this, in the scene switching method, the second processing subunit is configured to render the target image on the second layer after switching to the second scene, and to stop rendering the target image on the full-screen bulletin board.
[0100] In one possible approach, the processing unit 401 is also used to destroy the second image region after rendering the target image on the second layer.
[0101] like Figure 5 As shown in the embodiments of this application, an electronic device includes, but is not limited to, a processor 501 and a memory 502.
[0102] The aforementioned memory 502 is used to store the executable instructions of the aforementioned processor 501. It is understood that the aforementioned processor 501 is configured to execute instructions to implement the scene switching method in the above embodiments.
[0103] It should be noted that those skilled in the art will understand that Figure 5 The electronic device structure shown does not constitute a limitation on the electronic device; the electronic device may include, but is not limited to, other electronic devices. Figure 5 This may indicate more or fewer components, or combinations of certain components, or different component arrangements.
[0104] Processor 501 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in memory 502, and by calling data stored in memory 502, it performs various functions and processes data, thereby providing overall monitoring of the electronic device. Processor 501 may include one or more processing units. Optionally, processor 501 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into processor 501.
[0105] The memory 502 can be used to store software programs and various data. The memory 502 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, application programs required by at least one functional module (such as a determination unit, processing unit, etc.), etc. Furthermore, the memory 502 may include high-speed random access memory and may also include non-volatile memory. For example, non-volatile memory may include at least one disk storage device, flash memory device, or other non-volatile solid-state storage device.
[0106] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 502 including instructions, which can be executed by a processor 501 of an electronic device to implement the methods in the above embodiments.
[0107] Optionally, the computer-readable storage medium may be a non-transitory computer-readable storage medium, such as a read-only memory (ROM), random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.
[0108] In an exemplary embodiment, this application also provides a computer program product including one or more instructions, which can be executed by a processor 501 of an electronic device to perform the methods described above.
[0109] It should be noted that when one or more instructions in the computer-readable storage medium or computer program product are executed by the processor of an electronic device, they implement the various processes of the above method embodiments and achieve the same technical effect as the above method. To avoid repetition, they will not be described again here.
[0110] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0111] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0112] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0113] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0114] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0115] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.< / frotator> < / frotator>
Claims
1. A scene switching method, characterized in that, The scene switching method includes: In response to a scene switching instruction that causes the target object to switch from the current first scene to the second scene, the rendering of the first scene image of the first scene is maintained; Generate a target image; wherein the target image is used to characterize the image corresponding to the background object other than the target object in the second scene image of the second scene; the image region corresponding to the target object in the first scene image and the second scene image is the same; The target image is rendered with a gradient from completely transparent to completely opaque on the full-screen bulletin board, so as to achieve scene switching from the first scene to the second scene by superimposing the gradient target image on the first scene image.
2. The scene switching method according to claim 1, characterized in that, The step of performing a gradient rendering of the target image from completely transparent to completely opaque on the full-screen bulletin board includes: Using tweening animation technology, the target image is rendered linearly from completely transparent to completely opaque on a full-screen bulletin board.
3. The scene switching method according to claim 1, characterized in that, The step of performing a gradient rendering of the target image from completely transparent to completely opaque on the full-screen bulletin board includes: Determine the first camera parameters for the camera in the first scene; Determine the second camera parameters for the camera in the second scene; The method employs tweening animation technology, simultaneously adjusting the camera parameters of the camera from the first camera parameter to the second camera parameter linearly, and rendering the target image on the full-screen bulletin board from completely transparent to completely opaque. The rendering position of the object in the target image on the full-screen bulletin board changes with the camera parameters.
4. The scene switching method according to claim 3, characterized in that, The method employs tweening animation technology, simultaneously performing linear gradient adjustments on the camera's camera parameters from the first camera parameter to the second camera parameter, and applying gradient rendering from completely transparent to completely opaque to the target image on the full-screen bulletin board, including: For each animation frame generated by the tweening animation technique, the transparency and target buffer image corresponding to the animation frame are determined; wherein, the target buffer image is used to characterize the rendering position of objects in the target image of the full-screen bulletin board as the target camera parameters change; the target camera parameters are the camera parameters of the camera in the animation frame; Based on the transparency and the target buffer image, the target image is rendered on the full-screen bulletin board to obtain the animation frame.
5. The scene switching method according to claim 1, characterized in that, The generation of the target image includes: Load the scene resources of the second scene; wherein, the scene resources include the spatial position of the background object relative to the target object and the shape information of the background object; The target image is generated based on the scene resources and the image region corresponding to the target object in the first scene image.
6. The scene switching method according to claim 1, characterized in that, The process of rendering the first scene image of the first scene includes: Render the first image region corresponding to the target object in the first scene image on the first layer, and render the second image region in the first scene image other than the first image region on the second layer; The scene switching method further includes: after switching to the second scene, rendering the target image on the second layer, and stopping rendering the target image on the full-screen bulletin board.
7. The scene switching method according to claim 6, characterized in that, The scene switching method further includes: After rendering the target image on the second layer, the second image region is destroyed.
8. The scene switching method according to any one of claims 3-7, characterized in that, The camera parameters include: position, rotation, and field of view.
9. A scene switching device, characterized in that, The scene switching device includes: The processing unit is used to maintain the rendering of the first scene image of the first scene in response to a scene switching instruction from the target object to the second scene. A generation unit is used to generate a target image; wherein the target image is used to characterize the image corresponding to the background object other than the target object in the second scene image of the second scene; the image regions corresponding to the target object in the first scene image and the second scene image are the same; The rendering unit is used to perform gradient rendering of the target image from completely transparent to completely opaque on the full-screen bulletin board, so as to realize the scene switching from the first scene to the second scene by superimposing the gradient target image on the first scene image.
10. The scene switching device according to claim 9, characterized in that, The rendering unit is specifically used to perform linear gradient rendering of the target image from completely transparent to completely opaque on a full-screen bulletin board using tween animation technology.
11. A vehicle, characterized in that, The vehicle is equipped with the scene switching device as described in claim 9 or 10.
12. 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 switching method as described in any one of claims 1-8.