Scene switching display method and device, equipment and storage medium

By creating two invisible scenes in Euclidean space and using rendering textures and collision detection to achieve scene switching, the problems of dynamic rendering and light and shadow transformation in the existing technology are solved, and the richness and performance of the game experience are improved.

CN119280800APending Publication Date: 2025-01-10ARC GAMES CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311687726.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-08
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The prior art is difficult to dynamically render the picture differences between two scenes with far distances in the game, and the static map cannot fully simulate real-time light and shadow transformation, resulting in poor game experience.

Method used

Create two mutually invisible scenes in Euclidean space, and shoot the content of the second scene through the source camera to draw it into the rendered texture. Draw the first scene based on the rendered texture, and use collision detection logic to realize scene switching to simulate non-Euclidean Dynamic light and shadow transformation in space.

Benefits of technology

It realizes dynamic rendering of two completely different scenes, simulates real-time light and shadow transformation, improves the richness and performance of the game experience, and brings players a better non-Euclidean space experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119280800A_ABST
    Figure CN119280800A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a scene switching display method and device, equipment and a storage medium, and the method comprises the steps: creating a first scene and a second scene in an Euclidean space, and setting the first scene and the second scene to be invisible to each other; drawing the content in the second scene shot by the source camera into the rendering texture; drawing and displaying a first scene based on the drawn rendering texture; and under the condition that the scene crossing event is detected, executing collision detection logic of the observation main body or the main camera so as to realize switching display between the first scene and the second scene. Through the mode, the Euclidean space can be utilized to simulate the non-Euclidean space, so that two completely different scenes can be dynamically rendered, real-time light and shadow conversion can be realized, and game experience of the non-Euclidean space with richer effects and better performance can be brought to player users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image rendering technology, and in particular to a scene switching display method, device, equipment and storage medium. Background Art

[0002] In many game scenes, we can create counter-intuitive spaces that are very different from the conventional Euclidean space experience to provide players with a richer gaming experience. For example, we can create a portal, and when the character controlled by the player enters the portal, he can teleport from the current scene to another scene.

[0003] In order to realize the construction of the above counter-intuitive space, in the related art, generally speaking, it can be constructed based on a space of a pre-drawn texture. In this solution, a pre-drawn texture of the destination scene of the transmission can be used to render and construct the portal.

[0004] The space constructed in the above manner can achieve a good gaming experience for static scenes, but it is unable to dynamically render two scenes with different scene images due to a long distance. At the same time, static textures cannot fully simulate real-time light and shadow changes, resulting in a poor gaming experience. Summary of the invention

[0005] The embodiments of the present invention provide a scene switching display method, device, equipment and storage medium, so as to provide a more abundant non-Euclidean space game experience.

[0006] In a first aspect, an embodiment of the present invention provides a scene switching display method, the method comprising:

[0007] Creating a first scene and a second scene in the Euclidean space, and setting the first scene and the second scene to be invisible to each other, wherein the first scene is the scene where the observing subject is located;

[0008] Drawing the content of the second scene captured by a source camera into a rendering texture, wherein a position of the source camera is related to a position of a main camera corresponding to the observed subject;

[0009] Based on the rendered texture, the first scene is displayed;

[0010] When a scene crossing event is detected, a collision detection logic of the observation subject or the main camera is executed to implement a switching display between the first scene and the second scene.

[0011] Optionally, the creating a first scene and a second scene in the Euclidean space, and setting the first scene and the second scene to be invisible to each other, includes:

[0012] Creating a first group of models included in the first scene and a second group of models included in the second scene in Euclidean space;

[0013] The RenderLayer corresponding to each of the first group of models and the second group of models is set to a different value, or the first group of models and the second group of models are set at different positions with a distance greater than a preset visible distance, so that the first group of models and the second group of models are invisible to each other.

[0014] Optionally, before drawing the content of the second scene captured by the source camera into the rendering texture, the method further includes:

[0015] Pre-rendering is performed on the content in the second scene captured by the source camera until a camera loop event is detected.

[0016] Optionally, the pre-drawing processing of the content in the second scene captured by the source camera includes:

