Model rendering display method, device and computer equipment
By superimposing preset special effects models below the bottom surface of the virtual ground model and rendering them based on its depth information, the problem of poor special effects display in the existing technology is solved, and better three-dimensional rendering effects and special effects display are achieved.
Patent Information
- Application Number
- CN202210633539.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-06
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2042-06-06
AI Technical Summary
The prior art shows special effects by placing special effects maps or setting materials on virtual ground models in electronic games, which cannot achieve three-dimensional effects, and it is easy to cause confusion in rendering and sorting, resulting in poor display effects.
Superimpose preset special effects models below the bottom surface of the virtual ground model, give it a translucent material, obtain front and back depth information, determine its own occlusion information, render and display the special effects models and virtual ground models based on this information.
Through this method, the unobstructed areas of the front and back of the special effect model can be accurately displayed, the rendering and display effect of the three-dimensional model can be improved, and the authenticity of the special effect can be enhanced.
Smart Images

Figure CN115035226B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a model rendering and display method, device and computer equipment. Background Art
[0002] With the development of computer technology, more and more electronic games have entered people's lives. In electronic games, a lot of model rendering work is involved, and some special effects are often required to be displayed on the virtual ground in the game.
[0003] In the related art, electronic games generally display special effects on the virtual ground by placing special effect maps on the virtual ground model, or by setting the material of the virtual ground model when rendering the virtual ground model, for example, setting the material of a certain part of the object of the virtual ground model to be semi-transparent, so that when the virtual ground is displayed, this part of the object shows a specific effect. In this way, the purpose of displaying special effects on the virtual ground in the game can be achieved.
[0004] However, the solution of placing a texture on the virtual ground in the related art cannot achieve the three-dimensional effect of special effects, and the solution of setting the material of the virtual ground model easily causes the problem of rendering order confusion. Therefore, the solution of the related art has the problem of poor rendering display effect. Summary of the invention
[0005] The purpose of this application is to provide a model rendering and display method, device and computer equipment, which can improve the rendering and display effect of three-dimensional models.
[0006] The embodiment of the present application is implemented as follows:
[0007] In a first aspect of an embodiment of the present application, a model rendering and display method is provided, the method comprising:
[0008] Overlaying a preset special effect model below the bottom surface of the virtual ground model;
[0009] Assigning a first material to the preset special effect model to obtain front depth information of the preset special effect model, and obtaining back depth information of the preset special effect model, wherein the first material includes a translucent material, the back depth information includes the depth of each point on the back of the preset special effect model, and the front depth information includes the depth of each point on the front of the preset special effect model;
[0010] Determine the self-occlusion information of the preset special effect model according to the front depth information and the back depth information;
[0011] Based on the self-occlusion information, the preset special effect model and the virtual ground model are rendered and displayed.
[0012] Optionally, after determining the self-occlusion information of the preset special effect model according to the front depth information and the back depth information, the method further includes:
[0013] Determining associated occlusion information of the preset special effect model and an associated model, wherein the associated model is superimposed on the surface of the virtual ground model, and the associated occlusion information is used to indicate an area of the preset special effect model that is occluded by the associated model;
[0014] The rendering and displaying of the preset special effect model and the virtual ground model based on the self-occlusion information includes:
[0015] Based on the self-occlusion information and the associated occlusion information, the preset special effect model and the virtual ground model are rendered and displayed.
[0016] Optionally, determining the associated occlusion information of the preset special effect model and the associated model includes:
[0017] Emitting a plurality of rays in any direction from the position of the virtual camera to the shooting direction of the virtual camera, and determining whether each of the rays is simultaneously emitted to the preset special effect model and the associated model;
[0018] If any ray is emitted to the preset special effects model and the associated model at the same time, it is determined that the preset special effects model is blocked by the associated model, and the blocked area in the preset special effects model is determined according to the position where each ray is emitted to the preset special effects model.
[0019] Optionally, determining the associated occlusion information of the preset special effect model and the associated model includes:
[0020] Determining the scene depth of the associated model and the pixel depth of the preset special effect model based on the position of the virtual camera and the shooting direction of the virtual camera;
[0021] Determine a first vector according to the scene depth of the associated model, where the first vector is used to indicate the distance and direction from the position of the virtual camera to at least one point of the associated model;
[0022] Determining a length ratio of a second vector to the first vector according to a scene depth of the associated model and a pixel depth of the preset special effect model;
[0023] Multiplying the first vector and the length ratio to obtain the second vector, where the second vector is used to indicate the distance and direction from the position of the virtual camera to at least one point of the preset special effect model;
[0024] According to the position of the virtual camera and the second vector, an obstructed area in the preset special effects model is determined.
[0025] Optionally, the rendering and displaying the preset special effect model and the virtual ground model based on the self-occlusion information and the associated occlusion information includes:
[0026] Rendering the preset special effect model and the virtual ground model, setting the transparency of the area blocked by the preset special effect model to a first transparency, and displaying the preset special effect model and the virtual ground model, wherein the first transparency is greater than the preset transparency.
[0027] Optionally, the rendering and displaying the preset special effect model and the virtual ground model based on the self-occlusion information and the associated occlusion information includes:
[0028] Render and display the virtual ground model and the unobstructed areas in the preset special effect model.
[0029] Optionally, superimposing a preset special effect model below the bottom surface of the virtual ground model includes:
[0030] Determine first position information of the virtual ground model, wherein the first position information includes: position coordinates of each point in the virtual ground model;
[0031] The second position information of the preset special effect model is adjusted according to the first position information so that the preset special effect model is located below the bottom surface of the virtual ground model, and the second position information includes the position coordinates of each point in the preset special effect model.
[0032] Optionally, adjusting the second position information of the preset special effect model according to the first position information includes:
[0033] The position coordinates of each point in the preset special effect model are adjusted so that the position coordinates of each point in the preset special effect model are less than or equal to the corresponding position coordinates of each point in the virtual ground model.
[0034] Optionally, superimposing a preset special effect model below the bottom surface of the virtual ground model includes:
[0035] Acquire an association relationship between the preset special effect model and the virtual ground model, where the association relationship is used to indicate position information of the preset special effect model relative to the virtual ground model;
[0036] A preset special effect model is superimposed below the bottom surface of the virtual ground model according to the association relationship.
[0037] Optionally, the acquiring back surface depth information of the preset special effect model includes:
[0038] Copying the preset special effect model to obtain a target special effect model;
[0039] Obtaining custom depth information according to the target special effect model, wherein the custom depth information includes the back depth of the target special effect model;
[0040] The custom depth information is assigned to the preset special effect model to obtain back depth information of the preset special effect model.
[0041] Optionally, obtaining customized depth information according to the target special effects model includes:
[0042] Adjusting the transparency of each point on the surface of the target special effect model to a first transparency, and adjusting the transparency of each point on the bottom surface of the target special effect model to a second transparency;
[0043] Assigning a second material to the target special effect model to draw back depth information of the target special effect model to the custom depth information, wherein the second material includes a translucent material;
[0044] According to the second material, it is determined not to perform depth testing on the target special effects model and to perform customized depth drawing on the target special effects model.
[0045] Optionally, the determining the self-occlusion information of the preset special effect model according to the front depth information and the back depth information includes:
[0046] Determine whether the difference between the depth of each point on the back of the preset special effect model and the depth of each corresponding point on the front of the preset special effect model is greater than a preset threshold;
[0047] If the difference between the depth of the first target point on the back of the preset special effects model and the corresponding depth of the second target point on the front of the preset special effects model is greater than a preset threshold, it is confirmed that the first target point on the back of the preset special effects model is not blocked by the corresponding second target point on the front of the preset special effects model; otherwise, it is confirmed that the first target point on the back of the preset special effects model is blocked by the corresponding second target point on the front of the preset special effects model.
[0048] Optionally, before rendering and displaying the preset special effect model and the virtual ground model based on the self-occlusion information, the method further includes:
[0049] The rendering priority of the preset special effect model is adjusted, and the rendering priority is used to indicate that the preset special effect model has the lowest priority when rendering various translucent models.
[0050] Optionally, the rendering and displaying the preset special effect model and the virtual ground model based on the self-occlusion information includes:
[0051] Rendering the preset special effect model and the virtual ground model, setting the transparency of the area blocked by the preset special effect model to a first transparency, and displaying the preset special effect model and the virtual ground model, wherein the first transparency is greater than the preset transparency.
[0052] Optionally, the rendering and displaying the preset special effect model and the virtual ground model based on the self-occlusion information includes:
[0053] Render and display the virtual ground model and the unobstructed areas in the preset special effect model.
[0054] Optionally, after assigning the first material to the preset special effect model to obtain the front depth information of the preset special effect model, the method further includes:
[0055] According to the first material, the rendering order of the preset special effect model is adjusted.
[0056] According to a second aspect of an embodiment of the present application, a model rendering and display device is provided, the device comprising:
[0057] A superimposition module, used for superimposing a preset special effect model below the bottom surface of the virtual ground model;
[0058] an assignment acquisition module, configured to assign a first material to the preset special effect model to obtain front depth information of the preset special effect model, and to acquire back depth information of the preset special effect model, wherein the first material includes a translucent material, the back depth information includes the depth of each point on the back of the preset special effect model, and the front depth information includes the depth of each point on the front of the preset special effect model;
[0059] A determination module, used to determine the self-occlusion information of the preset special effect model according to the front depth information and the back depth information;
[0060] A rendering and display module is used to render and display the preset special effect model and the virtual ground model based on the self-occlusion information.
[0061] According to a third aspect of an embodiment of the present application, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the model rendering and display method described in the first aspect is implemented.
[0062] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the model rendering and display method described in the first aspect is implemented.
[0063] The beneficial effects of the embodiments of the present application include:
[0064] A model rendering and display method provided in an embodiment of the present application superimposes a preset special effects model under the bottom surface of a virtual ground model, assigns a first material to the preset special effects model to obtain the front depth information of the preset special effects model, and obtains the back depth information of the preset special effects model, determines the self-occlusion information of the preset special effects model according to the front depth information and the back depth information, and renders and displays the preset special effects model and the virtual ground model based on the self-occlusion information.
[0065] Among them, the first material is assigned to the preset special effects model to obtain the front depth information of the preset special effects model, and the back depth information of the preset special effects model is obtained, so that the preset special effects model can be displayed at the forefront of each virtual object in the virtual space in the terminal game or rendering software.
[0066] By determining the self-occlusion information of the preset special effects model based on the front depth information and the back depth information, it is possible to determine an area in the virtual picture captured by the virtual camera where the back of the preset special effects model is occluded by the front of the preset special effects model.
[0067] By rendering the preset special effects model and the virtual ground model based on the self-occlusion information, it is possible to ensure that the front of the preset special effects model and the area of the back of the preset special effects model that is not occluded by the front of the preset special effects model can be accurately displayed when the preset special effects model is displayed, and to improve the display effect of the preset special effects model superimposed on the bottom surface of the virtual ground model. In this way, the three-dimensional effect of displaying the preset special effects model can be improved.
[0068] In this way, the rendering and display effect of the three-dimensional model can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0070] Figure 1A flowchart of a first model rendering and display method provided in an embodiment of the present application;
[0071] Figure 2 A flowchart of a second model rendering and display method provided in an embodiment of the present application;
[0072] Figure 3 A flowchart of a third model rendering and display method provided in an embodiment of the present application;
[0073] Figure 4 A flowchart of a fourth model rendering and display method provided in an embodiment of the present application;
[0074] Figure 5 A schematic diagram of a virtual space provided in an embodiment of the present application;
[0075] Figure 6 A flowchart of a fifth model rendering and display method provided in an embodiment of the present application;
[0076] Figure 7 A flowchart of a sixth model rendering and display method provided in an embodiment of the present application;
[0077] Figure 8 A flowchart of a seventh model rendering and display method provided in an embodiment of the present application;
[0078] Fig. 9 A flowchart of an eighth model rendering and display method provided in an embodiment of the present application;
[0079] Fig.10 A flowchart of a ninth model rendering and display method provided in an embodiment of the present application;
[0080] Fig.11 A schematic diagram of the structure of a model rendering and display device provided in an embodiment of the present application;
[0081] Fig.12 A schematic diagram of the structure of another model rendering display device provided in an embodiment of the present application;
[0082] Fig.13 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0083] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0084] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0085] In the related art, electronic games generally display special effects on the virtual ground by placing special effect maps on the virtual ground model, or by setting the material of the virtual ground model when rendering the virtual ground model, for example, setting the material of a certain part of the object of the virtual ground model to be translucent, so that when the virtual ground is displayed, this part of the object shows a specific effect. In this way, the purpose of displaying special effects on the virtual ground in the game can be achieved. However, the solution of placing maps on the virtual ground in the related art cannot achieve the three-dimensional effect of special effects, and the solution of setting the material of the virtual ground model is prone to cause confusion in rendering sorting. Therefore, the solution of the related art has the problem of poor rendering display effect.
[0086] To this end, an embodiment of the present application provides a model rendering and display method, which superimposes a preset special effects model under the bottom surface of a virtual ground model, assigns a first material to the preset special effects model to obtain the front depth information of the preset special effects model, and obtains the back depth information of the preset special effects model, determines the self-occlusion information of the preset special effects model according to the front depth information and the back depth information, and renders and displays the preset special effects model and the virtual ground model based on the self-occlusion information, thereby improving the rendering and display effect of the three-dimensional model.
[0087] The model rendering and display method in one embodiment of the present application can be run on a terminal device or a server. The terminal device can be a local terminal device. When the model rendering and display method is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0088] In an optional implementation, various cloud applications, such as cloud games, can be run under the cloud interaction system. Taking cloud games as an example, cloud games refer to a game method based on cloud computing. In the operation mode of cloud games, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the game display method are completed on the cloud game server. The role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the terminal device for information processing is a cloud game server in the cloud. When playing the game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.
[0089] In an optional embodiment, the terminal device may be a local terminal device. Taking a game as an example, the local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the player through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.
[0090] In a possible implementation, an embodiment of the present invention provides a model rendering and display method, which provides a graphical user interface through a first terminal device, wherein the first terminal device can be the local terminal device mentioned above, or can be the client device in the cloud interaction system mentioned above.
[0091] The embodiment of the present application is described by taking the model rendering and display method applied in a terminal game as an example, but it does not mean that the embodiment of the present application can only be applied to model rendering and display in a terminal game.
[0092] In addition, the model rendering and display method provided in the embodiment of the present application can be applied to software such as Unreal Engine 4 (UnrealEngine 4).
[0093] The model rendering and display method provided in the embodiment of the present application is explained in detail below.
[0094] Figure 1This is a flowchart of a model rendering and display method provided by the present application. The method can be applied to a computer device, which can be the aforementioned terminal device or server. Figure 1 , the embodiment of the present application provides a model rendering and display method, comprising:
[0095] Step 1001: superimpose a preset special effect model below the bottom surface of the virtual ground model.
[0096] Optionally, the virtual ground model may be a virtual ground displayed in a terminal game, or may be a virtual ground model rendered in rendering software, which is not limited in the embodiments of the present application.
[0097] The preset special effect model may be a three-dimensional model prepared in advance by relevant technical personnel, and the preset special effect model may also be a model of special effects displayed in a terminal game.
[0098] For example, the preset special effects model can be a virtual ground crack model, a virtual ground hollow model, a ground lamp model embedded in the virtual ground in the terminal game, and any other model that can be superimposed under the bottom surface of the virtual ground model. The embodiments of the present application are not limited to this.
[0099] Of course, relevant technical personnel can superimpose the preset special effect model at any position below the bottom surface of the virtual ground model according to actual needs, and the embodiments of the present application are not limited to this.
[0100] It is worth noting that the bottom surface of the virtual ground model may refer to the side of the virtual ground model that is away from the virtual camera in the terminal game or rendering software. The operation of superimposing the preset special effects model below the bottom surface of the virtual ground model may be to embed the preset special effects model into the virtual ground model, or to fit the upper surface of the preset special effects model to the bottom surface of the virtual ground model, which is not limited in the embodiments of the present application. Generally, the virtual camera is located above the virtual ground model or fits the upper surface of the virtual ground model.
[0101] Step 1002: assigning the first material to the preset special effect model to obtain the front depth information of the preset special effect model, and obtaining the back depth information of the preset special effect model.
[0102] Optionally, the first material includes a translucent material.
[0103] In addition, when the first material is assigned to the preset special effect model, the illumination properties of the surface of the preset special effect model can also be adjusted. The illumination properties include reflectivity, refractive index, transparency, self-luminescence and other properties, which are not limited in the present embodiment.
[0104] When making the preset special effects model, the front side of the preset special effects model and the back side of the preset special effects model can be set in advance.
[0105] Generally, when the preset special effects model is superimposed below the bottom surface of the virtual ground model, the back of the preset special effects model can be in direct contact with the virtual ground model, and the above-mentioned virtual camera can directly shoot the front of the preset special effects model from above the virtual ground model.
[0106] Optionally, the back depth information includes the depth of each point on the back of the preset special effect model.
[0107] The back depth information may include the depth of each point on the back of the preset special effect model relative to the virtual camera.
[0108] Optionally, the front depth information includes the depth of each point on the front of the preset special effect model.
[0109] The front depth information may include the depth of each point on the front of the preset special effect model relative to the virtual camera.
[0110] It is worth noting that, when the first material is assigned to the preset special effects model, the first material can be assigned to the entire preset special effects model, or the first material can be assigned to a part of the preset special effects model. Moreover, since the first material includes a translucent material, when the first material is assigned to the entire preset special effects model, the preset special effects model can be adjusted to a translucent state. In addition, when the first material is assigned to a part of the preset special effects model, this part of the preset special effects model can be adjusted to a translucent state without adjusting the transparency of the part of the preset special effects model to which the first material is not assigned. In this way, the preset special effects model can be displayed at the forefront of each virtual object in the virtual space in the terminal game or rendering software.
[0111] Step 1003: Determine the self-occlusion information of the preset special effect model according to the front depth information and the back depth information.
[0112] Optionally, the self-occlusion information may be used to determine whether the back side of the preset special effects model is occluded by the front side of the preset special effects model, and the area where the back side of the preset special effects model is occluded by the front side of the preset special effects model.
[0113] Furthermore, the self-occlusion information may be used to indicate an area in the virtual picture captured by the virtual camera where the back side of the preset special effects model is occluded by the front side of the preset special effects model.
[0114] It is worth noting that determining the self-occlusion information based on the front depth information and the back depth information can determine the area in the virtual picture captured by the virtual camera where the back of the preset special effects model is occluded by the front of the preset special effects model, which facilitates subsequent operations.
[0115] Step 1004: Render and display the preset special effect model and the virtual ground model based on the self-occlusion information.
[0116] It is worth noting that by rendering the preset special effects model and the virtual ground model based on the self-occlusion information, it can be ensured that when the preset special effects model is displayed, the front of the preset special effects model and the back of the preset special effects model that are not blocked by the front of the preset special effects model can be accurately displayed, which can improve the display effect of the preset special effects model superimposed on the bottom surface of the virtual ground model.
[0117] In an embodiment of the present application, a preset special effects model is superimposed below the bottom surface of a virtual ground model, a first material is assigned to the preset special effects model to obtain front depth information of the preset special effects model, and back depth information of the preset special effects model is obtained, self-occlusion information of the preset special effects model is determined according to the front depth information and the back depth information, and based on the self-occlusion information, the preset special effects model and the virtual ground model are rendered and displayed.
[0118] Among them, the first material is assigned to the preset special effects model to obtain the front depth information of the preset special effects model, and the back depth information of the preset special effects model is obtained, so that the preset special effects model can be displayed at the forefront of each virtual object in the virtual space in the terminal game or rendering software.
[0119] The self-occlusion information of the preset special effects model is determined according to the front depth information and the back depth information, and the area where the back of the preset special effects model is occluded by the front of the preset special effects model in the virtual picture captured by the virtual camera can be determined.
[0120] By rendering the preset special effects model and the virtual ground model based on the self-occlusion information, it is possible to ensure that the front of the preset special effects model and the area of the back of the preset special effects model that is not occluded by the front of the preset special effects model can be accurately displayed when the preset special effects model is displayed, and to improve the display effect of the preset special effects model superimposed on the bottom surface of the virtual ground model. In this way, the three-dimensional effect of displaying the preset special effects model can be improved.
[0121] In this way, the rendering and display effect of the three-dimensional model can be improved.
[0122] In one possible manner, since the position of the virtual camera and / or the shooting direction of the virtual camera can be changed under the control of relevant technicians or users, once the position or shooting direction of the virtual camera changes, the front depth information and / or back depth information of the preset special effects model will also change, thereby causing the self-occlusion information of the preset special effects model to change. Therefore, before executing step 1002, the following steps may also be performed: determining the current position and current shooting direction of the virtual camera.
[0123] In this case, the back depth information of the preset special effects model, the front depth information of the preset special effects model and the self-occlusion relationship of the preset special effects model can be determined according to the current position and current shooting direction of the virtual camera.
[0124] In a possible implementation, after assigning the first material to the preset special effect model to obtain the front depth information of the preset special effect model, the method further includes:
[0125] According to the first material, the rendering order of the preset special effect model is adjusted.
[0126] That is to say, based on the first material, the order of rendering the preset special effects model can be adjusted when rendering each virtual object or each virtual model, so that the preset special effects model will not be blocked by other virtual objects or other virtual models that are closer to the virtual camera.
[0127] Exemplarily, the operation of adjusting the rendering order of the preset special effect model according to the first material may be: according to the first material, determining not to perform a depth test on the preset special effect model.
[0128] Optionally, the depth test operation may refer to determining the rendering order of each virtual object or each virtual model in the virtual space in the terminal game or rendering software according to the depth of each virtual object or each virtual model relative to the virtual camera, so that when performing model rendering, each virtual object or each virtual model in the virtual space is rendered in sequence according to the rendering order.
[0129] Generally speaking, if the depth of a virtual object or virtual model relative to the virtual camera is greater, it can be represented that the distance of the virtual object or virtual model relative to the virtual camera is farther, then when rendering or displaying, the virtual object or virtual model will be blocked by virtual objects or virtual models that are closer to the virtual camera.
[0130] In addition, the preset special effects model can be rendered after all virtual objects or virtual models that are closer to the virtual camera are rendered, or after all virtual objects or virtual models that are farther from the virtual camera are rendered, or after all other virtual objects or virtual models are rendered. The preset special effects model can be adjusted according to actual needs to ensure that the preset special effects model will not be blocked by other virtual objects or other virtual models that are closer to the virtual camera, and the embodiments of the present application are not limited to this.
[0131] It is worth noting that if a depth test is performed on the preset special effects model, the preset special effects model may be obscured by virtual objects or virtual models that are closer to the virtual camera. However, based on the first material, it is determined that no depth test will be performed on the preset special effects model. This ensures that during rendering, the preset special effects model will not be obscured by other virtual objects or other virtual models that are closer to the virtual camera.
[0132] In this way, the accuracy of rendering the preset special effects model can be improved, thereby improving the rendering and display effect of the three-dimensional model.
[0133] In one possible implementation, Figure 1 Based on Figure 2 After determining the self-occlusion information of the preset special effect model according to the front depth information and the back depth information, the method further includes:
[0134] Step 1005: Determine the associated occlusion information of the preset special effect model and the associated model.
[0135] Optionally, the associated model is superimposed on the surface of the virtual ground model.
[0136] The associated model may be another opaque three-dimensional model that contacts the upper surface of the preset special effect model when the preset special effect model is superimposed below the bottom surface of the virtual ground model.
[0137] The associated occlusion information is used to indicate an area in the preset special effect model that is occluded by the associated model.
[0138] It is worth noting that the associated occlusion information of the preset special effect model and the associated model can be used to determine the area indicating that the preset special effect model is occluded by the associated model, which facilitates subsequent operations.
[0139] Continue to see Figure 2 , based on the self-occlusion information, rendering and displaying the preset special effect model and the virtual ground model, including:
[0140] Step 1006: Render and display the preset special effect model and the virtual ground model based on the self-occlusion information and the associated occlusion information.
[0141] It is worth noting that rendering the preset special effects model and the virtual ground model based on the self-occlusion information can not only ensure that the front of the preset special effects model and the back of the preset special effects model that are not occluded by the front of the preset special effects model can be accurately displayed when the preset special effects model is displayed, but also only the area that is not occluded by the associated model can be displayed when the preset special effects model is displayed. In this way, not only can the display effect of the preset special effects model superimposed on the bottom surface of the virtual ground model be improved, but also the authenticity of displaying the preset special effects model can be improved.
[0142] In one possible implementation, Figure 2 Based on Figure 3 , determining the associated occlusion information of the preset special effect model and the associated model, including:
[0143] Step 1007: emit multiple rays in any direction from the position of the virtual camera to the shooting direction of the virtual camera, and determine whether each ray is emitted to the preset special effect model and the associated model at the same time.
[0144] Before executing step 1007, the current position and current shooting direction of the virtual camera may be determined first. Then, a plurality of rays in any direction may be emitted from the current position of the virtual camera to the shooting direction of the virtual camera.
[0145] In this way, it is possible to determine whether there is an occlusion relationship between the preset special effect model and the associated model by judging whether each ray is simultaneously emitted to the preset special effect model and the associated model, thereby facilitating subsequent operations.
[0146] Step 1008: If any ray is emitted to the preset special effect model and the associated model at the same time, it is determined that the preset special effect model is blocked by the associated model, and the blocked area in the preset special effect model is determined according to the position where each ray is emitted to the preset special effect model.
[0147] It is worth noting that, since each ray is a straight line formed by infinitely extending one end of a line segment, and since the virtual camera is generally located above the virtual ground model or fits the upper surface of the virtual ground model, the associated model is located above the virtual ground model, and the preset special effects model is located below the virtual ground model, if a ray is simultaneously emitted to the preset special effects model and the associated model, then it can be determined that in the picture taken by the virtual camera at the current position, a point in the preset special effects model hit by the ray is blocked by a point in the associated model hit by the ray. In this way, the area in the preset special effects model blocked by the associated model can be accurately determined. In this way, the authenticity of the display of the preset special effects model can be improved, and the rendering display effect of the three-dimensional model can be improved.
[0148] In one possible implementation, Figure 2 Based on Figure 4 , determining the associated occlusion information of the preset special effect model and the associated model, including:
[0149] Step 1009: Determine the scene depth of the associated model and the pixel depth of the preset special effect model based on the position of the virtual camera and the shooting direction of the virtual camera.
[0150] Optionally, the scene depth of the associated model may include the scene depth of any point on the associated model.
[0151] Optionally, the pixel depth of the preset special effect model may include the pixel depth of any point on the preset special effect model.
[0152] The pixel depth may refer to the depth of the pixel to be rendered. Specifically, the pixel depth may be used to indicate the distance from the virtual camera to the pixel to be rendered.
[0153] Step 1010: Determine a first vector according to the scene depth of the association model.
[0154] The first vector is used to indicate the distance and direction from the position of the virtual camera to at least one point of the associated model.
[0155] Step 1011: Determine a length ratio of the second vector to the first vector according to the scene depth of the associated model and the pixel depth of the preset special effect model.
[0156] Step 1012: Multiply the first vector and the length ratio to obtain the second vector.
[0157] The second vector is used to indicate the distance and direction from the position of the virtual camera to at least one point of the preset special effects model.
[0158] Step 1013: Determine the blocked area in the preset special effect model according to the position of the virtual camera and the second vector.
[0159] For example, see Figure 5 , Figure 5 A virtual camera S, an associated model G, and a preset special effect model T are shown, wherein point C0 is used to represent the position of the virtual camera S, point P0 is a point on the associated model G, and point P1 is a point on the preset special effect model T. It is assumed that the vector from point C0 to point P0 is the first vector L1, and the vector from point C0 to point P1 is the second vector L2.
[0160] Then, the length ratio of the first vector L1 and the second vector L2 can be obtained by dividing the scene depth of point P0 by the pixel depth of point P1, and the second vector L2 can be obtained by calculating the length ratio of the first vector L1 and the first vector L1 and the second vector L2. Finally, the position of point P1 can be calculated by the position of point C0 and the second vector L2, and then the position of point P1 blocked by point P0 of the associated model G in the preset special effect model T can be determined.
[0161] By determining the first vector and the second vector based on the position of the virtual camera, the scene depth of the associated model, and the pixel depth of the preset special effect model, it is possible to determine whether a point in the preset special effect model is blocked by a point in the associated model in the picture taken by the virtual camera at the current position. In this way, the area in the preset special effect model blocked by the associated model can be accurately determined. In this way, the authenticity of displaying the preset special effect model can be improved, and the rendering display effect of the three-dimensional model can be improved.
[0162] In one possible implementation, Figure 2 Based on Figure 6 , based on the self-occlusion information and the associated occlusion information, rendering and displaying the preset special effect model and the virtual ground model, including:
[0163] Step 1014: Render the preset special effect model and the virtual ground model, set the transparency of the area blocked by the preset special effect model to the first transparency, and display the preset special effect model and the virtual ground model.
[0164] Optionally, the first transparency refers to a transparency that can adjust the preset special effect model or any other three-dimensional model to a completely transparent state.
[0165] Exemplarily, the first transparency is greater than the preset transparency. Assuming that the transparency range of the preset special effect model can be 0-100%, wherein a greater transparency can represent a more transparent preset special effect model, and a smaller transparency can represent a more opaque preset special effect model.
[0166] The preset transparency can be set to 95%. If the first transparency is greater than the preset transparency, it means that when the transparency of the area blocked by the preset special effect model is set to the first transparency, the area blocked by the preset special effect model is in a completely transparent state.
[0167] Of course, the preset transparency can also be set to other values. Generally, the preset transparency can be set to a larger value. In this way, it can be ensured that the obscured area of the preset special effects model is not easily noticed when the rendering is completed and displayed, or that the obscured area of the preset special effects model is clearly distinguished from the unobstructed area when displayed.
[0168] It is worth noting that when executing step 1014, the entire preset special effects model and the virtual ground model need to be rendered. However, when finally displayed, the transparency of the area blocked by the preset special effects model will be set to the first transparency to ensure that the area blocked by the preset special effects model is completely transparent.
[0169] In this way, not only can it be ensured that when the preset special effects model is displayed, the front of the preset special effects model and the back of the preset special effects model that are not blocked by the front of the preset special effects model can be accurately displayed, but also only the area that is not blocked by the associated model can be displayed when the preset special effects model is displayed.
[0170] In a possible implementation, see Figure 6 , based on the self-occlusion information and the associated occlusion information, rendering and displaying the preset special effect model and the virtual ground model, including:
[0171] Step 1015: Render and display the virtual ground model and the unobstructed area of the preset special effect model.
[0172] It is worth noting that when executing step 1015, only the unobstructed area of the preset special effect model and the virtual ground model need to be rendered, which can ensure that only the area not obstructed by the associated model is displayed when the preset special effect model is displayed. In addition, since it is not necessary to render the obstructed area of the preset special effect model in this case, the processing pressure of the above-mentioned computer device is greatly reduced, thereby improving the efficiency of rendering and display.
[0173] In one possible implementation, Figure 1 Based on Figure 7 , which superimposes a preset special effect model below the bottom surface of the virtual ground model, including:
[0174] Step 1016: Determine first position information of the virtual ground model.
[0175] Optionally, the first position information includes: position coordinates of each point in the virtual ground model.
[0176] The position coordinates of each point in the virtual ground model may be coordinates of a world coordinate system based on the virtual space, the world coordinate system being a three-dimensional coordinate system, the world coordinate system may use any point in the virtual space as the origin of the coordinates, and the first axis, the second axis, and the third axis of the world coordinate system are mutually perpendicular. The embodiment of the present application does not limit the directions of the first axis, the second axis, and the third axis.
[0177] The position coordinates of each point in the virtual ground model may be used to indicate the height of each point in the virtual ground model relative to a reference plane.
[0178] The reference plane can be any horizontal plane in the virtual space.
[0179] Step 1017: adjusting the second position information of the preset special effect model according to the first position information so that the preset special effect model is located below the bottom surface of the virtual ground model.
[0180] Optionally, the second position information may include position coordinates of each point in the preset special effect model.
[0181] The position coordinates of each point in the preset special effect model may be coordinates based on the above-mentioned world coordinate system.
[0182] The position coordinates of each point in the preset special effect model can be used to indicate the height of each point in the preset special effect model relative to the above-mentioned reference plane.
[0183] In this way, it can be ensured that the height of each point in the preset special effect model relative to the reference plane is smaller than the height of a point in the virtual ground model corresponding to each point in the preset special effect model relative to the reference plane.
[0184] In addition, the second position information of the preset special effect model can be adjusted so that the preset special effect model can be located at any position of the virtual ground model. The position where the preset special effect model needs to be located on the virtual ground model can be set by relevant technical personnel, or can be determined in real time in response to certain trigger conditions in the terminal game, and the embodiments of the present application do not limit this.
[0185] For example, the first axis of the world coordinate system is perpendicular to the reference plane. Then, the position of the preset special effects model can be changed by adjusting the coordinates of each point of the preset special effects model on the second axis and the third axis of the world coordinate system, so that the preset special effects model can be adjusted to any position of the virtual ground model along a direction parallel to the reference plane.
[0186] In a possible implementation, adjusting the second position information of the preset special effect model according to the first position information includes:
[0187] The position coordinates of each point in the preset special effect model are adjusted so that the position coordinates of each point in the preset special effect model are less than or equal to the corresponding position coordinates of each point in the virtual ground model.
[0188] Exemplarily, adjusting the position coordinates of each point in the preset special effects model may specifically be: adjusting the position coordinates of each point in the preset special effects model in the direction perpendicular to the reference plane in the virtual space to be smaller than the position coordinates of each point in the corresponding virtual ground model in the direction perpendicular to the reference plane in the virtual space.
[0189] In addition, the points in the virtual ground model corresponding to the points in the preset special effects model may refer to points in the virtual ground model that are on the same straight line as the points in the preset special effects model in the direction perpendicular to the above-mentioned reference plane, and the embodiments of the present application are not limited to this.
[0190] It is worth noting that when adjusting the position coordinates of each point in the preset special effects model, it is necessary to adjust each point in the preset special effects model at the same time, that is, when adjusting the position coordinates of each point in the preset special effects model, the relative position relationship of each point in the preset special effects model will not change. Generally, the position coordinates of each point in the preset special effects model can be adjusted so that the upper surface of the preset special effects model fits the bottom surface of the virtual ground model.
[0191] In this way, the relative position of the preset special effect model can be ensured to be correct, so as to improve the three-dimensional effect of displaying the preset special effect model.
[0192] In one possible implementation, Figure 1 Based on Figure 8 , a preset special effect model is superimposed below the bottom surface of the virtual ground model, including:
[0193] Step 1018: Obtain the association relationship between the preset special effect model and the virtual ground model.
[0194] The association relationship is used to indicate position information of the preset special effect model relative to the virtual ground model.
[0195] Specifically, the association relationship may be used to indicate the distances of various points of the preset special effect model relative to various points of the corresponding virtual ground model in a direction perpendicular to the reference plane.
[0196] For example, the association relationship can be used to indicate the distance between each point on the upper surface of the preset special effect model and each point on the bottom surface of the corresponding virtual ground model. In this way, the distance between the preset special effect model and the virtual ground model in the direction perpendicular to the reference plane can be adjusted.
[0197] In this case, the relative position relationship of each point of the preset special effects model can also be adjusted according to the association relationship to achieve compression or stretching of the preset special effects model in a direction perpendicular to the above-mentioned reference plane, so that the shape of the preset special effects model can be changed.
[0198] Step 1019: superimpose a preset special effect model below the bottom surface of the virtual ground model according to the association relationship.
[0199] In this way, the flexibility of superimposing a preset special effect model below the bottom surface of the virtual ground model and the flexibility of displaying the preset special effect model can be improved.
[0200] In a possible implementation, obtaining back depth information of the preset special effect model includes:
[0201] Copy the preset special effects model to obtain the target special effects model.
[0202] The target special effect model is exactly the same as the preset special effect model.
[0203] Custom depth information is obtained according to the target special effects model.
[0204] Optionally, the custom depth information includes the back depth of the target special effects model.
[0205] The custom depth information is assigned to the preset special effect model to obtain the back depth information of the preset special effect model.
[0206] In this way, the back depth information of the preset special effect model can be obtained without performing operations such as drawing a custom depth on the preset special effect model.
[0207] In a possible implementation, obtaining customized depth information according to the target special effects model includes:
[0208] The transparency of each point on the surface of the target special effect model is adjusted to a first transparency, and the transparency of each point on the bottom surface of the target special effect model is adjusted to a second transparency.
[0209] Optionally, the second transparency refers to a transparency that can adjust the preset special effect model or any other three-dimensional model to a completely opaque state.
[0210] Exemplarily, the second transparency is less than the target transparency. Assuming that the transparency range of the preset special effect model can be 0-100%, wherein a greater transparency can represent a more transparent preset special effect model, and a smaller transparency can represent a more opaque preset special effect model.
[0211] The target transparency can be set to 5%. If the second transparency is less than the target transparency, it means that when the transparency of each point on the bottom surface of the preset special effect model is set to the second transparency, each point on the bottom surface of the preset special effect model is in a completely opaque state.
[0212] The second material is assigned to the target special effect model to draw the back depth information of the target special effect model to the custom depth information.
[0213] Optionally, the second material includes a translucent material.
[0214] In addition, when the second material is assigned to the target special effect model, the illumination properties of the surface of the target special effect model can also be adjusted. The illumination properties include reflectivity, refractive index, transparency, self-luminescence and other properties, which are not limited in the present embodiment.
[0215] When the preset special effect model is copied to obtain the target special effect model, the front side of the target special effect model and the back side of the target special effect model may be set in advance.
[0216] In this way, the back side of the target special effect model can be set to a completely opaque state, and the front side of the target special effect model can be set to a completely transparent state. In this way, each point on the front side of the target special effect model can be ignored and only the back side of the target special effect model can be customized for depth drawing.
[0217] According to the second material, it is determined not to perform depth testing on the target special effects model and to perform customized depth drawing on the target special effects model.
[0218] It is worth noting that if a depth test is performed on the target special effects model, the target special effects model may be blocked by virtual objects that are closer to the virtual camera. However, based on the second material, it is determined that no depth test will be performed on the target special effects model. This can ensure that the depth of the target special effects model will not affect the custom depth drawing of the target special effects model, thereby ensuring the accuracy of the back depth information of the target special effects model.
[0219] In one possible manner, after copying the preset special effect model to obtain the target special effect model, the method further includes:
[0220] Mark the target special effect model with identification information.
[0221] The identification information is used to indicate that the target special effect model does not need to be rendered and displayed.
[0222] Since the target special effects model and the preset special effects model are exactly the same, the target special effects model does not need to be rendered and displayed, and repeated rendering can be avoided, which greatly reduces the processing pressure of the above-mentioned computer equipment and thus improves the efficiency of rendering and display.
[0223] In a possible implementation, determining the self-occlusion information of the preset special effect model according to the front depth information and the back depth information includes:
[0224] It is determined whether the difference between the depth of each point on the back side of the preset special effect model and the corresponding depth of each point on the front side of the preset special effect model is greater than a preset threshold.
[0225] Optionally, the preset threshold may be 0.
[0226] Optionally, the point on the front of the preset special effects model corresponding to each point on the back of the preset special effects model may be a point on the front of the preset special effects model that is on the same line as each point on the back of the preset special effects model and the position of the above-mentioned virtual camera.
[0227] If the difference between the depth of the first target point on the back of the preset special effects model and the corresponding depth of the second target point on the front of the preset special effects model is greater than the preset threshold, it is confirmed that the first target point on the back of the preset special effects model is not obscured by the corresponding second target point on the front of the preset special effects model; otherwise, it is confirmed that the first target point on the back of the preset special effects model is obscured by the corresponding second target point on the front of the preset special effects model.
[0228] It is worth noting that it is necessary to determine whether the first target point on the back of the preset special effect model is blocked by the corresponding second target point on the front of the preset special effect model based on the position of the virtual camera and the shooting direction of the virtual camera. In other words, when the position of the virtual camera and / or the shooting direction of the virtual camera changes, the self-blocking information of the preset special effect model needs to be re-determined.
[0229] In this way, the area in which the back side of the preset special effects model is blocked by the front side of the preset special effects model in the virtual picture captured by the virtual camera can be accurately determined, which facilitates subsequent operations.
[0230] In one possible implementation, Figure 1 Based on Fig. 9 Before rendering and displaying the preset special effect model and the virtual ground model based on the self-occlusion information, the method further includes:
[0231] Step 1020: Adjust the rendering priority of the preset special effect model.
[0232] The rendering priority is used to indicate that the preset special effect model has the lowest priority when rendering various semi-transparent models.
[0233] Optionally, each semi-transparent model may include all semi-transparent models in the above virtual space.
[0234] It is worth noting that when rendering each translucent model, the later rendered model will be displayed under the earlier rendered model. In this way, it can be ensured that the preset special effect model can be displayed under other translucent models in the translucent models except the preset special effect model.
[0235] Generally, the preset special effect model can be a virtual ground crack model, a virtual ground hollow model, a ground lamp model embedded in the virtual ground in the terminal game, and any other model that can be superimposed below the bottom surface of the virtual ground model, and the upper surface of the preset special effect model fits the bottom surface of the virtual ground model. In this way, the rationality of displaying the preset special effect model, other translucent models, and the virtual ground model can be improved.
[0236] In one possible implementation, Figure 1 Based on Fig.10 , based on the self-occlusion information, rendering and displaying the preset special effect model and the virtual ground model, including:
[0237] Step 1021: Render the preset special effect model and the virtual ground model, set the transparency of the area blocked by the preset special effect model to a first transparency, and display the preset special effect model and the virtual ground model.
[0238] Optionally, the first transparency is greater than a preset transparency.
[0239] Optionally, the first transparency refers to a transparency that can adjust the preset special effect model or any other three-dimensional model to a completely transparent state.
[0240] It is worth noting that when executing step 1021, the entire preset special effects model and the virtual ground model need to be rendered. However, when finally displayed, the transparency of the area blocked by the preset special effects model will be set to the first transparency to ensure that the area blocked by the preset special effects model is completely transparent.
[0241] In this way, it can be ensured that when the preset special effects model is displayed, the front of the preset special effects model and the area on the back of the preset special effects model that is not blocked by the front of the preset special effects model can be accurately displayed.
[0242] In a possible implementation, see Fig.10 , based on the self-occlusion information, rendering and displaying the preset special effect model and the virtual ground model, including:
[0243] Step 1022: Render and display the virtual ground model and the unobstructed area of the preset special effect model.
[0244] It is worth noting that when executing step 1022, only the unobstructed area of the preset special effects model and the virtual ground model need to be rendered, which can ensure that when displaying the preset special effects model, only the front of the preset special effects model and the back of the preset special effects model that are not obstructed by the front of the preset special effects model are displayed. In addition, since it is not necessary to render the obstructed area of the preset special effects model in this case, the processing pressure of the above-mentioned computer device is greatly reduced, thereby improving the efficiency of rendering and display.
[0245] The following describes the device, equipment, and computer-readable storage medium used to implement the model rendering and display method provided by the present application. The specific implementation process and technical effects are as described above and will not be repeated here. Fig.11 , the device comprises:
[0246] The superimposition module 201 is used to superimpose a preset special effect model below the bottom surface of the virtual ground model.
[0247] The assigning and obtaining module 202 is used to assign the first material to the preset special effect model to obtain the front depth information of the preset special effect model, and obtain the back depth information of the preset special effect model.
[0248] The determination module 203 is used to determine the self-occlusion information of the preset special effect model according to the front depth information and the back depth information.
[0249] The rendering and display module 204 is used to render and display the preset special effect model and the virtual ground model based on the self-occlusion information.
[0250] Among them, the first material includes a translucent material, the back depth information includes the depth of each point on the back side of the preset special effect model, and the front depth information includes the depth of each point on the front side of the preset special effect model.
[0251] Optionally, the determination module 203 may also be used to determine associated occlusion information of the preset special effect model and the associated model.
[0252] The associated model is superimposed on the surface of the virtual ground model.
[0253] The associated occlusion information is used to indicate an area in the preset special effect model that is occluded by the associated model.
[0254] Optionally, the rendering and display module 204 may also be used to render and display the preset special effect model and the virtual ground model based on the self-occlusion information and the associated occlusion information.
[0255] Optionally, the determination module 203 may also be used to emit multiple rays in any direction from the position of the virtual camera to the shooting direction of the virtual camera, and determine whether each ray is emitted to the preset special effect model and the associated model at the same time.
[0256] If any ray is emitted to the preset special effect model and the associated model at the same time, it is determined that the preset special effect model is blocked by the associated model, and the blocked area in the preset special effect model is determined according to the position where each ray is emitted to the preset special effect model.
[0257] Optionally, the determination module 203 may also be used to determine the scene depth of the associated model and the pixel depth of the preset special effect model based on the position of the virtual camera and the shooting direction of the virtual camera.
[0258] A first vector is determined according to the scene depth of the association model.
[0259] The length ratio of the second vector to the first vector is determined according to the scene depth of the associated model and the pixel depth of the preset special effect model.
[0260] The second vector is obtained by multiplying the first vector and the length ratio.
[0261] According to the position of the virtual camera and the second vector, the blocked area in the preset special effects model is determined.
[0262] The first vector is used to indicate the distance and direction from the position of the virtual camera to at least one point of the associated model.
[0263] The second vector is used to indicate the distance and direction from the position of the virtual camera to at least one point of the preset special effects model.
[0264] Optionally, the rendering and display module 204 may also be used to render the preset special effect model and the virtual ground model, set the transparency of the area blocked by the preset special effect model to the first transparency, and display the preset special effect model and the virtual ground model.
[0265] The first transparency is greater than the preset transparency.
[0266] Optionally, the rendering and display module 204 may also be used to render and display the unobstructed areas of the virtual ground model and the preset special effect model.
[0267] Optionally, the superposition module 201 may also be used to determine the first position information of the virtual ground model;
[0268] The second position information of the preset special effect model is adjusted according to the first position information so that the preset special effect model is located below the bottom surface of the virtual ground model.
[0269] The first position information includes: the position coordinates of each point in the virtual ground model.
[0270] The second position information may include the position coordinates of each point in the preset special effect model.
[0271] Optionally, the superposition module 201 may also be used to adjust the position coordinates of each point in the preset special effect model so that the position coordinates of each point in the preset special effect model are less than or equal to the corresponding position coordinates of each point in the virtual ground model.
[0272] Optionally, the superposition module 201 may also be used to obtain the association relationship between the preset special effect model and the virtual ground model.
[0273] A preset special effect model is superimposed below the bottom surface of the virtual ground model according to the association relationship.
[0274] The association relationship is used to indicate position information of the preset special effect model relative to the virtual ground model.
[0275] Optionally, the assignment acquisition module 202 may also be used to copy the preset special effect model to obtain a target special effect model.
[0276] Custom depth information is obtained according to the target special effect model, where the custom depth information includes a back surface depth of the target special effect model.
[0277] The custom depth information is assigned to the preset special effect model to obtain the back depth information of the preset special effect model.
[0278] Optionally, the assignment acquisition module 202 may also be used to adjust the transparency of each point on the surface of the target special effect model to a first transparency, and adjust the transparency of each point on the bottom surface of the target special effect model to a second transparency.
[0279] The second material is assigned to the target special effect model to draw the back depth information of the target special effect model to the custom depth information.
[0280] According to the second material, it is determined not to perform depth testing on the target special effects model and to perform customized depth drawing on the target special effects model.
[0281] The second material includes a translucent material.
[0282] Optionally, the acquisition module 202 may also be used to determine whether the difference between the depth of each point on the back of the preset special effect model and the corresponding depth of each point on the front of the preset special effect model is greater than a preset threshold.
[0283] If the difference between the depth of the first target point on the back of the preset special effects model and the corresponding depth of the second target point on the front of the preset special effects model is greater than the preset threshold, it is confirmed that the first target point on the back of the preset special effects model is not obscured by the corresponding second target point on the front of the preset special effects model; otherwise, it is confirmed that the first target point on the back of the preset special effects model is obscured by the corresponding second target point on the front of the preset special effects model.
[0284] For one possible approach, see Fig.12 The device may further include an adjustment module 205, which may be used to adjust the rendering priority of the preset special effect model.
[0285] The rendering priority is used to indicate that the preset special effect model has the lowest priority when rendering various semi-transparent models.
[0286] Optionally, the adjustment module 205 may also be used to adjust the rendering order of the preset special effect model according to the first material.
[0287] In addition, the adjustment module 205 can also be used to determine not to perform a depth test on the preset special effect model according to the first material.
[0288] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0289] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), or one or more microprocessors, or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0290] Fig.13 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Fig.13The computer device includes: a memory 301 and a processor 302. The memory 301 stores a computer program that can be run on the processor 302. When the processor 302 executes the computer program, the steps in any of the above method embodiments are implemented.
[0291] Optionally, the processor 302 may be configured to overlay a preset special effect model below the bottom surface of the virtual ground model.
[0292] The processor 302 may also be configured to assign the first material to the preset special effect model to obtain front depth information of the preset special effect model, and obtain back depth information of the preset special effect model.
[0293] The processor 302 may also be configured to determine the self-occlusion information of the preset special effect model according to the front depth information and the back depth information.
[0294] The processor 302 may also be configured to render and display the preset special effect model and the virtual ground model based on the self-occlusion information.
[0295] The processor 302 may also be configured to determine associated occlusion information of the preset special effect model and the associated model.
[0296] The processor 302 may also be configured to render and display the preset special effect model and the virtual ground model based on the self-occlusion information and the associated occlusion information.
[0297] The processor 302 may also be used to emit multiple rays in any direction from the position of the virtual camera to the shooting direction of the virtual camera, and determine whether each ray is emitted to the preset special effect model and the associated model at the same time.
[0298] If any ray is emitted to the preset special effect model and the associated model at the same time, it is determined that the preset special effect model is blocked by the associated model, and the blocked area in the preset special effect model is determined according to the position where each ray is emitted to the preset special effect model.
[0299] The processor 302 may also be configured to determine the scene depth of the associated model and the pixel depth of the preset special effect model based on the position of the virtual camera and the shooting direction of the virtual camera.
[0300] A first vector is determined according to the scene depth of the association model.
[0301] Determining a length ratio of the second vector to the first vector according to the scene depth of the associated model and the pixel depth of the preset special effect model;
[0302] The second vector is obtained by multiplying the first vector and the length ratio.
[0303] According to the position of the virtual camera and the second vector, the blocked area in the preset special effects model is determined.
[0304] The first vector is used to indicate the distance and direction from the position of the virtual camera to at least one point of the associated model.
[0305] The second vector is used to indicate the distance and direction from the position of the virtual camera to at least one point of the preset special effects model.
[0306] The processor 302 may also be configured to render the preset special effects model and the virtual ground model, set the transparency of the area blocked by the preset special effects model to a first transparency, and display the preset special effects model and the virtual ground model.
[0307] The first transparency is greater than the preset transparency.
[0308] The processor 302 may also be configured to render and display the virtual ground model and the unobstructed areas in the preset special effect model.
[0309] The processor 302 may also be configured to determine first position information of the virtual ground model.
[0310] The second position information of the preset special effect model is adjusted according to the first position information so that the preset special effect model is located below the bottom surface of the virtual ground model.
[0311] The first position information includes: the position coordinates of each point in the virtual ground model.
[0312] The second position information may include the position coordinates of each point in the preset special effect model.
[0313] The processor 302 may also be configured to adjust the position coordinates of each point in the preset special effect model so that the position coordinates of each point in the preset special effect model are less than or equal to the corresponding position coordinates of each point in the virtual ground model.
[0314] The processor 302 may also be configured to obtain an association between the preset special effect model and the virtual ground model.
[0315] A preset special effect model is superimposed below the bottom surface of the virtual ground model according to the association relationship.
[0316] The association relationship is used to indicate position information of the preset special effect model relative to the virtual ground model.
[0317] The processor 302 may also be used to copy the preset special effect model to obtain a target special effect model.
[0318] Custom depth information is obtained according to the target special effect model, where the custom depth information includes a back surface depth of the target special effect model.
[0319] The custom depth information is assigned to the preset special effect model to obtain the back depth information of the preset special effect model.
[0320] The processor 302 may also be configured to adjust the transparency of each point on the surface of the target special effect model to a first transparency, and adjust the transparency of each point on the bottom surface of the target special effect model to a second transparency.
[0321] The second material is assigned to the target special effect model to draw the back depth information of the target special effect model to the custom depth information.
[0322] According to the second material, it is determined not to perform depth testing on the target special effects model and to perform customized depth drawing on the target special effects model.
[0323] The second material includes a translucent material.
[0324] The processor 302 may also be used to determine whether a difference between the depth of each point on the back side of the preset special effect model and the corresponding depth of each point on the front side of the preset special effect model is greater than a preset threshold.
[0325] If the difference between the depth of the first target point on the back of the preset special effects model and the corresponding depth of the second target point on the front of the preset special effects model is greater than the preset threshold, it is confirmed that the first target point on the back of the preset special effects model is not obscured by the corresponding second target point on the front of the preset special effects model; otherwise, it is confirmed that the first target point on the back of the preset special effects model is obscured by the corresponding second target point on the front of the preset special effects model.
[0326] The processor 302 may also be configured to adjust the rendering priority of the preset special effect model.
[0327] The rendering priority is used to indicate that the preset special effect model has the lowest priority when rendering various semi-transparent models.
[0328] The processor 302 may also be configured to adjust the rendering order of the preset special effect model according to the first material.
[0329] The processor 302 may also be configured to determine, based on the first material, not to perform a depth test on the preset special effect model.
[0330] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0331] Optionally, the processor may be configured to overlay a preset special effects model below the bottom surface of the virtual ground model.
[0332] The processor can also be used to assign the first material to the preset special effect model to obtain the front depth information of the preset special effect model, and obtain the back depth information of the preset special effect model.
[0333] The processor may also be used to determine the self-occlusion information of the preset special effect model according to the front depth information and the back depth information.
[0334] The processor can also be used to render and display the preset special effects model and the virtual ground model based on the self-occlusion information.
[0335] The processor may also be used to determine associated occlusion information of the preset special effect model and the associated model.
[0336] The processor may also be used to render and display the preset special effects model and the virtual ground model based on the self-occlusion information and the associated occlusion information.
[0337] The processor can also be used to emit multiple rays in any direction from the position of the virtual camera to the shooting direction of the virtual camera, and determine whether each ray is emitted to the preset special effect model and the associated model at the same time.
[0338] If any ray is emitted to the preset special effect model and the associated model at the same time, it is determined that the preset special effect model is blocked by the associated model, and the blocked area in the preset special effect model is determined according to the position where each ray is emitted to the preset special effect model.
[0339] The processor may also be used to determine the scene depth of the associated model and the pixel depth of the preset special effect model based on the position of the virtual camera and the shooting direction of the virtual camera.
[0340] A first vector is determined according to the scene depth of the association model.
[0341] Determining a length ratio of the second vector to the first vector according to the scene depth of the associated model and the pixel depth of the preset special effect model;
[0342] The second vector is obtained by multiplying the first vector and the length ratio.
[0343] According to the position of the virtual camera and the second vector, the blocked area in the preset special effects model is determined.
[0344] The first vector is used to indicate the distance and direction from the position of the virtual camera to at least one point of the associated model.
[0345] The second vector is used to indicate the distance and direction from the position of the virtual camera to at least one point of the preset special effects model.
[0346] The processor may also be used to render the preset special effects model and the virtual ground model, set the transparency of the area blocked by the preset special effects model to a first transparency, and display the preset special effects model and the virtual ground model.
[0347] The first transparency is greater than the preset transparency.
[0348] The processor can also be used to render and display the virtual ground model and the unobstructed areas in the preset special effects model.
[0349] The processor may also be used to determine first position information of the virtual ground model;
[0350] The second position information of the preset special effect model is adjusted according to the first position information so that the preset special effect model is located below the bottom surface of the virtual ground model.
[0351] The first position information includes: the position coordinates of each point in the virtual ground model.
[0352] The second position information may include the position coordinates of each point in the preset special effect model.
[0353] The processor may also be used to adjust the position coordinates of each point in the preset special effects model so that the position coordinates of each point in the preset special effects model are less than or equal to the corresponding position coordinates of each point in the virtual ground model.
[0354] The processor may also be used to obtain an association relationship between the preset special effect model and the virtual ground model.
[0355] A preset special effect model is superimposed below the bottom surface of the virtual ground model according to the association relationship.
[0356] The association relationship is used to indicate position information of the preset special effect model relative to the virtual ground model.
[0357] The processor can also be used to copy the preset special effect model to obtain a target special effect model.
[0358] Custom depth information is obtained according to the target special effect model, where the custom depth information includes a back surface depth of the target special effect model.
[0359] The custom depth information is assigned to the preset special effect model to obtain the back depth information of the preset special effect model.
[0360] The processor may also be used to adjust the transparency of each point on the surface of the target special effect model to a first transparency, and adjust the transparency of each point on the bottom surface of the target special effect model to a second transparency.
[0361] The second material is assigned to the target special effect model to draw the back depth information of the target special effect model to the custom depth information.
[0362] According to the second material, it is determined not to perform depth testing on the target special effects model and to perform customized depth drawing on the target special effects model.
[0363] The second material includes a translucent material.
[0364] The processor may also be used to determine whether a difference between the depth of each point on the back of the preset special effect model and the corresponding depth of each point on the front of the preset special effect model is greater than a preset threshold.
[0365] If the difference between the depth of the first target point on the back of the preset special effects model and the corresponding depth of the second target point on the front of the preset special effects model is greater than the preset threshold, it is confirmed that the first target point on the back of the preset special effects model is not obscured by the corresponding second target point on the front of the preset special effects model; otherwise, it is confirmed that the first target point on the back of the preset special effects model is obscured by the corresponding second target point on the front of the preset special effects model.
[0366] The processor may also be used to adjust the rendering priority of the preset special effects model.
[0367] The rendering priority is used to indicate that the preset special effect model has the lowest priority when rendering various semi-transparent models.
[0368] The processor may also be configured to adjust a rendering order of the preset special effect model according to the first material.
[0369] The processor can also be used to determine not to perform depth testing on the preset special effects model based on the first material.
[0370] Optionally, the present application also provides a program product, such as a computer-readable storage medium, including a program, which is used to execute any of the above-mentioned model rendering and display method embodiments when executed by a processor.
[0371] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as 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 devices or units, which can be electrical, mechanical or other forms.
[0372] The units described 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 network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0373] In addition, each functional unit in each embodiment of the present invention 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 hardware plus software functional units.
[0374] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.
[0375] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0376] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A model rendering and display method, characterized in that: The method comprises: Overlaying a preset special effect model below the bottom surface of the virtual ground model; Assigning a first material to the preset special effect model to obtain front depth information of the preset special effect model, and obtaining back depth information of the preset special effect model, wherein the first material includes a translucent material, the back depth information includes the depth of each point on the back of the preset special effect model, and the front depth information includes the depth of each point on the front of the preset special effect model; Determine the self-occlusion information of the preset special effect model according to the front depth information and the back depth information; Based on the self-occlusion information, rendering and displaying the preset special effect model and the virtual ground model; The determining the self-occlusion information of the preset special effect model according to the front depth information and the back depth information includes: Determine whether the difference between the depth of each point on the back of the preset special effect model and the depth of each corresponding point on the front of the preset special effect model is greater than a preset threshold; If the difference between the depth of the first target point on the back of the preset special effects model and the corresponding depth of the second target point on the front of the preset special effects model is greater than a preset threshold, it is confirmed that the first target point on the back of the preset special effects model is not blocked by the corresponding second target point on the front of the preset special effects model; otherwise, it is confirmed that the first target point on the back of the preset special effects model is blocked by the corresponding second target point on the front of the preset special effects model.
2. The model rendering and display method according to claim 1, characterized in that: After determining the self-occlusion information of the preset special effect model according to the front depth information and the back depth information, the method further includes: Determining associated occlusion information of the preset special effect model and an associated model, wherein the associated model is superimposed on the surface of the virtual ground model, and the associated occlusion information is used to indicate an area of the preset special effect model that is occluded by the associated model; The rendering and displaying of the preset special effect model and the virtual ground model based on the self-occlusion information includes: Based on the self-occlusion information and the associated occlusion information, the preset special effect model and the virtual ground model are rendered and displayed.
3. The model rendering and display method according to claim 2, characterized in that: The determining of the associated occlusion information of the preset special effect model and the associated model includes: Emitting a plurality of rays in any direction from the position of the virtual camera to the shooting direction of the virtual camera, and determining whether each of the rays is simultaneously emitted to the preset special effect model and the associated model; If any ray is emitted to the preset special effects model and the associated model at the same time, it is determined that the preset special effects model is blocked by the associated model, and the blocked area in the preset special effects model is determined according to the position where each ray is emitted to the preset special effects model.
4. The model rendering and display method according to claim 2, characterized in that: The determining of the associated occlusion information of the preset special effect model and the associated model includes: Determining the scene depth of the associated model and the pixel depth of the preset special effect model based on the position of the virtual camera and the shooting direction of the virtual camera; Determine a first vector according to the scene depth of the associated model, where the first vector is used to indicate the distance and direction from the position of the virtual camera to at least one point of the associated model; Determining a length ratio of a second vector to the first vector according to a scene depth of the associated model and a pixel depth of the preset special effect model; Multiplying the first vector and the length ratio to obtain the second vector, where the second vector is used to indicate the distance and direction from the position of the virtual camera to at least one point of the preset special effect model; According to the position of the virtual camera and the second vector, an obstructed area in the preset special effects model is determined.
5. The model rendering and display method according to claim 2, characterized in that: The rendering and displaying of the preset special effect model and the virtual ground model based on the self-occlusion information and the associated occlusion information includes: Rendering the preset special effect model and the virtual ground model, setting the transparency of the area blocked by the preset special effect model to a first transparency, and displaying the preset special effect model and the virtual ground model, wherein the first transparency is greater than the preset transparency.
6. The model rendering and display method according to claim 2, characterized in that: The rendering and displaying of the preset special effect model and the virtual ground model based on the self-occlusion information and the associated occlusion information includes: Render and display the virtual ground model and the unobstructed areas in the preset special effect model.
7. The model rendering and display method according to any one of claims 1 to 6, characterized in that: The step of superimposing a preset special effect model below the bottom surface of the virtual ground model includes: Determine first position information of the virtual ground model, wherein the first position information includes: position coordinates of each point in the virtual ground model; The second position information of the preset special effect model is adjusted according to the first position information so that the preset special effect model is located below the bottom surface of the virtual ground model, and the second position information includes the position coordinates of each point in the preset special effect model.
8. The model rendering and display method according to claim 7, characterized in that: The adjusting the second position information of the preset special effect model according to the first position information includes: The position coordinates of each point in the preset special effect model are adjusted so that the position coordinates of each point in the preset special effect model are less than or equal to the corresponding position coordinates of each point in the virtual ground model.
9. The model rendering and display method according to claim 1, characterized in that: The step of superimposing a preset special effect model below the bottom surface of the virtual ground model includes: Acquire an association relationship between the preset special effect model and the virtual ground model, where the association relationship is used to indicate position information of the preset special effect model relative to the virtual ground model; A preset special effect model is superimposed below the bottom surface of the virtual ground model according to the association relationship.
10. The model rendering and display method according to claim 1, characterized in that: The obtaining of back depth information of the preset special effect model includes: Copying the preset special effect model to obtain a target special effect model; Obtaining custom depth information according to the target special effect model, wherein the custom depth information includes the back depth of the target special effect model; The custom depth information is assigned to the preset special effect model to obtain back depth information of the preset special effect model.
11. The model rendering and display method according to claim 10, characterized in that: The obtaining of customized depth information according to the target special effects model includes: Adjusting the transparency of each point on the surface of the target special effect model to a first transparency, and adjusting the transparency of each point on the bottom surface of the target special effect model to a second transparency; Assigning a second material to the target special effect model to draw back depth information of the target special effect model to the custom depth information, wherein the second material includes a translucent material; According to the second material, it is determined not to perform depth testing on the target special effects model and to perform customized depth drawing on the target special effects model.
12. The model rendering and display method according to claim 1, characterized in that: Before rendering and displaying the preset special effect model and the virtual ground model based on the self-occlusion information, the method further includes: The rendering priority of the preset special effect model is adjusted, and the rendering priority is used to indicate that the preset special effect model has the lowest priority when rendering various translucent models.
13. The model rendering and display method according to claim 1, characterized in that: The rendering and displaying of the preset special effect model and the virtual ground model based on the self-occlusion information includes: Rendering the preset special effect model and the virtual ground model, setting the transparency of the area blocked by the preset special effect model to a first transparency, and displaying the preset special effect model and the virtual ground model, wherein the first transparency is greater than the preset transparency.
14. The model rendering and display method according to claim 1, characterized in that: The rendering and displaying of the preset special effect model and the virtual ground model based on the self-occlusion information includes: Render and display the virtual ground model and the unobstructed areas in the preset special effect model.
15. The model rendering and display method according to any one of claims 1 to 6, characterized in that: After assigning the first material to the preset special effect model to obtain the front depth information of the preset special effect model, the method further includes: According to the first material, the rendering order of the preset special effect model is adjusted.
16. A model rendering display device, characterized in that: The device comprises: A superimposition module, used for superimposing a preset special effect model below the bottom surface of the virtual ground model; an assignment acquisition module, configured to assign a first material to the preset special effect model to obtain front depth information of the preset special effect model, and to acquire back depth information of the preset special effect model, wherein the first material includes a translucent material, the back depth information includes the depth of each point on the back of the preset special effect model, and the front depth information includes the depth of each point on the front of the preset special effect model; A determination module, used to determine the self-occlusion information of the preset special effect model according to the front depth information and the back depth information; A rendering and display module, used for rendering and displaying the preset special effect model and the virtual ground model based on the self-occlusion information; The determination module is specifically used to determine whether the difference between the depth of each point on the back of the preset special effect model and the depth of each corresponding point on the front of the preset special effect model is greater than a preset threshold; If the difference between the depth of the first target point on the back of the preset special effects model and the corresponding depth of the second target point on the front of the preset special effects model is greater than a preset threshold, it is confirmed that the first target point on the back of the preset special effects model is not blocked by the corresponding second target point on the front of the preset special effects model; otherwise, it is confirmed that the first target point on the back of the preset special effects model is blocked by the corresponding second target point on the front of the preset special effects model.
17. A computer device, characterized in that: include: A memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the steps of the model rendering and display method described in any one of claims 1 to 15 are implemented.
18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the model rendering and display method according to any one of claims 1 to 15.
Citation Information
Patent Citations
3D model merging and rendering system, method and terminal
CN106780686A
Shadow rendering method and device, terminal and storage medium
CN109993823A