Virtual three-dimensional model rendering method and device, storage medium and electronic device
By performing pixel grayscale calculation on the first map of the virtual three-dimensional model, combining directed distance field information and interpolation mixing processing of target pre-rendered images, the problem of poor viewing angle switching fluency in pseudo-3-dimensional model display is solved, and a higher level of viewing angle switching is achieved user experience.
Patent Information
- Application Number
- CN202310962582.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-01
- Publication Date
- 2025-02-14
AI Technical Summary
Existing pseudo-3D model display methods are prone to screen jumps when switching observation angles, and adding pre-rendered images to reduce jump visibility will lead to increased package occupation, thereby increasing rendering costs.
By performing pixel grayscale calculation on the first map of the virtual three-dimensional model, a second map is obtained, in which directed distance field information is stored; based on the current viewing angle, at least two target pre-rendered images are determined from the multiple pre-rendered images, and the pre-rendered images are determined for the first map of the virtual three-dimensional model and the second map is obtained, where directed distance field information is stored; based on the current viewing angle, at least two target pre-rendered images are determined from the multiple pre-rendered images, and the pre-rendered images are determined from the multiple pre-rendered images, and the pre-rendered images is determined from the first map of the virtual three-dimensional model. The second map is obtained by performing pixel grayscale calculation on the first map of the virtual three-dimensional model, and the directed distance field information is stored; and the directed distance field information is stored; and the directed distance field information is stored; based on the current viewing angle, at least two target pre-rendered images are determined from the multiple pre-rendered images from the first map of the virtual three-dimensional model. Based on the current viewing angle, at least two target pre-rendered images are determined from the first map of the virtual three-dimensional model. Based on the current viewing angle, at least two target pre-rendered images are determined from the first map of the virtual three-dimensional model, and the second map is obtained by performing pixel grayscale calculation on the first map of the virtual three-dimensional model, and the second map is obtained by storing the first map of the virtual three-dimensional model. Based on the current viewing angle, at least two target pre-rendered images are determined from the first map of the virtual three-dimensional model. Based on the current viewing angle, at least two target pre-rendered images are determined from the first map of the virtual three-dimensional model, and the second map is obtained by storing the first map of the virtual three-dimensional model. Based on the current viewing angle, at least two target pre-rendered images are determined from the first map of the virtual three-dimensional model. Based on the current viewing angle, at least two target pre Directed distance field information and target pre-rendered image are interpolated and mixed to generate rendering results.
The smoothness of view angle switching during the display of pseudo-3D model is improved, the user experience is improved, and the problems of poor view angle switching are solved.
Smart Images