[0017] Detecting patches in the second scene within the frustum corresponding to the source camera;

[0018] Call the preset drawing function to draw the detected faces.

[0019] Optionally, drawing the content of the second scene captured by the source camera into a rendering texture includes:

[0020] Determining a target relative position between the main camera and a patch in the second scene;

[0021] Setting the relative position between the source camera and the patch in the first scene to be consistent with the target relative position;

[0022] Based on the position of the source camera, the content of the second scene captured by the source camera is drawn into a rendering texture.

[0023] Optionally, drawing and displaying the first scene based on the rendered texture includes:

[0024] Determine the first vertex corresponding to the rendered texture after drawing;

[0025] Determine a second vertex corresponding to the first vertex in the first scene;

[0026] Based on the rendered texture corresponding to the first vertex, the face formed by the corresponding second vertex is rendered and displayed.

[0027] Optionally, after creating the first scene and the second scene in the Euclidean space, the method further includes:

[0028] Setting the template values ​​corresponding to the first group of models included in the first scene and the second group of models included in the second scene to different values;

[0029] In pre-rendering, writing preset specific values ​​into the template buffers corresponding to the first scene and the second scene respectively;

[0030] Constructing the faces respectively included in the first scene and the second scene through template detection;

[0031] When drawing the first scene or the second scene, different contents are drawn and displayed in the area where the face patch exists and in the area where the face patch does not exist, respectively, according to the template value.

[0032] Optionally, executing the collision detection logic of the observation subject includes:

[0033] When it is detected that the observed subject collides with the preset transmission model, a model copy of the target model corresponding to the observed subject is created, the model copy is set in the second scene, and the model copy is controlled to be displayed overlapping with the target model;

[0034] When it is detected that the center point of the target model passes through the preset transmission model, the positions of the target model and the model copy are swapped, and the swapped model copy is controlled to display overlapped with the target model.

[0035] Optionally, the method further comprises:

[0036] When it is detected that the target model leaves the preset transmission model, the model copy is deleted.

[0037] Optionally, executing the collision detection logic of the main camera includes:

[0038] In the case of detecting that the main camera collides with the preset transmission model, determining whether a near clipping plane of the frustum corresponding to the main camera cuts any facet;

[0039] If it is determined that the near cutting plane cuts any of the face pieces, then move any of the face pieces to cross the near cutting plane;

[0040] When it is detected that the center point of the main camera passes through the preset transmission model, the main camera is transmitted to the second scene, and the source camera in the first scene is activated.

[0041] Optionally, the method further comprises:

[0042] When it is detected that the main camera leaves the preset transmission model, the switching display between the first scene and the second scene is terminated.

[0043] In a second aspect, an embodiment of the present invention provides a scene switching display device, comprising:

[0044] A creation module, used for creating a first scene and a second scene in a Euclidean space, and setting the first scene and the second scene to be invisible to each other, wherein the first scene is the scene where the observing subject is located;

[0045] A drawing module, configured to draw the content of the second scene captured by a source camera into a rendering texture, wherein the position of the source camera is related to the position of a main camera corresponding to the observed subject; and draw and display the first scene based on the drawn rendering texture;

[0046] A detection module is used to execute the collision detection logic of the observation subject or the main camera when a scene crossing event is detected, so as to realize the switching display between the first scene and the second scene.

[0047] Optionally, the creation module is used to:

[0048] Creating a first group of models included in the first scene and a second group of models included in the second scene in Euclidean space;

[0049] The RenderLayer corresponding to each of the first group of models and the second group of models is set to a different value, or the first group of models and the second group of models are set at different positions with a distance greater than a preset visible distance, so that the first group of models and the second group of models are invisible to each other.

[0050] Optionally, the detection module is further used to:

[0051] Pre-rendering is performed on the content in the second scene captured by the source camera until a camera loop event is detected.

[0052] Optionally, the detection module is used to:

[0053] Detecting patches in the second scene within the frustum corresponding to the source camera;

[0054] Call the preset drawing function to draw the detected faces.

[0055] Optionally, the drawing module is used to:

[0056] Determining a target relative position between the main camera and a patch in the second scene;

