Virtual object rendering method and apparatus, storage medium, and electronic device
By acquiring information from the inner and outer normal maps, the inner and outer information of the virtual model is generated for rendering, solving the problem of high performance consumption when rendering crystal balls and achieving efficient rendering and improved artistic effects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2022-12-26
- Publication Date
- 2026-04-17
AI Technical Summary
Existing technologies for rendering crystal balls consume significant resources, have poor rendering efficiency, and place high demands on user terminal devices.
By acquiring the inner and outer normal maps, sampling the normal and texture information, generating the inner and outer information of the virtual model, and then using the textures to render and display the virtual model.
It reduces performance consumption, improves rendering effects, displays a visual effect with inner and outer layers, enhances the artistic effect of virtual models, and reduces the requirements for terminal devices.
Smart Images

Figure CN115944914B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to virtual object rendering methods, virtual model rendering apparatus, computer-readable storage media, and electronic devices. Background Technology
[0002] With the development of terminal devices and the gaming industry, a large number of games and works of different themes have emerged to meet user needs. Some games or films utilize crystal ball display schemes.
[0003] In related technologies, lighting rendering is typically used to achieve the display effect of a crystal ball. Specifically, this involves simulating optical phenomena such as the reflection and refraction of light within the crystal ball, and then performing complex lighting calculations to achieve the desired display effect. Real-time calculation schemes in these technologies are resource-intensive, have poor rendering efficiency, and place high demands on the user's terminal devices.
[0004] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0005] The purpose of this disclosure is to provide a virtual object rendering method and apparatus, a computer-readable storage medium and an electronic device, which can solve the problem of high energy consumption when rendering crystal balls in related technologies.
[0006] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.
[0007] According to a first aspect of this disclosure, a method for rendering a virtual object is provided, characterized in that the method includes: acquiring an inner layer normal map and sampling the inner layer normal map to obtain inner layer normal information; acquiring an inner layer texture map and sampling the inner layer texture map based on the inner layer normal information to obtain inner layer texture information; generating inner layer information of a virtual model based on the inner layer normal information and the inner layer texture information; acquiring an outer layer normal map and sampling the outer layer normal map to obtain outer layer normal information; acquiring an outer layer environment map and sampling the outer layer environment map based on the outer layer normal information to obtain outer layer environment information; generating outer layer information of a virtual model based on the outer layer normal information and the outer layer environment information; and rendering and displaying the virtual model to be rendered based on the inner layer information and the outer layer information of the virtual model.
[0008] According to a second aspect of this disclosure, a virtual model rendering apparatus is provided, characterized in that the apparatus comprises: an inner layer normal map acquisition module, used to acquire an inner layer normal map and sample the inner layer normal map to obtain inner layer normal information; an inner layer texture map acquisition module, used to acquire an inner layer texture map and sample the inner layer texture map according to the inner layer normal information to obtain inner layer texture information; an object inner layer information generation module, used to generate virtual model inner layer information according to the inner layer normal information and the inner layer texture information; an outer layer normal map acquisition module, used to acquire an outer layer normal map and sample the outer layer normal map to obtain outer layer normal information; an outer layer environment map acquisition module, used to acquire an outer layer environment map and sample the outer layer environment map according to the outer layer normal information to obtain outer layer environment information; an object outer layer information generation module, used to generate virtual model outer layer information according to the outer layer normal information and the outer layer environment information; and a virtual model rendering module, used to render and display the virtual model to be rendered according to the virtual model inner layer information and the virtual model outer layer information.
[0009] According to a third aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the virtual object rendering method of the first aspect of the above embodiments.
[0010] According to a fourth aspect of this disclosure, an electronic device is provided, comprising:
[0011] One or more processors; and
[0012] A memory for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the virtual object rendering method of the first aspect in the above embodiments.
[0013] The technical solutions provided in this disclosure may have the following beneficial effects:
[0014] In one embodiment of the virtual object rendering method disclosed herein, an inner layer normal map is obtained, and inner layer normal information is obtained by sampling the inner layer normal map. An inner layer texture map is obtained, and inner layer texture information is obtained by sampling the inner layer texture map based on the inner layer normal information. Inner layer information of the virtual model is generated based on the inner layer normal information and the inner layer texture information. An outer layer normal map is obtained, and outer layer normal information is obtained by sampling the outer layer normal map. An outer layer environment map is obtained, and outer layer environment information is obtained by sampling the outer layer environment map based on the outer layer normal information. Outer layer information of the virtual model is generated based on the outer layer normal information and the outer layer information of the virtual model. The virtual model to be rendered is then rendered and displayed based on the inner layer information and the outer layer information of the virtual model. On the one hand, using textures to process the virtual model can avoid the problem of high performance consumption, improve the rendering effect, and have lower requirements for the user's terminal device. On the other hand, it can display virtual objects with inner and outer layers of virtual models, so that the virtual objects visually exhibit the effect of having two layers, which can enhance the artistic effect of the virtual model.
[0015] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:
[0017] Figure 1 The schematic diagram illustrates an exemplary system architecture of the virtual object rendering method in an exemplary embodiment of the present disclosure;
[0018] Figure 2 A flowchart illustrating a virtual object rendering method in an exemplary embodiment of this disclosure is shown schematically.
[0019] Figure 3 This illustration schematically shows a schematic diagram of an inner layer normal map in an exemplary embodiment of the present disclosure;
[0020] Figure 4 This schematically illustrates an inner texture map in an exemplary embodiment of the present disclosure;
[0021] Figure 5 This schematically illustrates a flowchart of obtaining inner layer texture information by performing edge blurring processing on candidate inner layer texture information in an exemplary embodiment of this disclosure;
[0022] Figure 6 This schematically illustrates a flowchart of obtaining inner layer texture information by performing edge blurring processing on candidate inner layer texture information based on an edge blur map in an exemplary embodiment of the present disclosure;
[0023] Figure 7 This schematically illustrates a diagram of an edge blurring map in an exemplary embodiment of the present disclosure;
[0024] Figure 8 This schematic diagram illustrates an inner layer of a virtual model in an exemplary embodiment of the present disclosure.
[0025] Figure 9 This schematically illustrates a flowchart of determining the inner layer information of a virtual model based on the displayed portion and the non-displayed portion in an exemplary embodiment of this disclosure;
[0026] Figure 10 This illustration schematically shows a dot product result in an exemplary embodiment of the present disclosure;
[0027] Figure 11 This schematic diagram illustrates a display portion and a non-display portion in an inner region according to an exemplary embodiment of the present disclosure;
[0028] Figure 12 This schematically illustrates a display of candidate virtual model inner layer information in a display portion according to an exemplary embodiment of the present disclosure;
[0029] Figure 13 This schematically illustrates a flowchart in an exemplary embodiment of the present disclosure, in which a portion of the inner region excluding the displayed portion is defined as the non-displayed portion of the inner region;
[0030] Figure 14 This schematically illustrates a diagram of defining a display portion in an inner layer region according to an exemplary embodiment of the present disclosure;
[0031] Figure 15 This schematically illustrates an outer environment map and a schematic diagram of the outer layer of a virtual model rendered using outer environment information, as shown in an exemplary embodiment of this disclosure.
[0032] Figure 16 This schematically illustrates a flowchart of obtaining outer layer environment information based on candidate outer layer environment information and inner and outer layer staining information in an exemplary embodiment of this disclosure.
[0033] Figure 17 This schematically illustrates a flowchart of obtaining outer environment information by coloring candidate outer environment information according to a colorimetric map in an exemplary embodiment of the present disclosure.
[0034] Figure 18This schematic diagram illustrates the outer layer of a virtual model obtained by rendering a color map and outer environment information in an exemplary embodiment of this disclosure.
[0035] Figure 19 This schematically illustrates a flowchart of obtaining the outer layer information of a virtual model by hollowing out the outer layer information of a candidate virtual model in an exemplary embodiment of the present disclosure;
[0036] Figure 20 The diagram illustrates the outer layer of the virtual model before and after hollowing in an exemplary embodiment of the present disclosure.
[0037] Figure 21 This schematically illustrates a flowchart of obtaining the outer layer information of a virtual model by hollowing out the outer layer information of a candidate virtual model through a target hollow processing diagram in an exemplary embodiment of this disclosure.
[0038] Figure 22 The schematic diagrams illustrate the first hollow processing diagram, the second hollow processing diagram, and the target hollow processing diagram in an exemplary embodiment of the present disclosure.
[0039] Figure 23 This schematically illustrates a flowchart of rendering a virtual model to be rendered based on the inner layer information, outer layer information, and transparency information of the virtual model in an exemplary embodiment of this disclosure.
[0040] Figure 24 This schematic diagram illustrates a target hollow processing map, the outer layer of a virtual model, and transparency information at multiple locations in an exemplary embodiment of this disclosure.
[0041] Figure 25 This illustration schematically shows a virtual model rendered based on inner layer information, outer layer information, and transparency information at multiple locations, according to an exemplary embodiment of the present disclosure.
[0042] Figure 26 This schematic diagram illustrates the composition of a virtual model rendering apparatus according to an exemplary embodiment of the present disclosure;
[0043] Figure 27 The schematic diagram illustrates a structural schematic of a computer system suitable for implementing an electronic device according to exemplary embodiments of the present disclosure. Detailed Implementation
[0044] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that this disclosure will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., may be employed. In other instances, well-known structures, methods, apparatuses, implementations, materials, or operations are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0045] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, or in one or more software-hardened modules, or in different network and / or processor devices and / or microcontroller devices.
[0046] Figure 1 A schematic diagram of an exemplary system architecture to which the virtual object rendering method of embodiments of the present disclosure can be applied is shown.
[0047] like Figure 1 As shown, system architecture 1000 may include one or more of terminal devices 1001, 1002, and 1003, network 1004, and server 1005. Network 1004 is used as a medium to provide a communication link between terminal devices 1001, 1002, and 1003 and server 1005. Network 1004 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0048] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included. For example, server 1005 could be a server cluster composed of multiple servers.
[0049] Users can use terminal devices 1001, 1002, and 1003 to interact with server 1005 via network 1004 to receive or send messages, etc. Terminal devices 1001, 1002, and 1003 can be various electronic devices with displays, including but not limited to smartphones, tablets, laptops, and desktop computers. Additionally, server 1005 can be a server providing various services.
[0050] In one embodiment, the execution entity of the virtual object rendering method disclosed herein may be a server 1005. The server 1005 can obtain an inner layer normal map sent by terminal devices 1001, 1002, and 1003, sample the inner layer normal map to obtain inner layer normal information, obtain an inner layer texture map, sample the inner layer texture map according to the inner layer normal information to obtain inner layer texture information, generate inner layer information of the virtual model according to the inner layer normal information and the inner layer texture information, obtain an outer layer normal map, sample the outer layer normal map to obtain outer layer normal information, obtain an outer layer environment map, sample the outer layer environment map according to the outer layer normal information to obtain outer layer environment information, generate outer layer information of the virtual model according to the outer layer normal information and the outer layer environment information, and render and display the virtual model to be rendered according to the inner layer information and the outer layer information of the virtual model.
[0051] In addition, the virtual object rendering method disclosed herein can also be executed through terminal devices 1001, 1002, 1003, etc., to achieve the following: obtaining inner layer normal map, sampling the inner layer normal map to obtain inner layer normal information, obtaining inner layer texture map, sampling the inner layer texture map according to the inner layer normal information to obtain inner layer texture information, generating virtual model inner layer information according to the inner layer normal information and inner layer texture information, obtaining outer layer normal map, sampling the outer layer normal map to obtain outer layer normal information, obtaining outer layer environment map, sampling the outer layer environment map according to the outer layer normal information to obtain outer layer environment information, generating virtual model outer layer information according to the outer layer normal information and outer layer environment information, and rendering and displaying the virtual model to be rendered according to the virtual model inner layer information and virtual model outer layer information.
[0052] Furthermore, the implementation process of the method for generating visual effects disclosed herein can also be jointly implemented by terminal devices 1001, 1002, and 1003 and server 1005. For example, terminal devices 1001, 1002, and 1003 can acquire an inner layer normal map, sample the inner layer normal map to obtain inner layer normal information, acquire an inner layer texture map, sample the inner layer texture map based on the inner layer normal information to obtain inner layer texture information, generate inner layer information of a virtual model based on the inner layer normal information and inner layer texture information, acquire an outer layer normal map, sample the outer layer normal map to obtain outer layer normal information, acquire an outer layer environment map, sample the outer layer environment map based on the outer layer normal information to obtain outer layer environment information, generate outer layer information of a virtual model based on the outer layer normal information and outer layer environment information, and then send the obtained inner layer information and outer layer information of the virtual model to server 1005 so that server 1005 can render and display the virtual model to be rendered based on the inner layer information and outer layer information of the virtual model.
[0053] With the development of terminal devices and the gaming industry, a large number of games and works of different themes have emerged to meet user needs. Some games or films utilize crystal ball display schemes.
[0054] In related technologies, lighting rendering is typically used to achieve the display effect of a crystal ball. Specifically, this involves simulating optical phenomena such as the reflection and refraction of light within the crystal ball, and then performing complex lighting calculations to achieve the desired display effect. Real-time calculation schemes in these technologies are resource-intensive, have poor rendering efficiency, and place high demands on the user's terminal devices.
[0055] In one example embodiment of this disclosure, an inner layer normal map can be obtained, and inner layer normal information can be obtained by sampling the inner layer normal map. An inner layer texture map can be obtained, and inner layer texture information can be obtained by sampling the inner layer texture map based on the inner layer normal information. Virtual model inner layer information can be generated based on the inner layer normal information and the inner layer texture information. An outer layer normal map can be obtained, and outer layer normal information can be obtained by sampling the outer layer normal map. An outer layer environment map can be obtained, and outer layer environment information can be obtained by sampling the outer layer environment map based on the outer layer normal information. Virtual model outer layer information can be generated based on the outer layer normal information and the outer layer environment information. Finally, the virtual model to be rendered is rendered and displayed based on the virtual model inner layer information and the virtual model outer layer information. (Reference) Figure 2 The diagram illustrates a flowchart of a virtual object rendering method in this exemplary embodiment, which may include the following steps:
[0056] Step S210: Obtain the inner layer normal map, and sample the inner layer normal map to obtain the inner layer normal information; wherein, the inner layer normal information causes the inner layer of the virtual model to rotate with the virtual camera in the virtual scene;
[0057] Step S220: Obtain the inner texture map and sample the inner texture map according to the inner normal information to obtain the inner texture information;
[0058] Step S230: Generate virtual model inner layer information based on inner layer normal information and inner layer texture information;
[0059] Step S240: Obtain the outer layer normal map and sample the outer layer normal map to obtain the outer layer normal information;
[0060] Step S250: Obtain the outer environment map; sample the outer environment map based on the outer normal information to obtain the outer environment information.
[0061] Step S260: Generate virtual model outer layer information based on outer layer normal information and outer layer environment information;
[0062] Step S270: Render and display the virtual model to be rendered based on the inner layer information and outer layer information of the virtual model.
[0063] In one embodiment of the virtual object rendering method disclosed herein, an inner layer normal map is obtained, and inner layer normal information is obtained by sampling the inner layer normal map. An inner layer texture map is obtained, and inner layer texture information is obtained by sampling the inner layer texture map based on the inner layer normal information. Inner layer information of the virtual model is generated based on the inner layer normal information and the inner layer texture information. An outer layer normal map is obtained, and outer layer normal information is obtained by sampling the outer layer normal map. An outer layer environment map is obtained, and outer layer environment information is obtained by sampling the outer layer environment map based on the outer layer normal information. Outer layer information of the virtual model is generated based on the outer layer normal information and the outer layer information of the virtual model. The virtual model to be rendered is then rendered and displayed based on the inner layer information and the outer layer information of the virtual model. On the one hand, using textures to process the virtual model can avoid the problem of high performance consumption, improve the rendering effect, and have lower requirements for the user's terminal device. On the other hand, it can display virtual objects with inner and outer layers of virtual models, so that the virtual objects visually exhibit the effect of having two layers, which can enhance the artistic effect of the virtual model.
[0064] Below, we will combine Figure 2 The embodiments will provide a more detailed description of steps S210 to S270 of the virtual object rendering method in this exemplary embodiment.
[0065] Step S210: Obtain the inner layer normal map, and sample the inner layer normal map to obtain the inner layer normal information; wherein, the inner layer normal information causes the inner layer of the virtual model to rotate with the virtual camera in the virtual scene;
[0066] In one example embodiment of this disclosure, an inner layer normal map can be obtained, and the inner layer normal map can be sampled to obtain inner layer normal information. Specifically, in the solution of this disclosure, when rendering a virtual model to be rendered, an inner layer and an outer layer of the virtual model can be rendered on the surface of the virtual model. The inner layer of the virtual model can be used to display the inner part of the object, and the outer layer of the virtual model can be used to display the outer part of the object.
[0067] For example, when the virtual object is a crystal ball, the inner layer of the virtual model corresponding to the virtual object can be the core part of the crystal ball, and the outer layer of the virtual model corresponding to the virtual object can be the outer shell part of the crystal ball.
[0068] It should be noted that the solution disclosed herein can visually display a virtual model with inner and outer layers, thereby enhancing the artistic effect of the virtual model.
[0069] In one example embodiment of this disclosure, the virtual model to be rendered can be a virtual model created through a 3D interactive content creation platform. For example, the virtual model to be rendered can be created through Unity3D; or, it can be created through UE. It should be noted that this disclosure does not impose any special limitations on the method of obtaining the virtual model to be rendered.
[0070] In one example embodiment of this disclosure, an inner normal map can be obtained, and inner normal information can be obtained by sampling the inner normal map. Specifically, the inner normal map can draw normals at each point on the uneven surface of the original model, and the direction of the normals can be marked by RGB color channels. The inner normal map can be sampled to obtain inner normal information, which can be used to indicate the normal direction of each vertex in the virtual model.
[0071] For example, such as Figure 3 As shown, this is an inner layer normal map.
[0072] It should be noted that this disclosure does not impose any special limitations on the specific method of sampling the inner layer normal map to obtain the inner layer normal information.
[0073] In one example embodiment of this disclosure, the inner layer normal map can be sampled to obtain first candidate inner layer normal information. This first candidate inner layer normal information is then converted from tangent space to world space to obtain second candidate inner layer normal information. Finally, the second candidate inner layer normal information is converted from world space to camera space to obtain inner layer normal information. Specifically, after converting the first candidate inner layer normal information to camera space, the inner layer of the virtual model rotates with the virtual camera in the virtual scene. This means that as the virtual model rotates within the virtual scene, the inner layer of the virtual model displayed on the surface of the virtual model always faces the virtual camera.
[0074] Specifically, after sampling the inner layer normal map to obtain the inner layer normal information, this information can be converted to world space and then to camera space, allowing the inner layer of the virtual model to rotate with the virtual camera within the virtual scene. World space refers to the space with the virtual scene containing the virtual object as the reference frame, while camera space refers to the space with the virtual camera as the reference frame, facing the entire virtual scene.
[0075] Specifically, when the virtual camera rotates, the position of the virtual model does not change, therefore, the position of the virtual model in world space does not change; however, in camera space, the position of the virtual model relative to the virtual camera changes, therefore, the position of the virtual model in camera space changes.
[0076] Specifically, the second candidate inner layer normal information can be obtained by transforming the first candidate inner layer normal information from tangent space to world space using a spatial matrix. Here, the spatial matrix refers to the combination of the three basis vectors—tangent, bitangent, and normal—in tangent space. For example, multiplying the spatial matrix with the first candidate inner layer normal information can transform the first candidate inner layer normal information from tangent space to world space, thus obtaining the second candidate inner layer normal information.
[0077] Specifically, the inner normal information of the second candidate inner layer can be obtained by transforming the inner normal information from world space to camera space using the view matrix.
[0078] Step S220: Obtain the inner texture map and sample the inner texture map according to the inner normal information to obtain the inner texture information;
[0079] In one example embodiment of this disclosure, after obtaining the inner layer normal information through the above steps, the inner layer texture map can be sampled based on the inner layer normal information to obtain inner layer texture information. Specifically, the inner layer texture map refers to a two-dimensional graphic used to render the surface of a virtual model. When the texture is mapped onto the surface of the virtual model in a specific way, the object can appear more realistic. Specifically, the inner layer texture map is for the inner layer of the virtual model. The inner layer texture information can be obtained by sampling the inner layer texture map based on the inner layer normal information, wherein the inner layer texture information can be used to indicate the texture used in the inner layer of the virtual model.
[0080] For example, such as Figure 4 As shown, this is an inner layer texture map.
[0081] It should be noted that this disclosure does not impose any special limitations on the specific method of sampling the inner layer texture map based on the inner layer normal information to obtain the inner layer texture information.
[0082] In one example embodiment of this disclosure, Matcap (Material Capture) technology can be used to calculate the inner layer normal information, and the inner layer texture map can be sampled based on the calculated results, so that the inner layer of the virtual model rotates with the virtual camera.
[0083] In one example embodiment of this disclosure, candidate inner layer texture information can be obtained by sampling the inner layer texture map based on the inner layer normal information, and edge blurring processing can be applied to the candidate inner layer texture information to obtain the final inner layer texture information. (Refer to...) Figure 5 As shown, obtaining inner layer texture information by edge blurring of candidate inner layer texture information may include the following steps S510 to S520:
[0084] Step S510: Sample the inner layer texture map based on the inner layer normal information to obtain candidate inner layer texture information;
[0085] Step S520: Perform edge blurring processing on the candidate inner layer texture information to obtain the inner layer texture information.
[0086] In one example embodiment of this disclosure, candidate inner layer texture information can be obtained by sampling the inner layer texture map based on the inner layer normal information, and edge blurring processing can be applied to the candidate inner layer texture information to obtain the inner layer texture information. Specifically, edge blurring processing of the candidate inner layer texture information means that the edges of the virtual model inner layer rendered from the inner layer texture information after edge blurring processing are blurred or not displayed. Specifically, the edges of the virtual model inner layer can be faded, focusing more on the central part of the virtual model inner layer.
[0087] It should be noted that this disclosure does not impose any special limitations on the specific method of obtaining inner layer texture information by edge blurring of candidate inner layer texture information.
[0088] Through the above steps S510 to S520, the inner layer texture map can be sampled according to the inner layer normal information to obtain candidate inner layer texture information, and the candidate inner layer texture information can be processed by edge blurring to obtain the inner layer texture information.
[0089] In one example embodiment of this disclosure, an edge blur map can be created, and the candidate inner layer texture information can be obtained by performing edge blurring processing on the candidate inner layer texture information based on the edge blur map. (Refer to...) Figure 6 As shown, obtaining inner layer texture information by performing edge blurring processing on candidate inner layer texture information based on the edge blur map may include the following steps S610 to S620:
[0090] Step S610: Create an edge blur map;
[0091] Step S620: Obtain inner layer texture information by performing edge blurring processing on the candidate inner layer texture information based on the edge blur map.
[0092] In one example embodiment of this disclosure, an edge blur map can be created. Specifically, the edge blur map can be used to indicate how to perform edge blurring processing on candidate inner layer texture information. For example, the edge blur map can indicate the edge blur range of the inner layer of a virtual model, and the candidate inner layer texture information can be obtained by performing edge blurring processing on the candidate inner layer texture information using the edge blur map.
[0093] The edge blur map includes a portion with a first preset color and a portion with a second preset color. The edge blur map gradually changes from the first preset color to the second preset color from the center to the edge. The portion with the first preset color is used for display using candidate inner layer texture information, and the portion with the second preset color is filled with a preset color.
[0094] For example, such as Figure 7 The image shown is a blurred edge image (the circular part in the image represents the blurred edge image).
[0095] For example, the candidate inner layer texture information can be obtained by blurring the edges based on the edge blur map. The inner layer of the virtual model rendered using this inner layer texture information is as follows: Figure 8 As shown.
[0096] Furthermore, the edge-blurred image is a Fresnel image.
[0097] It should be noted that this disclosure does not impose any special restrictions on the type of edge blur map or the specific method of obtaining inner layer texture information by performing edge blur processing on candidate inner layer texture information based on the edge blur map.
[0098] Through the above steps S610 to S620, an edge blur map can be created, and the candidate inner layer texture information can be obtained by performing edge blur processing on the candidate inner layer texture information based on the edge blur map.
[0099] Step S230: Generate virtual model inner layer information based on inner layer normal information and inner layer texture information;
[0100] In one example embodiment of this disclosure, after obtaining the inner layer normal information and inner layer texture information through the above steps, virtual model inner layer information can be generated based on the inner layer normal information and inner layer texture information. Specifically, the inner layer normal information can be used to indicate the orientation and texture of the virtual model inner layer. The virtual model inner layer information can be generated based on the inner layer normal information and inner layer texture information, and this virtual model inner layer information can be used to render the virtual model inner layer in the virtual model, thereby displaying the virtual model inner layer on the surface of the virtual model.
[0101] It should be noted that this disclosure does not impose any special limitations on the specific method of generating the inner layer information of the virtual model based on the inner layer normal information and the inner layer texture information.
[0102] In one example embodiment of this disclosure, candidate virtual model inner layer information can be generated based on inner layer normal information and inner layer texture information. The inner layer normal information and the orientation information of the virtual camera are multiplied to obtain a dot product result. The display portion and the non-display portion of the inner layer region are determined based on the dot product result. The virtual model inner layer information is then determined based on the display portion and the non-display portion. (Refer to...) Figure 9 As shown, determining the inner layer information of the virtual model based on the displayed and non-displayed parts may include the following steps S910 to S930:
[0103] Step S910: Generate candidate virtual model inner layer information based on inner layer normal information and inner layer texture information;
[0104] In one example embodiment of this disclosure, candidate virtual model inner layer information can be generated based on inner layer normal information and inner layer texture information. Specifically, the inner layer normal information can be used to indicate the orientation and texture of the virtual model inner layer. Candidate virtual model inner layer information can be generated based on the inner layer normal information and inner layer texture information. This candidate virtual model inner layer information can be used to render the virtual model inner layer in the virtual model, thereby displaying the virtual model inner layer on the surface of the virtual model.
[0105] The inner layer region corresponds to the inner layer information of the candidate virtual model. Specifically, the inner layer region refers to the region corresponding to the inner layer of the virtual model rendered using the inner layer information of the candidate virtual model.
[0106] It should be noted that this disclosure does not impose any special limitations on the specific method of generating candidate virtual model inner layer information based on inner layer normal information and inner layer texture information.
[0107] Step S920: Perform a dot product between the inner layer normal information and the orientation information of the virtual camera to obtain the dot product result;
[0108] In one example embodiment of this disclosure, the inner layer normal information and the orientation information of the virtual camera can be multiplied by a dot product to obtain a dot product result. The dot product result is used to indicate the orientation difference between the virtual camera's orientation information and the inner layer normal information. Specifically, the orientation information of the virtual camera can be obtained, which can indicate the direction the virtual camera is facing. The inner layer normal information can indicate the normal direction of each vertex in the virtual model. The dot product between the virtual camera's orientation information and the inner layer normal information is used to indicate the orientation difference between the virtual camera's orientation information and the inner layer normal information. Specifically, the dot product result can be used to indicate the orientation difference between the virtual camera's orientation information and the normal direction of each vertex in the virtual model.
[0109] It should be noted that this disclosure obtains the dot product result by multiplying the inner layer normal information with the orientation information of the virtual camera.
[0110] For example, such as Figure 10 As shown, the dot product result can be obtained by multiplying the inner layer normal information and the orientation information of the virtual lens through the image display. The darker the color, the smaller the orientation difference.
[0111] Step S930: Determine the displayed portion and the non-displayed portion of the inner region based on the dot product result, and determine the inner layer information of the virtual model based on the displayed portion and the non-displayed portion.
[0112] In one example embodiment of this disclosure, after obtaining the dot product result through the above steps, the display portion and the non-display portion of the inner layer region can be determined based on the dot product result, and the inner layer information of the virtual model can be determined based on the display portion and the non-display portion. Specifically, the candidate virtual model inner layer information is used to display the display portion, while a preset color is displayed in the non-display portion. In detail, the inner layer region can be divided into a display portion and a non-display portion based on the dot product result.
[0113] For example, the dot product result can be used to indicate the difference between the orientation information of the virtual camera and the orientation information of the inner layer normal. The part with a smaller orientation difference can be identified as the display part, and the part with a larger orientation difference can be identified as the non-display part. In the display part, the inner layer information of the candidate virtual model is used for display, and in the non-display part, a preset color can be displayed.
[0114] For example, such as Figure 11 As shown, the inner area (circle, including white and black within the circle) can be divided into a display portion (the black portion) and a non-display portion (the white portion).
[0115] For example, such as Figure 12As shown, in the display section, the inner layer information of the candidate virtual model can be used for display (the inner layer information of the candidate virtual model is used for display in the display section).
[0116] It should be noted that this disclosure does not impose any special limitations on the specific method of determining the inner layer information of the virtual model based on the displayed and non-displayed parts.
[0117] Through the above steps S910 to S930, candidate virtual model inner layer information can be generated based on inner layer normal information and inner layer texture information. The inner layer normal information and the orientation information of the virtual camera are multiplied to obtain the dot product result. The display part and the non-display part in the inner layer region are determined based on the dot product result. The virtual model inner layer information is determined based on the display part and the non-display part.
[0118] In one example embodiment of this disclosure, the dot product results corresponding to multiple vertices in a virtual model can be obtained. Vertices whose dot product results are greater than or equal to a preset threshold are identified as target vertices. The display portion in the inner region is determined based on the target vertices and the lines connecting them. The portion of the inner region excluding the display portion is identified as the non-display portion. (Refer to...) Figure 13 As shown, defining the portion of the inner layer region excluding the display portion as the non-display portion of the inner layer region may include the following steps S1310 to S1340:
[0119] Step S1310: Obtain the dot product results of multiple vertices in the virtual model;
[0120] In one example embodiment of this disclosure, after obtaining the inner layer normal information and the orientation information of the virtual camera through the above steps and performing a dot product to obtain the dot product result, the dot product results corresponding to multiple vertices in the virtual model can be obtained. Specifically, the dot product result can be used to indicate the orientation difference between the orientation information of the virtual camera and the orientation direction of the normals of each vertex in the virtual model. Therefore, the dot product results corresponding to multiple vertices in the virtual model can be obtained.
[0121] It should be noted that this disclosure does not impose any special restrictions on the specific method for obtaining the dot product results corresponding to multiple vertices in the virtual model.
[0122] Step S1320: Determine the vertices whose dot product result is greater than or equal to a preset threshold as target vertices;
[0123] In one example embodiment of this disclosure, after obtaining the dot product results corresponding to multiple vertices in the virtual model through the above steps, vertices whose dot product results are greater than or equal to a preset threshold can be identified as target vertices. Specifically, the dot product results corresponding to each vertex can be obtained, and the dot product results corresponding to each vertex can be compared with the preset threshold. Vertices whose dot product results are greater than the preset threshold can be identified as target vertices. Specifically, when the dot product result corresponding to a vertex is greater than the preset threshold, it indicates that the orientation difference between the normal direction of the vertex and the orientation information of the virtual camera is small.
[0124] It should be noted that this disclosure does not impose any special limitations on the specific value of the preset threshold.
[0125] Step S1330: Determine the display portion in the inner region based on the target vertex and the vertex connections between the target vertices;
[0126] Step S1340: The portion of the inner layer region excluding the display portion is determined as the non-display portion of the inner layer region.
[0127] In one exemplary embodiment of this disclosure, after determining the target vertices through the above steps, the display portion in the inner region can be determined based on the target vertices and the vertex connections between them. Specifically, the virtual model includes multiple vertices connected by vertex connections. The virtual model can be composed of these vertex connections and vertices. After determining the target vertices, the vertex connections between these target vertices can be determined based on the target vertices, and multiple faces can be determined through these vertex connections. These faces are then defined as the display portion in the inner region, and the portion of the inner region excluding the display portion is defined as the non-display portion in the inner region.
[0128] Specifically, the orientation difference between the normal direction of vertices in the display portion of the inner layer region and the orientation information of the virtual camera is small, while the orientation difference between the normal direction of vertices in the non-display portion of the inner layer region and the orientation information of the virtual camera is large.
[0129] It should be noted that this disclosure does not impose any special limitations on the specific method of determining the display portion in the inner region based on the target vertex and the vertex connections between the target vertices.
[0130] For example, such as Figure 14 As shown, the virtual model includes multiple vertices connected by vertex lines. Vertices whose dot product result is greater than a preset threshold can be identified as target vertices. The display portion (the black part in the circle) in the inner region is determined based on the target vertices and the vertex lines connecting them. The portion in the inner region other than the display portion is identified as the non-display portion (the other part in the circle excluding the black part).
[0131] In one example embodiment of this disclosure, in response to a rotation control operation on the virtual model, the virtual model is controlled to rotate. During rotation, the displayed and non-display areas are switched. Specifically, during rotation, the normal directions of the vertices on the virtual model and the orientation of the virtual camera change, thus the target vertex also changes. Consequently, the displayed and non-display areas within the inner region change. When switching between the displayed and non-display areas within the inner region, a flashing effect can be displayed around the displayed area.
[0132] It should be noted that this disclosure does not impose any special restrictions on the specific form of the blinking effect.
[0133] Through the above steps S1310 to S1340, the dot product results corresponding to multiple vertices in the virtual model can be obtained. Vertices whose dot product results are greater than or equal to a preset threshold are determined as target vertices. The display part in the inner region is determined based on the target vertices and the vertex connections between them. The part in the inner region other than the display part is determined as the non-display part in the inner region.
[0134] Step S240: Obtain the outer layer normal map and sample the outer layer normal map to obtain the outer layer normal information;
[0135] In one example embodiment of this disclosure, an outer normal map can be obtained, and outer normal information can be obtained by sampling the outer normal map. Specifically, the outer normal map can be used to draw normals at each point on the uneven surface of the original model, and the direction of the normals can be marked by RGB color channels. The outer normal information can be obtained by sampling the outer normal map, and specifically, the outer normal information can be used to indicate the normal direction of each vertex in the virtual model.
[0136] It should be noted that this disclosure does not impose any special limitations on the specific method of sampling the outer layer normal map to obtain the outer layer normal information.
[0137] Step S250: Obtain the outer environment map; sample the outer environment map based on the outer normal information to obtain the outer environment information.
[0138] In one example embodiment of this disclosure, after obtaining the outer layer normal information through the above steps, the outer layer texture map can be sampled based on the outer layer normal information to obtain the outer layer texture information. Specifically, the outer layer texture map refers to a two-dimensional graphic used to render the surface of a virtual model. When the texture is mapped onto the surface of the virtual model in a specific way, the object can appear more realistic. Specifically, the outer layer texture map refers to the outer layer of the virtual model. The outer layer texture information can be obtained by sampling the outer layer texture map based on the outer layer normal information, wherein the outer layer texture information can be used to indicate the texture used on the outer layer of the virtual model.
[0139] It should be noted that this disclosure does not impose any special limitations on the specific method of sampling the outer texture map based on the outer normal information to obtain the outer texture information.
[0140] For example, such as Figure 15 As shown in Figure a, this is an outer environment texture; the virtual model outer layer obtained by rendering the outer environment information is as follows: Figure 15 As shown in b.
[0141] In one example embodiment of this disclosure, candidate outer layer environment information can be obtained by sampling the outer layer environment map based on the outer layer normal information, and the outer layer environment information can be obtained based on the candidate outer layer environment information and the inner and outer layer coloring information. (Refer to...) Figure 16 As shown, obtaining outer layer environment information based on candidate outer layer environment information and inner and outer layer staining information may include the following steps S1610 to S1620:
[0142] Step S1610: Sample the outer layer environment map based on the outer layer normal information to obtain candidate outer layer environment information;
[0143] Step S1620: Obtain outer layer environment information based on candidate outer layer environment information and inner and outer layer staining information.
[0144] In one example embodiment of this disclosure, after obtaining the outer layer normal information through the above steps, candidate outer layer environment information can be obtained by sampling the outer layer environment map based on the outer layer normal information, and the outer layer environment information can be obtained based on the candidate outer layer environment information and the inner and outer layer shading information. Specifically, the outer layer environment information is obtained based on the candidate outer layer environment information and the inner and outer layer shading information, and the outer layer of the virtual model rendered by this outer layer environment information has a color (the color assigned by the inner and outer layer shading information).
[0145] It should be noted that this disclosure does not impose any special limitations on the specific method of obtaining outer environment information based on candidate outer environment information and inner and outer staining information.
[0146] Through the above steps S1610 to S1620, candidate outer layer environment information can be obtained by sampling the outer layer environment map based on the outer layer normal information, and outer layer environment information can be obtained based on the candidate outer layer environment information and the inner and outer layer staining information.
[0147] In one example embodiment of this disclosure, a colorimetric map can be created, and candidate outer environment information can be colored according to the colorimetric map to obtain outer environment information. (Refer to...) Figure 17 As shown, obtaining outer environment information by staining candidate outer environment information based on the staining map may include the following steps S1710~S1720:
[0148] Step S1710, create a color map;
[0149] Step S1720: The candidate outer environment information is obtained by staining the staining map.
[0150] In one example embodiment of this disclosure, a coloring map can be created. Specifically, the coloring map can be used to indicate how to color candidate outer environment information. The outer environment information can be obtained by coloring the candidate outer environment information according to the coloring map, so that the outer layer of the virtual model rendered from the outer environment information has color. For example, the coloring map can be used to indicate the coloring area and the specific color.
[0151] For example, such as Figure 18 As shown in Figure a, this is a coloring map. The outer environment information can be obtained by coloring candidate outer environment information according to the coloring map. The outer layer of the virtual model obtained by rendering this outer environment information is shown below. Figure 18 As shown in b.
[0152] Furthermore, the staining diagram is a Fresnel diagram.
[0153] It should be noted that this disclosure does not impose any special limitations on the type of staining map or the specific method of obtaining outer environment information by staining candidate outer environment information based on the staining map.
[0154] Through the above steps S1710 to S1720, a staining map can be created, and the candidate outer environment information can be obtained by staining the candidate outer environment information according to the staining map.
[0155] Step S260: Generate virtual model outer layer information based on outer layer normal information and outer layer environment information;
[0156] In one example embodiment of this disclosure, after obtaining the outer layer normal information and outer layer texture information through the above steps, virtual model outer layer information can be generated based on the outer layer normal information and outer layer texture information. Specifically, the outer layer normal information can be used to indicate the orientation and texture of the virtual model outer layer. The virtual model outer layer information can be generated from the outer layer normal information and outer layer texture information, and this virtual model outer layer information can be used to render the virtual model outer layer in the virtual model, thereby displaying the virtual model outer layer on the surface of the virtual model.
[0157] It should be noted that this disclosure does not impose any special limitations on the specific method of generating the outer layer information of the virtual model based on the outer layer normal information and the outer layer texture information.
[0158] In one example embodiment of this disclosure, candidate virtual model outer layer information is generated based on outer layer normal information and outer layer environment information, and the candidate virtual model outer layer information is hollowed out to obtain the virtual model outer layer information. (Refer to...) Figure 19 As shown, the process of hollowing out the outer layer information of the candidate virtual model to obtain the outer layer information of the virtual model may include the following steps S1910 to S1920:
[0159] Step S1910: Generate candidate virtual model outer layer information based on outer layer normal information and outer layer environment information;
[0160] In one example embodiment of this disclosure, after obtaining the outer layer normal information and outer layer environment information through the above steps, candidate virtual model outer layer information can be generated based on the outer layer normal information and outer layer environment information. Specifically, the outer layer normal information can be used to indicate the orientation and texture of the virtual model outer layer. Candidate virtual model outer layer information can be generated based on the outer layer normal information and outer layer texture information. This virtual model outer layer information can be used to render the virtual model outer layer in the virtual model, thereby displaying the virtual model outer layer on the surface of the virtual model.
[0161] It should be noted that this disclosure does not impose any special limitations on the specific method of generating candidate virtual model outer layer information based on outer layer normal information and outer layer environment information.
[0162] Step S1920: Hollow out the outer layer information of the candidate virtual model to obtain the outer layer information of the virtual model.
[0163] In one example embodiment of this disclosure, after obtaining the candidate virtual model outer layer information through the above steps, the candidate virtual model outer layer information can be hollowed out to obtain the virtual model outer layer information. Specifically, hollowing out the candidate virtual model outer layer information to obtain the virtual model outer layer information means that the rendered virtual model outer layer of the processed virtual model outer layer information has a hollow effect, that is, it can visually display the effect of an outer layer. For example, the part near the edge of the virtual model outer layer corresponding to the candidate virtual model outer layer information can be darkened, so that after the virtual model is rendered with the hollowed-out virtual model outer layer information, the part near the edge of the rendered virtual model outer layer can be darker in color, thus visually displaying the effect of an outer layer.
[0164] It should be noted that this disclosure does not impose any special limitations on the specific method of hollowing out the outer layer information of the candidate virtual model to obtain the outer layer information of the virtual model.
[0165] For example, the outer layer of the virtual model rendered from the outer layer information of the candidate virtual model is as follows: Figure 20 As shown in Figure a, the outer layer information of the candidate virtual model can be hollowed out to obtain the outer layer information of the virtual model. The outer layer of the virtual model rendered using this outer layer information is as follows: Figure 20 As shown in b.
[0166] Through the above steps S1910 to S1920, after obtaining the outer layer normal information and outer layer environment information through the above steps, the candidate virtual model outer layer information can be generated based on the outer layer normal information and outer layer environment information.
[0167] In one example embodiment of this disclosure, a first hollow processing image can be created, the first hollow processing image can be inverted to obtain a second hollow processing image, the first hollow processing image and the second hollow processing image can be superimposed to obtain a target hollow processing image, and the outer layer information of the candidate virtual model can be hollowed out using the target hollow processing image to obtain the outer layer information of the virtual model. (Refer to...) Figure 21 As shown, the process of hollowing out the outer layer information of the candidate virtual model through the target hollow processing diagram to obtain the outer layer information of the virtual model may include the following steps S2110 to S2140:
[0168] Step S2110: Create the first hollow processing diagram;
[0169] In one example embodiment of this disclosure, a first hollow processing image can be created. Specifically, the first hollow processing image includes a first preset color portion and a second preset color portion, which gradually changes from the first preset color to the second preset color from the center to the edge. The first preset color portion is filled with black, and the second preset color portion is displayed using the outer layer information of the candidate virtual model.
[0170] Step S2120: Invert the first hollow image to obtain the second hollow image;
[0171] In one exemplary embodiment of this disclosure, after obtaining the first hollow image through the above steps, the first hollow image can be inverted to obtain a second hollow image. Specifically, in the second hollow image, the color gradually changes from a second preset color to a first preset color from the center to the edge. For example, the first hollow image can be inverted by using 1 - the Fresnel value corresponding to the first hollow image.
[0172] Step S2130: Overlay the first hollow processing image and the second hollow processing image to obtain the target hollow processing image;
[0173] In one exemplary embodiment of this disclosure, after obtaining the first hollow processing image and the second hollow processing image through the above steps, the first hollow processing image and the second hollow processing image can be superimposed to obtain a target hollow processing image. Specifically, in the first hollow processing image, the color gradually changes from a first preset color to a second preset color from the center to the edge; in the second hollow processing image, the color gradually changes from the second preset color to the first preset color from the center to the edge. Superimposing the first hollow processing image and the second hollow processing image yields the target hollow processing image, in which the colors from the center to the edge are sequentially the second preset color, the first preset color, and the second preset color.
[0174] In the target hollow processing diagram, the part with the second preset color is displayed using the outer layer information of the candidate virtual model, while the part with the first preset color is filled with black.
[0175] It should be noted that this disclosure does not impose any special limitations on the specific method of superimposing the first hollow processing image and the second hollow processing image to obtain the target hollow processing image.
[0176] Step S2140: Hollow processing is performed on the outer layer information of the candidate virtual model through the target hollow processing diagram to obtain the outer layer information of the virtual model.
[0177] In one exemplary embodiment of this disclosure, after obtaining the target hollow processing map through the above steps, the outer layer information of the candidate virtual model can be hollowed out using the target hollow processing map to obtain the outer layer information of the virtual model. Specifically, the target hollow processing map can be used to indicate how to hollow out the outer layer information of the candidate virtual model. After obtaining the outer layer information of the virtual model by hollowing out the candidate virtual model information using the target hollow processing map, the virtual model can be rendered using this outer layer information, so that the outer layer of the rendered virtual model has a portion of the area near the edge filled with black, creating a visual effect of an outer layer.
[0178] For example, a first hollow processing diagram can be created as follows: Figure 22 As shown in Figure a, the second hollow processing image is obtained by inverting the first hollow processing image. Figure 22 As shown in b, the first hollow processing image and the second hollow processing image are then superimposed to obtain the target hollow processing image, as shown in Figure 2. Figure 22 As shown in c.
[0179] Through the above steps S2110 to S2140, a first hollow processing image can be created, the first hollow processing image can be inverted to obtain a second hollow processing image, the first hollow processing image and the second hollow processing image can be superimposed to obtain a target hollow processing image, and the outer layer information of the candidate virtual model can be hollowed out using the target hollow processing image to obtain the outer layer information of the virtual model.
[0180] In one example embodiment of this disclosure, the outer layer information of the candidate virtual model has outer layer attributes, which can be adjusted. These outer layer attributes include one or more of the following: brightness attribute, sharpness attribute, and grayscale attribute.
[0181] In one example embodiment of this disclosure, a first Fresnel value and a second Fresnel value corresponding to a position can be obtained. The larger of the first and second Fresnel values is determined as the transparency information of the position. The virtual model to be rendered is then rendered based on the inner layer information of the virtual model, the outer layer information of the virtual model, and the transparency information of multiple positions. (Refer to...) Figure 23 As shown, rendering the virtual model to be rendered based on the inner layer information, outer layer information, and transparency information of the virtual model may include the following steps S2310 to S2330:
[0182] Step S2310: Obtain the first Fresnel value and the second Fresnel value corresponding to the position;
[0183] In one example embodiment of this disclosure, a first Fresnel value and a second Fresnel value corresponding to a position can be obtained. Specifically, the first Fresnel value is obtained based on the hollow processing map of the target, and the second Fresnel value is obtained based on the outer layer information of the virtual model. The Fresnel value can be used to indicate transparency.
[0184] Specifically, the hollow processing diagram of the target includes multiple locations, and the outer layer information of the virtual model has corresponding multiple locations. Moreover, the multiple locations in the hollow processing diagram of the target correspond one-to-one with the multiple locations in the outer layer information of the virtual model.
[0185] It should be noted that this disclosure does not impose any special restrictions on the specific methods for obtaining the first Fresnel value and the second Fresnel value corresponding to the position.
[0186] Step S2320: Determine the larger of the first Fresnel value and the second Fresnel value corresponding to the position as the transparency information of the position;
[0187] Step S2330: Render the virtual model to be rendered based on the inner layer information of the virtual model, the outer layer information of the virtual model, and the transparency information of multiple locations.
[0188] In one exemplary embodiment of this disclosure, after obtaining the first Fresnel value and the second Fresnel value corresponding to the position through the above steps, the larger of the two values can be determined as the transparency information of the position. Specifically, determining the larger of the first and second Fresnel values as the transparency information makes the edges of the rendered virtual model appear more transparent and the center appear solid, thereby improving the transparency and realism of the rendered virtual model.
[0189] When rendering a virtual model, rendering can be performed based on the inner layer information of the virtual model, the outer layer information of the virtual model, and the transparency information of multiple locations.
[0190] For example, the target hollow processing diagram is as follows: Figure 24 As shown in a, the virtual model outer layer information corresponds to the virtual model outer layer as follows: Figure 24 As shown in b, the transparency information at multiple locations is as follows: Figure 24 As shown in c.
[0191] It should be noted that this disclosure does not impose any special limitations on the specific method of rendering the virtual model to be rendered based on the inner layer information of the virtual model, the outer layer information of the virtual model, and the transparency information of multiple locations.
[0192] It should be noted that this disclosure does not impose any special limitations on the specific method of rendering the virtual model to be rendered based on the inner layer information of the virtual model, the outer layer information of the virtual model, and the transparency information of multiple locations.
[0193] For example, a virtual model rendered based on the inner layer information, outer layer information, and transparency information at multiple locations is like... Figure 25 As shown.
[0194] Through the above steps S2310 to S2320, the first Fresnel value and the second Fresnel value corresponding to the position can be obtained. The larger value between the first Fresnel value and the second Fresnel value corresponding to the position is determined as the transparency information of the position. The virtual model to be rendered is rendered based on the inner layer information of the virtual model, the outer layer information of the virtual model, and the transparency information of multiple positions.
[0195] In one example embodiment of this disclosure, after obtaining the target hollow processing map through the above steps, the second Fresnel value corresponding to each position in the target hollow processing map can be obtained from the first Fresnel value, and the second Fresnel value corresponding to those positions in the outer layer information of the virtual model can be obtained. The Fresnel value can be used to indicate transparency information.
[0196] Step S270: Render and display the virtual model to be rendered based on the inner layer information and outer layer information of the virtual model.
[0197] In one example embodiment of this disclosure, after obtaining the inner layer information and outer layer information of the virtual model through the above steps, the virtual model to be rendered can be displayed based on the inner layer information and the outer layer information. Specifically, the inner layer information can render the inner layer of the virtual model within the virtual model, thereby displaying the inner layer on the surface of the virtual model; similarly, the outer layer information can render the outer layer of the virtual model within the virtual model, thereby displaying the outer layer on the surface of the virtual model. Therefore, the virtual model to be rendered can be displayed based on the inner and outer layer information, showing both the inner and outer layers.
[0198] It should be noted that the solution disclosed herein renders both the inner and outer layers of the virtual model on the surface of the virtual model simultaneously, thus visually representing that the virtual model has two layers, which can enhance the artistic effect of the virtual model.
[0199] In one embodiment of the virtual object rendering method disclosed herein, an inner layer normal map is obtained, and inner layer normal information is obtained by sampling the inner layer normal map. An inner layer texture map is obtained, and inner layer texture information is obtained by sampling the inner layer texture map based on the inner layer normal information. Inner layer information of the virtual model is generated based on the inner layer normal information and the inner layer texture information. An outer layer normal map is obtained, and outer layer normal information is obtained by sampling the outer layer normal map. An outer layer environment map is obtained, and outer layer environment information is obtained by sampling the outer layer environment map based on the outer layer normal information. Outer layer information of the virtual model is generated based on the outer layer normal information and the outer layer information of the virtual model. The virtual model to be rendered is then rendered and displayed based on the inner layer information and the outer layer information of the virtual model. On the one hand, using textures to process the virtual model can avoid the problem of high performance consumption, improve the rendering effect, and have lower requirements for the user's terminal device. On the other hand, it can display virtual objects with inner and outer layers of virtual models, so that the virtual objects visually exhibit the effect of having two layers, which can enhance the artistic effect of the virtual model.
[0200] It should be noted that the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this disclosure, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0201] Furthermore, in an exemplary embodiment of this disclosure, a virtual model rendering apparatus is also provided. (Refer to...) Figure 26 As shown, a virtual model rendering device 2600 includes an inner layer normal map acquisition module 2610, an inner layer texture map acquisition module 2620, an object inner layer information generation module 2630, an outer layer normal map acquisition module 2640, an outer layer environment map acquisition module 2650, an object outer layer information generation module 2660, and a virtual model rendering module 2670.
[0202] The system includes the following modules: an inner layer normal map acquisition module, which acquires the inner layer normal map and samples it to obtain inner layer normal information; an inner layer texture map acquisition module, which acquires the inner layer texture map and samples it based on the inner layer normal information to obtain inner layer texture information; an object inner layer information generation module, which generates virtual model inner layer information based on the inner layer normal information and inner layer texture information; an outer layer normal map acquisition module, which acquires the outer layer normal map and samples it based on the outer layer normal information to obtain outer layer normal information; an outer layer environment map acquisition module, which acquires the outer layer environment map and samples it based on the outer layer normal information to obtain outer layer environment information; an object outer layer information generation module, which generates virtual model outer layer information based on the outer layer normal information and outer layer environment information; and a virtual model rendering module, which renders and displays the virtual model to be rendered based on the virtual model inner layer information and virtual model outer layer information.
[0203] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, inner layer normal map is sampled to obtain inner layer normal information. The apparatus further includes: a first candidate inner layer normal information acquisition unit, used to sample the inner layer normal map to obtain first candidate inner layer normal information; a world space conversion unit, used to convert the first candidate inner layer normal information from tangent space to world space to obtain second candidate inner layer normal information; and a camera space conversion unit, used to convert the second candidate inner layer normal information from world space to camera space to obtain inner layer normal information.
[0204] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, inner layer texture information is obtained by sampling the inner layer texture map according to the inner layer normal information. The apparatus further includes: a candidate inner layer texture information acquisition unit, used to obtain candidate inner layer texture information by sampling the inner layer texture map according to the inner layer normal information; and a candidate inner layer texture information processing unit, used to obtain inner layer texture information by performing edge blurring processing on the candidate inner layer texture information.
[0205] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, edge blurring processing is performed on candidate inner layer texture information to obtain inner layer texture information. The apparatus further includes: an edge blurring map creation unit, used to create an edge blurring map; wherein the edge blurring map gradually changes from a first preset color to a second preset color from the center to the edge, the portion of the first preset color is used for display using candidate inner layer texture information, and the portion of the second preset color is filled with a preset color; and an edge blurring map processing unit, used to perform edge blurring processing on candidate inner layer texture information according to the edge blurring map to obtain inner layer texture information.
[0206] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the device generates virtual model inner layer information according to inner layer normal information and inner layer texture information. The device further includes: a candidate virtual model inner layer information generation unit, used to generate candidate virtual model inner layer information according to inner layer normal information and inner layer texture information; wherein, the inner layer region corresponds to candidate virtual model inner layer information; a dot product unit, used to perform a dot product between the inner layer normal information and the orientation information of the virtual camera to obtain a dot product result; wherein, the dot product result is used to indicate the orientation difference between the orientation information of the virtual camera and the orientation information of the inner layer normal information; and a differentiation unit, used to determine the display portion and the non-display portion in the inner layer region according to the dot product result, and to determine the virtual model inner layer information according to the display portion and the non-display portion; wherein, the candidate virtual model inner layer information is used for display in the display portion, and a preset color is displayed in the non-display portion.
[0207] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the virtual model includes multiple vertices connected by vertex lines. The display portion and the non-display portion of the inner region are determined based on the dot product result. The apparatus further includes: a vertex dot product result acquisition unit, used to acquire the dot product results corresponding to multiple vertices in the virtual model; a dot product result comparison unit, used to determine vertices whose dot product results are greater than or equal to a preset threshold as target vertices; a display portion determination unit, used to determine the display portion of the inner region based on the target vertex and the vertex lines connecting the target vertices; and a non-display portion determination unit, used to determine the portion of the inner region excluding the display portion as the non-display portion of the inner region.
[0208] In an exemplary embodiment of this disclosure, based on the foregoing scheme, the apparatus further includes: a rotation control operation response unit, configured to control the virtual model to rotate in response to a rotation control operation on the virtual model; and a display switching unit, configured to control the switching between a display portion and a non-display portion when the virtual model rotates.
[0209] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, outer environment information is obtained by sampling the outer environment map according to the outer layer normal information. The apparatus further includes: a candidate outer environment information acquisition unit, used to obtain candidate outer environment information by sampling the outer environment map according to the outer layer normal information; and a candidate outer environment information processing unit, used to obtain outer environment information according to the candidate outer environment information and inner and outer layer shading information; wherein, the inner and outer layer shading information is used to superimpose colors on the candidate outer environment information.
[0210] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the outer layer environment information is obtained according to the candidate outer layer environment information and the inner and outer layer dyeing information. The apparatus further includes: a dyeing map creation unit, used to create a dyeing map; wherein, the first hollow processing map gradually changes from a first preset color to a second preset color from the center to the edge, the portion of the first preset color is filled with dyeing color, the portion of the second preset color is filled with a preset color, and the dyeing map is used to indicate the inner and outer layer dyeing information; and a dyeing map processing unit, used to perform dyeing processing on the candidate outer layer environment information according to the dyeing map to obtain the outer layer environment information.
[0211] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, virtual model outer layer information is generated according to outer layer normal information and outer layer environment information. The apparatus further includes: a candidate object outer layer information acquisition unit, used to generate candidate virtual model outer layer information according to outer layer normal information and outer layer environment information; and a first hollow processing unit, used to perform hollow processing on the candidate virtual model outer layer information to obtain virtual model outer layer information.
[0212] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the device further includes: a first hollow processing image creation unit, used to create a first hollow processing image; wherein the first hollow processing image gradually changes from a first preset color to a second preset color from the center to the edge, the portion of the first preset color is filled with black, and the portion of the second preset color is displayed using the candidate virtual model outer layer information; a second hollow processing image determination unit, used to invert the first hollow processing image to obtain a second hollow processing image; a target hollow processing image determination unit, used to superimpose the first hollow processing image and the second hollow processing image to obtain a target hollow processing image; and a second hollow processing unit, used to perform hollow processing on the candidate virtual model outer layer information through the target hollow processing image to obtain the virtual model outer layer information.
[0213] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the target hollow processing map includes multiple locations. A virtual model to be rendered is then rendered based on the inner layer information and outer layer information of the virtual model. The apparatus further includes: a Fresnel value acquisition unit, used to acquire a first Fresnel value and a second Fresnel value corresponding to the location; wherein the first Fresnel value is acquired based on the target hollow processing map, and the second Fresnel value is acquired based on the outer layer information of the virtual model; a Fresnel value comparison unit, used to determine the larger of the first Fresnel value and the second Fresnel value corresponding to the location as the transparency information of the location; and a rendering unit, used to render the virtual model to be rendered based on the inner layer information, the outer layer information, and the transparency information of the multiple locations.
[0214] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the outer layer information of the candidate virtual model has outer layer attributes, and the apparatus further includes: an outer layer attribute adjustment unit for adjusting the outer layer attributes; wherein, the outer layer attributes include one or more of brightness attributes, sharpness attributes, and grayscale attributes.
[0215] One embodiment of this disclosure provides a virtual model rendering apparatus that can acquire an inner layer normal map, sample the inner layer normal map to obtain inner layer normal information, acquire an inner layer texture map, sample the inner layer texture map based on the inner layer normal information to obtain inner layer texture information, generate inner layer information of the virtual model based on the inner layer normal information and inner layer texture information, acquire an outer layer normal map, sample the outer layer normal map to obtain outer layer normal information, acquire an outer layer environment map, sample the outer layer environment map based on the outer layer normal information to obtain outer layer environment information, generate outer layer information of the virtual model based on the outer layer normal information and outer layer information, and render and display the virtual model to be rendered based on the inner and outer layer information of the virtual model. On the one hand, using textures to process the virtual model can avoid the problem of high performance consumption, improve the rendering effect, and have lower requirements for the user's terminal device; on the other hand, it can display virtual objects with inner and outer layers of virtual models, so that the virtual objects visually exhibit an effect of having two layers, which can enhance the artistic effect of the virtual model.
[0216] Since the functional modules of the virtual model rendering apparatus in the example embodiments of this disclosure correspond to the steps of the example embodiments of the virtual object rendering method described above, for details not disclosed in the apparatus embodiments of this disclosure, please refer to the embodiments of the virtual object rendering method described above.
[0217] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0218] Furthermore, in an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described virtual object rendering method is also provided.
[0219] Those skilled in the art will understand that various aspects of this disclosure can be implemented as a system, method, or program product. Therefore, various aspects of this disclosure can be embodied in the following forms: a completely hardware embodiment, a completely software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."
[0220] The following reference Figure 27 To describe an electronic device 2700 according to such an embodiment of the present disclosure. Figure 27 The electronic device 2700 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0221] like Figure 27 As shown, the electronic device 2700 is manifested in the form of a general-purpose computing device. The components of the electronic device 2700 may include, but are not limited to: at least one processing unit 2710, at least one storage unit 2720, a bus 2730 connecting different system components (including storage unit 2720 and processing unit 2710), and a display unit 2740.
[0222] The storage unit stores program code, which can be executed by the processing unit 2710 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. For example, the processing unit 2710 can perform actions such as... Figure 2 Step S210 shows the process of obtaining an inner layer normal map and sampling it to obtain inner layer normal information; wherein, the inner layer normal information causes the inner layer of the virtual model to rotate with the virtual camera in the virtual scene; Step S220 shows the process of obtaining an inner layer texture map and sampling it based on the inner layer normal information to obtain inner layer texture information; Step S230 shows the process of generating inner layer information of the virtual model based on the inner layer normal information and the inner layer texture information; Step S240 shows the process of obtaining an outer layer normal map and sampling it to obtain outer layer normal information; Step S250 shows the process of obtaining an outer layer environment map and sampling it based on the outer layer normal information to obtain outer layer environment information; Step S260 shows the process of generating outer layer information of the virtual model based on the outer layer normal information and the outer layer environment information; Step S270 shows the process of rendering and displaying the virtual model to be rendered based on the inner layer information and the outer layer information of the virtual model.
[0223] Based on the embodiments of this disclosure, the following solutions can also be implemented:
[0224] In one exemplary embodiment of this disclosure, based on the aforementioned scheme, sampling the inner layer normal map to obtain inner layer normal information includes: sampling the inner layer normal map to obtain first candidate inner layer normal information; converting the first candidate inner layer normal information from tangent space to world space to obtain second candidate inner layer normal information; and converting the second candidate inner layer normal information from world space to camera space to obtain inner layer normal information.
[0225] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, sampling the inner layer texture map according to the inner layer normal information to obtain inner layer texture information includes: sampling the inner layer texture map according to the inner layer normal information to obtain candidate inner layer texture information; and performing edge blurring processing on the candidate inner layer texture information to obtain inner layer texture information.
[0226] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, edge blurring processing is performed on candidate inner layer texture information to obtain inner layer texture information, including: creating an edge blur map; wherein, the edge blur map gradually changes from a first preset color to a second preset color from the center to the edge, the portion of the first preset color is used for display using candidate inner layer texture information, and the portion of the second preset color is filled with a preset color; and edge blurring processing is performed on candidate inner layer texture information according to the edge blur map to obtain inner layer texture information.
[0227] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, generating virtual model inner layer information according to inner layer normal information and inner layer texture information includes: generating candidate virtual model inner layer information according to inner layer normal information and inner layer texture information; wherein, an inner layer region corresponds to candidate virtual model inner layer information; performing a dot product between the inner layer normal information and the orientation information of the virtual camera to obtain a dot product result; wherein, the dot product result is used to indicate the orientation difference between the orientation information of the virtual camera and the inner layer normal information; determining the display portion and the non-display portion in the inner layer region according to the dot product result, and determining the virtual model inner layer information according to the display portion and the non-display portion; wherein, the candidate virtual model inner layer information is used for display in the display portion, and a preset color is displayed in the non-display portion.
[0228] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the virtual model includes multiple vertices connected by vertex lines. Determining the display portion and the non-display portion of the inner region based on the dot product result includes: obtaining the dot product result corresponding to multiple vertices in the virtual model; identifying vertices whose dot product result is greater than or equal to a preset threshold as target vertices; determining the display portion of the inner region based on the target vertices and the vertex lines connecting them; and identifying the portion of the inner region excluding the display portion as the non-display portion of the inner region.
[0229] In one exemplary embodiment of this disclosure, based on the foregoing scheme, in response to a rotation control operation on the virtual model, the virtual model is controlled to rotate; while the virtual model is rotating, the display portion and the non-display portion are switched.
[0230] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, sampling the outer environment map according to the outer layer normal information to obtain outer environment information includes: sampling the outer environment map according to the outer layer normal information to obtain candidate outer environment information; obtaining outer environment information according to the candidate outer environment information and inner and outer layer shading information; wherein, the inner and outer layer shading information is used to overlay colors on the candidate outer environment information.
[0231] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, obtaining outer layer environment information according to candidate outer layer environment information and inner and outer layer coloring information includes: creating a coloring map; wherein, a first hollow processing map gradually changes from a first preset color to a second preset color from the center to the edge, the portion of the first preset color is filled with a coloring color, the portion of the second preset color is filled with a preset color, and the coloring map is used to indicate inner and outer layer coloring information; and coloring the candidate outer layer environment information according to the coloring map to obtain outer layer environment information.
[0232] In one exemplary embodiment of this disclosure, based on the aforementioned scheme, generating virtual model outer layer information according to outer layer normal information and outer layer environment information includes: generating candidate virtual model outer layer information according to outer layer normal information and outer layer environment information; and performing hollow processing on the candidate virtual model outer layer information to obtain virtual model outer layer information.
[0233] In one exemplary embodiment of this disclosure, based on the aforementioned scheme, hollow processing is performed on the outer layer information of the candidate virtual model to obtain the outer layer information of the virtual model, including: creating a first hollow processing image; wherein, the first hollow processing image gradually changes from black to white from the center to the edge, the black part is filled with black, and the white part is displayed using the outer layer information of the candidate virtual model; inverting the first hollow processing image to obtain a second hollow processing image; inverting the first hollow processing image to obtain the second hollow processing image; superimposing the first hollow processing image and the second hollow processing image to obtain a target hollow processing image; and hollow processing is performed on the outer layer information of the candidate virtual model using the target hollow processing image to obtain the outer layer information of the virtual model.
[0234] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the target hollow processing map includes multiple locations. Rendering the virtual model to be rendered according to the inner layer information and outer layer information of the virtual model includes: obtaining a first Fresnel value and a second Fresnel value corresponding to the location; wherein, the first Fresnel value is obtained based on the target hollow processing map, and the second Fresnel value is obtained based on the outer layer information of the virtual model; the larger of the first Fresnel value and the second Fresnel value corresponding to the location is determined as the transparency information of the location; and rendering the virtual model to be rendered according to the inner layer information, the outer layer information, and the transparency information of the multiple locations.
[0235] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the outer layer information of the candidate virtual model has outer layer attributes, and the method further includes: adjusting the outer layer attributes; wherein, the outer layer attributes include one or more of brightness attributes, sharpness attributes, and grayscale attributes.
[0236] An embodiment of this disclosure provides an electronic device that can acquire an inner layer normal map, sample the inner layer normal map to obtain inner layer normal information, acquire an inner layer texture map, sample the inner layer texture map based on the inner layer normal information to obtain inner layer texture information, generate inner layer information of a virtual model based on the inner layer normal information and inner layer texture information, acquire an outer layer normal map, sample the outer layer normal map to obtain outer layer normal information, acquire an outer layer environment map, sample the outer layer environment map based on the outer layer normal information to obtain outer layer environment information, generate outer layer information of a virtual model based on the outer layer normal information and outer layer information, and render and display the virtual model to be rendered based on the inner and outer layer information of the virtual model. On the one hand, using textures to process the virtual model avoids the problem of high performance consumption, improves the rendering effect, and has lower requirements for the user's terminal device; on the other hand, it can display virtual objects with inner and outer layers of virtual models, making the virtual objects visually exhibit a two-layer effect, thus enhancing the artistic effect of the virtual model.
[0237] Storage unit 2720 may include readable media in the form of volatile storage units, such as random access memory (RAM) 2721 and / or cache memory 2722, and may further include read-only memory (ROM) 2723.
[0238] Storage unit 2720 may also include a program / utility 2724 having a set (at least one) program module 2725, such program module 2725 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0239] Bus 2730 can represent one or more of several types of bus structures, including memory cell bus or memory cell controller, peripheral bus, graphics acceleration port, processing unit, or local bus using any of the multiple bus structures.
[0240] Electronic device 2700 can also communicate with one or more external devices 2770 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 2700, and / or with any device that enables electronic device 2700 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 2750. Furthermore, electronic device 2700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 2760. As shown, network adapter 2760 communicates with other modules of electronic device 2700 via bus 2730. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 2700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0241] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0242] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of this disclosure may also be implemented as a program product including program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure.
[0243] In one exemplary embodiment of this disclosure, an inner layer normal map can be obtained, the inner layer normal map can be sampled to obtain inner layer normal information, an inner layer texture map can be obtained, the inner layer texture map can be sampled according to the inner layer normal information to obtain inner layer texture information, virtual model inner layer information can be generated according to the inner layer normal information and the inner layer texture information, an outer layer normal map can be obtained, the outer layer normal map can be sampled to obtain outer layer normal information, an outer layer environment map can be obtained, the outer layer environment map can be sampled according to the outer layer normal information to obtain outer layer environment information, virtual model outer layer information can be generated according to the outer layer normal information and the outer layer environment information, and the virtual model to be rendered can be rendered and displayed according to the virtual model inner layer information and the virtual model outer layer information.
[0244] In one exemplary embodiment of this disclosure, based on the aforementioned scheme, sampling the inner layer normal map to obtain inner layer normal information includes: sampling the inner layer normal map to obtain first candidate inner layer normal information; converting the first candidate inner layer normal information from tangent space to world space to obtain second candidate inner layer normal information; and converting the second candidate inner layer normal information from world space to camera space to obtain inner layer normal information.
[0245] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, sampling the inner layer texture map according to the inner layer normal information to obtain inner layer texture information includes: sampling the inner layer texture map according to the inner layer normal information to obtain candidate inner layer texture information; and performing edge blurring processing on the candidate inner layer texture information to obtain inner layer texture information.
[0246] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, edge blurring processing is performed on candidate inner layer texture information to obtain inner layer texture information, including: creating an edge blur map; wherein, the edge blur map gradually changes from a first preset color to a second preset color from the center to the edge, the portion of the first preset color is used for display using candidate inner layer texture information, and the portion of the second preset color is filled with a preset color; and edge blurring processing is performed on candidate inner layer texture information according to the edge blur map to obtain inner layer texture information.
[0247] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, generating virtual model inner layer information according to inner layer normal information and inner layer texture information includes: generating candidate virtual model inner layer information according to inner layer normal information and inner layer texture information; wherein, an inner layer region corresponds to candidate virtual model inner layer information; performing a dot product between the inner layer normal information and the orientation information of the virtual camera to obtain a dot product result; wherein, the dot product result is used to indicate the orientation difference between the orientation information of the virtual camera and the inner layer normal information; determining the display portion and the non-display portion in the inner layer region according to the dot product result, and determining the virtual model inner layer information according to the display portion and the non-display portion; wherein, the candidate virtual model inner layer information is used for display in the display portion, and a preset color is displayed in the non-display portion.
[0248] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the virtual model includes multiple vertices connected by vertex lines. Determining the display portion and the non-display portion of the inner region based on the dot product result includes: obtaining the dot product result corresponding to multiple vertices in the virtual model; identifying vertices whose dot product result is greater than or equal to a preset threshold as target vertices; determining the display portion of the inner region based on the target vertices and the vertex lines connecting them; and identifying the portion of the inner region excluding the display portion as the non-display portion of the inner region.
[0249] In one exemplary embodiment of this disclosure, based on the foregoing scheme, in response to a rotation control operation on the virtual model, the virtual model is controlled to rotate; while the virtual model is rotating, the display portion and the non-display portion are switched.
[0250] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, sampling the outer environment map according to the outer layer normal information to obtain outer environment information includes: sampling the outer environment map according to the outer layer normal information to obtain candidate outer environment information; obtaining outer environment information according to the candidate outer environment information and inner and outer layer shading information; wherein, the inner and outer layer shading information is used to overlay colors on the candidate outer environment information.
[0251] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, obtaining outer layer environment information according to candidate outer layer environment information and inner and outer layer coloring information includes: creating a coloring map; wherein, a first hollow processing map gradually changes from a first preset color to a second preset color from the center to the edge, the portion of the first preset color is filled with a coloring color, the portion of the second preset color is filled with a preset color, and the coloring map is used to indicate inner and outer layer coloring information; and coloring the candidate outer layer environment information according to the coloring map to obtain outer layer environment information.
[0252] In one exemplary embodiment of this disclosure, based on the aforementioned scheme, generating virtual model outer layer information according to outer layer normal information and outer layer environment information includes: generating candidate virtual model outer layer information according to outer layer normal information and outer layer environment information; and performing hollow processing on the candidate virtual model outer layer information to obtain virtual model outer layer information.
[0253] In one exemplary embodiment of this disclosure, based on the aforementioned scheme, hollow processing is performed on the outer layer information of the candidate virtual model to obtain the outer layer information of the virtual model, including: creating a first hollow processing image; wherein, the first hollow processing image gradually changes from black to white from the center to the edge, the black part is filled with black, and the white part is displayed using the outer layer information of the candidate virtual model; inverting the first hollow processing image to obtain a second hollow processing image; inverting the first hollow processing image to obtain the second hollow processing image; superimposing the first hollow processing image and the second hollow processing image to obtain a target hollow processing image; and hollow processing is performed on the outer layer information of the candidate virtual model using the target hollow processing image to obtain the outer layer information of the virtual model.
[0254] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the target hollow processing map includes multiple locations. Rendering the virtual model to be rendered according to the inner layer information and outer layer information of the virtual model includes: obtaining a first Fresnel value and a second Fresnel value corresponding to the location; wherein, the first Fresnel value is obtained based on the target hollow processing map, and the second Fresnel value is obtained based on the outer layer information of the virtual model; the larger of the first Fresnel value and the second Fresnel value corresponding to the location is determined as the transparency information of the location; and rendering the virtual model to be rendered according to the inner layer information, the outer layer information, and the transparency information of the multiple locations.
[0255] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the outer layer information of the candidate virtual model has outer layer attributes, and the method further includes: adjusting the outer layer attributes; wherein, the outer layer attributes include one or more of brightness attributes, sharpness attributes, and grayscale attributes.
[0256] One embodiment of this disclosure provides a computer-readable signal medium that can acquire an inner layer normal map, sample the inner layer normal map to obtain inner layer normal information, acquire an inner layer texture map, sample the inner layer texture map based on the inner layer normal information to obtain inner layer texture information, generate inner layer information of a virtual model based on the inner layer normal information and inner layer texture information, acquire an outer layer normal map, sample the outer layer normal map to obtain outer layer normal information, acquire an outer layer environment map, sample the outer layer environment map based on the outer layer normal information to obtain outer layer environment information, generate outer layer information of a virtual model based on the outer layer normal information and outer layer information, and render and display the virtual model to be rendered based on the inner and outer layer information of the virtual model. On the one hand, using textures to process the virtual model avoids the problem of high performance consumption, improves the rendering effect, and has lower requirements for the user's terminal device; on the other hand, it can display virtual objects with inner and outer layers of virtual models, making the virtual objects visually exhibit a two-layer effect, thus enhancing the artistic effect of the virtual model.
[0257] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0258] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0259] Program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing devices can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0260] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this disclosure and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0261] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
Claims
1. A virtual model rendering method, characterized in that, The method includes: Obtain the inner layer normal map, and sample the inner layer normal map to obtain the inner layer normal information; Obtain the inner layer texture map, and sample the inner layer texture map according to the inner layer normal information to obtain the inner layer texture information; Candidate virtual model inner layer information is generated based on the inner layer normal information and the inner layer texture information, and the inner layer region corresponds to the candidate virtual model inner layer information; the inner layer normal information and the virtual camera orientation information are multiplied by a dot product to obtain a dot product result, which is used to indicate the orientation difference between the virtual camera orientation information and the inner layer normal information; the display portion and the non-display portion of the inner layer region are determined based on the dot product result, and the virtual model inner layer information is determined based on the display portion and the non-display portion; wherein, the candidate virtual model inner layer information is used to display in the display portion, and a preset color is displayed in the non-display portion; Obtain the outer layer normal map, and sample the outer layer normal map to obtain the outer layer normal information; Obtain the outer environment map, and sample the outer environment map according to the outer normal information to obtain the outer environment information; The outer layer information of the virtual model is generated based on the outer layer normal information and the outer layer environment information; The virtual model to be rendered is rendered and displayed based on the inner layer information and the outer layer information of the virtual model.
2. The method according to claim 1, characterized in that, The step of sampling the inner layer normal map to obtain inner layer normal information includes: The first candidate inner layer normal information is obtained by sampling the inner layer normal map; The information of the first candidate inner normal is transformed from tangent space to world space to obtain the information of the second candidate inner normal. The inner normal information is obtained by converting the second candidate inner normal information from world space to camera space.
3. The method according to claim 1, characterized in that, The step of sampling the inner layer texture map based on the inner layer normal information to obtain the inner layer texture information includes: Candidate inner layer texture information is obtained by sampling the inner layer texture map based on the inner layer normal information; The candidate inner layer texture information is obtained by performing edge blurring processing on the inner layer texture information.
4. The method according to claim 3, characterized in that, The step of performing edge blurring processing on the candidate inner layer texture information to obtain the inner layer texture information includes: Create an edge blur map; wherein the edge blur map gradually changes from a first preset color to a second preset color from the center to the edge, the portion of the first preset color is used for display using the candidate inner layer texture information, and the portion of the second preset color is filled with a preset color; The candidate inner layer texture information is obtained by performing edge blurring processing on the edge blur map.
5. The method according to claim 1, characterized in that, The virtual model includes multiple vertices connected by vertex lines. Determining the display portion and the non-display portion of the inner region based on the dot product result includes: Obtain the dot product results corresponding to multiple vertices in the virtual model; Vertices whose dot product result is greater than or equal to a preset threshold are identified as target vertices; The display portion of the inner region is determined based on the target vertex and the vertex connections between the target vertices; The portion of the inner layer region excluding the display portion is defined as the non-display portion of the inner layer region.
6. The method according to claim 5, characterized in that, The method further includes: In response to a rotation control operation on the virtual model, the virtual model is controlled to rotate; When the virtual model rotates, the display portion is switched between the display portion and the non-display portion.
7. The method according to claim 1, characterized in that, The step of sampling the outer environment map based on the outer normal information to obtain the outer environment information includes: Candidate outer environment information is obtained by sampling the outer environment map based on the outer normal information; The outer layer environment information is obtained based on the candidate outer layer environment information and the inner and outer layer staining information; The inner and outer layer staining information is used to overlay color onto the candidate outer layer environment information.
8. The method according to claim 7, characterized in that, The step of obtaining the outer layer environment information based on the candidate outer layer environment information and the inner and outer layer staining information includes: Create a coloring map; wherein, the first hollow processing map gradually changes from a first preset color to a second preset color from the center to the edge, the portion of the first preset color is filled with the coloring color, and the portion of the second preset color is filled with the preset color, and the coloring map is used to indicate the coloring information of the inner and outer layers; The candidate outer environment information is obtained by staining the staining map.
9. The method according to claim 1, characterized in that, The step of generating virtual model outer layer information based on the outer layer normal information and the outer layer environment information includes: Generate candidate virtual model outer layer information based on the outer layer normal information and the outer layer environment information; The outer layer information of the candidate virtual model is obtained by hollowing out the outer layer information.
10. The method according to claim 9, characterized in that, The step of hollowing out the outer layer information of the candidate virtual model to obtain the outer layer information of the virtual model includes: Create a first hollow processing image; wherein, the first hollow processing image gradually changes from a first preset color to a second preset color from the center to the edge, the part of the first preset color is filled with black, and the part of the second preset color is displayed using the outer layer information of the candidate virtual model; The first hollow image is inverted to obtain the second hollow image; The first hollow processing image and the second hollow processing image are superimposed to obtain the target hollow processing image; The outer layer information of the virtual model is obtained by hollowing out the outer layer information of the candidate virtual model through the target hollow processing diagram.
11. The method according to claim 10, characterized in that, The target hollow processing diagram includes multiple locations. The rendering of the virtual model to be rendered based on the inner layer information and the outer layer information of the virtual model includes: Obtain the first Fresnel value and the second Fresnel value corresponding to the position; wherein, the first Fresnel value is obtained according to the target hollow processing diagram, and the second Fresnel value is obtained according to the outer layer information of the virtual model; The larger of the first Fresnel value and the second Fresnel value corresponding to the location is determined as the transparency information of the location; The virtual model to be rendered is rendered based on the inner layer information of the virtual model, the outer layer information of the virtual model, and the transparency information of multiple positions.
12. The method according to claim 10, characterized in that, The candidate virtual model outer layer information has outer layer attributes, and the method further includes: The outer layer attributes are adjusted; wherein, the outer layer attributes include one or more of the following: brightness attribute, sharpness attribute, and grayscale attribute.
13. A virtual model rendering device, characterized in that, The device includes: The inner layer normal map acquisition module is used to acquire the inner layer normal map and sample the inner layer normal map to obtain inner layer normal information. The inner texture map acquisition module is used to acquire the inner texture map and sample the inner texture map according to the inner normal information to obtain the inner texture information; An object inner layer information generation module is used to generate candidate virtual model inner layer information based on the inner layer normal information and the inner layer texture information, wherein the inner layer region corresponds to the candidate virtual model inner layer information; perform a dot product between the inner layer normal information and the orientation information of the virtual camera to obtain a dot product result, the dot product result being used to indicate the orientation difference between the orientation information of the virtual camera and the inner layer normal information; determine the display portion and the non-display portion of the inner layer region based on the dot product result, and determine the virtual model inner layer information based on the display portion and the non-display portion; wherein, the candidate virtual model inner layer information is used to display in the display portion, and a preset color is displayed in the non-display portion; The outer normal map acquisition module is used to acquire the outer normal map and sample the outer normal map to obtain outer normal information; The outer environment map acquisition module is used to acquire the outer environment map and sample the outer environment map according to the outer normal information to obtain the outer environment information; An object outer layer information generation module is used to generate virtual model outer layer information based on the outer layer normal information and the outer layer environment information; The virtual model rendering module is used to render and display the virtual model to be rendered based on the inner layer information and the outer layer information of the virtual model.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 12.
15. An electronic device, characterized in that, include: One or more processors; as well as A memory for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the method as described in any one of claims 1 to 12.
Citation Information
Patent Citations
Crystal stone model rendering method and device, electronic equipment and storage medium
CN111899325A
Display control method and device in game
CN114307133A