Figure CN119444958A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a rendering method, device, storage medium and electronic device for a virtual three-dimensional model. Background Art
[0002] In the process of computer image rendering, in order to reduce the rendering cost while ensuring the visual effect, virtual patches are often used to replace the display of partial models (such as distant models with low display accuracy requirements) in the virtual scene through pseudo-3D (Imposter) technology. In the shader, the image of the observation angle closest to the virtual scene in the pre-rendered multiple angle images is sampled, and then the sampling result is displayed on the virtual patch to achieve the three-dimensional visual effect of the virtual three-dimensional model. However, the implementation method of the above-mentioned pseudo-3D (Imposter) technology has a defect that when the observation angle is switched, the pre-rendered multiple angle images are switched to display, and further, even if the obvious degree of the picture jump is reduced by increasing the number of pre-rendered multiple angle images, the added images will cause the package to occupy more, thereby increasing the rendering cost.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] At least some embodiments of the present application provide a method, device, storage medium and electronic device for rendering a virtual three-dimensional model, so as to at least solve the technical problems in the prior art of the pseudo three-dimensional model display method of the pre-rendered image which is only based on the observation perspective sampling display model, such as poor perspective switching smoothness and poor user experience.
[0006] According to one embodiment of the present application, a rendering method of a virtual three-dimensional model is provided, comprising: performing pixel grayscale calculation on a first map corresponding to the virtual three-dimensional model to obtain a second map, wherein the first map stores a plurality of pre-rendered images of the virtual three-dimensional model at a plurality of preset viewing angles, the plurality of pre-rendered images are arranged in a determinant in the first map according to angle deflection values of the plurality of preset viewing angles in a virtual scene, and the second map stores signed distance field information corresponding to the plurality of pre-rendered images; based on a current viewing angle corresponding to the virtual three-dimensional model, determining at least two target pre-rendered images from the plurality of pre-rendered images, wherein the at least two target pre-rendered images are adjacent in a row direction or a column direction in the determinant arrangement; and performing interpolation and mixing processing on the signed distance field information and the at least two target pre-rendered images to generate a rendering result of the virtual three-dimensional model.
[0007] According to one embodiment of the present application, a switching display method for a virtual three-dimensional model is also provided, comprising: displaying a first scene image corresponding to the virtual three-dimensional model in a graphical user interface, wherein the first scene image is obtained by interpolating and mixing at least two first target images and directed distance field information stored in a second map determined by a first map, the first map stores a plurality of pre-rendered images of the virtual three-dimensional model at a plurality of preset viewing angles, the plurality of pre-rendered images are arranged in a determinant in the first map according to angle deflection values of the plurality of preset viewing angles in the virtual scene, the at least two first target images are determined from the plurality of pre-rendered images based on the first viewing angle, the second map is obtained by interpolating and mixing the first map A pixel grayscale calculation is performed to determine that the second map stores signed distance field information corresponding to a plurality of pre-rendered images, and at least two first target images are adjacent in a row direction or a column direction in a determinant-column arrangement; in response to a scene observation perspective corresponding to the virtual three-dimensional model being switched from a first perspective to a second perspective, a graphical user interface is controlled to switch from displaying the first scene image to displaying a second scene image corresponding to the virtual three-dimensional model, wherein the second scene image is obtained by performing interpolation and mixing processing on at least two second target images and the signed distance field information, the second target image is determined from the plurality of pre-rendered images based on the second perspective, and at least two second target images are adjacent in a row direction or a column direction in a determinant-column arrangement.
[0008] According to one embodiment of the present application, a rendering device for a virtual three-dimensional model is also provided, including: a processing module, used to perform pixel grayscale calculation on a first map corresponding to the virtual three-dimensional model to obtain a second map, wherein the first map stores a plurality of pre-rendered images of the virtual three-dimensional model at a plurality of preset viewing angles, and the plurality of pre-rendered images are arranged in a determinant manner in the first map according to the angle deflection values of the plurality of preset viewing angles in the virtual scene, and the second map stores signed distance field information corresponding to the plurality of pre-rendered images; a determination module, used to determine at least two target pre-rendered images from the plurality of pre-rendered images based on a current viewing angle corresponding to the virtual three-dimensional model, wherein the at least two target pre-rendered images are adjacent in a row direction or a column direction in the determinant arrangement; and a processing module, used to perform interpolation and mixing processing on the signed distance field information and the at least two target pre-rendered images to obtain a rendering result of the virtual three-dimensional model.
[0009] According to one embodiment of the present application, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned virtual three-dimensional model rendering method or virtual three-dimensional model switching display method when running.
[0010] According to one embodiment of the present application, an electronic device is also provided, including: a memory and a processor, the memory storing a computer program, and the processor being configured to run the computer program to execute the above-mentioned virtual three-dimensional model rendering method or virtual three-dimensional model switching display method.
[0011] In at least some embodiments of the present application, a second map is obtained by performing pixel grayscale calculation on a first map corresponding to a virtual three-dimensional model, wherein the first map stores a plurality of pre-rendered images of the virtual three-dimensional model at a plurality of preset viewing angles, and the plurality of pre-rendered images are arranged in a determinant in the first map according to angle deflection values of the plurality of preset viewing angles in a virtual scene, and the second map stores signed distance field information corresponding to the plurality of pre-rendered images; then, based on a current viewing angle corresponding to the virtual three-dimensional model, at least two target pre-rendered images are determined from the plurality of pre-rendered images, wherein the at least two target pre-rendered images are adjacent in a row direction or a column direction in the determinant arrangement; and the signed distance field information and the at least two target pre-rendered images are further interpolated and mixed to generate a rendering result of the virtual three-dimensional model. Therefore, the present application achieves the purpose of rendering the virtual three-dimensional model based on the current perspective corresponding to the virtual three-dimensional model and multiple pre-rendered images with corresponding signed distance field information, thereby achieving the technical effect of improving the perspective switching smoothness and user experience during the pseudo three-dimensional model display process, and further solves the technical problem of poor perspective switching smoothness and poor user experience in the prior art of the pseudo three-dimensional model display method that only displays the pre-rendered images of the model based on the observation perspective sampling. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0013] Figure 1 It is a hardware structure block diagram of a mobile terminal of a method for rendering a virtual three-dimensional model in one embodiment of the present application;
[0014] Figure 2 is a flowchart of a method for rendering a virtual three-dimensional model according to one embodiment of the present application;
[0015] Figure 3 is a schematic diagram of an optional process of generating a second map according to one embodiment of the present application;
[0016] Figure 4 is a schematic diagram of an optional first map according to one embodiment of the present application;
[0017] Figure 5 is a schematic diagram of another optional first map according to one embodiment of the present application;
[0018] Figure 6 is a schematic diagram of an optional mapping result according to one embodiment of the present application;
[0019] Figure 7 is a schematic diagram of an optional third grayscale image according to one embodiment of the present application;
[0020] Figure 8 is a schematic diagram of an optional inversion result according to one embodiment of the present application;
[0021] Fig. 9 is a schematic diagram of an optional fifth grayscale image according to one embodiment of the present application;
[0022] Fig.10 is a schematic diagram of an optional fourth grayscale image according to one embodiment of the present application;
[0023] Fig.11 is a schematic diagram of an optional second grayscale image according to one embodiment of the present application;
[0024] Fig.12 is a schematic diagram of an optional second mapping process according to one embodiment of the present application;
[0025] Fig.13 is a schematic diagram of an optional process of determining a target pre-rendered image according to one embodiment of the present application;
[0026] Fig.14 is a flow chart of a method for switching display of a virtual three-dimensional model according to one embodiment of the present application;
[0027] Fig.15 is a structural block diagram of a virtual three-dimensional model rendering device according to one embodiment of the present application;
[0028] Fig.16 is a structural block diagram of a switching display device for a virtual three-dimensional model according to one embodiment of the present application;
[0029] Fig.17 is a schematic diagram of an electronic device according to one embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the solution of the present application, 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 only 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 should fall within the scope of protection of the present application.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] It should be noted that, in the specification of the present application, the word "for example" is used to mean "used as an example, illustration or description". Any embodiment described as "for example" in the present application is not necessarily interpreted as being more preferred or more advantageous than other embodiments. In order to enable any technician in the field to implement and use the present application, the following description is given. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can be implemented without using these specific details. In other examples, well-known structures and processes will not be elaborated in detail to avoid unnecessary details that make the description of the present application obscure. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest range of principles and features disclosed in the present application.
[0033] In the process of describing the embodiments of the present application, some nouns or terms appearing are applicable to the following interpretations:
[0034] Shader: used to render virtual scenes in real time to calculate and generate different picture effects corresponding to the virtual scenes. The Shader can be used for image post-processing and supports user customization.
[0035] Two-dimensional signed distance field: A mathematical concept used to describe the orthogonal distance and inclusion relationship between a point on a two-dimensional plane and the boundary of a given set. In the field of computer graphics, grayscale images are usually used to store the data of two-dimensional signed distance fields. Two-dimensional signed distance fields can be used in application scenarios involving graphic fusion transitions.
[0036] Imposter image: refers to a pseudo-3D image, in which models with low display accuracy requirements (such as distant models, etc.) in the virtual scene are replaced by billboard patches. The billboard patches are virtual patches used to render the model and are always perpendicular to the viewing direction of the virtual camera. Imposter technology refers to the technology of displaying the image of the corresponding angle of the model pre-rendered on the map on the billboard patch according to the viewing angle of the virtual camera in the virtual scene.
[0037] In the process of computer image rendering, the existing pseudo 3D (Imposter) technology is implemented as follows: the first step is to pre-render the virtual 3D model from multiple angles, and store the rendered multiple angle images in a map (which can be called an Imposter map); the second step is to select the angle image with the rendering angle closest to the observation angle from the Imposter map in the shader according to the observation angle of the virtual 3D model in the virtual scene, and display the angle image on the Billboard patch. In the first step above, the multi-angle rendering of the virtual 3D model is implemented in one of the following ways: multiple virtual cameras are set around a single virtual 3D model to capture to assist the shader in rendering; a single virtual camera is used to capture multiple different placement angles of a single virtual 3D model to assist the shader in rendering.
[0038] However, the implementation method of the above-mentioned pseudo-3D (Imposter) technology has the following defects: when the viewing angle is switched, the pre-rendered multiple angle images are easily switched to display screen jumps. Furthermore, even if the number of pre-rendered multiple angle images is increased to reduce the obvious degree of screen jumps, it is still difficult to achieve smooth screen switching, and the increased images will lead to an increase in the package occupancy, thereby increasing the rendering cost. In view of the above defects, no effective solution has been proposed in the relevant technical field before the present application.
[0039] In a possible implementation of the present application, the inventors have found that the method of pre-rendering images of the model based on observation perspective sampling, which is usually used in the context of pseudo three-dimensional visual effects involving virtual three-dimensional models in the field of computer graphics, still has technical problems such as poor perspective switching fluency and poor user experience after practice and careful research. Based on this, the application scenario of the embodiment of the present application can be an application scenario of pseudo three-dimensional visual effects involving virtual three-dimensional models in virtual scenes, and the virtual scenes can be virtual game scenes, virtual building scenes, virtual meeting scenes, virtual film and television scenes, etc. In particular, the types of games targeted by the virtual game scenes can be action, adventure, simulation, role-playing, and leisure, etc.
[0040] An embodiment of the present application proposes a rendering method for a virtual 3D model, which aims to render the virtual 3D model based on the current viewing angle corresponding to the virtual 3D model and multiple pre-rendered images with corresponding signed distance field information, thereby achieving the technical effect of improving the viewing angle switching smoothness and user experience during the pseudo 3D model display process, and further solving the technical problem of poor viewing angle switching smoothness and poor user experience in the prior art pseudo 3D model display method that only displays the pre-rendered images of the model based on the observation viewing angle sampling.
[0041] The above method embodiments involved in this application can be executed in a terminal device (for example, a mobile terminal, a computer terminal or a similar computing device). Taking running on a mobile terminal as an example, the mobile terminal can be a smart phone, a tablet computer, a PDA, a mobile Internet device, a game console and other terminal devices.
[0042] Figure 1 1 is a hardware structure block diagram of a mobile terminal for a method for rendering a virtual three-dimensional model according to one embodiment of the present application. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 (only one is shown in the figure) processor 102, memory 104, transmission device 106, input / output device 108 and display device 110. Taking the virtual three-dimensional model rendering method applied to an electronic game scene through the mobile terminal as an example, the processor 102 calls and runs the computer program stored in the memory 104 to execute the virtual three-dimensional model rendering method, and the obtained virtual three-dimensional model rendering result is transmitted to the input / output device 108 and / or the display device 110 through the transmission device 106, and then the rendering result is provided to the player.
[0043] Still like Figure 1 As shown, the processor 102 may include but is not limited to: a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microcontroller unit (MCU), a programmable logic device (Field Programmable Gate Array, FPGA), a neural network processor (Neural-Network Processing Unit, NPU), a tensor processor (Tensor Processing Unit, TPU), an artificial intelligence (Artificial Intelligence, AI) type processor and other processing devices.
[0044] Those skilled in the art will understand that Figure 1 The structure shown is for illustration only and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0045] In some optional embodiments mainly based on game scenarios, the above-mentioned terminal device can also provide a human-computer interaction interface with a touch-sensitive surface, which can sense finger contact and / or gestures to perform human-computer interaction with a graphical user interface (Graphical User Interface, GUI). The human-computer interaction function may include the following interactions: creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving emails, call interface, playing digital videos, playing digital music and / or web browsing, etc. The executable instructions for executing the above-mentioned human-computer interaction functions are configured / stored in a computer program product or readable storage medium executable by one or more processors.
[0046] The above method embodiments involved in this application can also be executed in a server. Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms. Taking the application of the rendering method of a virtual three-dimensional model to an electronic game scene through an electronic game server as an example, the electronic game server can obtain the rendering result of the virtual three-dimensional model based on the rendering method of the virtual three-dimensional model, and provide the rendering result to the player (for example, it can be rendered and displayed on the display screen of the player's terminal, or provided to the player through holographic projection, etc.).
[0047] According to one embodiment of the present application, an embodiment of a method for rendering a virtual three-dimensional model is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0048] In this embodiment, a method for rendering a virtual three-dimensional model running on the above mobile terminal is provided. Figure 2 is a flowchart of a method for rendering a virtual three-dimensional model according to one embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:
[0049] Step S21, performing pixel grayscale calculation on a first map corresponding to the virtual three-dimensional model to obtain a second map, wherein the first map stores a plurality of pre-rendered images of the virtual three-dimensional model at a plurality of preset viewing angles, the plurality of pre-rendered images are arranged in a determinant in the first map according to angle deflection values of the plurality of preset viewing angles in the virtual scene, and the second map stores signed distance field information corresponding to the plurality of pre-rendered images;
[0050] The above virtual scenes may be virtual game scenes, virtual building scenes, virtual meeting scenes, virtual film and television scenes, etc. The game types corresponding to the virtual game scenes may be: action games (for example: first-person or third-person shooting games, two-dimensional or three-dimensional fighting games, war action games, and sports action games, etc.), adventure games (for example: exploration games, collection games, puzzle games, etc.), simulation games (for example: simulation sandbox games, simulation development games, strategy simulation games, city construction simulation games, business simulation games, etc.), role-playing games, and leisure games (for example: chess and card table games, casual competitive games, music rhythm games, dress-up development games, etc.), etc.
[0051] The above-mentioned virtual 3D model is a model with low display accuracy requirements in the above-mentioned virtual scene, such as a distant view model, a model at the edge of the field of view, etc. In order to ensure the visual effect and reduce the rendering cost in the process of rendering the scene screen of the virtual scene, the above-mentioned virtual 3D model in the virtual scene is usually rendered using pseudo 3D technology, and a two-dimensional virtual face is used to replace the above-mentioned virtual 3D model in the scene screen to achieve the pseudo 3D visual effect of the virtual 3D model, while other models in the virtual scene are rendered in normal 3D to ensure the display accuracy of the model.
[0052] The first map is a map (called Imposter map) used to store multiple pre-rendered images in pseudo three-dimensional technology. The multiple preset viewing angles are multiple angles pre-set when implementing pseudo three-dimensional technology. The virtual camera captures the virtual three-dimensional model at these multiple angles to assist the shader in pre-rendering. For example, it is intended to capture the virtual three-dimensional model at 8 viewing angles through a virtual camera, and the 8 viewing angles are evenly distributed in the observation angle (360°). The angle deflection values of the 8 viewing angles can be pre-set as follows: 0° (same as 360°), 45°, 90°, 135°, 180°, 225°, 270° and 315°. Furthermore, if the one-dimensional rotation (horizontal rotation or vertical rotation) of the virtual camera in the virtual scene is considered, the virtual camera captures the virtual three-dimensional model at the above 8 viewing angles, and correspondingly, the shader will render 8 pre-rendered images. If the two-dimensional rotation of the virtual camera in the virtual scene is considered (horizontal rotation and vertical rotation, or rotation in the X direction (U coordinate direction) and Y direction (V coordinate direction) in the virtual scene), the virtual camera captures the virtual three-dimensional model 64 times based on the above 8 perspectives, and correspondingly, the shader will render 64 pre-rendered images (for example, the corresponding rotation angles of the virtual camera are: horizontal rotation 0° vertical rotation 0°, horizontal rotation 0° vertical rotation 45°, horizontal rotation 0° vertical rotation 90°, ..., horizontal rotation 315° vertical rotation 315°). Further, according to the angle deflection value of the two-dimensional rotation, the above 64 pre-rendered images are arranged in an 8×8 determinant in the color channel of the first map.
[0053] The color information of the plurality of pre-rendered images is stored in the color channel of the first map. For example, the RGB information of the plurality of pre-rendered images is respectively stored in the R channel, the G channel and the B channel of the first map.
[0054] Calculate the pixel grayscale of each pixel in the first map to obtain the signed distance field information between each pixel and the display area of the plurality of pre-rendered images in the first map, and generate the second map based on the signed distance field information. It is easy to understand that the signed distance field information can be used to characterize the orthogonal distance and inclusion relationship between each pixel in the first map and the display area of the plurality of pre-rendered images in the first map.
[0055] Specifically, the above-mentioned pixel grayscale calculation of the first map corresponding to the virtual three-dimensional model to obtain the second map may also include other method steps, which can be referred to the further introduction of the embodiments of the present application below and will not be repeated here.
[0056] Step S22, determining at least two target pre-rendered images from the plurality of pre-rendered images based on the current viewing angle corresponding to the virtual three-dimensional model, wherein the at least two target pre-rendered images are adjacent in a row direction or a column direction in the determinant-column arrangement;
[0057] The current viewing angle corresponding to the above virtual three-dimensional model is the viewing angle of the virtual camera in the virtual scene at the current moment to the virtual three-dimensional model. For example, in a virtual game scene, the above current viewing angle may be the viewing angle of the player to the virtual three-dimensional model at the current viewing angle. The above at least two target pre-rendered images are pre-rendered images corresponding to at least two preset viewing angles closest to the current viewing angle among the multiple pre-rendered images. For example, when considering the one-dimensional rotation of the viewing angle, the current viewing angle is 60°, and the two closest preset viewing angles are 45° and 90°. When considering the two-dimensional rotation of the viewing angle, when the current viewing angle is (45°, 60°), the two closest preset viewing angles are (45°, 45°) and (45°, 90°); when the current viewing angle is (60°, 60°), the four closest preset viewing angles are (45°, 45°), (45°, 90°), (90°, 45°) and (90°, 90°). Therefore, the at least two target pre-rendered images may be considered as at least two pre-rendered images that are closest to the visual performance of the rendering result of the virtual three-dimensional model at the current viewing angle.
[0058] Specifically, the above-mentioned determining at least two target pre-rendered images from multiple pre-rendered images based on the current viewing angle corresponding to the virtual three-dimensional model may also include other method steps, which can be referred to the further introduction of the embodiments of the present application below and will not be repeated here.
[0059] Step S23: performing interpolation and mixing processing on the signed distance field information and at least two target pre-rendered images to generate a rendering result of the virtual three-dimensional model.
[0060] The process of performing interpolation and mixing processing on the signed distance field information in the second map and at least two target pre-rendered images to generate a rendering result of the virtual three-dimensional model can be regarded as pseudo three-dimensional rendering. The result obtained by the interpolation and mixing processing (i.e., the rendering result) is the image to be displayed corresponding to the virtual three-dimensional model, and the image to be displayed is displayed on the virtual surface (such as the billboard surface) corresponding to the virtual three-dimensional model, that is, the pseudo three-dimensional rendering is completed. The above rendering result can display a scene picture or scene video of a virtual scene with a pseudo three-dimensional visual effect of the virtual three-dimensional model.
[0061] Specifically, the above-mentioned interpolation and mixing processing of the signed distance field information and at least two target pre-rendered images to generate the rendering result of the virtual three-dimensional model may also include other method steps, which can be referred to the further introduction of the embodiments of the present application below and will not be repeated here.
[0062] In at least some embodiments of the present application, a second map is obtained by performing pixel grayscale calculation on a first map corresponding to a virtual three-dimensional model, wherein the first map stores a plurality of pre-rendered images of the virtual three-dimensional model at a plurality of preset viewing angles, and the plurality of pre-rendered images are arranged in a determinant in the first map according to angle deflection values of the plurality of preset viewing angles in a virtual scene, and the second map stores signed distance field information corresponding to the plurality of pre-rendered images; then, based on a current viewing angle corresponding to the virtual three-dimensional model, at least two target pre-rendered images are determined from the plurality of pre-rendered images, wherein the at least two target pre-rendered images are adjacent in a row direction or a column direction in the determinant arrangement; and the signed distance field information and the at least two target pre-rendered images are further interpolated and mixed to generate a rendering result of the virtual three-dimensional model. Therefore, the present application achieves the purpose of rendering the virtual three-dimensional model based on the current perspective corresponding to the virtual three-dimensional model and multiple pre-rendered images with corresponding signed distance field information, thereby achieving the technical effect of improving the perspective switching smoothness and user experience during the pseudo three-dimensional model display process, and further solves the technical problem of poor perspective switching smoothness and poor user experience in the prior art of the pseudo three-dimensional model display method that only displays the pre-rendered images of the model based on the observation perspective sampling.
[0063] The method of the embodiment of the present application is further introduced below by taking rendering a virtual three-dimensional model in a virtual game scene as an example.
[0064] Optionally, when considering the two-dimensional rotation of the pre-rendering perspective in the virtual scene, the at least two target grid coordinates include four target grid coordinates, and the at least two target pre-rendered images include four target pre-rendered images, wherein any two of the four target pre-rendered images are arranged adjacent to each other in the row direction or the column direction of the determinant-column arrangement.
[0065] Optionally, in step S21, performing pixel grayscale calculation on the first map corresponding to the virtual three-dimensional model to obtain the second map may include the following execution steps:
[0066] Step S211, converting a first texture corresponding to the virtual three-dimensional model into a first grayscale image;
[0067] Step S212, performing a two-dimensional directed distance calculation on the first grayscale image based on the pixel grayscale of the first grayscale image to generate a second grayscale image, where the second grayscale image is used to represent the directed distance field information;
[0068] Step S213, storing the second grayscale image in the transparency channel of the first image to obtain a second image.
[0069] The above steps S211 to S213 can be implemented in a rendering engine or a game engine (such as Unreal Engine) environment, and the implementation process can be shown as follows: Figure 3 As shown, a material design tool (such as SubstanceDesigner) is used in a game engine to process a first texture corresponding to a virtual three-dimensional model to obtain a second texture.
[0070] Specifically, the first map corresponding to the pre-acquired virtual three-dimensional model is as follows: Figure 4 As shown, the first map stores 64 pre-rendered images corresponding to the virtual three-dimensional model at 64 preset angles. The 64 pre-rendered images are arranged in an 8×8 distribution grid in the first map. Figure 4 The horizontal direction in is denoted as U direction, and Figure 4 The vertical direction in the image is recorded as V direction, then the side length of the distribution grid in the first map is 8, and each pre-rendered image corresponds to a UV coordinate. For example, the UV coordinate of the pre-rendered image in the 1st row and the 1st column is (1, 1), which indicates that the virtual three-dimensional model corresponds to a rendered image when the horizontal rotation angle of the virtual camera is 0° and the vertical rotation angle is 0°. For another example, the UV coordinate of the pre-rendered image in the 2nd row and the 5th column is (2, 5), which indicates that the virtual three-dimensional model corresponds to a rendered image when the horizontal rotation angle of the virtual camera is 45° and the vertical rotation angle is 180°.
[0071] In an optional embodiment of the present application, Figure 4 The first texture shown in FIG. 1 is subjected to gamma correction to update the first texture. The updated first texture is as shown in FIG. Figure 5 As shown. The above-mentioned implementation method of gamma correction for the first map is: using a preset gamma function (Gamma Function), non-linearly adjusting the brightness parameters and color parameters of the first map to obtain an updated first map. Taking the non-linear adjustment of the brightness parameters of the first map as an example, using the gamma value (Gamma Value) corresponding to the preset gamma function, the brightness parameters of the first map are subjected to gamma compression (Gamma Compression) and / or gamma expansion (Gamma Expansion) according to the gamma value, wherein the gamma compression is used to increase the distinguishability between the pixels in the low-brightness area of the first map so that the first map has better dark details; the gamma expansion is used to restore the brightness values of the pixels in the low-brightness area of the first map to improve the display accuracy of the first map.
[0072] Still like Figure 3 As shown, Figure 4 or Figure 5 The first map shown is converted into a first grayscale map (for the sake of clarity, Figure 4 and Figure 5The grayscale image corresponding to the first map is used for display). Based on the pixel grayscale of each pixel in the first grayscale image, a two-dimensional directed distance calculation is performed on the first grayscale image to generate a second grayscale image, and the second grayscale image is stored in the transparency channel (i.e., the Alpha channel) of the first map to obtain a second map. In other words, the color channels (R channel, G channel, and B channel) of the second map store the grayscale information corresponding to the multiple pre-rendered images, and the Alpha channel of the second map stores the two-dimensional directed distance information of each pixel relative to the multiple pre-rendered images.
[0073] Optionally, in step S212, performing a two-dimensional directed distance calculation on the first grayscale image based on the pixel grayscales of the first grayscale image to generate the second grayscale image may include the following execution steps:
[0074] Step S2121, determining a first pixel point set and a second pixel point set from the plurality of pixels according to the pixel grayscales of the plurality of pixels in the first grayscale image, wherein the first pixel point set includes pixel points whose pixel grayscales are the first grayscale value, and the second pixel point set includes other pixel points in the first grayscale image except the pixel points corresponding to the first pixel point set;
[0075] Step S2122, mapping the pixel grayscale of the second pixel point set in the first grayscale image to a second grayscale value;
[0076] Step S2123, performing a two-dimensional directed distance calculation on the first grayscale image using the first pixel point set, the second pixel point set, the first grayscale value, and the second grayscale value to generate a second grayscale image.
[0077] Still like Figure 3 As shown, pixel grayscale mapping is performed based on the first grayscale image to obtain Figure 6 In one embodiment of the present application, the first grayscale value is 0, the second grayscale value is 1, and correspondingly, the color of the pixel points in the first pixel point set is pure black. The pixel grayscales of the pixel points in the second pixel point set whose pixel grayscales are not 0 in the first grayscale image are all mapped to 1, and the color of the pixel points in the second pixel point set is pure white. Figure 6 The mapping result is shown as a black two-tone image.
[0078] Optionally, in step S2123, performing a two-dimensional directed distance calculation on the first grayscale image using the first pixel point set, the second pixel point set, the first grayscale value, and the second grayscale value to generate the second grayscale image may include the following execution steps:
[0079] Step S2124, determining a first image region corresponding to a plurality of pre-rendered images from the first grayscale image using the first pixel point set and the first grayscale value;
[0080] Step S2125, performing two-dimensional directed distance calculation on a plurality of pixel points of the first grayscale image based on the first image region to generate a third grayscale image, wherein the third grayscale image is used to determine the two-dimensional directed distances between the plurality of pixel points and the first image region;
[0081] Step S2126, determining a second image region corresponding to a plurality of pre-rendered images from the first grayscale image using the second pixel point set and the second grayscale value;
[0082] Step S2127, performing two-dimensional directed distance calculation on the pixels of the first grayscale image based on the second image area to generate a fourth grayscale image, wherein the fourth grayscale image is used to determine the two-dimensional directed distances between the plurality of pixels and the second image area;
[0083] Step S2128, mixing the third grayscale image and the fourth grayscale image to obtain a second grayscale image.
[0084] One implementation method of determining the first image region corresponding to the plurality of pre-rendered images from the first grayscale image using the first pixel point set and the first grayscale value is: using Figure 6 The pixel points with a grayscale of 0 (i.e., black pixel points) in the mapping result shown determine that the multiple pre-rendered images correspond to the first image area. The first image area can be represented by the pixel coordinates of the pixel points in the display area of the multiple pre-rendered images in the mapping result, or by the pixel coordinates of the region boundary pixel points in the display area of the multiple pre-rendered images in the mapping result.
[0085] One implementation method of generating the third grayscale image by performing two-dimensional directed distance calculation on multiple pixel points of the first grayscale image based on the first image area is: for each pixel point among the multiple pixel points, calculate the two-dimensional directed distance (or orthogonal distance) between the pixel point and the first image area to obtain first distance data, store the first distance data in the form of grayscale values, and generate the third grayscale image as shown in FIG. Figure 7 The third grayscale image shown.
[0086] In order to improve the accuracy of the calculated directed distance information, the first image area is determined based on the black pixels and the second image area is determined based on the white pixels. Two-dimensional directed distance calculations are performed based on the first image area and the second image area respectively, and then a second grayscale image is obtained. The accuracy of the directed distance information represented by the second grayscale image is relatively high.
[0087] Specifically, one implementation method of using the second pixel point set and the second grayscale value to determine the second image region corresponding to the plurality of pre-rendered images from the first grayscale image is: using Figure 6The pixel points with a grayscale of 1 (i.e., white pixels) in the mapping result shown determine that the multiple pre-rendered images correspond to the second image area. The second image area can be represented by the pixel coordinates of the pixel points in the display area of the multiple pre-rendered images in the mapping result, or by the pixel coordinates of the region boundary pixel points of the display area of the multiple pre-rendered images in the mapping result.
[0088] In addition, another implementation method of using the second pixel point set and the second grayscale value to determine the second image area corresponding to the plurality of pre-rendered images from the first grayscale image is: Figure 6 The mapping result shown in FIG. 1 is subjected to inversion processing (i.e., the pixel grayscale of the first pixel point set is mapped to the second grayscale value, and the pixel grayscale of the second pixel point set is mapped to the first grayscale value), and the following is obtained: Figure 8 The inversion result shown; using Figure 8 The pixel points with a grayscale of 0 (ie, black pixel points) in the inversion result shown are used to determine that the plurality of pre-rendered images correspond to the second image area.
[0089] One implementation method of performing two-dimensional directed distance calculation on the pixels of the first grayscale image based on the second image area to generate the fourth grayscale image is as follows: for each pixel of the plurality of pixels, a two-dimensional directed distance (or orthogonal distance) between the pixel and the second image area is calculated to obtain second distance data, and the second distance data is stored in the form of grayscale values to generate the fourth grayscale image. Fig. 9 The fifth grayscale image is shown. Fig. 9 The fifth grayscale image shown is based on Figure 8 The inversion result shown is obtained, so for Fig. 9 The fifth grayscale image shown in FIG. 1 is inverted to obtain the following Fig.10 The fourth grayscale image shown in FIG. Figure 7 The third grayscale image shown is mixed, that is, Fig.10 The fourth grayscale image shown and Figure 7 The third grayscale images shown all satisfy the following rule: a black pixel point indicates that the pixel point is not in the image display area corresponding to the above-mentioned multiple pre-rendered images, and a white pixel point indicates that the pixel point is in the image display area corresponding to the above-mentioned multiple pre-rendered images.
[0090] Furthermore, for Figure 7 The third grayscale image shown and Fig.10 The fourth grayscale image shown in FIG. 1 is mixed to obtain the following Fig.11 In an optional embodiment, the above-mentioned blending process can be a linear lightening blending process: Figure 7 The third grayscale image shown is similar to Fig.10The average value of the pixel grayscale of the corresponding pixel points in the fourth grayscale image shown is taken as Fig.11 The pixel grayscale of the corresponding pixel point in the second grayscale image shown in FIG. Fig.11 The second grayscale image shown is stored in the transparency channel of the first map, and the following is obtained: Fig.12 The second map shown.
[0091] It is easy to understand that Fig.11 The pixel grayscale of each pixel in the second grayscale image shown represents the two-dimensional directed distance between the pixel and the image display area corresponding to the multiple pre-rendered images. Further, the pixel grayscale of each pixel in the second grayscale image can be used to determine whether the pixel is within the image display area corresponding to the multiple pre-rendered images. For example, if the pixel grayscale of the pixel is greater than the transparency clipping value (such as 0.5) set in the engine material, it means that the pixel is within the image display area corresponding to the multiple pre-rendered images.
[0092] Optionally, in step S22, based on the current viewing angle corresponding to the virtual three-dimensional model, determining at least two target pre-rendered images from a plurality of pre-rendered images may include the following execution steps:
[0093] Step S221, determining a current viewing angle corresponding to the virtual three-dimensional model based on a first position of the virtual three-dimensional model in the virtual scene and a second position of the virtual camera in the virtual scene, wherein the virtual camera is used to observe the virtual three-dimensional model;
[0094] Step S222, obtaining at least two target grid coordinates using the current viewing angle and the distribution grid, wherein the distribution grid is a virtual network corresponding to the first map and the second map, and the virtual network is obtained by dividing the number of rows and columns of the plurality of pre-rendered images in the first map and the second map;
[0095] Step S223: selecting at least two target pre-rendered images from the plurality of pre-rendered images according to at least two target grid coordinates.
[0096] In this embodiment, 8 pre-rendering viewing angles are respectively set in the X direction and the Y direction in the virtual scene, that is, the corresponding 64 pre-rendering images are arranged in 8 rows and 8 columns in the first map and the second map. Furthermore, an 8×8 distribution grid is obtained on the first map and the second map. In the distribution grid, the grid coordinates of the pre-rendered image in the 1st row and the 1st column are (1, 1), and so on.
[0097] Taking a distribution grid of 8×8 as an example, based on the current viewing angle and the distribution grid, at least two target grid coordinates corresponding to at least two preset viewing angles closest to the current viewing angle are determined. At least two target pre-rendered images are determined from multiple pre-rendered images according to the target grid coordinates.
[0098] The following is an example of determining the horizontal coordinates (ie, the target U coordinates) in the target grid coordinates. The method for determining the vertical coordinates (target V coordinates) is similar to that of the horizontal coordinates and will not be described in detail.
[0099] Optionally, in step S222, using the current viewing angle and the distribution grid to obtain the target grid coordinates may include the following execution steps:
[0100] Step S2221, using the current viewing angle, the number of arrangement rows and the number of arrangement columns, determine four grid offset coordinates;
[0101] Step S2222, scaling the distribution grid to obtain grid scaling coordinates;
[0102] Step S2223, four target grid coordinates are calculated based on the four grid offset coordinates and the grid scaling coordinates.
[0103] Therefore, after storing multiple pre-rendered images in the first map and the second map, in the pseudo-three-dimensional rendering stage, the target grid coordinates corresponding to the target pre-rendered image are determined by coordinate calculation based on the current perspective, and the search problem for the pre-rendering angle close to the current perspective in the geometric dimension is converted into a coordinate calculation problem in the numerical dimension, making the method provided in the embodiment of the present application easier to apply to application scenarios with more complex spatial relationships (such as scenarios with a large number of pre-rendering angle divisions or more complex rules).
[0104] In this embodiment, the number of arrangement rows and the number of arrangement columns corresponding to the distribution grid are both 8, and the number of arrangement rows and the number of arrangement columns are collectively referred to as side lengths for explanation below.
[0105] Optionally, in step S2221, using the current viewing angle, the number of arrangement rows, and the number of arrangement columns to determine four grid offset coordinates may include the following execution steps:
[0106] Step S31, dividing the current viewing angle by a preset full viewing angle threshold to obtain a relative viewing angle corresponding to the current viewing angle;
[0107] Step S32, multiplying the relative viewing angle by the number of arrangement rows to obtain a row position component, and multiplying the relative viewing angle by the number of arrangement columns to obtain a column position component;
[0108] Step S33, rounding the row position components and the column position components to obtain four grid offset coordinates.
[0109] The relative viewing angle can be calculated by dividing the current viewing angle by a preset full viewing angle threshold (such as 360°). Assuming that the horizontal rotation angle is 200° and the vertical rotation angle is 100°, 200° divided by 360° equals 0.555 (rounded to three decimal places), and 100° divided by 360° equals 0.278 (rounded to three decimal places), thus the relative viewing angle can be expressed as (0.555, 0.278).
[0110] Furthermore, the above relative viewing angle is multiplied by the side length of the distribution grid to obtain the above row position component and column position component. The above 0.555 is multiplied by the side length of the distribution grid (i.e. 8), and the row position component is 4.44; the above 0.278 is multiplied by the side length of the distribution grid (i.e. 8), and the column position component is 2.22.
[0111] It is easy to notice that the row position component and the column position component are usually not integers. In order to determine the target pre-rendered image closest to the current viewing angle from multiple pre-rendered images, it is necessary to perform rounding processing based on the row position component and the column position component to determine four grid offset coordinates, and then determine four target grid coordinates. A first rounding processing and a second rounding processing are performed on at least one of the row position component and the column position component to obtain four rounding results, and the rounding directions of the first rounding processing and the second rounding processing are opposite.
[0112] Optionally, the four grid offset coordinates include: a first offset coordinate, a second offset coordinate, a third offset coordinate and a fourth offset coordinate. On this basis, in step S33, the row position component and the column position component are rounded to obtain four grid offset coordinates, which may include the following execution steps:
[0113] Step S331, rounding up the row position component and rounding up the column position component to obtain a first offset coordinate;
[0114] Step S332, rounding up the row position component and rounding down the column position component to obtain a second offset coordinate;
[0115] Step S333, rounding down the row position component and rounding up the column position component to obtain a third offset coordinate;
[0116] Step S334, rounding down the row position component and rounding down the column position component to obtain a fourth offset coordinate.
[0117] Specifically, based on the above row position component and column position component (4.44, 2.22), four grid offset coordinates are obtained by rounding off: (5, 3), (5, 2), (4, 3) and (4, 2). Thus, the four pre-rendered images at the 5th row and 3rd column, the 5th row and 2nd column, the 4th row and 3rd column and the 4th row and 2nd column in the distribution grid are determined as the target pre-rendered images.
[0118] Still taking the implementation of the above method in the environment of a game engine as an example, the implementation process of the above steps S221 to S223 can be as follows: Fig.13 As shown. The first position is determined by the world coordinates of the virtual three-dimensional model in the virtual scene, and the second position is determined by the world coordinates of the virtual camera in the virtual scene. Based on the first position and the second position, the relative world coordinate positions of the virtual camera and the virtual three-dimensional model are calculated. Fig.13 As shown, according to the relative world coordinate positions of the virtual camera and the virtual 3D model, the current viewing angle of the virtual camera to the virtual 3D model is calculated. Furthermore, in the horizontal direction, the current viewing angle is divided by the preset full viewing angle threshold (i.e., 360°) to obtain the ratio of the current viewing angle to the observation circumference (i.e., the above-mentioned relative viewing angle).
[0119] Still like Fig.13 As shown, the grid scaling coordinates are determined based on the distribution grid of the plurality of pre-rendered images in the first map and the number of pre-rendered images (i.e., 8×8). That is, the distribution grid is scaled based on the side length (i.e., 8) to obtain the grid scaling coordinates (scaling U coordinates) in the horizontal direction. In this example, the 8×8 distribution grid is scaled to a 1×1 square, that is, the scaling U coordinate in the horizontal direction is 1, and thus, the grid offset coordinates are used to determine the column of the target pre-rendered image in the distribution grid.
[0120] Still like Fig.13 As shown, in the horizontal direction, the ratio (i.e., the relative viewing angle) is multiplied by the number of pre-rendered images (i.e., 8), and a multiplication result of 4.44 is obtained. The multiplication result is rounded up to obtain a first rounding result of 5; the multiplication result is rounded down to obtain a second rounding result of 4. Further, the first rounding result is divided by the number of pre-rendered images in the horizontal direction (i.e., 8), and a first horizontal offset coordinate of 0.625 is obtained; the second rounding result is divided by the number of pre-rendered images in the horizontal direction (i.e., 8), and a second horizontal offset coordinate of 0.5 is obtained. Further, the first horizontal offset coordinate and the grid scaling coordinate are used to determine the first horizontal mapping coordinate (denoted as m); the second horizontal offset coordinate and the grid scaling coordinate are used to determine the second horizontal mapping coordinate (denoted as m-1).
[0121] According to the above method for determining the first horizontal mapping coordinate and the second horizontal mapping coordinate in the horizontal direction, the first vertical mapping coordinate (denoted as n) and the second vertical mapping coordinate (denoted as n-1) are determined in the vertical direction according to the vertical rotation angle of the virtual camera corresponding to the current viewing angle.
[0122] The target grid coordinates include first mapping coordinates (first horizontal mapping coordinates, first vertical mapping coordinates) and second mapping coordinates (second horizontal mapping coordinates, second vertical mapping coordinates). Fig.13 As shown, the first mapping coordinates are determined using the first offset coordinates and the grid scaling coordinates; and the second mapping coordinates are determined using the second offset coordinates and the grid scaling coordinates.
[0123] Furthermore, Fig.13 As shown, after determining the first mapping coordinates and the second mapping coordinates, a first image to be used is determined from a plurality of pre-rendered images according to the first mapping coordinates, and a second image to be used is determined from a plurality of pre-rendered images according to the second mapping coordinates, and the first image to be used and the second image to be used are used as target pre-rendered images.
[0124] In one embodiment of the present application, four images to be used are selected from multiple pre-rendered images as target pre-rendered images according to a first horizontal mapping coordinate (denoted as m), a second horizontal mapping coordinate (denoted as m-1), a first vertical mapping coordinate (denoted as n) and a second vertical mapping coordinate (denoted as n-1), and the UV coordinates of the four images to be used in the distribution grid are (m, n), (m-1, n), (m, n-1) and (m-1, n-1), respectively.
[0125] It should be noted that in the application scenario, if the current viewing angle is the same as one of the multiple pre-rendering viewing angles corresponding to the multiple pre-rendering images, a pre-rendering image corresponding to the current viewing angle is selected from the multiple pre-rendering images as the target pre-rendering image.
[0126] Optionally, in step S23, interpolation and mixing processing is performed on the signed distance field information and at least two target pre-rendered images to generate a rendering result, which may include the following execution steps:
[0127] Step S231, determining an interpolation coefficient using the row and column arrangement data corresponding to the current viewing angle and a plurality of pre-rendered images;
[0128] Step S232: performing interpolation and mixing processing on the signed distance field information and at least two target pre-rendered images based on the interpolation coefficients to generate a rendering result.
[0129] The above-mentioned current viewing angle and row and column arrangement data (including the number of arrangement rows and the number of arrangement columns) are not only used to determine the grid offset coordinates, and then determine the row and column of the distribution grid corresponding to the first map and the second map where the target pre-rendered image corresponding to the current viewing angle is located, but also used to determine the interpolation coefficient when interpolating at least two target pre-rendered images.
[0130] Optionally, in step S231, determining the interpolation coefficient using the current viewing angle and row and column arrangement data may include the following execution steps:
[0131] Step S2311, obtaining arrangement position data based on row and column arrangement data and the relative viewing angle of the current viewing angle to a preset full viewing angle interval, wherein the row and column arrangement data includes the number of arrangement rows and the number of arrangement columns of the plurality of pre-rendered images in the first map, and the arrangement position data includes the row position component and the column position component corresponding to the current viewing angle;
[0132] Step S2312, performing decimal calculation on the arrangement position data to obtain an interpolation coefficient.
[0133] The arrangement position data is decimalized to obtain a decimalized result; and an interpolation coefficient to be used is determined based on the decimalized result. Further, the interpolation coefficient is a corresponding coefficient of an interpolation function used to interpolate the signed distance field information and the target pre-rendered image.
[0134] In one embodiment of the present application, a decimal calculation is performed based on the above-mentioned row position component and column position component (4.44, 2.22) to obtain an interpolation coefficient (0.44, 0.22). In an optional embodiment, in order to simplify the interpolation calculation, the decimal result corresponding to the row position component and the decimal result corresponding to the column position component can also be averaged to obtain the interpolation coefficient. For example, the average value of 0.44 and 0.22 is calculated to obtain an interpolation coefficient of 0.33.
[0135] Still taking the implementation of the above method in the game engine environment as an example, Fig.13 As shown, the multiplication result is decimalized to obtain a decimal result; based on the decimal result, the interpolation coefficient to be used is determined, and the interpolation coefficient is a corresponding coefficient of the interpolation function used to interpolate the signed distance field information and the target pre-rendered image.
[0136] Optionally, in step S232, performing interpolation and mixing processing on the signed distance field information and at least two target pre-rendered images based on the interpolation coefficients to generate a rendering result may include the following execution steps:
[0137] Step S2321, performing linear interpolation processing on the signed distance field information based on the interpolation coefficient to obtain a transparency mask;
[0138] Step S2322, performing linear interpolation processing on at least two target pre-rendered images based on the interpolation coefficients to obtain target color information;
[0139] Step S2323, using the transparency mask to perform transparency mixing processing on the target color information to generate a rendering result.
[0140] The interpolation coefficients can be used as interpolation coefficients for linear interpolation of the signed distance field information and interpolation coefficients for linear interpolation of at least two target pre-rendered images. Since the signed distance field information can represent the orthogonal distance and inclusion relationship between the pixel point and the display area of the plurality of pre-rendered images, the transparency mask obtained by linear interpolation of the signed distance field information can also represent the orthogonal distance and inclusion relationship between the pixel point and the display area of the plurality of pre-rendered images.
[0141] The target color information is color information jointly determined by the image colors of the at least two target pre-rendered images. Therefore, by using the target color information to represent the color to be rendered of the virtual three-dimensional model at the current viewing angle, a color gradient transition effect between the at least two target pre-rendered images can be achieved, thereby reducing the scene image jump phenomenon caused by viewing angle switching in the application scene.
[0142] The target color information is obtained by performing linear interpolation processing on at least two target pre-rendered images based on the interpolation coefficient. The interpolation coefficient can represent the proximity relationship between the current perspective and the multiple pre-rendered perspectives corresponding to the multiple pre-rendered images. Therefore, the target color information can be used more accurately for the multiple pre-rendered images based on the current perspective.
[0143] It should be noted that, in an application scenario, when the target image includes only one target pre-rendered image (that is, one of multiple pre-rendered images), there is no need to perform the linear interpolation processing in the above step S2321, that is, the image color information of the target pre-rendered image is used as the above target color information.
[0144] Furthermore, the transparency clipping of the target color information is performed using a transparency mask, which can fully consider the orthogonal distance and inclusion relationship between the pixel points and the display areas of multiple pre-rendered images to determine the display effect of the pixel color corresponding to each pixel point in the target color information. The obtained clipping result has better image transparency performance.
[0145] Thus, the virtual 3D model is rendered based on the clipping result to obtain a rendering result, which can display the virtual 3D model more richly based on fewer pre-rendered images. Compared with the pseudo 3D model display method in the prior art that only samples and displays the pre-rendered image of the model based on the current observation angle, the above method provided by the present application rarely or avoids the jump of the scene picture when the observation angle is switched, and the perspective switching is smooth and the user experience is good.
[0146] In this embodiment, a method for switching and displaying a virtual three-dimensional model running on the mobile terminal is provided. Fig.14 is a flow chart of a method for switching display of a virtual three-dimensional model according to one embodiment of the present application, such as Fig.14 As shown, the method comprises the following steps:
[0147] Step S141, displaying a first scene image corresponding to the virtual three-dimensional model in a graphical user interface, wherein the first scene image is obtained by interpolating and mixing at least two first target images and signed distance field information stored in a second map determined by the first map, the first map stores multiple pre-rendered images of the virtual three-dimensional model at multiple preset viewing angles, the multiple pre-rendered images are arranged in a determinant in the first map according to angle deflection values of the multiple preset viewing angles in the virtual scene, at least two first target images are determined from the multiple pre-rendered images based on the first viewing angle, the second map is determined by performing pixel grayscale calculation on the first map, the second map stores signed distance field information corresponding to the multiple pre-rendered images, and the at least two first target images are adjacent in a row direction or a column direction in the determinant arrangement;
[0148] Step S142, in response to the scene observation perspective corresponding to the virtual three-dimensional model switching from the first perspective to the second perspective, controlling the graphical user interface to switch from displaying the first scene image to displaying the second scene image corresponding to the virtual three-dimensional model, wherein the second scene image is obtained by interpolating and mixing at least two second target images and signed distance field information, the second target image is determined from a plurality of pre-rendered images based on the second perspective, and at least two second target images are adjacent in a row direction or a column direction in a deterministic arrangement.
[0149] It is easy to understand that according to the above-mentioned method for switching and displaying a virtual three-dimensional model, for each scene observation perspective, the virtual three-dimensional model is rendered using a virtual three-dimensional model rendering method such as steps S21 to S23. Therefore, when controlling the graphical user interface to switch from displaying a first scene image to displaying a second scene image corresponding to the virtual three-dimensional model, there is little or no scene screen jump, and the perspective switching is smooth and the user experience is good.
[0150] The above-mentioned method for switching and displaying a virtual three-dimensional model also includes other preferred implementations, which can be referred to the description of the method for rendering a virtual three-dimensional model in the foregoing text and will not be described in detail.
[0151] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a disk, an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.
[0152] In this embodiment, a rendering device for a virtual three-dimensional model is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the term "module" may be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0153] Fig.15 is a structural block diagram of a rendering device for a virtual three-dimensional model according to one embodiment of the present application, such as Fig.15 As shown, the device includes: a processing module 1501, which is used to perform pixel grayscale calculation on a first map corresponding to a virtual three-dimensional model to obtain a second map, wherein the first map stores a plurality of pre-rendered images of the virtual three-dimensional model at a plurality of preset viewing angles, and the plurality of pre-rendered images are arranged in a determinant in the first map according to angle deflection values of the plurality of preset viewing angles in a virtual scene, and the second map stores signed distance field information corresponding to the plurality of pre-rendered images; a determination module 1502, which is used to determine at least two target pre-rendered images from the plurality of pre-rendered images based on a current viewing angle corresponding to the virtual three-dimensional model, wherein the at least two target pre-rendered images are adjacent in a row direction or a column direction in the determinant arrangement; and a rendering module 1503, which is used to perform interpolation and mixing processing on the signed distance field information and the at least two target pre-rendered images to generate a rendering result of the virtual three-dimensional model.
[0154] Optionally, the above-mentioned processing module 1501 is also used to: convert the first map corresponding to the virtual three-dimensional model into a first grayscale image; perform a two-dimensional signed distance calculation on the first grayscale image based on the pixel grayscale of the first grayscale image to generate a second grayscale image, and the second grayscale image is used to characterize the signed distance field information; store the second grayscale image in the transparency channel of the first map to obtain the second map.
[0155] Optionally, the above-mentioned processing module 1501 is also used to: determine a first pixel point set and a second pixel point set from multiple pixel points according to the pixel grayscale of multiple pixel points of the first grayscale image, wherein the first pixel point set includes pixel points whose pixel grayscale is a first grayscale value, and the second pixel point set includes other pixel points in the first grayscale image except the pixel points corresponding to the first pixel point set; map the pixel grayscale of the second pixel point set in the first grayscale image to a second grayscale value; use the first pixel point set, the second pixel point set, the first grayscale value and the second grayscale value to perform a two-dimensional directed distance calculation on the first grayscale image to generate a second grayscale image.
[0156] Optionally, the above-mentioned processing module 1501 is also used to: determine from the first grayscale image that multiple pre-rendered images correspond to the first image area using the first pixel point set and the first grayscale value; perform two-dimensional directed distance calculation on multiple pixel points of the first grayscale image based on the first image area to generate a third grayscale image, wherein the third grayscale image is used to determine the two-dimensional directed distance between the multiple pixel points and the first image area; determine from the first grayscale image that multiple pre-rendered images correspond to the second image area using the second pixel point set and the second grayscale value; perform two-dimensional directed distance calculation on the pixel points of the first grayscale image based on the second image area to generate a fourth grayscale image, wherein the fourth grayscale image is used to determine the two-dimensional directed distance between the multiple pixel points and the second image area; and perform mixing processing on the third grayscale image and the fourth grayscale image to obtain a second grayscale image.
[0157] Optionally, the above-mentioned determination module 1502 is also used to: determine the current viewing angle corresponding to the virtual three-dimensional model based on the first position of the virtual three-dimensional model in the virtual scene and the second position of the virtual camera in the virtual scene, wherein the virtual camera is used to observe the virtual three-dimensional model; use the current viewing angle and the distribution grid to obtain at least two target grid coordinates, wherein the distribution grid is a virtual network corresponding to the first map and the second map, and the virtual network is obtained based on the number of arrangement rows and columns of multiple pre-rendered images in the first map and the second map; according to the at least two target grid coordinates, select at least two target pre-rendered images from multiple pre-rendered images.
[0158] Optionally, in the rendering device of the virtual three-dimensional model, the at least two target grid coordinates include four target grid coordinates, and the at least two target pre-rendered images include four target pre-rendered images, wherein any two of the four target pre-rendered images are arranged adjacent to each other in a row direction or a column direction of the determinant arrangement.
[0159] Optionally, the above-mentioned determination module 1502 is also used to: determine four grid offset coordinates using the current viewing angle, number of arrangement rows and number of arrangement columns; scale the distribution grid to obtain grid scaling coordinates; and add the four grid offset coordinates to the grid scaling coordinates respectively to obtain four target grid coordinates.
[0160] Optionally, the above-mentioned determination module 1502 is also used to: divide the current viewing angle and the preset full viewing angle threshold to obtain the relative viewing angle corresponding to the current viewing angle; multiply the relative viewing angle and the number of arranged rows to obtain the row position component, and multiply the relative viewing angle and the number of arranged columns to obtain the column position component; round the row position component and the column position component to obtain four grid offset coordinates.
[0161] Optionally, the four grid offset coordinates include: a first offset coordinate, a second offset coordinate, a third offset coordinate and a fourth offset coordinate; the above-mentioned determination module 1502 is also used to: round up the row position component and round up the column position component to obtain the first offset coordinate; round up the row position component and round down the column position component to obtain the second offset coordinate; round down the row position component and round up the column position component to obtain the third offset coordinate; round down the row position component and round down the column position component to obtain the fourth offset coordinate.
[0162] Optionally, the rendering module 1503 is further used to: determine an interpolation coefficient using the current viewing angle and row and column arrangement data corresponding to the plurality of pre-rendered images; and perform interpolation and mixing processing on the signed distance field information and at least two target pre-rendered images based on the interpolation coefficient to generate a rendering result.
[0163] Optionally, the above-mentioned rendering module 1503 is also used to: calculate the arrangement position data based on the row and column arrangement data and the relative perspective of the current perspective to the preset full perspective interval, wherein the row and column arrangement data include the number of arrangement rows and the number of arrangement columns of multiple pre-rendered images in the first map, and the arrangement position data include the row position component and the column position component corresponding to the current perspective; perform decimal calculation on the arrangement position data to obtain the interpolation coefficient.
[0164] Optionally, the rendering module 1503 is further used to: perform linear interpolation processing on the signed distance field information based on the interpolation coefficient to obtain a transparency mask; perform linear interpolation processing on at least two target pre-rendered images based on the interpolation coefficient to obtain target color information; and perform transparency blending processing on the target color information using the transparency mask to generate a rendering result.
[0165] In this embodiment, a switching display device for a virtual three-dimensional model is also provided. The device is used to implement the switching display method of the virtual three-dimensional model, and the details that have been explained will not be repeated here.
[0166] Fig.16 is a structural block diagram of a switching display device for a virtual three-dimensional model according to one embodiment of the present application, such as Fig.16 As shown, the device includes: a display module 1601, which is used to display a first scene image corresponding to a virtual three-dimensional model in a graphical user interface, wherein the first scene image is obtained by interpolating and mixing at least two first target images and directed distance field information stored in a second map determined by a first map, the first map stores multiple pre-rendered images of the virtual three-dimensional model at multiple preset viewing angles, the multiple pre-rendered images are arranged in a determinant in the first map according to angle deflection values of the multiple preset viewing angles in the virtual scene, at least two first target images are determined from the multiple pre-rendered images based on the first viewing angle, the second map is determined by performing pixel grayscale calculation on the first map, and the second The texture map stores signed distance field information corresponding to a plurality of pre-rendered images, and at least two first target images are adjacent in a row direction or a column direction in a determinant arrangement; a switching module 1602 is used to control a graphical user interface to switch from displaying a first scene image to displaying a second scene image corresponding to the virtual three-dimensional model in response to a scene observation perspective corresponding to the virtual three-dimensional model being switched from a first perspective to a second perspective, wherein the second scene image is obtained by performing interpolation and mixing processing on at least two second target images and the signed distance field information, the second target image is determined from the plurality of pre-rendered images based on the second perspective, and at least two second target images are adjacent in a row direction or a column direction in a determinant arrangement.
[0167] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0168] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
[0169] Optionally, in this embodiment, the above-mentioned computer-readable storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0170] Optionally, in this embodiment, the computer-readable storage medium may be located in any one of the computer terminals in a computer terminal group in a computer network, or in any one of the mobile terminals in a mobile terminal group.
[0171] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0172] S1, performing pixel grayscale calculation on a first map corresponding to the virtual three-dimensional model to obtain a second map, wherein the first map stores a plurality of pre-rendered images of the virtual three-dimensional model at a plurality of preset viewing angles, the plurality of pre-rendered images are arranged in a determinant in the first map according to angle deflection values of the plurality of preset viewing angles in the virtual scene, and the second map stores signed distance field information corresponding to the plurality of pre-rendered images;
[0173] S2, determining at least two target pre-rendered images from the plurality of pre-rendered images based on a current viewing angle corresponding to the virtual three-dimensional model, wherein the at least two target pre-rendered images are adjacent in a row direction or a column direction in a determinant-column arrangement;
[0174] S3, performing interpolation and mixing processing on the signed distance field information and at least two target pre-rendered images to generate a rendering result of the virtual three-dimensional model.
[0175] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: converting a first map corresponding to the virtual three-dimensional model into a first grayscale image; performing a two-dimensional directed distance calculation on the first grayscale image based on the pixel grayscale of the first grayscale image to generate a second grayscale image, wherein the second grayscale image is used to characterize the directed distance field information; and storing the second grayscale image in the transparency channel of the first map to obtain a second map.
[0176] Optionally, the above-mentioned computer-readable storage medium is also configured to store program code for executing the following steps: determining a first pixel point set and a second pixel point set from multiple pixel points based on the pixel grayscale of multiple pixel points of the first grayscale image, wherein the first pixel point set includes pixel points whose pixel grayscale is a first grayscale value, and the second pixel point set includes other pixel points in the first grayscale image except the pixel points corresponding to the first pixel point set; mapping the pixel grayscale of the second pixel point set in the first grayscale image to a second grayscale value; performing a two-dimensional directed distance calculation on the first grayscale image using the first pixel point set, the second pixel point set, the first grayscale value and the second grayscale value to generate a second grayscale image.
[0177] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: determining from the first grayscale image that a plurality of pre-rendered images correspond to a first image region using a first pixel point set and a first grayscale value; performing a two-dimensional directed distance calculation on a plurality of pixel points of the first grayscale image based on the first image region to generate a third grayscale image, wherein the third grayscale image is used to determine a two-dimensional directed distance between the plurality of pixel points and the first image region; determining from the first grayscale image that a plurality of pre-rendered images correspond to a second image region using a second pixel point set and a second grayscale value; performing a two-dimensional directed distance calculation on the pixel points of the first grayscale image based on the second image region to generate a fourth grayscale image, wherein the fourth grayscale image is used to determine a two-dimensional directed distance between the plurality of pixel points and the second image region; and mixing the third grayscale image and the fourth grayscale image to obtain a second grayscale image.
[0178] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: determining a current viewing angle corresponding to the virtual three-dimensional model based on a first position of the virtual three-dimensional model in the virtual scene and a second position of the virtual camera in the virtual scene, wherein the virtual camera is used to observe the virtual three-dimensional model; obtaining at least two target grid coordinates using the current viewing angle and the distribution grid, wherein the distribution grid is a virtual network corresponding to the first map and the second map, and the virtual network is obtained by dividing the plurality of pre-rendered images based on the number of arrangement rows and the number of arrangement columns in the first map and the second map; and selecting at least two target pre-rendered images from the plurality of pre-rendered images according to the at least two target grid coordinates.
[0179] Optionally, the computer-readable storage medium is further configured to store a program code for executing the following steps: the at least two target grid coordinates include four target grid coordinates, the at least two target pre-rendered images include four target pre-rendered images, wherein any two of the four target pre-rendered images are arranged adjacent to each other in a row direction or a column direction of a deterministic arrangement.
[0180] Optionally, the computer-readable storage medium is also configured to store program code for executing the following steps: determining four grid offset coordinates using the current viewing angle, number of arrangement rows, and number of arrangement columns; scaling the distribution grid to obtain grid scaling coordinates; and adding the four grid offset coordinates to the grid scaling coordinates to obtain four target grid coordinates.
[0181] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: dividing the current viewing angle and a preset full viewing angle threshold to obtain a relative viewing angle corresponding to the current viewing angle; multiplying the relative viewing angle and the number of arranged rows to obtain a row position component, and multiplying the relative viewing angle and the number of arranged columns to obtain a column position component; rounding the row position component and the column position component to obtain four grid offset coordinates.
[0182] Optionally, the above-mentioned computer-readable storage medium is also configured to store program codes for performing the following steps: when the four grid offset coordinates include: a first offset coordinate, a second offset coordinate, a third offset coordinate and a fourth offset coordinate, rounding up the row position component and rounding up the column position component to obtain a first offset coordinate; rounding up the row position component and rounding down the column position component to obtain a second offset coordinate; rounding down the row position component and rounding up the column position component to obtain a third offset coordinate; rounding down the row position component and rounding down the column position component to obtain a fourth offset coordinate.
[0183] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: determining interpolation coefficients using the row and column arrangement data corresponding to the current viewing angle and multiple pre-rendered images; and performing interpolation and mixing processing on the signed distance field information and at least two target pre-rendered images based on the interpolation coefficients to generate a rendering result.
[0184] Optionally, the computer-readable storage medium is also configured to store program code for executing the following steps: obtaining arrangement position data based on row and column arrangement data and the relative viewing angle of the current viewing angle to a preset full viewing angle interval, wherein the row and column arrangement data include the number of arrangement rows and the number of arrangement columns of multiple pre-rendered images in the first map, and the arrangement position data include the row position component and the column position component corresponding to the current viewing angle; performing decimal calculation on the arrangement position data to obtain an interpolation coefficient.
[0185] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: performing linear interpolation processing on the signed distance field information based on the interpolation coefficients to obtain a transparency mask; performing linear interpolation processing on at least two target pre-rendered images based on the interpolation coefficients to obtain target color information; and performing transparency blending processing on the target color information using the transparency mask to generate a rendering result.
[0186] In the computer-readable storage medium of the above embodiment, a technical solution for implementing a rendering method of a virtual three-dimensional model is provided. A second map is obtained by performing pixel grayscale calculation on a first map corresponding to the virtual three-dimensional model, wherein the first map stores multiple pre-rendered images of the virtual three-dimensional model at multiple preset viewing angles, and the multiple pre-rendered images are arranged in a determinant in the first map according to the angle deflection values of the multiple preset viewing angles in the virtual scene, and the second map stores signed distance field information corresponding to the multiple pre-rendered images; then, based on the current viewing angle corresponding to the virtual three-dimensional model, at least two target pre-rendered images are determined from the multiple pre-rendered images, wherein the at least two target pre-rendered images are adjacent in the row direction or column direction in the determinant arrangement; and the signed distance field information and the at least two target pre-rendered images are further interpolated and mixed to generate a rendering result of the virtual three-dimensional model. Therefore, the present application achieves the purpose of rendering the virtual three-dimensional model based on the current perspective corresponding to the virtual three-dimensional model and multiple pre-rendered images with corresponding signed distance field information, thereby achieving the technical effect of improving the perspective switching smoothness and user experience during the pseudo three-dimensional model display process, and further solves the technical problem of poor perspective switching smoothness and poor user experience in the prior art of the pseudo three-dimensional model display method that only displays the pre-rendered images of the model based on the observation perspective sampling.
[0187] Optionally, the computer-readable storage medium is further configured to store a program code for executing the following steps: displaying a first scene image corresponding to the virtual three-dimensional model in a graphical user interface, wherein the first scene image is obtained by interpolating and mixing at least two first target images and directed distance field information stored in a second map determined by the first map, the first map stores a plurality of pre-rendered images of the virtual three-dimensional model at a plurality of preset viewing angles, the plurality of pre-rendered images are arranged in a determinant in the first map according to angle deflection values of the plurality of preset viewing angles in the virtual scene, the at least two first target images are determined from the plurality of pre-rendered images based on the first viewing angle, and the second map is obtained by interpolating and mixing the at least two first target images and the directed distance field information stored in the second map determined by the first map. A pixel grayscale calculation is performed to determine that the second map stores signed distance field information corresponding to a plurality of pre-rendered images, and at least two first target images are adjacent in a row direction or a column direction in a determinant-column arrangement; in response to a scene observation perspective corresponding to the virtual three-dimensional model being switched from a first perspective to a second perspective, a graphical user interface is controlled to switch from displaying the first scene image to displaying a second scene image corresponding to the virtual three-dimensional model, wherein the second scene image is obtained by performing interpolation and mixing processing on at least two second target images and the signed distance field information, the second target image is determined from the plurality of pre-rendered images based on the second perspective, and at least two second target images are adjacent in a row direction or a column direction in a determinant-column arrangement.
[0188] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0189] In an exemplary embodiment of the present application, a program product capable of implementing the above method of the present embodiment is stored on a computer-readable storage medium. In some possible implementations, various aspects of the embodiments of the present application can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary implementations of the present application described in the above "Exemplary Method" section of the present embodiment.
[0190] According to the program product for implementing the above method in the embodiment of the present application, it can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the embodiment of the present application is not limited thereto. In the embodiment of the present application, the computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0191] The program product may be in any combination of one or more computer-readable media. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive) of computer-readable storage media include: an electrical connection with one or more wires, a portable 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 thereof.
[0192] It should be noted that the program code contained in the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0193] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0194] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0195] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0196] S1, performing pixel grayscale calculation on a first map corresponding to the virtual three-dimensional model to obtain a second map, wherein the first map stores a plurality of pre-rendered images of the virtual three-dimensional model at a plurality of preset viewing angles, the plurality of pre-rendered images are arranged in a determinant in the first map according to angle deflection values of the plurality of preset viewing angles in the virtual scene, and the second map stores signed distance field information corresponding to the plurality of pre-rendered images;
[0197] S2, determining at least two target pre-rendered images from the plurality of pre-rendered images based on a current viewing angle corresponding to the virtual three-dimensional model, wherein the at least two target pre-rendered images are adjacent in a row direction or a column direction in a determinant-column arrangement;
[0198] S3, performing interpolation and mixing processing on the signed distance field information and at least two target pre-rendered images to generate a rendering result of the virtual three-dimensional model.
[0199] Optionally, the processor may also be configured to perform the following steps through a computer program: converting a first map corresponding to the virtual three-dimensional model into a first grayscale image; performing a two-dimensional directed distance calculation on the first grayscale image based on the pixel grayscale of the first grayscale image to generate a second grayscale image, wherein the second grayscale image is used to characterize the directed distance field information; and storing the second grayscale image in the transparency channel of the first map to obtain a second map.
[0200] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: determine a first pixel point set and a second pixel point set from multiple pixel points according to the pixel grayscale of multiple pixel points of the first grayscale image, wherein the first pixel point set includes pixel points whose pixel grayscale is a first grayscale value, and the second pixel point set includes other pixel points in the first grayscale image except the pixel points corresponding to the first pixel point set; map the pixel grayscale of the second pixel point set in the first grayscale image to a second grayscale value; perform a two-dimensional directed distance calculation on the first grayscale image using the first pixel point set, the second pixel point set, the first grayscale value and the second grayscale value to generate a second grayscale image.
[0201] Optionally, the processor may also be configured to perform the following steps through a computer program: determining from the first grayscale image that a plurality of pre-rendered images correspond to a first image region using a first pixel point set and a first grayscale value; performing a two-dimensional directed distance calculation on a plurality of pixel points of the first grayscale image based on the first image region to generate a third grayscale image, wherein the third grayscale image is used to determine the two-dimensional directed distances between the plurality of pixel points and the first image region; determining from the first grayscale image that a plurality of pre-rendered images correspond to a second image region using a second pixel point set and a second grayscale value; performing a two-dimensional directed distance calculation on the pixel points of the first grayscale image based on the second image region to generate a fourth grayscale image, wherein the fourth grayscale image is used to determine the two-dimensional directed distances between the plurality of pixel points and the second image region; and mixing the third grayscale image and the fourth grayscale image to obtain a second grayscale image.
[0202] Optionally, the processor can also be configured to perform the following steps through a computer program: determine a current viewing angle corresponding to the virtual three-dimensional model based on a first position of the virtual three-dimensional model in the virtual scene and a second position of the virtual camera in the virtual scene, wherein the virtual camera is used to observe the virtual three-dimensional model; obtain at least two target grid coordinates using the current viewing angle and the distribution grid, wherein the distribution grid is a virtual network corresponding to the first map and the second map, and the virtual network is obtained by dividing the plurality of pre-rendered images based on the number of arrangement rows and the number of arrangement columns in the first map and the second map; and select at least two target pre-rendered images from the plurality of pre-rendered images according to the at least two target grid coordinates.
[0203] Optionally, the processor may also be configured to perform the following steps through a computer program: the at least two target grid coordinates include four target grid coordinates, the at least two target pre-rendered images include four target pre-rendered images, wherein any two of the four target pre-rendered images are arranged adjacent to each other in a row direction or a column direction of the deterministic arrangement.
[0204] Optionally, the processor can also be configured to perform the following steps through a computer program: determine four grid offset coordinates using the current viewing angle, number of arrangement rows, and number of arrangement columns; scale the distribution grid to obtain grid scaling coordinates; and obtain four target grid coordinates based on the four grid offset coordinates and the grid scaling coordinates.
[0205] Optionally, the processor can also be configured to perform the following steps through a computer program: divide the current viewing angle and a preset full viewing angle threshold to obtain a relative viewing angle corresponding to the current viewing angle; multiply the relative viewing angle and the number of arranged rows to obtain a row position component, and multiply the relative viewing angle and the number of arranged columns to obtain a column position component; round the row position component and the column position component to obtain four grid offset coordinates.
[0206] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: when the four grid offset coordinates include: a first offset coordinate, a second offset coordinate, a third offset coordinate and a fourth offset coordinate, the row position component is rounded up and the column position component is rounded up to obtain a first offset coordinate; the row position component is rounded up and the column position component is rounded down to obtain a second offset coordinate; the row position component is rounded down and the column position component is rounded up to obtain a third offset coordinate; the row position component is rounded down and the column position component is rounded down to obtain a fourth offset coordinate.
[0207] Optionally, the processor may also be configured to execute the following steps through a computer program: determining an interpolation coefficient using row and column arrangement data corresponding to the current viewing angle and a plurality of pre-rendered images; and performing interpolation and mixing processing on the signed distance field information and at least two target pre-rendered images based on the interpolation coefficient to generate a rendering result.
[0208] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: calculate the arrangement position data based on the row and column arrangement data and the relative perspective of the current perspective to a preset full perspective interval, wherein the row and column arrangement data includes the number of arrangement rows and the number of arrangement columns of multiple pre-rendered images in the first map, and the arrangement position data includes the row position component and the column position component corresponding to the current perspective; perform decimal calculation on the arrangement position data to obtain the interpolation coefficient.
[0209] Optionally, the processor may also be configured to perform the following steps through a computer program: performing linear interpolation processing on the signed distance field information based on the interpolation coefficients to obtain a transparency mask; performing linear interpolation processing on at least two target pre-rendered images based on the interpolation coefficients to obtain target color information; and performing transparency blending processing on the target color information using the transparency mask to generate a rendering result.
[0210] In the electronic device of the above embodiment, a technical solution for implementing a rendering method of a virtual three-dimensional model is provided. A second map is obtained by performing pixel grayscale calculation on a first map corresponding to the virtual three-dimensional model, wherein the first map stores multiple pre-rendered images of the virtual three-dimensional model at multiple preset viewing angles, and the multiple pre-rendered images are arranged in a determinant in the first map according to the angle deflection values of the multiple preset viewing angles in the virtual scene, and the second map stores signed distance field information corresponding to the multiple pre-rendered images; then, based on the current viewing angle corresponding to the virtual three-dimensional model, at least two target pre-rendered images are determined from the multiple pre-rendered images, wherein the at least two target pre-rendered images are adjacent in the row direction or column direction in the determinant arrangement; and the signed distance field information and the at least two target pre-rendered images are further interpolated and mixed to generate a rendering result of the virtual three-dimensional model. Therefore, the present application achieves the purpose of rendering the virtual three-dimensional model based on the current perspective corresponding to the virtual three-dimensional model and multiple pre-rendered images with corresponding signed distance field information, thereby achieving the technical effect of improving the perspective switching smoothness and user experience during the pseudo three-dimensional model display process, and further solves the technical problem of poor perspective switching smoothness and poor user experience in the prior art of the pseudo three-dimensional model display method that only displays the pre-rendered images of the model based on the observation perspective sampling.
[0211] Optionally, the processor may also be configured to perform the following steps through a computer program: displaying a first scene image corresponding to the virtual three-dimensional model in a graphical user interface, wherein the first scene image is obtained by interpolating and mixing at least two first target images and directed distance field information stored in a second map determined by the first map, the first map stores a plurality of pre-rendered images of the virtual three-dimensional model at a plurality of preset viewing angles, the plurality of pre-rendered images are arranged in a determinant manner in the first map according to angle deflection values of the plurality of preset viewing angles in the virtual scene, the at least two first target images are determined from the plurality of pre-rendered images based on the first viewing angle, the second map is obtained by performing image processing on the first map The pixel grayscale is calculated and determined, the second map stores signed distance field information corresponding to a plurality of pre-rendered images, and at least two first target images are adjacent in a row direction or a column direction in a determinant arrangement; in response to the scene observation perspective corresponding to the virtual three-dimensional model being switched from a first perspective to a second perspective, the graphical user interface is controlled to switch from displaying the first scene image to displaying a second scene image corresponding to the virtual three-dimensional model, wherein the second scene image is obtained by performing interpolation and mixing processing on at least two second target images and the signed distance field information, the second target image is determined from the plurality of pre-rendered images based on the second perspective, and at least two second target images are adjacent in a row direction or a column direction in a determinant arrangement.
[0212] Fig.17 is a schematic diagram of an electronic device according to one embodiment of the present application. Fig.17As shown, the electronic device 1700 is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0213] like Fig.17 As shown, the electronic device 1700 is in the form of a general computing device. The components of the electronic device 1700 may include but are not limited to: at least one processor 1710, at least one memory 1720, a bus 1730 connecting different system components (including the memory 1720 and the processor 1710), and a display 1740.
[0214] The memory 1720 stores program codes, which can be executed by the processor 1710, so that the processor 1710 executes the steps described in the method section of the embodiment of the present application according to various exemplary embodiments of the present application.
[0215] The memory 1720 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 17201 and / or a cache memory unit 17202, and may further include a read-only memory unit (ROM) 17203, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
[0216] In some examples, the memory 1720 may also include a program / utility 17204 having a set (at least one) of program modules 17205, such program modules 17205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may include the implementation of a network environment. The memory 1720 may further include a memory remotely disposed relative to the processor 1710, and these remote memories may be connected to the electronic device 1700 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.
[0217] The bus 1730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a local bus of the processor 1710, or a bus using any of a variety of bus architectures.
[0218] The display 1740 may be, for example, a touch screen liquid crystal display (LCD), which may enable a user to interact with a user interface of the electronic device 1700 .
[0219] Optionally, the electronic device 1700 may also communicate with one or more external devices 1800 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 1700, and / or any device that enables the electronic device 1700 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 1750. Furthermore, the electronic device 1700 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 1760. Fig.17 As shown, the network adapter 1760 communicates with other modules of the electronic device 1700 via the bus 1730. It should be understood that although Fig.17 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 1700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, disk arrays (Redundant Arrays of Independent Disks, RAID) systems, tape drives, and data backup storage systems.
[0220] The electronic device 1700 may further include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply and / or a camera.
[0221] It can be understood by those skilled in the art that Fig.17 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig.17 More or fewer components as shown, or with Fig.17 The memory 1720 may be used to store computer programs and corresponding data, such as computer programs and corresponding data corresponding to the method for rendering a virtual three-dimensional model or the method for switching and displaying a virtual three-dimensional model in the embodiments of the present application. The processor 1710 executes various functional applications and data processing by running the computer programs stored in the memory 1720, that is, implementing the method for rendering a virtual three-dimensional model or the method for switching and displaying a virtual three-dimensional model.
[0222] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0223] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0224] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0225] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0226] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0227] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method provided in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program codes.
[0228] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for rendering a virtual three-dimensional model, characterized in that: The method comprises: Performing pixel grayscale calculation on a first map corresponding to the virtual three-dimensional model to obtain a second map, wherein the first map stores a plurality of pre-rendered images of the virtual three-dimensional model at a plurality of preset viewing angles, the plurality of pre-rendered images are arranged in a determinant in the first map according to the angle deflection values of the plurality of preset viewing angles in the virtual scene, and the second map stores the directed distance field information corresponding to the plurality of pre-rendered images; Determining at least two target pre-rendered images from the plurality of pre-rendered images based on a current viewing angle corresponding to the virtual three-dimensional model, wherein the at least two target pre-rendered images are adjacent in a row direction or a column direction in the determinant-column arrangement; The signed distance field information and the at least two target pre-rendered images are interpolated and mixed to generate a rendering result of the virtual three-dimensional model.
2. The method for rendering a virtual three-dimensional model according to claim 1, characterized in that: Performing pixel grayscale calculation on the first map corresponding to the virtual three-dimensional model to obtain the second map includes: Converting the first map into a first grayscale image; performing a two-dimensional directed distance calculation on the first grayscale image based on the pixel grayscale of the first grayscale image to generate a second grayscale image, where the second grayscale image is used to represent the directed distance field information; The second grayscale image is stored in the transparency channel of the first map to obtain the second map.
3. The method for rendering a virtual three-dimensional model according to claim 2, characterized in that: Performing a two-dimensional directed distance calculation on the first grayscale image based on the pixel grayscale of the first grayscale image to generate the second grayscale image includes: Determine a first pixel point set and a second pixel point set from the plurality of pixels according to the pixel grayscales of the plurality of pixels in the first grayscale image, wherein the first pixel point set includes the pixel points whose pixel grayscale is a first grayscale value, and the second pixel point set includes the other pixel points in the first grayscale image except the pixel points corresponding to the first pixel point set; Mapping the pixel grayscale of the second pixel point set in the first grayscale image to a second grayscale value; The second grayscale image is generated by performing a two-dimensional directed distance calculation on the first grayscale image using the first pixel point set, the second pixel point set, the first grayscale value, and the second grayscale value.
4. The method for rendering a virtual three-dimensional model according to claim 3, characterized in that: Performing a two-dimensional directed distance calculation on the first grayscale image by using the first pixel point set, the second pixel point set, the first grayscale value, and the second grayscale value to generate the second grayscale image includes: Determining a first image region corresponding to the plurality of pre-rendered images from the first grayscale image using the first pixel point set and the first grayscale value; Performing a two-dimensional directed distance calculation on the multiple pixel points of the first grayscale image based on the first image area to generate a third grayscale image, wherein the third grayscale image is used to determine the two-dimensional directed distance between the multiple pixel points and the first image area; Determining a second image region corresponding to the plurality of pre-rendered images from the first grayscale image using the second pixel point set and the second grayscale value; Performing a two-dimensional directed distance calculation on the pixels of the first grayscale image based on the second image area to generate a fourth grayscale image, wherein the fourth grayscale image is used to determine the two-dimensional directed distances between the plurality of pixels and the second image area; The third grayscale image and the fourth grayscale image are mixed to obtain the second grayscale image.
5. The method for rendering a virtual three-dimensional model according to claim 1, characterized in that: Based on the current viewing angle, determining the at least two target pre-rendered images from the plurality of pre-rendered images comprises: Determining the current viewing angle corresponding to the virtual three-dimensional model based on a first position of the virtual three-dimensional model in the virtual scene and a second position of a virtual camera in the virtual scene, wherein the virtual camera is used to observe the virtual three-dimensional model; Obtain at least two target grid coordinates using the current viewing angle and the distribution grid, wherein the distribution grid is a virtual network corresponding to the first map and the second map, and the virtual network is obtained by dividing based on the number of arrangement rows and the number of arrangement columns of the plurality of pre-rendered images in the first map and the second map; According to the at least two target grid coordinates, the at least two target pre-rendered images are selected from the plurality of pre-rendered images.
6. The method for rendering a virtual three-dimensional model according to claim 5, characterized in that: The at least two target grid coordinates include four target grid coordinates, and the at least two target pre-rendered images include four target pre-rendered images, wherein any two of the four target pre-rendered images are adjacently arranged in a row direction or a column direction of the determinant arrangement.
7. The method for rendering a virtual three-dimensional model according to claim 6, characterized in that: Using the current viewing angle and the distribution grid, obtaining the four target grid coordinates includes: Determine four grid offset coordinates using the current viewing angle, the number of arrangement rows, and the number of arrangement columns; Scaling the distribution grid to obtain grid scaling coordinates; The four grid offset coordinates are respectively added to the grid scaling coordinates to obtain the four target grid coordinates.
8. The method for rendering a virtual three-dimensional model according to claim 7, characterized in that: Determining the four grid offset coordinates using the current viewing angle, the number of arrangement rows, and the number of arrangement columns includes: Performing a division calculation on the current viewing angle and a preset full viewing angle threshold to obtain a relative viewing angle corresponding to the current viewing angle; Multiplying the relative viewing angle by the number of arranged rows to obtain a row position component, and multiplying the relative viewing angle by the number of arranged columns to obtain a column position component; The row position component and the column position component are rounded to obtain the four grid offset coordinates.
9. The method for rendering a virtual three-dimensional model according to claim 8, characterized in that: The four grid offset coordinates include: a first offset coordinate, a second offset coordinate, a third offset coordinate and a fourth offset coordinate; the row position component and the column position component are rounded to obtain the grid offset coordinates including: Rounding up the row position component and rounding up the column position component to obtain the first offset coordinate; Rounding up the row position component and rounding down the column position component to obtain the second offset coordinate; The row position component is rounded down, and the column position component is rounded up to obtain the third offset coordinate; The row position component is rounded down, and the column position component is rounded down to obtain the fourth offset coordinate.
10. The method for rendering a virtual three-dimensional model according to claim 1, characterized in that: Performing interpolation and mixing processing on the signed distance field information and the at least two target pre-rendered images to generate the rendering result includes: Determine an interpolation coefficient using the row and column arrangement data corresponding to the current viewing angle and the plurality of pre-rendered images; performing interpolation and mixing processing on the signed distance field information and the at least two target pre-rendered images based on the interpolation coefficients, Generate the rendering result.
11. The method for rendering a virtual three-dimensional model according to claim 10, characterized in that: Determining the interpolation coefficient using the current viewing angle and the row and column arrangement data includes: The arrangement position data is calculated based on the row and column arrangement data and the relative viewing angle of the current viewing angle to the preset full viewing angle interval, wherein the row and column arrangement data includes the number of arrangement rows and the number of arrangement columns of the multiple pre-rendered images in the first map, and the arrangement position data includes the row position component and the column position component corresponding to the current viewing angle; The arrangement position data is calculated by taking a decimal point to obtain the interpolation coefficient.
12. The method for rendering a virtual three-dimensional model according to claim 10, characterized in that: Performing interpolation and mixing processing on the signed distance field information and the at least two target pre-rendered images based on the interpolation coefficients to generate the rendering result includes: Performing linear interpolation processing on the signed distance field information based on the interpolation coefficients to obtain a transparency mask; Performing linear interpolation processing on the at least two target pre-rendered images based on the interpolation coefficients to obtain target color information; The target color information is subjected to transparency mixing processing using the transparency mask to generate the rendering result.
13. A method for switching display of a virtual three-dimensional model, characterized in that: The method comprises: Displaying a first scene image corresponding to a virtual three-dimensional model in a graphical user interface, wherein the first scene image is obtained by interpolating and mixing at least two first target images and signed distance field information stored in a second map determined by a first map, the first map stores a plurality of pre-rendered images of the virtual three-dimensional model at a plurality of preset viewing angles, the plurality of pre-rendered images are arranged in a determinant in the first map according to angle deflection values of the plurality of preset viewing angles in the virtual scene, the at least two first target images are determined from the plurality of pre-rendered images based on a first viewing angle, the second map is determined by performing pixel grayscale calculation on the first map, the signed distance field information corresponding to the plurality of pre-rendered images is stored in the second map, and the at least two first target images are adjacent in a row direction or a column direction in the determinant arrangement; In response to the scene observation perspective corresponding to the virtual three-dimensional model being switched from the first perspective to the second perspective, the graphical user interface is controlled to switch from displaying the first scene image to displaying a second scene image corresponding to the virtual three-dimensional model, wherein the second scene image is obtained by interpolating and mixing at least two second target images and the directed distance field information, the second target image is determined from the multiple pre-rendered images based on the second perspective, and the at least two second target images are adjacent in the row direction or the column direction in the determinant arrangement.
14. A rendering device for a virtual three-dimensional model, characterized in that: The device comprises: a processing module, configured to perform pixel grayscale calculation on a first map corresponding to the virtual three-dimensional model to obtain a second map, wherein the first map stores a plurality of pre-rendered images of the virtual three-dimensional model at a plurality of preset viewing angles, the plurality of pre-rendered images are arranged in a determinant in the first map according to angle deflection values of the plurality of preset viewing angles in the virtual scene, and the second map stores directed distance field information corresponding to the plurality of pre-rendered images; A determination module, configured to determine at least two target pre-rendered images from the plurality of pre-rendered images based on a current viewing angle corresponding to the virtual three-dimensional model, wherein the at least two target pre-rendered images are adjacent in a row direction or a column direction in the determinant-column arrangement; The processing module is used to perform interpolation and mixing processing on the signed distance field information and the at least two target pre-rendered images to obtain a rendering result of the virtual three-dimensional model.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the virtual three-dimensional model rendering method described in any one of claims 1 to 12 or the virtual three-dimensional model switching display method described in claim 13 when executed by a processor.
16. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to run the computer program to execute the virtual three-dimensional model rendering method described in any one of claims 1 to 12 or the virtual three-dimensional model switching display method described in claim 13.
Citation Information
Cited By
Nuclear power station containment vessel model rendering method, system and equipment
CN119941957A
Simulation deduction multi-modal interaction data processing method and system
CN121505163A