[0057] Setting the relative position between the source camera and the patch in the first scene to be consistent with the target relative position;

[0058] Based on the position of the source camera, the content of the second scene captured by the source camera is drawn into a rendering texture.

[0059] Optionally, the drawing module is used to:

[0060] Determine the first vertex corresponding to the rendered texture after drawing;

[0061] Determine a second vertex corresponding to the first vertex in the first scene;

[0062] Based on the rendered texture corresponding to the first vertex, the face formed by the corresponding second vertex is rendered and displayed.

[0063] Optionally, the drawing module is further used for:

[0064] Setting the template values ​​corresponding to the first group of models included in the first scene and the second group of models included in the second scene to different values;

[0065] In pre-rendering, writing preset specific values ​​into the template buffers corresponding to the first scene and the second scene respectively;

[0066] Constructing the faces respectively included in the first scene and the second scene through template detection;

[0067] When drawing the first scene or the second scene, different contents are drawn and displayed in the area where the face patch exists and in the area where the face patch does not exist, respectively, according to the template value.

[0068] Optionally, the detection module is used to:

[0069] When it is detected that the observed subject collides with the preset transmission model, a model copy of the target model corresponding to the observed subject is created, the model copy is set in the second scene, and the model copy is controlled to be displayed overlapping with the target model;

[0070] When it is detected that the center point of the target model passes through the preset transmission model, the positions of the target model and the model copy are swapped, and the swapped model copy is controlled to display overlapped with the target model.

[0071] Optionally, the detection module is further used to:

[0072] When it is detected that the target model leaves the preset transmission model, the model copy is deleted.

[0073] Optionally, the detection module is used to:

[0074] In the case of detecting that the main camera collides with the preset transmission model, determining whether a near clipping plane of the frustum corresponding to the main camera cuts any facet;

[0075] If it is determined that the near cutting plane cuts any of the face pieces, then move any of the face pieces to cross the near cutting plane;

[0076] When it is detected that the center point of the main camera passes through the preset transmission model, the main camera is transmitted to the second scene, and the source camera in the first scene is activated.

[0077] Optionally, the detection module is further used to:

[0078] When it is detected that the main camera leaves the preset transmission model, the switching display between the first scene and the second scene is terminated.

[0079] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor and a memory, wherein the memory stores executable code, and when the executable code is executed by the processor, the processor can at least implement the scene switching display method in the first aspect.

[0080] In a fourth aspect, an embodiment of the present invention provides a non-temporary machine-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor can at least implement the scene switching display method in the first aspect.

[0081] By adopting the present invention, a first scene and a second scene can be created in Euclidean space, and the first scene and the second scene can be set to be invisible to each other; the content of the second scene captured by the source camera is drawn into the rendering texture; based on the drawn rendering texture, the first scene is drawn and displayed; when a scene crossing event is detected, the collision detection logic of the observation subject or the main camera is executed to realize the switching display between the first scene and the second scene. In this way, Euclidean space can be used to simulate non-Euclidean space, and then two completely different scenes can be dynamically rendered, real-time light and shadow transformation can be realized, and the game experience of non-Euclidean space with richer effects and better performance can be brought to the players. BRIEF DESCRIPTION OF THE DRAWINGS

[0082] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0083] Figure 1 A schematic diagram of a flow chart of a scene switching display method provided by an embodiment of the present invention;

[0084] Figure 2 A schematic diagram of a scene of a game character passing through a portal provided by an embodiment of the present invention;

[0085] Figure 3 A schematic diagram of a camera loop scene provided by an embodiment of the present invention;

[0086] Figure 4 A schematic diagram of the structure of a scene switching display device provided by an embodiment of the present invention;

[0087] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0088] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0089] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two.

[0090] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0091] In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.

[0092] Figure 1 The present invention provides a flowchart of a scene switching display method, which can be applied to electronic devices. Figure 1 As shown, the method comprises the following steps:

[0093] 101. Create a first scene and a second scene in the Euclidean space, and set the first scene and the second scene to be invisible to each other, wherein the first scene is the scene where the observing subject is located.

