Determination method and device for false indoor show window effect, medium and product
By determining multi-layer virtual planes based on the depth information of objects in the indoor space and simulating different texture images, the problem of insufficient depth and layering of fake interiors in the prior art is solved, and a more realistic and accurate fake interior effect is achieved.
Patent Information
- Application Number
- CN202411115649.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-11-26
AI Technical Summary
When existing pre-projection technology simulates the effect of fake interiors, the sense of depth and layering is insufficient, resulting in visual distortion or bending when viewed from the side, exposing flaws in the fake interiors.
By determining multiple virtual planes based on the depth information of objects in the indoor space, each virtual plane is independent, and different texture images are simulated to enhance the depth and three-dimensional sense of the fake interior effect.
It significantly improves the depth and three-dimensionality of the fake interior effect, reduces distortion and stretching at the side viewing angle, and provides a more realistic and accurate visual effect.
Smart Images

Figure CN119027475A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, medium and product for determining a fake indoor window effect. Background Art
[0002] In game development, in order to achieve rich visual effects with limited computing resources, developers will use various techniques to optimize the rendering process. In games, a large number of interior furnishings are often displayed through windows, such as tables, chairs, benches, etc. For these detailed elements, if a complex interior model is created for each component object of the interior furnishings, it will result in huge performance overhead. Therefore, it is necessary to use Shader techniques to create fake interior technology, and pre-projection technology is one of the efficient and easy-to-use methods.
[0003] In pre-projection technology, developers generally place a simple two-dimensional plane model in the scene to represent the surface of the window. Behind the plane of the window, a virtual three-dimensional box is used to simulate the indoor three-dimensional space behind the window. In addition, the developer will create a 2D texture image in advance as the result of pre-projecting the scene inside the window; then, the ray emitted from the player's perspective is intersected with the virtual three-dimensional box behind the window, and based on the intersection, the point where the player's line of sight enters the window can be determined. Furthermore, the shader can determine the coordinates (texture coordinates) on the texture image based on the intersection, and sample the pre-projected 2D texture image based on the texture coordinates. In this way, the effect inside the window is like it really exists.
[0004] However, the inventors found that there are at least the following technical problems in the related art:
[0005] Because pre-projection technology usually uses a two-dimensional texture image to simulate the interior effect, it will result in a lack of depth and layering in the fake interior. When observing the furnishings in the fake interior from the side, visual distortion or bending may occur, exposing the flaws in the fake interior. Summary of the invention
[0006] One purpose of the present application is to provide a method, device, medium and product for determining the effect of a fake indoor display window, at least to solve the technical problem that the fake indoor display window has insufficient depth and layering in the related art. When the display in the fake indoor display window is observed from the side, visual distortion or bending may occur, exposing the technical problem of the flaws in the fake indoor display window.
[0007] To achieve the above objectives, some embodiments of the present application provide the following aspects:
[0008] In the first aspect, some embodiments of the present application also provide a method for determining a fake indoor window effect, the method comprising: determining a virtual plane based on depth information of objects in the indoor space; wherein the virtual plane has multiple layers, and virtual planes in different layers are independent of each other; and determining a fake indoor window effect corresponding to the indoor space based on the virtual plane.
[0009] In a second aspect, some embodiments of the present application further provide an electronic device, comprising: one or more processors; and a memory storing computer program instructions, wherein the computer program instructions, when executed, cause the processor to perform the steps of the method described above.
[0010] In a third aspect, some embodiments of the present application further provide a computer-readable medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the method as described above.
[0011] In a fourth aspect, some embodiments of the present application further provide a computer program product, comprising a computer program / instruction, which implements the steps of the method described above when executed by a processor.
[0012] Compared with the related art, it is not difficult to find that in the solution provided in the embodiment of the present application, compared with the related art, the solution provided in the embodiment of the present application proposes a layered concept, by determining multiple layers of virtual planes according to the depth information of objects in the indoor space, and the virtual planes of different layers are independent of each other; then, according to the virtual planes, the fake indoor window effect corresponding to the indoor space is determined. In the embodiment of the present application, since each layer of virtual plane can simulate a target object with different depth information and thus correspond to different texture images, the depth and stereoscopic sense of the fake indoor effect can be significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0014] Figure 1 An exemplary flow chart of a method for determining a fake indoor window effect provided according to some embodiments of the present application;
[0015] Figure 2 This is an exemplary flow chart of step S101 in a method for determining a fake indoor window effect provided in some embodiments of the present application;
[0016] Figure 3This is an exemplary schematic diagram of performing multiple intersection calculations in a method for determining a fake indoor window effect provided in some embodiments of the present application;
[0017] Figure 4 This is an exemplary schematic diagram of performing an intersection calculation provided in a traditional technical solution;
[0018] Figure 5 This is an exemplary flow chart of step S102 in a method for determining a fake indoor window effect provided in some embodiments of the present application;
[0019] Figure 6 An exemplary schematic diagram of generating a pre-projected 2D texture image based only on a wall portion in the indoor space in a method for determining a fake indoor window effect provided in some embodiments of the present application;
[0020] Figure 7 This is an exemplary schematic diagram of making other objects displayed in the indoor space into independent pre-projected 2D texture images in a method for determining a fake indoor window effect provided in some embodiments of the present application;
[0021] Figure 8 and Fig. 9 The comparison diagrams of the fake indoor window effects of the traditional solution and the solution provided by the embodiment of the present application are respectively shown at the front view angle and the side view angle;
[0022] Fig.10 and Fig.11 Another comparison diagram of the fake indoor window effect of the traditional solution and the solution provided by the embodiment of the present application is shown in front view and side view respectively;
[0023] Fig.12 An exemplary schematic diagram of an offset process of sampling texture coordinates in a method for determining a fake indoor window effect provided according to some embodiments of the present application;
[0024] Fig.13 This is an exemplary schematic diagram of a normal texture used in a method for determining a fake indoor window effect provided according to some embodiments of the present application;
[0025] Fig.14 This is an exemplary schematic diagram of the influence of different offset degrees on the distortion of fake indoor texture and the change of offset effect in a method for determining a fake indoor window effect provided according to some embodiments of the present application;
[0026] Fig.15 This is an exemplary schematic diagram of the performance of a false indoor window effect corresponding to a specific indoor space by a disturbance effect in a method for determining a false indoor window effect provided in some embodiments of the present application;
[0027] Fig.16 This is a schematic diagram of an exemplary structure of an electronic device provided according to some embodiments of the present application. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0029] The following terms are used in this article.
[0030] Pre-projection,Before a 3D scene is projected onto a 2D plane, a series of preprocessing steps involving various mathematical calculations and geometric transformations are required.
[0031] Fake interior refers to the use of one or more simple two-dimensional planes (Mesh) to replace the actual three-dimensional interior model in the game in order to save performance, and through a series of calculation and transformation methods, the two-dimensional plane can visually show complex indoor effects.
[0032] Shader is a program used to calculate rendering effects and is mainly executed on the GPU.
[0033] Patterned glass is a kind of decorative glass that uses a special process to create concave and convex patterns or designs on the glass surface.
[0034] The offline environment refers to the stage where developers edit and create games within the game engine.
[0035] Runtime refers to the stage when the game program is running, which is also the stage when the player finally plays the game.
[0036] Intersection refers to finding the intersection point. In this solution, it refers to calculating the coordinates of the intersection point between the ray and the surface of the virtual geometric body.
[0037] First embodiment
[0038] The first embodiment of the present application relates to a method for determining a fake indoor window effect. Figure 1 As shown, the method may include the following steps: Figure 1 As shown:
[0039] Step S101, determining a virtual plane according to depth information of an object in an indoor space; wherein the virtual plane has multiple layers, and virtual planes at different layers are independent of each other;
[0040] Step S102: determining a fake indoor window effect corresponding to the indoor space according to the virtual plane.
[0041] The following is a detailed description of each of the above steps.
[0042] For step S101, specifically, in some examples, the indoor space may be a 3D model of the indoor space created in 3D modeling software. The objects in the indoor space specifically refer to objects displayed in the indoor space, and the objects are virtual objects. These objects may have different depths. For example, the objects may be, but are not limited to, tables, sofas, benches, walls, and the like. Exemplarily, the depth information of different objects in the indoor space may be obtained by 3D scanning, photogrammetry, and the like. Then, the virtual plane may be determined based on the depth information.
[0043] The number of layers of the virtual plane is multiple. For example, assuming that the objects in the indoor space include: a wall, a sofa and a TV cabinet, and the depth information of the wall, the sofa and the TV cabinet in the indoor space is different, a virtual plane 1 where the wall is located can be created; a virtual plane 2 where the sofa is located can be created; and a virtual plane 3 where the TV cabinet is located can be created.
[0044] Among them, the virtual planes of different layers are independent of each other. From the perspective of the horizontal section, each virtual plane belongs to a different layer, and the virtual planes of different layers are not connected. Each virtual plane can correspond to its own content and has nothing to do with other virtual planes. For example, the virtual object corresponding to the first virtual plane is a table, and the virtual object corresponding to the second virtual plane is a bookshelf. The first virtual plane and the second virtual plane are in the same indoor space, but the first virtual plane and the second virtual plane exist independently. From the perspective of the longitudinal section, different virtual planes are not in the same plane. For example, in the same indoor space, walls, sofas, and bookcases can all be regarded as different virtual planes, and they have different positions in the vertical direction.
[0045] Regarding step S102, specifically, in some examples, a fake indoor window effect corresponding to the indoor space can be determined based on the multi-layer virtual plane. The fake indoor window effect refers to simulating the perspective of the indoor space so that the player can see the scene of the indoor space, just like seeing the indoor space through a window.
[0046] It is not difficult to find that, compared with the related art, the solution provided in the embodiment of the present application proposes a layered concept, by determining multiple layers of virtual planes according to the depth information of objects in the indoor space, and the virtual planes of different layers are independent of each other; then, according to the virtual planes, the fake indoor window effect corresponding to the indoor space is determined. In the embodiment of the present application, since each layer of virtual plane can simulate a target object with different depth information and thus correspond to different texture images, the depth and stereoscopic sense of the fake indoor effect can be significantly improved.
[0047] Second embodiment
[0048] The second embodiment of the present application relates to a method for determining a fake indoor window effect. The second embodiment is an improvement on the first embodiment, and the specific improvement is: in the second embodiment of the present application, a specific implementation method for determining a virtual plane based on the depth information of objects in the indoor space is provided.
[0049] Specifically, in some embodiments, the step of determining the virtual plane according to the depth information of the object in the indoor space, that is, step S101, may further include the following steps: Figure 2 As shown:
[0050] Step S1011, determining a target object according to depth information of an object in the indoor space; the depth information of the target object is different;
[0051] Step S1012: determining the virtual plane according to the target object and the player's line of sight.
[0052] Exemplarily, the depth information of the target object may be the relative distance between the target object and the player's perspective. The depth information of objects located at different positions in the indoor space is different. For example, the indoor space may be classified first according to the depth information, such as taking a plane perpendicular to the ground as a reference, and the near position, the middle position and the far position may be determined, the near position is closer to the player's perspective, the far position is farther from the player's perspective, and the middle position is between the near position and the far position. In this way, it may be determined whether there is an object in the vertical plane where the near position, the middle position and the far position are located. If there is an object 1 in the vertical plane where the near position is located, the object 1 is determined as the target object, and the depth information of the object 1 is the depth information corresponding to the near position; if there is no object in the vertical plane where the middle position is located, the object 2 closest to the vertical plane where the middle position is located is automatically searched for, and the object 2 is determined as the target object, and the object 2 has its corresponding depth information; if there is no object in the vertical plane where the distant position is located, the object 3 closest to the vertical plane where the distant position is located is automatically searched for, and the object 3 is determined as the target object, and the object 3 has its corresponding depth information.
[0053] Optionally, in some embodiments, determining the target object according to the depth information of the object in the indoor space may include: determining the first object according to the wall portion of the indoor space; determining the second object according to the depth information of other objects in the indoor space except the wall; thus, the first virtual plane may be determined according to the first object and the player's line of sight; and the second virtual plane may be determined according to the second object and the player's line of sight. Exemplarily, the second virtual plane may have multiple layers, and the second virtual planes at different layers are independent of each other.
[0054] Optionally, in some embodiments, the step S1012 may further include the following steps: performing intersection calculations based on the target object and the player's line of sight to determine the virtual plane; wherein the number of intersection calculations is multiple. Performing intersection calculations on each layer of virtual planes at runtime is helpful to improve the visual effect of the fake indoor display window, especially at a side view angle, and can better maintain the correctness and realism of the objects displayed in the indoor space.
[0055] Exemplarily, the player's line of sight refers to the player's line of sight from the position of the camera, pointing to a certain point in the indoor space.
[0056] For example, a virtual cube or cuboid (virtual BOX) can be used to represent the boundary of the window of the indoor space and the target object, and the virtual BOX has a corresponding position and size. Thus, a ray tracing algorithm can be used to determine the intersection of the player's line of sight and the virtual box; if the player's line of sight intersects with the virtual box, the intersection of the player's line of sight and the surface of the virtual box is calculated, so that a multi-layer virtual plane with different depths in the vertical direction can be constructed according to the intersection.
[0057] by Figure 3 , in which, in addition to the basic intersection calculation based on the wall part of the indoor space, an additional intersection calculation is added, and three layers of virtual planes are constructed based on the results of the intersection technology, and the three layers of virtual planes are: a virtual plane corresponding to the near distance, a virtual plane corresponding to the middle distance, and a virtual plane corresponding to the far distance. Optionally, in some embodiments, the number of layers of the second virtual plane generally does not exceed 5 layers.
[0058] It can be understood that in the traditional technical solution, usually only one intersection calculation is performed between the boundary virtual BOX of the window used to represent the indoor space and the player's sight line, such as Figure 4 As shown. Considering that the virtual BOX and the player's line of sight are intersected once, the performance pressure is not great; therefore, in the embodiment of the present application, while maintaining the performance, the virtual BOX used to represent the target object and the player's line of sight are additionally intersected, and by increasing the number of additional intersection calculations, a multi-layer virtual plane with different depths in the vertical direction is constructed to enhance the fake indoor window effect corresponding to the indoor space. Among them, the number of intersection calculations is multiple. Optionally, in some embodiments, the number of layers of the second virtual plane generally does not exceed 5 layers, and the number of additional intersection calculations is generally not more than 5 times. Exemplarily, the number of intersection calculations can be 2 times, 3 times or 4 times, etc. The inventors found that when the number of additional intersection calculations is generally not more than 5 times, the performance pressure is still within a controllable range, thereby achieving the purpose of maintaining performance while enhancing the depth and stereoscopic sense of the fake indoor effect; if the additional intersection calculation is greater than 5 times, the performance pressure is further increased, resulting in uncontrollable performance.
[0059] It is not difficult to find that in the embodiment of the present application, a specific implementation method for determining a virtual plane based on the depth information of an object in an indoor space is provided. Specifically, the target object is determined based on the depth information of the object in the indoor space; the depth information of the target object is different; and then the virtual plane is determined based on the target object and the player's line of sight. Since each layer of virtual plane can sample the texture of different target objects, each layer of virtual plane can simulate target objects with different depth information and thus correspond to different texture images, which can significantly improve the depth and stereoscopic sense of the fake indoor effect.
[0060] Third embodiment
[0061] The third embodiment of the present application relates to a method for determining a fake indoor window effect. The third embodiment is an improvement on the second embodiment, and the specific improvement is: in the third embodiment of the present application, a specific implementation method for determining a fake indoor window effect corresponding to the indoor space according to the virtual plane is provided.
[0062] Specifically, in some embodiments, the step of determining the fake indoor window effect corresponding to the indoor space according to the virtual plane, that is, step S102 may further include the following steps: Figure 5 As shown:
[0063] Step S1021, sampling the pre-projected 2D texture according to the texture coordinates of each layer of the virtual plane to obtain a sampling result; wherein each layer of the virtual plane corresponds to a different pre-projected 2D texture image;
[0064] Step S1022: determining a fake indoor window effect corresponding to the indoor space according to the sampling result.
[0065] Exemplarily, the intersection coordinate mapping of each layer of virtual planes can be converted into texture coordinates to obtain the texture coordinates of each layer of the virtual planes; and according to the texture coordinates of each layer of the virtual planes, the pre-projected 2D texture images corresponding to the virtual planes of different layers are sampled respectively, so as to obtain a fake indoor window effect corresponding to the indoor space, and the fake indoor window effect has a multi-layer depth effect.
[0066] Exemplarily, the pre-projected 2D texture image is prepared in an offline environment. That is, it is necessary to produce multiple pre-projected 2D texture images before the game is run. In the embodiment of the present application, multiple pre-projected 2D texture images are carefully produced in the offline stage to be layered according to the depth information of the objects displayed in the indoor space. In this way, the effect of the fake indoor window can be more accurately calculated and rendered during runtime.
[0067] It is understandable that in the traditional technical solution, all objects displayed in the interior space will be merged into a pre-projected 2D texture image. This will result in the interior furnishings that originally have different depth information being given the same depth information; since the depth information of all objects displayed in the interior space is the same, it is impossible to accurately reflect the visual changes in depth of different objects. Therefore, when the player's perspective turns to the side, it will be found that the objects displayed in the interior space are severely distorted and stretched.
[0068] In the embodiment of the present application, a pre-projected 2D texture image can be generated based on only the wall portion in the indoor space. The texture of the wall portion can be called wallpaper, in the form of Figure 6 As shown, then, other objects displayed in the indoor space are made into independent pre-projected 2D texture images, such as Figure 7 It should be noted that Figure 7 Although the four parts are shown in the same figure, each part corresponds to a pre-projected 2D texture image. In this way, other objects displayed in the interior space can also have their own depth information and texture. In this way, at runtime, each layer of the virtual plane can be correctly synthesized and rendered according to the player's line of sight and depth information, thereby providing a more accurate visual effect and reducing distortion and stretching from a side view.
[0069] It is worth mentioning that, from the perspective of the front view, there is no obvious difference between the fake indoor window effects of the traditional solution and the solution provided by the embodiment of the present application. Figure 8 However, in the side view, the depth information of all objects displayed in the indoor space in the traditional solution is compressed, resulting in an obvious stretching phenomenon. In the embodiment of the present application, since multiple layers of virtual planes are split according to the depth information, the accuracy of the effect can be maintained even in the side view, such as Fig. 9 shown.
[0070] Further, Fig.10 and Fig.11 The contrast effect combined with the texture of a specific indoor space is demonstrated, which can further prove that the solution provided in the embodiment of the present application can provide players with better visual effects from different perspectives of the players.
[0071] It should be noted that the third embodiment of the present application may also be an improvement based on the first embodiment.
[0072] It is not difficult to find that in the embodiment of the present application, the sampling result is obtained by sampling the pre-projected 2D texture according to the texture coordinates of each layer of the virtual plane; wherein each layer of the virtual plane corresponds to a different pre-projected 2D texture image, so as to determine the fake indoor window effect corresponding to the indoor space according to the sampling result, and provide a specific implementation method for determining the fake indoor window effect corresponding to the indoor space according to the virtual plane.
[0073] Fourth embodiment
[0074] The fourth embodiment of the present application relates to a method for determining a fake indoor window effect. The fourth embodiment is an improvement on the first embodiment, and the specific improvement is that: in the fourth embodiment of the present application, after determining the fake indoor window effect corresponding to the indoor space according to the virtual plane, the refraction of light is further simulated by perturbing the normal of the glass surface layer of the fake indoor window, so as to achieve the visual effect of embossed glass in the fake indoor window.
[0075] The perturbation is to make small, random changes to the texture coordinates to simulate the irregularities of the embossed glass surface.
[0076] Specifically, in some embodiments, after determining the fake indoor window effect corresponding to the indoor space based on the virtual plane, the method may further include: perturbing the normal of the glass surface layer of the fake indoor window according to the texture coordinates of each layer of the virtual plane to simulate light refraction and realize the visual effect of embossed glass in the fake indoor window.
[0077] Optionally, in some embodiments, the perturbing the normal of the glass surface layer of the fake indoor window according to the texture coordinates of each layer of the virtual plane may further include the following steps:
[0078] Step S201, sampling the normal texture according to the texture coordinates of the virtual plane of each layer to determine the offset vector;
[0079] Step S202, according to the offset vector, the texture coordinates of each layer of the virtual plane are offset to disturb the normal of the glass surface layer of the fake indoor window; wherein the offset degree represented by the offset vector is positively correlated with the refraction intensity of the light refraction.
[0080] Exemplarily, the normal texture may be sampled using the texture coordinates of the virtual plane of each layer to obtain the offset vector, wherein the offset vector is generally a two-dimensional offset vector.
[0081] Exemplarily, the offset vector is used to adjust the texture coordinates of each layer of the virtual plane, so that the texture mapping changes, so that the texture of each layer of the virtual plane obtained by sampling will produce an offset and stretching effect. Fig.12 As shown, the offset process of sampling texture coordinates is shown. Point A is the original texture coordinate sampling point, and after the original texture coordinate sampling point is perturbed and offset according to the offset vector, the original texture coordinate sampling point will be offset to form a new texture coordinate sampling point A'.
[0082] See also Fig.13 , which is an exemplary schematic diagram of a normal texture used in some examples.
[0083] See also Fig.14 1 and 2. Shown are the effects of different offset levels on the distortion and offset effects of the fake indoor texture in some examples.
[0084] See also Fig.15 As shown, the performance of the perturbation effect in some examples corresponding to the fake indoor window effect in the specific indoor space is further demonstrated.
[0085] Optionally, in some embodiments, the step of shifting the texture coordinates of the virtual plane of each layer according to the offset vector, that is, step S202, may further include the following steps:
[0086] Step S2021, determining a compressed offset vector according to the offset vector; wherein the compressed offset vector is used to represent vector data compressed and mapped to a preset range of the offset vector;
[0087] Step S2022: offset the texture coordinates of the virtual plane of each layer according to the compression offset vector.
[0088] Exemplarily, for the offset vector, since it can be offset to the left or to the right, the value of the offset vector can be positive or negative, so the value of the offset vector is generally between -1 and 1. However, considering that for a picture, a picture can only store values between 0 and 255, it is necessary to perform compression mapping processing on the offset vector to obtain vector data within the range of 0 to 1. Then, according to the vector data within the range of 0 to 1, the texture coordinates of the virtual plane of each layer are offset.
[0089] Exemplarily, the compression offset vector may be stored in, but not limited to, an RG channel.
[0090] It can be understood that in the traditional technical solution, if the refraction effect of embossed glass needs to be simulated, it is generally necessary to enable the refraction processing process in the rendering pipeline to perform complex ray tracing and calculation, which will generate a lot of performance overhead. In the embodiment of the present application, the refraction of light is simulated by perturbing the texture coordinates of each layer of the virtual plane, and the refraction processing process in the rendering pipeline does not need to be enabled. Therefore, the visual effect of embossed glass can be achieved in the fake indoor window while maintaining relatively good performance.
[0091] It should be noted that the fourth embodiment of the present application may also be an improvement based on any one or more of the first to third embodiments.
[0092] It is not difficult to find that in the embodiment of the present application, after determining the fake indoor window effect corresponding to the indoor space according to the virtual plane, the refraction of light is further simulated by disturbing the normal of the glass surface of the fake indoor window to achieve the visual effect of embossed glass in the fake indoor window. In this way, not only the Shader is used more cleverly to show the window effect of embossed glass, the overall artistic performance is improved, but also the performance consumption caused by refraction rendering in the traditional technical solution is saved.
[0093] The step division of the above methods is only for the purpose of clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this patent.
[0094] In addition, some embodiments of the present application also provide an electronic device. The electronic device may be a digital computer in various forms, such as a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, etc. The electronic device may also be a mobile device in various forms, such as a personal digital processing, a cellular phone, a smart phone, a wearable device, and other similar computing devices.
[0095] The electronic device includes: one or more processors; and a memory storing computer program instructions, wherein when the computer program instructions are executed, the processor executes the steps of the method provided in any one or more of the above embodiments. Fig.16 An exemplary structural diagram of the electronic device is disclosed. Fig.16As shown, the electronic device includes: one or more processors 1101, memory 1102, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Among them, the components shown in this article, their connections and relationships, and their functions are only used as examples, and are not intended to limit the implementation of the present application described and / or required herein.
[0096] The electronic device may further include: an input device 1103 and an output device 1104. The processor 1101, the memory 1102, the input device 1103 and the output device 1104 may be connected via a bus or other means. Fig.16 The example of connecting through bus is taken in the following.
[0097] The input device 1103 can receive input digital or character information, and generate key signal input related to the user settings and function control of the electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a track ball, a joystick and other input devices. The output device 1104 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.
[0098] To provide interaction with a user, the electronic device may be a computer. The computer has: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball), through which the user can provide input to the computer. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0099] In the embodiments of the present application, a computer program / instruction is stored on a computer-readable medium, and when the computer program / instruction is executed by a processor, the steps of the method provided by any one or more of the above embodiments are implemented. The computer-readable medium may be included in the electronic device described in the above embodiments; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more computer-readable instructions.
[0100] The memory 1102 can be used as a non-transient computer-readable storage medium, which can be used to store non-transient software programs, non-transient computer executable programs and modules. The processor 1101 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 1102, so as to implement the program instructions / modules corresponding to the method provided by any one or more embodiments in the embodiments of the present application.
[0101] The memory 1102 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 1102 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 1102 may optionally include a memory remotely arranged relative to the processor 1101, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0102] It should be noted that the computer-readable medium described in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.
[0103] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
[0104] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet).
[0105] In the above-described embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. For example, it can be implemented by using an application specific integrated circuit (ASIC), a general-purpose computer or any other similar hardware device. In certain embodiments, the software program of the present application can be executed by a processor to implement the above steps or functions. Similarly, the software program of the present application (including relevant data structures) can be stored in a computer-readable recording medium, for example, a RAM memory, a magnetic or optical drive or a floppy disk and similar devices. In addition, some steps or functions of the present application can be implemented by hardware, for example, as a circuit that cooperates with a processor to perform each step or function.
[0106] The computer program product provided in the embodiment of the present application includes one or more computer programs / instructions, and when the computer program / instructions are executed by the processor, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive so lid state di sk (SSD)), etc.
[0107] The flow chart or block diagram in the accompanying drawings shows the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0108] The scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes that fall within the meaning and scope of the equivalent elements of the claims are included in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the device claim may also be implemented by one unit or device through software or hardware. The words "first", "second", etc. are only used to distinguish the description, and do not indicate any particular order, nor can they be understood as indicating or implying relative importance.
[0109] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily mention changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims, and the above embodiments should be regarded as exemplary and non-restrictive.
Claims
1. A method for determining a fake indoor window effect, characterized in that: The method comprises: Determine a virtual plane according to the depth information of the object in the indoor space; wherein the virtual plane has multiple layers, and the virtual planes at different layers are independent of each other; A fake indoor window effect corresponding to the indoor space is determined according to the virtual plane.
2. The method according to claim 1, characterized in that Determining the virtual plane according to the depth information of the object in the indoor space includes: Determining a target object according to depth information of an object in an indoor space; the depth information of the target object is different; The virtual plane is determined according to the target object and the player's line of sight.
3. The method according to claim 2, characterized in that The determining the virtual plane according to the target object and the player's line of sight comprises: The virtual plane is determined by performing an intersection calculation based on the target object and the player's line of sight; wherein the intersection calculation is performed multiple times.
4. The method according to claim 1, characterized in that: Determining the fake indoor window effect corresponding to the indoor space according to the virtual plane includes: According to the texture coordinates of each layer of the virtual plane, the pre-projected 2D texture is sampled to obtain a sampling result; wherein each layer of the virtual plane corresponds to a different pre-projected 2D texture image; According to the sampling result, a fake indoor window effect corresponding to the indoor space is determined.
5. The method according to any one of claims 1 to 4, characterized in that: After determining the fake indoor window effect corresponding to the indoor space according to the virtual plane, the method includes: According to the texture coordinates of each layer of the virtual plane, the normal of the glass surface layer of the fake indoor window is disturbed to simulate the refraction of light and realize the visual effect of embossed glass in the fake indoor window.
6. The method according to claim 5, characterized in that The perturbing the normal of the glass surface layer of the fake indoor window according to the texture coordinates of each layer of the virtual plane comprises: Sampling the normal texture according to the texture coordinates of the virtual plane of each layer to determine the offset vector; According to the offset vector, the texture coordinates of each layer of the virtual plane are offset to disturb the normal of the glass surface layer of the fake indoor window; wherein the offset degree represented by the offset vector is positively correlated with the refraction intensity of the light refraction.
7. The method according to claim 6, characterized in that The step of shifting the texture coordinates of the virtual plane of each layer according to the offset vector comprises: Determine a compressed offset vector according to the offset vector; wherein the compressed offset vector is used to represent vector data compressed and mapped to a preset range of the offset vector; The texture coordinates of the virtual plane of each layer are offset according to the compression offset vector.
8. An electronic device, characterized in that: The electronic device comprises: one or more processors; and A memory storing computer program instructions, which, when executed, cause the processor to perform the steps of the method as claimed in any one of claims 1 to 7.
9. A computer readable medium having a computer program / instructions stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