[0094] 102. Draw the content of the second scene captured by the source camera into the rendering texture, wherein the position of the source camera is related to the position of the main camera corresponding to the observation subject.

[0095] 103. Based on the drawn rendering texture, draw and display the first scene.

[0096] 104. When a scene crossing event is detected, a collision detection logic of the observation subject or the main camera is executed to implement switching display between the first scene and the second scene.

[0097] In many game scenarios, in order to enrich the game experience of players and users, this can be achieved by constructing other types of counterintuitive spaces that are very different from conventional Euclidean spaces, such as Riemann spaces. For example, you can construct a portal, such as Figure 2 As shown, when the game character enters the portal, the game character can be teleported from scene A where the portal is located to scene B, and the distance between scene A and scene B is not limited.

[0098] In an embodiment of the present invention, in order to dynamically render two scenes and realize real-time light and shadow transformation during the transmission process, an implementation scheme is proposed: using Euclidean space to simulate non-Euclidean space. Game production is carried out in Euclidean space, but for player users, game experience, player feelings and game logic all occur in non-Euclidean space.

[0099] In practical applications, the first scene and the second scene can be created in the Euclidean space, wherein the first scene and the second scene can be two different scenes that are far apart. After the first scene and the second scene are created, the first scene and the second scene can be set to be invisible to each other. Specifically, the creation of the first scene and the second scene can be interpreted as creating a first group of models contained in the first scene and a second group of models contained in the second scene in the Euclidean space. Since the scenes are composed of different models, the corresponding scenes can be created by creating the models in the scenes.

[0100] Since the first and second groups of models are created in Euclidean space, based on the characteristics of Euclidean space, the corresponding models in the first and second groups of models are in different positions, and in fact, they are far apart. From the perspective of non-Euclidean space, based on the characteristics of non-Euclidean space, the corresponding models in the first and second groups of models are in the same position and are connected together. The first and second groups of models can be understood from Euclidean space and non-Euclidean space respectively, and can be distinguished in different dimensions.

[0101] After creating the first group of models and the second group of models, the first group of models and the second group of models may be set to be invisible to each other. Specifically, optionally, the RenderLayer corresponding to the first group of models and the second group of models may be set to different values, or the first group of models and the second group of models may be set at different positions with a distance greater than a preset visible distance, so that the first group of models and the second group of models are invisible to each other.

[0102] Among them, for the first method, different rendering layers can be set for the first group of models and the second group of models respectively, so that during the camera rendering process, models belonging to different rendering layers can be screened, thereby achieving the effect of mutually exclusive rendering of models of different dimensions.

[0103] In addition, for the second method, in the process of making the scene, the first group of models and the second group of models can be placed at positions far away from each other, so as to achieve the effect that the first group of models and the second group of models are invisible to each other.

[0104] Assume that the observed subject is in the first scene, the main camera is bound to the observed subject and changes with the player's perspective. Among them, the observed subject can be, for example, the protagonist controlled by the player user. The main camera is a free camera, and the corresponding source camera is the source camera. The position of the source camera is related to the position of the main camera corresponding to the observed subject. Therefore, the position of the main camera is the independent variable, and the position of the source camera is the dependent variable. In simple terms, the change in the position of the main camera will drive the change in the position of the source camera. Based on this, when the position of the main camera is known, the position of the source camera can be inferred based on calculation. Furthermore, the content of the second scene captured by the source camera can be drawn into the render texture (RenderTexture).

[0105] Optionally, the process of drawing the content of the second scene captured by the source camera into the rendering texture can be implemented as follows: determining the target relative position between the main camera and the face patch in the second scene; setting the relative position between the source camera and the face patch in the first scene to be consistent with the target relative position; based on the position of the source camera, drawing the content of the second scene captured by the source camera into the rendering texture. Among them, since it is assumed that the observing subject is in the first scene, the face patch in the first scene can also be called the face patch on the current side, and the face patch in the second scene can also be called the face patch on the opposite side. Based on this, the relative position between the source camera and the face patch on the current side can be adjusted in real time according to the relative position between the main camera and the face patch on the opposite side.

[0106] In some optional embodiments, in order to improve rendering efficiency, before drawing the content of the second scene captured by the source camera into the rendering texture, the content of the second scene captured by the source camera can optionally be pre-drawn until a camera loop event is detected.

[0107] Among them, the camera loopback event refers to, for example, Figure 3 As shown in the figure, assuming that the source camera A of the A patch captures the B patch, the source camera B of the B patch captures the C patch, and the source camera C of the C patch captures the A patch, a camera loop event is formed. In practical applications, the content in the second scene captured by the source camera can be continuously pre-drawn until a camera loop event is detected.

[0108] Optionally, the above-mentioned pre-drawing process can be implemented as follows: detecting the face patches in the second scene within the frustum corresponding to the source camera; and calling a preset drawing function to perform drawing processing on the detected face patches.

[0109] After drawing the content of the second scene captured by the source camera into the rendering texture, the first scene can be drawn and displayed based on the drawn rendering texture. Optionally, the process of drawing and displaying the first scene based on the drawn rendering texture can be implemented as follows: determining a first vertex corresponding to the drawn rendering texture; determining a second vertex corresponding to the first vertex in the first scene; and drawing and displaying a face formed by the corresponding second vertex based on the drawn rendering texture corresponding to the first vertex.

[0110] The first vertex is a vertex of a patch in the second scene, and the second vertex is a vertex of a corresponding patch in the first scene corresponding to the first vertex. It is worth noting that the six rendering vertices of the RenderTexture can be transformed to the corresponding positions of the patch in the first scene for display according to the preset transformation rules. In this way, the vertices in the second scene can be transformed to the first scene, so as to draw and display the first scene based on the rendered texture after drawing.

[0111] The above is a method of constructing a patch using RenderTexture. Optionally, a patch can also be constructed by using template detection. Specifically, the process of constructing a patch using template detection can be implemented as follows: setting the template values ​​corresponding to the first group of models contained in the first scene and the second group of models contained in the second scene to different values; in pre-rendering (PrePass), writing preset specific values ​​to the template buffers corresponding to the first scene and the second scene respectively; constructing the patches contained in the first scene and the second scene respectively through template detection; when drawing the first scene or the second scene, drawing and displaying different contents in the area where the patches exist and the area where the patches do not exist respectively according to the template value.

[0112] It should be noted that, in the above process, by setting the first group of models and the second group of models to different template values, the two groups of models that should not be displayed at the same time can be rendered and displayed separately during the rendering process.

[0113] After the first scene is drawn and displayed, when a scene crossing event is detected, the collision detection logic of the observation subject or the main camera is executed to realize the switching display between the first scene and the second scene.

[0114] For example, assuming that the observed subject is in the first scene, a portal is set in the first scene, and when the observed subject passes through the portal, the observed subject can be transferred to the second scene connected to the portal. In order to detect the positional relationship between the observed subject, the main camera and the portal, the collision detection logic of the observed subject or the main camera can be executed.

[0115] Optionally, the process of executing the collision detection logic of the observed subject can be implemented as follows: when it is detected that the observed subject collides with a preset transmission model, a model copy of the target model corresponding to the observed subject is created, the model copy is set in a second scene, and the model copy is controlled to be displayed overlapping with the target model; when it is detected that the center point of the target model passes through the preset transmission model, the positions of the target model and the model copy are swapped, and the swapped model copy is controlled to be displayed overlapping with the target model.

[0116] Among them, the above-mentioned preset transmission model can be a model of a transmission gate.

[0117] In the above process, when it is detected that the observed subject collides with the preset transmission model, a model copy of the target model corresponding to the observed subject can be created. The model copy and the target model should be consistent in appearance. The model copy can be set in the second scene. Although the positions of the model copy and the target model are different, the model copy and the target model can be controlled to overlap in display. In addition, the center point of the target model can be determined, and the center point can be continuously detected to see if it passes through the edge of the preset transmission model. When it is detected that the above center point passes through the edge of the preset transmission model, the positions of the target model and the model copy can be swapped. At this time, the positions of the target model and the model copy are still different, but the swapped model copy can still be controlled to overlap in display with the target model.

[0118] Optionally, when the observing subject leaves the transmission portal, the following logic may be executed: when it is detected that the target model leaves the preset transmission model, the model copy is deleted.

[0119] Optionally, the process of executing the collision detection logic of the main camera can be implemented as follows: when it is detected that the main camera collides with a preset transmission model, determining whether the near plane of the frustum corresponding to the main camera cuts any facet; if it is determined that the near plane cuts any facet, moving any facet to cross the near plane; when it is detected that the center point of the main camera passes through the preset transmission model, transmitting the main camera to the second scene and activating the source camera in the first scene.

[0120] It should be noted that, in the above process, when it is determined that the near cutting plane cuts any face piece, the any face piece can be moved to cross the near cutting plane, so as to avoid the rendered picture from being cut.

[0121] Optionally, when the observed subject leaves the transmission gate, the main camera also leaves the transmission gate because the main camera is bound to the observed subject. Based on this, when the main camera leaves the preset transmission model, the switching display between the first scene and the second scene can be terminated.

[0122] The above is a construction method of the first scene and the second scene in the Euclidean space. After the construction is completed, the scene logic can be dynamically executed according to the game requirements to trigger the switching display process between the first scene and the second scene under the predetermined scene logic.

[0123] By adopting the present invention, a first scene and a second scene can be created in Euclidean space, and the first scene and the second scene can be set to be invisible to each other; the content of the second scene captured by the source camera is drawn into the rendering texture; based on the drawn rendering texture, the first scene is drawn and displayed; when a scene crossing event is detected, the collision detection logic of the observation subject or the main camera is executed to realize the switching display between the first scene and the second scene. In this way, Euclidean space can be used to simulate non-Euclidean space, and then two completely different scenes can be dynamically rendered, real-time light and shadow transformation can be realized, and the game experience of non-Euclidean space with richer effects and better performance can be brought to the players.

[0124] The scene switching display device of one or more embodiments of the present invention will be described in detail below. Those skilled in the art will appreciate that these scene switching display devices can be configured using commercially available hardware components through the steps taught in this solution.

[0125] Figure 4 A schematic diagram of the structure of a scene switching display device provided by an embodiment of the present invention is shown in FIG. Figure 4 As shown, the device comprises:

[0126] A creation module 41, used for creating a first scene and a second scene in the Euclidean space, and setting the first scene and the second scene to be invisible to each other, wherein the first scene is the scene where the observing subject is located;

[0127] A drawing module 42 is used to draw the content of the second scene captured by the source camera into a rendering texture, wherein the position of the source camera is related to the position of the main camera corresponding to the observed subject; and draw and display the first scene based on the rendered rendering texture;

[0128] The detection module 43 is used to execute the collision detection logic of the observation subject or the main camera when a scene crossing event is detected, so as to realize the switching display between the first scene and the second scene.

[0129] Optionally, the creation module 41 is used to:

[0130] Creating a first group of models included in the first scene and a second group of models included in the second scene in Euclidean space;

[0131] The RenderLayer corresponding to each of the first group of models and the second group of models is set to a different value, or the first group of models and the second group of models are set at different positions with a distance greater than a preset visible distance, so that the first group of models and the second group of models are invisible to each other.

[0132] Optionally, the detection module 43 is further used to:

[0133] Pre-rendering is performed on the content in the second scene captured by the source camera until a camera loop event is detected.

[0134] Optionally, the detection module 43 is used to:

[0135] Detecting patches in the second scene within the frustum corresponding to the source camera;

[0136] Call the preset drawing function to draw the detected faces.

[0137] Optionally, the drawing module 42 is used to:

[0138] Determining a target relative position between the main camera and a patch in the second scene;

[0139] Setting the relative position between the source camera and the patch in the first scene to be consistent with the target relative position;

[0140] Based on the position of the source camera, the content of the second scene captured by the source camera is drawn into a rendering texture.

[0141] Optionally, the drawing module 42 is used to:

[0142] Determine the first vertex corresponding to the rendered texture after drawing;

[0143] Determine a second vertex corresponding to the first vertex in the first scene;

[0144] Based on the rendered texture corresponding to the first vertex, the face formed by the corresponding second vertex is rendered and displayed.

[0145] Optionally, the drawing module 42 is further used for:

[0146] Setting the template values ​​corresponding to the first group of models included in the first scene and the second group of models included in the second scene to different values;

[0147] In pre-rendering, writing preset specific values ​​into the template buffers corresponding to the first scene and the second scene respectively;

[0148] Constructing the faces respectively included in the first scene and the second scene through template detection;

[0149] When drawing the first scene or the second scene, different contents are drawn and displayed in the area where the face patch exists and in the area where the face patch does not exist, respectively, according to the template value.

[0150] Optionally, the detection module 43 is used to:

[0151] When it is detected that the observed subject collides with the preset transmission model, a model copy of the target model corresponding to the observed subject is created, the model copy is set in the second scene, and the model copy is controlled to be displayed overlapping with the target model;

[0152] When it is detected that the center point of the target model passes through the preset transmission model, the positions of the target model and the model copy are swapped, and the swapped model copy is controlled to display overlapped with the target model.

[0153] Optionally, the detection module 43 is further used to:

[0154] When it is detected that the target model leaves the preset transmission model, the model copy is deleted.

[0155] Optionally, the detection module 43 is used to:

[0156] In the case of detecting that the main camera collides with the preset transmission model, determining whether a near clipping plane of the frustum corresponding to the main camera cuts any facet;

[0157] If it is determined that the near cutting plane cuts any of the face pieces, then move any of the face pieces to cross the near cutting plane;

[0158] When it is detected that the center point of the main camera passes through the preset transmission model, the main camera is transmitted to the second scene, and the source camera in the first scene is activated.

[0159] Optionally, the detection module 43 is further used to:

[0160] When it is detected that the main camera leaves the preset transmission model, the switching display between the first scene and the second scene is terminated.

[0161] Figure 4 The device shown can perform the aforementioned Figures 1 to 3 The scene switching display method provided in the illustrated embodiment, the detailed execution process and technical effects are described in the aforementioned embodiment, which will not be repeated here.

[0162] In one possible design, the above Figure 4 The structure of the scene switching display device shown can be implemented as an electronic device, such as Figure 5 As shown, the electronic device may include: a processor 51 and a memory 52. ​​The memory 52 stores executable code, and when the executable code is executed by the processor 51, the processor 51 can at least implement the above-mentioned Figures 1 to 3 The scene switching display method provided in the illustrated embodiment.

[0163] Optionally, the electronic device may further include a communication interface 53 for communicating with other devices.

[0164] In addition, an embodiment of the present invention provides a non-transitory machine-readable storage medium, wherein an executable code is stored on the non-transitory machine-readable storage medium. When the executable code is executed by a processor of an electronic device, the processor can at least implement the above-mentioned Figures 1 to 3 The scene switching display method provided in the illustrated embodiment.

[0165] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. Those of ordinary skill in the art may understand and implement the present invention without creative effort.

[0166] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on such an understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a computer product, and the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0167] The scene switching display method provided in the embodiment of the present invention can be executed by a certain program / software, and the program / software can be provided by the network side. The electronic device mentioned in the above embodiment can download the program / software to a local non-volatile storage medium, and when it needs to execute the above scene switching display method, the program / software is read into the memory by the CPU, and then the CPU executes the program / software to implement the scene switching display method provided in the above embodiment. The execution process can refer to the above Figures 1 to 3 Instructions in .

[0168] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A scene switching display method, characterized in that: include: Creating a first scene and a second scene in the Euclidean space, and setting the first scene and the second scene to be invisible to each other, wherein the first scene is the scene where the observing subject is located; Drawing the content of the second scene captured by a source camera into a rendering texture, wherein a position of the source camera is related to a position of a main camera corresponding to the observed subject; Based on the rendered texture, the first scene is displayed; When a scene crossing event is detected, a collision detection logic of the observation subject or the main camera is executed to implement a switching display between the first scene and the second scene.

2. The method according to claim 1, characterized in that The step of creating a first scene and a second scene in the Euclidean space and setting the first scene and the second scene to be invisible to each other includes: Creating a first group of models included in the first scene and a second group of models included in the second scene in Euclidean space; The RenderLayer corresponding to each of the first group of models and the second group of models is set to a different value, or the first group of models and the second group of models are set at different positions with a distance greater than a preset visible distance, so that the first group of models and the second group of models are invisible to each other.

3. The method according to claim 1, characterized in that Before drawing the content of the second scene captured by the source camera into the rendering texture, the method further includes: Pre-rendering is performed on the content in the second scene captured by the source camera until a camera loop event is detected.

4. The method according to claim 3, characterized in that The pre-drawing processing of the content in the second scene captured by the source camera includes: Detecting patches in the second scene within the frustum corresponding to the source camera; Call the preset drawing function to draw the detected faces.

5. The method according to claim 1, characterized in that Drawing the content of the second scene captured by the source camera into the rendering texture includes: Determining a target relative position between the main camera and a patch in the second scene; Setting the relative position between the source camera and the patch in the first scene to be consistent with the target relative position; Based on the position of the source camera, the content of the second scene captured by the source camera is drawn into a rendering texture.

6. The method according to claim 1, characterized in that Drawing and displaying the first scene based on the rendered texture after drawing, comprises: Determine the first vertex corresponding to the rendered texture after drawing; Determine a second vertex corresponding to the first vertex in the first scene; Based on the rendered texture corresponding to the first vertex, the face formed by the corresponding second vertex is rendered and displayed.

7. The method according to claim 1, characterized in that After creating the first scene and the second scene in the Euclidean space, the method further includes: Setting the template values ​​corresponding to the first group of models included in the first scene and the second group of models included in the second scene to different values; In pre-rendering, writing preset specific values ​​into the template buffers corresponding to the first scene and the second scene respectively; Constructing the faces respectively included in the first scene and the second scene through template detection; When drawing the first scene or the second scene, different contents are drawn and displayed in the area where the face patch exists and in the area where the face patch does not exist, respectively, according to the template value.

8. The method according to claim 1, characterized in that The executing the collision detection logic of the observation subject comprises: When it is detected that the observed subject collides with the preset transmission model, a model copy of the target model corresponding to the observed subject is created, the model copy is set in the second scene, and the model copy is controlled to be displayed overlapping with the target model; When it is detected that the center point of the target model passes through the preset transmission model, the positions of the target model and the model copy are swapped, and the swapped model copy is controlled to display overlapped with the target model.

9. The method according to claim 8, characterized in that The method further comprises: When it is detected that the target model leaves the preset transmission model, the model copy is deleted.

10. The method according to claim 1, characterized in that The executing the collision detection logic of the main camera includes: In the case of detecting that the main camera collides with the preset transmission model, determining whether a near clipping plane of the frustum corresponding to the main camera cuts any facet; If it is determined that the near cutting plane cuts any of the face pieces, then move any of the face pieces to cross the near cutting plane; When it is detected that the center point of the main camera passes through the preset transmission model, the main camera is transmitted to the second scene, and the source camera in the first scene is activated.

11. The method according to claim 10, characterized in that The method further comprises: When it is detected that the main camera leaves the preset transmission model, the switching display between the first scene and the second scene is terminated.

12. A scene switching display device, characterized in that: include: A creation module, used for creating a first scene and a second scene in a Euclidean space, and setting the first scene and the second scene to be invisible to each other, wherein the first scene is the scene where the observing subject is located; A drawing module, configured to draw the content of the second scene captured by a source camera into a rendering texture, wherein the position of the source camera is related to the position of a main camera corresponding to the observed subject; and draw and display the first scene based on the drawn rendering texture; A detection module is used to execute the collision detection logic of the observation subject or the main camera when a scene crossing event is detected, so as to realize the switching display between the first scene and the second scene.

13. An electronic device, characterized in that: include: A memory and a processor; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the scene switching display method as described in any one of claims 1-11.

14. A non-transitory machine-readable storage medium, characterized in that: The non-transitory machine-readable storage medium stores executable code, and when the executable code is executed by a processor of an electronic device, the processor executes the scene switching display method according to any one of claims 1 to 11.

Citation Information

Cited By

  • Virtual scene switching method, apparatus and device, and storage medium

    WO2025130465A1