Model rendering method and device, electronic equipment and computer readable storage medium

By obtaining and processing the spatial coordinates of the model in the rendering technology, calculating the light transmittance and rendering, the problems of low rendering efficiency or overhead in the existing technology are solved, and efficient light transmission effect is achieved.

CN119399350APending Publication Date: 2025-02-07NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411449903.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

When simulating the light transmission effect, the rendering efficiency is low or the rendering overhead is large, and it cannot effectively solve the light transmission phenomenon of cloud models, cotton models and jade models.

Method used

By obtaining the spatial coordinates of the model to be rendered in the target coordinate space, performing normalization processing, determining the component coordinate value of the normalized spatial coordinate in the target direction, calculating the thickness value based on the component coordinate value, and then determining the light transmittance, and Render based on light transmittance to achieve light transmission effect.

Benefits of technology

There is no need to make additional maps, improve rendering efficiency, save rendering overhead, and achieve light transmission effect. It is suitable for cloud models, cotton models and jade models, etc.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119399350A_ABST
    Figure CN119399350A_ABST
Patent Text Reader

Abstract

The invention discloses a model rendering method and device, electronic equipment and a computer readable storage medium. According to the embodiment of the invention, space coordinates of a to-be-rendered model in a target coordinate space are obtained; performing normalization processing on the space coordinates to obtain normalized space coordinates; determining a component coordinate value of the normalized space coordinate in a target direction, wherein the target direction comprises at least one of an irradiation direction of a light source to the to-be-rendered model and an observation direction of the to-be-rendered model; determining a thickness value of the to-be-rendered model in the target direction according to the component coordinate values; according to the thickness value, the light transmittance of the to-be-rendered model is determined, and the to-be-rendered model is rendered based on the light transmittance, so that the rendering efficiency can be improved, and the rendering overhead can be saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of rendering technology, and in particular to a model rendering method, device, electronic device and computer-readable storage medium. Background Art

[0002] When making cloud models, cotton models and jade models, it is necessary to reflect the phenomenon of light transmission in these models in order to achieve a transparent visual effect.

[0003] There are two main methods for simulating the effect of light transmission. One is to make the thickness map required by the model and then sample the thickness map. However, this method requires making a thickness map and has low rendering efficiency. The other method is to use two rendering passes, which results in high rendering overhead. Therefore, the current methods for simulating light transmission have the problems of low rendering efficiency or high rendering overhead. Summary of the invention

[0004] The embodiments of the present application provide a model rendering method, device, electronic device and computer-readable storage medium, which can improve rendering efficiency and save rendering overhead without the need for additional texture production.

[0005] In a first aspect, an embodiment of the present application provides a model rendering method, the method comprising:

[0006] Get the spatial coordinates of the model to be rendered in the target coordinate space;

[0007] Normalizing the above space coordinates to obtain normalized space coordinates;

[0008] Determine the component coordinate value of the normalized space coordinate in the target direction, where the target direction includes at least one of the irradiation direction of the light source to the model to be rendered and the observation direction of the model to be rendered;

[0009] Determine the thickness value of the model to be rendered in the target direction according to the component coordinate values;

[0010] According to the thickness value, the transmittance of the model to be rendered is determined, and the model to be rendered is rendered based on the transmittance.

[0011] In a second aspect, an embodiment of the present application further provides a model rendering device, the device comprising:

[0012] A coordinate acquisition module is used to obtain the spatial coordinates of the model to be rendered in the target coordinate space;

[0013] A coordinate processing module, used for normalizing the above-mentioned space coordinates to obtain normalized space coordinates;

[0014] A coordinate determination module, used to determine the component coordinate value of the normalized space coordinate in a target direction, wherein the target direction includes at least one of an irradiation direction of the light source to the model to be rendered and an observation direction of the model to be rendered;

[0015] A thickness determination module, used to determine the thickness value of the model to be rendered in the target direction according to the component coordinate values;

[0016] The model rendering module is used to determine the light transmittance of the model to be rendered according to the thickness value, and render the model to be rendered based on the light transmittance.

[0017] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory storing a plurality of instructions; the above-mentioned processor loads instructions from the above-mentioned memory to execute any one of the model rendering methods provided in the embodiments of the present application.

[0018] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for loading by a processor to execute any model rendering method provided in an embodiment of the present application.

[0019] In an embodiment of the present application, the spatial coordinates of the model to be rendered in the target coordinate space are obtained, and the spatial coordinates are normalized to obtain normalized spatial coordinates; the component coordinate values ​​of the normalized spatial coordinates in the target direction are determined, and the target direction includes at least one of the irradiation direction of the light source to the above-mentioned model to be rendered and the observation direction of the above-mentioned model to be rendered, and the thickness value of the model to be rendered in the target direction is determined according to the component coordinate values, and the transmittance of the model to be rendered is determined according to the thickness value, and the model to be rendered is rendered based on the transmittance, so as to determine the transmittance of the model to be rendered according to the thickness value of the model to be rendered in the target direction, so that the model obtained after rendering the model to be rendered based on the transmittance has a light transmission effect, and there is no need to make a thickness map, thereby improving the rendering efficiency and requiring no additional rendering overhead. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 This is a flow chart of an embodiment of the model rendering method provided in the embodiment of the present application;

[0022] Figure 2is a schematic diagram of a bounding box provided in an embodiment of the present application;

[0023] Figure 3 is a schematic diagram of the thickness provided in the embodiments of the present application;

[0024] Figure 4 is a schematic diagram of a rendered model provided in an embodiment of the present application;

[0025] Figure 5 is another schematic diagram of a rendered model provided in an embodiment of the present application;

[0026] Figure 6 is another schematic diagram of a rendered model provided in an embodiment of the present application;

[0027] Figure 7 is another embodiment flow chart of the model rendering method provided in the embodiments of the present application;

[0028] Figure 8 is a schematic diagram of a node for implementing a model rendering method provided in an embodiment of the present application;

[0029] Fig. 9 It is a structural schematic diagram of a model rendering device provided in an embodiment of the present application;

[0030] Fig.10 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0032] Before explaining the embodiments of the present application in detail, some terms involved in the embodiments of the present application are first explained.

[0033] Among them, in the description of the embodiments of the present application, the terms "first", "second", etc. may be used in this article to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0034] The embodiments of the present application provide a model rendering method, device, electronic device and computer-readable storage medium. Specifically, the model rendering method of the embodiments of the present application can be executed by an electronic device, wherein the electronic device can be a terminal or a server.

[0035] The terminal can be a terminal device such as a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC), a personal digital assistant (PDA), etc. The terminal can also include a client, which can be a game application client, a browser client carrying a game program, or an instant messaging client, etc.

[0036] The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), as well as big data and artificial intelligence platforms.

[0037] The following is a detailed description of the embodiments in conjunction with the accompanying drawings. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments. Although the logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different from that shown in the accompanying drawings.

[0038] In this embodiment, a terminal is used as an example for illustration. This embodiment provides a model rendering method, such as Figure 1 As shown, the specific process of the model rendering method can be as follows:

[0039] 101. Obtain the spatial coordinates of the model to be rendered in the target coordinate space.

[0040] Among them, the model to be rendered refers to the geometric description of the virtual object, and the type of the virtual object can be set according to the actual situation. For example, the virtual object can be a virtual animal or a virtual cloud, which is not limited in the embodiment of the present application.

[0041] The target coordinate space refers to a three-dimensional geometric space where the model to be rendered is located. Its type can be set according to actual conditions. For example, the target coordinate space can be one of the world coordinate space or model coordinate space of the model to be rendered. The embodiment of the present application does not limit this.

[0042] When the target coordinate space is a world coordinate space, the spatial coordinates of the model to be rendered in the target coordinate space can be called the world coordinates of the model to be rendered. When the target coordinate space is a model coordinate space, the spatial coordinates of the model to be rendered in the target coordinate space can be called the model coordinates of the model to be rendered.

[0043] The terminal may obtain the spatial coordinates of the model to be rendered in the target coordinate space upon receiving a rendering instruction of the model to be rendered sent by other devices, or the terminal may also obtain the spatial coordinates of the model to be rendered in the target coordinate space in response to a trigger operation of the user.

[0044] The manner in which the terminal obtains the spatial coordinates of the model to be rendered in the target coordinate space can be set according to actual conditions, and the embodiments of the present application are not limited thereto.

[0045] 102. Normalize the spatial coordinates to obtain normalized spatial coordinates.

[0046] Among them, the method of normalizing the spatial coordinates can be set according to actual conditions, and the embodiment of the present application is not limited here.

[0047] For example, the process of normalizing the spatial coordinates to obtain the normalized spatial coordinates can be:

[0048] Determine a first difference between the maximum value and the minimum value corresponding to each component coordinate in the spatial coordinate;

[0049] Subtract the minimum value corresponding to each component coordinate from each component coordinate in the spatial coordinate to obtain a second difference value;

[0050] The second difference value corresponding to each component coordinate in the spatial coordinate is divided by the first difference value corresponding to each component coordinate to obtain a normalized spatial coordinate.

[0051] Among them, the component coordinates refer to the coordinates of the spatial coordinates on a certain coordinate axis. For example, if the spatial coordinates are (x11, y11, z11), the component coordinates can be the coordinates x11 on the x-axis, y11 on the y-axis, and z11 on the z-axis. The maximum value corresponding to each component coordinate refers to the maximum value of the spatial coordinate on a certain coordinate axis, and the minimum value corresponding to each component coordinate refers to the minimum value of the spatial coordinate on a certain coordinate axis. For example, the spatial coordinates include (x11, y11, z11), (x12, y12, z12) and (x13, y13, z13), among which, on the x-axis, x13 is the largest and x11 is the smallest. The maximum value corresponding to the component coordinates on the x-axis is x13, the minimum value is x11, and the first difference is (x13- x11), on the y-axis, y13 is the largest and y11 is the smallest, the maximum value corresponding to the component coordinate on the y-axis is y13, the minimum value is y11, and the first difference is (y13-y11). On the z-axis, z13 is the largest and z11 is the smallest, the maximum value corresponding to the component coordinate on the z-axis is z13, the minimum value is z11, and the first difference is (z13-z11). For x11, the second difference is (x11-x11), and for x12, the second difference is (x12-x11).

[0052] In an embodiment of the present application, a first difference between the maximum value and the minimum value corresponding to each component coordinate in the spatial coordinate is determined, the minimum value corresponding to each component coordinate in the spatial coordinate is subtracted from the minimum value to obtain a second difference, and the second difference corresponding to each component coordinate in the spatial coordinate is divided by the first difference corresponding to each component coordinate to obtain a normalized spatial coordinate, thereby achieving normalization processing of the spatial coordinates.

[0053] Alternatively, the process of normalizing the spatial coordinates to obtain the normalized spatial coordinates may also be:

[0054] Get the bounding box parameters of the model to be rendered;

[0055] According to the bounding box parameters, the space coordinates are normalized to obtain normalized space coordinates.

[0056] The bounding box of the model to be rendered refers to a geometric body that approximately replaces the model to be rendered. The bounding box parameters of the model to be rendered refer to parameters used to describe the bounding box of the model to be rendered. For example, the bounding box parameters can be at least one of the bounding box size and the spatial coordinates of the bounding box in the target coordinate space, which is not limited in the embodiments of the present application.

[0057] In an embodiment of the present application, the bounding box parameters of the model to be rendered are obtained, and the spatial coordinates are normalized according to the bounding box parameters to obtain normalized spatial coordinates, so that the spatial coordinates of the model to be rendered are normalized with the center of the bounding box as the origin, so that the model rendered by the thickness value determined according to the normalized coordinates of the model to be rendered has a better light transmission effect.

[0058] In some embodiments, when the center of the target coordinate space is the center of the model to be rendered and the bounding box parameters are the bounding box sizes of the bounding box on each coordinate axis, the space coordinates are normalized according to the bounding box parameters to obtain the normalized space coordinates as follows:

[0059] Divide the spatial coordinates by the bounding box size of the bounding box on each coordinate axis to obtain the normalized spatial coordinates.

[0060] For example, the spatial coordinates are (x11, y11, z11), and the size of the bounding box on the x-axis is s x , the bounding box size on the y axis is s y , the bounding box size on the z-axis is s z , then the normalized spatial coordinates are (x11 / s x ,y11 / s y , z11 / s z ).

[0061] In some embodiments, the space coordinates are normalized according to the bounding box parameters to obtain normalized space coordinates, including:

[0062] Get the center coordinates of the model to be rendered in the target coordinate space;

[0063] Determine the change coordinates between the space coordinates and the center coordinates;

[0064] According to the bounding box parameters and the change coordinates, the space coordinates are normalized to obtain normalized space coordinates.

[0065] The center coordinates of the model to be rendered in the target coordinate space refer to the coordinates corresponding to the center of all vertices of the model to be rendered in the target coordinate space. Since the center coordinates of the model to be rendered in the target coordinate space are not necessarily the origin of the coordinate system corresponding to the target coordinate space, the center coordinates are subtracted from the space coordinates to obtain the changed coordinates.

[0066] After obtaining the changed coordinates, if the bounding box parameters are the spatial coordinates of the bounding box in the target coordinate space, first determine the bounding box size based on the spatial coordinates of the bounding box in the target coordinate space, and then divide the changed coordinates by the bounding box size. If the bounding box parameters are the bounding box size, then directly divide the changed coordinates by the bounding box size.

[0067] For example, the spatial coordinates are (x11, y11, z11), the center coordinates are (x0, y0, z0), and the bounding box size on the x-axis is s x , the bounding box size on the y axis is s y , the bounding box size on the z-axis is s z , then the normalized spatial coordinate is ((x11-x0) / s x , (y11-y0) / s y , (z11-z0) / s z ).

[0068] It is understandable that the center coordinates of the model to be rendered in the target coordinate space can be directly read, or the bounding box parameters can include the spatial coordinates of the bounding box in the target coordinate space, and the center coordinates of the model to be rendered in the target coordinate space can be determined based on the spatial coordinates of the bounding box in the target coordinate space. Specifically, the maximum value and the minimum value of the spatial coordinates of the bounding box in the target coordinate space can be added, and the addition result can be divided by 2 to obtain the center coordinates of the model to be rendered in the target coordinate space.

[0069] For example, the center coordinates are (x0, y0, z0), and the spatial coordinates of the bounding box in the target coordinate space include (x21, y21, z21), (x22, y22, z22) and (x23, y23, z23). Among x21, x22 and x23, x21 is the minimum value and x23 is the maximum value, then x0 = (x23 + x21) / 2, among y21, y22 and y23, y21 is the minimum value and y23 is the maximum value, then y0 = (y23 + y21) / 2, among z21, z22 and z23, z21 is the minimum value and z23 is the maximum value, then x0 = (z23 + z21) / 2.

[0070] In an embodiment of the present application, the center coordinates of the model to be rendered in the target coordinate space are obtained, the change coordinates between the spatial coordinates and the center coordinates are determined, and the spatial coordinates are normalized according to the bounding box parameters and the change coordinates to obtain normalized spatial coordinates. This ensures that the normalization effect of the spatial coordinates can be achieved even if the center coordinates of the model to be rendered in the target coordinate space are not the origin of the coordinate system corresponding to the target coordinate space.

[0071] In some embodiments, when the target coordinate space is the world coordinate space and the spatial coordinates are normalized according to the bounding box parameters, since after the model to be rendered is rotated, in the world coordinate space, the edges of the bounding box are not parallel to the coordinate axes of the world coordinate system. Therefore, if the spatial coordinates are normalized according to the bounding box parameters in the world coordinate space, the thickness value determined according to the normalized spatial coordinates will be inaccurate.

[0072] For example, Figure 2 As shown, in the model coordinate space, the model to be rendered is rotated. After the rotation, the edges of the bounding box of the model to be rendered are still parallel to the coordinate axes of the model coordinate system. However, in the world coordinate space, the edges of the bounding box of the model to be rendered are not parallel to the coordinate axes of the world coordinate system. If the spatial coordinates are normalized according to the bounding box of the model to be rendered, the thickness value determined according to the normalized spatial coordinates will be inaccurate.

[0073] Therefore, in the embodiment of the present application, when the target coordinate space is the model coordinate space and the space coordinates are normalized according to the bounding box parameters, the accuracy of the thickness value subsequently determined according to the normalized space coordinates can be improved.

[0074] For example, when the target coordinate space is the world coordinate space and the space coordinates are normalized according to the bounding box parameters, the thickness value determined according to the normalized space coordinates can be as follows: Figure 3 As shown in 301, when the target coordinate space is the model coordinate space and the space coordinates are normalized according to the bounding box parameters, the thickness value determined according to the normalized space coordinates can be as follows Figure 3 As shown in 302, from Figure 3 It can be seen that Figure 3 The range of thickness values ​​shown in 302 is larger, which is more conducive to expressing thickness changes.

[0075] 103. Determine component coordinate values ​​of the normalized space coordinates in a target direction, where the target direction includes at least one of an irradiation direction of the light source to the model to be rendered and an observation direction of the model to be rendered.

[0076] The component coordinate value of the normalized space coordinate in the target direction can be understood as the projection value of the normalized space coordinate in the target direction. The irradiation direction of the light source to the model to be rendered can include the incident direction of the light of the model to be rendered and the transmission direction of the light of the model to be rendered.

[0077] The incident direction of the light of the model to be rendered refers to the direction when the light is incident on the model to be rendered. The transmission direction of the light of the model to be rendered refers to the transmission direction of the incident light of the model to be rendered.

[0078] Since the thickness value of the model to be rendered in the direction of light incidence will affect the light that can be incident on the model to be rendered, thereby affecting the transmission effect of the model to be rendered on the light, when the thickness value in the direction of light incidence is different, the light that can be incident on the model to be rendered is also different, and the light transmission effect of the model to be rendered is also different.

[0079] Since the thickness value of the light incident on the model to be rendered in the transmission direction of the model to be rendered will affect the transmission effect of the light incident on the model to be rendered, when the thickness value in the transmission direction of the light is different, the light transmitted from the model to be rendered may also be different, and the transmission effect of the model to be rendered may also be different. Therefore, the component coordinate value of the normalized spatial coordinate in the illumination direction can be determined, and the thickness value subsequently determined based on the component coordinate value in the illumination direction is the thickness value that the light passes through from the incident on the model to be rendered to the transmission.

[0080] Since the user observes the light transmission effect of the model to be rendered from the observation direction of the model to be rendered, the thickness value of the model to be rendered in the observation direction will also affect the light transmission effect of the model to be rendered felt by the user. When the thickness value in the observation direction is different, the light transmission effect of the model to be rendered felt by the user is also different. Therefore, the target direction can be the observation direction.

[0081] Therefore, in an embodiment of the present application, the component coordinate values ​​of the normalized spatial coordinates in the target direction can be determined, so as to determine the thickness value in the target direction based on the component coordinate values ​​in the target direction, and thus the model to be rendered can be rendered based on the thickness value in the target direction, so that the light transmission effect of the rendered model is closer to the actual situation.

[0082] In some embodiments, the process of determining the component coordinate value of the normalized spatial coordinate in the target direction may be:

[0083] Determine the angle between the vector direction corresponding to the normalized space coordinate and the target direction;

[0084] According to the normalized space coordinate and the cosine value of the included angle, the component coordinate value of the normalized space coordinate in the target direction is determined.

[0085] Alternatively, in some embodiments, the target direction is the irradiation direction, and determining the component coordinate value of the normalized space coordinate in the target direction includes:

[0086] Obtain the illumination vector of the model to be rendered in the target coordinate space, where the direction of the illumination vector indicates the illumination direction;

[0087] Perform dot product processing on the normalized space coordinates and the illumination vector to obtain the component coordinate values ​​of the normalized space coordinates in the target direction.

[0088] For example, the normalized space coordinate is P, and the illumination vector is L, then the component coordinate value T1 = Dot(P, L), where dot represents dot product processing.

[0089] In an embodiment of the present application, the illumination direction is indicated by the illumination vector of the model to be rendered in the target coordinate space, and then the normalized space coordinates and the illumination vector are dot-producted to obtain the projection value of the normalized space coordinates in the target direction. The projection value of the normalized space coordinates in the target direction is the component coordinate value of the normalized space coordinates in the target direction, so that the thickness through which the light passes when it is incident and transmitted from the model to be rendered can be determined subsequently based on the coordinate component values.

[0090] Alternatively, in some embodiments, the target direction is the observation direction, and determining the component coordinate values ​​of the normalized space coordinates in the target direction includes:

[0091] Get the camera vector in the target coordinate space. The direction of the camera vector is the orientation of the virtual camera. The orientation of the virtual camera indicates the viewing direction.

[0092] Perform dot product processing on the normalized space coordinates and the camera vector to obtain the component coordinate values ​​of the normalized space coordinates in the target direction.

[0093] The size of the camera vector can be set according to the actual situation, for example, the size of the camera vector can be (0, 0, 1), or the size of the camera vector can be (0, 1, 0), which is not limited in the embodiments of the present application. The direction of the camera vector is the direction of the virtual camera, and the direction of the virtual camera indicates the direction in which the user observes the model to be rendered, that is, the direction of the virtual camera indicates the observation direction.

[0094] After obtaining the camera vector, the terminal performs dot product processing on the normalized space coordinates and the camera vector to obtain the projection value of the normalized space coordinates in the direction of the virtual camera. The projection value of the normalized space coordinates in the direction of the virtual camera is the component coordinate value of the normalized space coordinates in the observation direction.

[0095] For example, the normalized space coordinate is P, and the camera vector is V, then the component coordinate value of the normalized space coordinate in the target direction is T2=Dot(P, V), where dot represents dot product processing.

[0096] In an embodiment of the present application, a camera vector in the target coordinate space is obtained, the direction of the camera vector is the orientation of the virtual camera, the orientation of the virtual camera indicates the observation direction, and the normalized space coordinates and the camera vector are dot-producted to obtain the component coordinate values ​​of the normalized space coordinates in the target direction, so that the thickness value of the model to be rendered in the direction of the virtual camera can be determined based on the component coordinate values.

[0097] 104. Determine the thickness value of the model to be rendered in the target direction according to the component coordinate values.

[0098] Among them, after obtaining the component coordinate value, the terminal can directly determine the component coordinate value as the thickness value of the model to be rendered in the target direction, or, in order to improve the light transmission effect of the model subsequently rendered according to the thickness value, the component coordinate value can be normalized to obtain the thickness value of the model to be rendered in the target direction.

[0099] Specifically, the process of normalizing the component coordinate values ​​to obtain the thickness value of the model to be rendered in the target direction can be:

[0100] The component coordinate value is divided by the first target value and added to the second target value to obtain the thickness value of the model to be rendered in the target direction.

[0101] Among them, the first target value and the second target value can be set according to actual conditions. For example, the first target value can be 1.732 and the second target value can be 0.5. The embodiment of the present application does not limit this.

[0102] 105. Determine the transmittance of the model to be rendered according to the thickness value, and render the model to be rendered based on the transmittance.

[0103] Among them, the method of determining the transmittance of the model to be rendered according to the thickness value can be set according to actual conditions. For example, the transmittance of the model to be rendered can be determined according to the thickness value through the Beer-Lambert law or the Raman scattering method. The embodiment of the present application is not limited here.

[0104] After obtaining the transmittance, the terminal renders the model to be rendered based on the transmittance, and the rendered model has the light transmission effect.

[0105] It can be understood that the application scenario of the rendered model can be set according to actual conditions. For example, the rendered model can be used in a game scene, that is, the rendered model can be a model in a game scene, or the rendered model can also be used in a video scene, that is, the rendered model is a model in a video. The embodiments of the present application are not limited here.

[0106] In an embodiment of the present application, the spatial coordinates of the model to be rendered in the target coordinate space are obtained, and the spatial coordinates are normalized to obtain the normalized spatial coordinates; the component coordinate values ​​of the normalized spatial coordinates in the target direction are determined, and the target direction includes at least one of the irradiation direction of the light source on the model to be rendered and the observation direction of the model to be rendered; according to the component coordinate values, the thickness value of the model to be rendered in the target direction is determined; according to the thickness value, the transmittance of the model to be rendered is determined, and the model to be rendered is rendered based on the transmittance, so as to determine the transmittance of the model to be rendered according to the thickness value of the model to be rendered in the target direction, so that the model obtained after rendering the model to be rendered based on the transmittance has a light transmission effect, and there is no need to make a thickness map, so as to ensure the art asset production workflow, improve the rendering efficiency, and there is no need to obtain the scene depth, so that it is not affected by the distance between the model to be rendered and the virtual camera, which is convenient for art adjustment, and can support opaque models to have a light transmission effect, thereby reducing rendering overhead.

[0107] In some embodiments, the target direction includes an irradiation direction and an observation direction, the thickness value includes a thickness value in the irradiation direction and a thickness value in the observation direction, and the transmittance of the model to be rendered is determined according to the thickness value, including:

[0108] Correcting the thickness value in the observation direction according to the thickness value in the irradiation direction to obtain a corrected thickness value;

[0109] According to the corrected thickness value, the transmittance of the model to be rendered is determined.

[0110] Among them, since when the target direction is the direction of the virtual camera, only the thickness value of a certain axis is considered, at this time, the light transmission effect of the rendered model on the semi-light-facing surface will be distorted. Therefore, in an embodiment of the present application, the thickness value in the observation direction is corrected according to the thickness value in the irradiation direction to obtain the corrected thickness value. According to the corrected thickness value, the transmittance of the model to be rendered is determined, so that the light transmission effect of the model rendered according to the transmittance is closer to the actual situation, thereby increasing the depth details perceived by the user.

[0111] In some embodiments, the thickness value in the observation direction is corrected according to the thickness value in the irradiation direction, and the method for obtaining the corrected thickness value can be set according to actual conditions. For example, the thickness value in the observation direction is corrected according to the thickness value in the irradiation direction, and the process for obtaining the corrected thickness value can be:

[0112] The thickness value in the irradiation direction and the thickness value in the observation direction are weightedly added to achieve correction processing of the thickness value in the observation direction to obtain a corrected thickness value.

[0113] Alternatively, the thickness value in the observation direction is corrected according to the thickness value in the irradiation direction to obtain the corrected thickness value. The process may also be:

[0114] Get the preset interpolation parameters;

[0115] According to preset interpolation parameters, interpolation processing is performed on the thickness value in the irradiation direction and the thickness value in the observation direction to achieve correction processing of the thickness value in the observation direction and obtain a corrected thickness value.

[0116] The preset interpolation parameters are pre-set parameters, which are adjusted by the artist and can be used to control the performance of light transmission effects. The interpolation processing method can be set according to actual conditions, such as bilinear interpolation or lerp interpolation, which is not limited in the present embodiment of the application.

[0117] When the interpolation process is lerp interpolation, the thickness value in the irradiation direction and the thickness value in the observation direction can be substituted into the following formula for interpolation to obtain the corrected thickness value:

[0118] T=lerp(Dot(P,V),Dot(P,L),k)

[0119] Among them, T represents the corrected thickness value, P represents the normalized space coordinate, V represents the camera vector, L represents the illumination vector, and k represents the preset interpolation parameter.

[0120] In an embodiment of the present application, preset interpolation parameters are obtained, and the thickness value in the irradiation direction and the thickness value in the observation direction are interpolated according to the preset interpolation parameters to achieve correction of the thickness value in the observation direction and obtain a corrected thickness value, so that the transmittance of the model to be rendered is determined according to the corrected thickness value, and the light transmission effect of the model rendered according to the transmittance is closer to the actual situation.

[0121] For example, the transmittance is determined according to the thickness value in the irradiation direction, and the model to be rendered can be rendered according to the transmittance. Figure 4 As shown, the transmittance is determined according to the thickness value in the viewing direction, and the model to be rendered is rendered according to the transmittance to obtain the model as shown in FIG. Figure 5 As shown, according to the corrected thickness value, the transmittance of the model to be rendered is determined, and the model to be rendered is rendered according to the transmittance. Figure 6 shown.

[0122] From the above content, it can be seen that in an embodiment of the present application, the spatial coordinates of the model to be rendered in the target coordinate space are obtained, and the spatial coordinates are normalized to obtain normalized spatial coordinates; the component coordinate values ​​of the normalized spatial coordinates in the target direction are determined, and the target direction includes at least one of the irradiation direction of the light source to the model to be rendered and the observation direction of the model to be rendered, and the thickness value of the model to be rendered in the target direction is determined according to the component coordinate values, and the transmittance of the model to be rendered is determined according to the thickness value, and the model to be rendered is rendered based on the transmittance, so as to determine the transmittance of the model to be rendered according to the thickness value of the model to be rendered in the target direction, so that the model obtained after rendering the model to be rendered based on the transmittance has a light transmission effect, and there is no need to make a thickness map, thereby improving rendering efficiency and requiring no additional rendering overhead.

[0123] According to the following Figure 7 , the model rendering method provided by the present application is further described. In this embodiment, the illumination direction of the light source to the model to be rendered and the observation direction of the model to be rendered are taken as the target direction, and the model coordinate space is taken as the target coordinate space for example.

[0124] 701. Obtain the spatial coordinates of the model to be rendered in the model coordinate space and obtain the center coordinates of the model to be rendered in the model coordinate space.

[0125] 702. Determine the change coordinates between the spatial coordinates and the center coordinates, and normalize the spatial coordinates according to the bounding box size and the change coordinates to obtain normalized spatial coordinates.

[0126] 703. Obtain the illumination vector of the model to be rendered in the model coordinate space, and perform dot product processing on the normalized space coordinates and the illumination vector to obtain component coordinate values ​​of the normalized space coordinates in the illumination direction.

[0127] The direction of the light vector indicates the illumination direction.

[0128] 704. Normalize the component coordinate values ​​in the irradiation direction to obtain the thickness value of the model to be rendered in the irradiation direction.

[0129] 705. Obtain a camera vector in the target coordinate space, perform dot product processing on the normalized space coordinates and the camera vector, and obtain component coordinate values ​​of the normalized space coordinates in the observation direction.

[0130] The direction of the camera vector is the orientation of the virtual camera, and the orientation of the virtual camera indicates the viewing direction.

[0131] 706. Normalize the component coordinate values ​​in the viewing direction to obtain a thickness value of the model to be rendered in the viewing direction.

[0132] 707. Correct the thickness value in the observation direction according to the thickness value in the irradiation direction to obtain a corrected thickness value, and determine the light transmittance of the model to be rendered according to the corrected thickness value.

[0133] 708. Render the model to be rendered according to the light transmittance of the model to be rendered.

[0134] This embodiment can be implemented through Unreal Engine, and the computing nodes in Unreal Engine can be as follows: Figure 8 As shown, the world coordinates of the model to be rendered are obtained through the "Absolute World Position" node, the world coordinates are converted into the spatial coordinates of the model to be rendered in the model coordinate space through the "TransformPosition" node, the minimum value, maximum value and size of the spatial coordinates of the bounding box of the model to be rendered are obtained through the "ObjectLocalBounds" node, the minimum value and maximum value of the spatial coordinates of the bounding box are added together through the "Add" node to obtain the addition result, the addition result is divided by 2 through the "Divide" node to obtain the center coordinates of the model to be rendered in the model coordinate space, the spatial coordinates of the model to be rendered in the model coordinate space are subtracted from the center coordinates through the "Subtract" node to obtain the changed coordinates, and the changed coordinates are divided by the size of the bounding box through the "Divide" node to obtain the normalized spatial coordinates.

[0135] The light vector in the world coordinate space is obtained through the "SkyAtmosphereLightDirection[0]" node. The light source vector in the world coordinate space is converted into the light vector in the model coordinate space through the "TransformVector" node. The normalized space coordinate and the light vector are dot-producted through the "Dot" node to obtain the component coordinate values ​​of the normalized space coordinate in the illumination direction. The component coordinate values ​​in the illumination direction are normalized through the "Divide" node and the "Add" node to obtain the thickness value in the illumination direction.

[0136] The camera vector in the camera coordinate space is obtained through the "0,0,1" node. The camera vector in the world coordinate space is converted into the camera vector in the model coordinate space through the "TransformVector" node. The normalized space coordinates and the camera vector are dot-producted through the "Dot" node to obtain the component coordinate values ​​of the normalized space coordinates in the observation direction. The component coordinate values ​​in the observation direction are normalized through the "Divide" node and the "Add" node to obtain the thickness value in the observation direction.

[0137] Through the "lerp" node, according to the preset interpolation parameters (the preset interpolation parameters are Figure 8The thickness values ​​in the irradiation direction and the thickness values ​​in the observation direction are interpolated to obtain the corrected thickness values. The corrected thickness values ​​are converted into shading results through the "vertexinterpolator" node. The shading results, the surface colors output by the "SurfaceColor" node, and the depth colors output by the "DeepColor" node are interpolated through the "lerp" node to obtain the interpolated colors. The interpolated colors and other data are merged through the "merged" node, and the model to be rendered is rendered according to the merged data.

[0138] The nodes before the "vertexinterpolator" node are nodes in the vertex shader, which are automatically interpolated by the pixel shader and have very low overhead.

[0139] The specific implementation method and corresponding beneficial effects of this embodiment can be specifically referred to the above-mentioned model rendering method embodiment, and this embodiment is not limited here.

[0140] In order to better implement the above method, an embodiment of the present application also provides a model rendering device, which can be specifically integrated into an electronic device, such as a computer device, which can be a terminal, a server, or other device.

[0141] Among them, the terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, a personal computer and other devices; the server can be a single server or a server cluster composed of multiple servers.

[0142] For example, in this embodiment, the method of the embodiment of the present application is described in detail by taking the model rendering device specifically integrated in the terminal as an example. This embodiment provides a model rendering device, such as Fig. 9 As shown, the model rendering device may include:

[0143] The coordinate acquisition module 901 is used to acquire the spatial coordinates of the model to be rendered in the target coordinate space.

[0144] The coordinate processing module 902 is used to perform normalization processing on the space coordinates to obtain normalized space coordinates.

[0145] The coordinate determination module 903 is used to determine the component coordinate value of the normalized space coordinate in the target direction, where the target direction includes at least one of the irradiation direction of the light source to the model to be rendered and the observation direction of the model to be rendered.

[0146] The thickness determination module 904 is used to determine the thickness value of the model to be rendered in the target direction according to the component coordinate values.

[0147] The model rendering module 905 is used to determine the transmittance of the model to be rendered according to the thickness value, and render the model to be rendered based on the transmittance.

[0148] In some embodiments, the coordinate processing module 902 is specifically used to perform:

[0149] Get the bounding box parameters of the model to be rendered;

[0150] According to the bounding box parameters, the space coordinates are normalized to obtain normalized space coordinates.

[0151] In some embodiments, the coordinate processing module 902 is specifically used to perform:

[0152] Get the center coordinates of the model to be rendered in the target coordinate space;

[0153] Determine the change coordinates between the space coordinates and the center coordinates;

[0154] According to the bounding box parameters and the change coordinates, the space coordinates are normalized to obtain normalized space coordinates.

[0155] In some embodiments, the target direction is the irradiation direction, and the coordinate determination module 903 is specifically used to:

[0156] Obtain the illumination vector of the model to be rendered in the target coordinate space, where the direction of the illumination vector indicates the illumination direction;

[0157] Perform dot product processing on the normalized space coordinates and the illumination vector to obtain the component coordinate values ​​of the normalized space coordinates in the target direction.

[0158] In some embodiments, the target direction is the viewing direction, and the coordinate determination module 903 is specifically used to:

[0159] Get the camera vector in the target coordinate space. The direction of the camera vector is the orientation of the virtual camera. The orientation of the virtual camera indicates the viewing direction.

[0160] Perform dot product processing on the normalized space coordinates and the camera vector to obtain the component coordinate values ​​of the normalized space coordinates in the target direction.

[0161] In some embodiments, the thickness determination module 904 is specifically configured to:

[0162] The component coordinate values ​​are normalized to obtain the thickness value of the model to be rendered in the target direction.

[0163] In some embodiments, the target direction includes an irradiation direction and an observation direction, the thickness value includes a thickness value in the irradiation direction and a thickness value in the observation direction, and the model rendering module 905 is specifically used to perform:

[0164] Correcting the thickness value in the observation direction according to the thickness value in the irradiation direction to obtain a corrected thickness value;

[0165] According to the corrected thickness value, the transmittance of the model to be rendered is determined.

[0166] In some embodiments, the model rendering module 905 is specifically used to perform:

[0167] Get the preset interpolation parameters;

[0168] According to preset interpolation parameters, interpolation processing is performed on the thickness value in the irradiation direction and the thickness value in the observation direction to achieve correction processing of the thickness value in the observation direction and obtain a corrected thickness value.

[0169] In some embodiments, the target coordinate space is a model coordinate space.

[0170] In specific implementation, the above modules can be implemented as independent entities, or can be arbitrarily combined and implemented as the same or several entities. The specific implementation methods and corresponding beneficial effects of the above modules can be found in the previous method embodiments, which will not be repeated here.

[0171] Accordingly, an embodiment of the present application further provides an electronic device, which may be a terminal, and the terminal may be a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC), a personal digital assistant (PDA), or other terminal devices. Fig.10 As shown, Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 1000 includes a processor 1001 having one or more processing cores, a memory 1002 having one or more computer-readable storage media, and a computer program stored in the memory 1002 and executable on the processor. The processor 1001 is electrically connected to the memory 1002. It will be understood by those skilled in the art that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0172] Processor 1001 is the control center of electronic device 1000. It uses various interfaces and lines to connect various parts of the entire electronic device 1000, executes various functions of electronic device 1000 and processes data by running or loading software programs and / or modules stored in memory 1002, and calling data stored in memory 1002, thereby monitoring electronic device 1000 as a whole.

[0173] In the embodiment of the present application, the processor 1001 in the electronic device 1000 will load instructions corresponding to the processes of one or more application programs into the memory 1002 according to the following steps, and the processor 1001 will run the application programs stored in the memory 1002, thereby realizing various functions, such as:

[0174] Get the spatial coordinates of the model to be rendered in the target coordinate space;

[0175] Normalizing the spatial coordinates to obtain normalized spatial coordinates;

[0176] Determine a component coordinate value of the normalized space coordinate in a target direction, where the target direction includes at least one of an irradiation direction of the light source to the model to be rendered and an observation direction of the model to be rendered;

[0177] According to the component coordinate values, determine the thickness value of the model to be rendered in the target direction;

[0178] The transmittance of the model to be rendered is determined according to the thickness value, and the model to be rendered is rendered based on the transmittance.

[0179] The specific implementation methods and corresponding beneficial effects of the above operations can be found in the detailed description of the model rendering method above, which will not be elaborated here.

[0180] Optional, such as Fig.10 As shown, the electronic device 1000 further includes: a touch screen 1003, a radio frequency circuit 1004, an audio circuit 1005, an input unit 1006, and a power supply 1007. The processor 1001 is electrically connected to the touch screen 1003, the radio frequency circuit 1004, the audio circuit 1005, the input unit 1006, and the power supply 1007, respectively. Those skilled in the art can understand that Fig.10 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0181] The touch display screen 1003 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 1003 may include a display panel and a touch panel. Among them, the display panel may be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, and these graphical user interfaces may be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel may be used to collect the user's touch operation on or near it (such as the user using any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 1001, and can receive the command sent by the processor 1001 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 1001 to determine the type of touch event, and then the processor 1001 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 1003 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 1003 can also be used as a part of the input unit 1006 to realize the input function.

[0182] The radio frequency circuit 1004 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other electronic devices through wireless communication, and to send and receive signals with the network device or other electronic devices.

[0183] The audio circuit 1005 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 1005 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 1005 and converted into audio data, and then the audio data is output to the processor 1001 for processing, and then sent to another electronic device through the radio frequency circuit 1004, or the audio data is output to the memory 1002 for further processing. The audio circuit 1005 may also include an earplug jack to provide communication between an external headset and an electronic device.

[0184] The input unit 1006 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0185] The power supply 1007 is used to supply power to various components of the electronic device 1000. Optionally, the power supply 1007 can be logically connected to the processor 1001 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 1007 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0186] although Fig.10 Not shown, the electronic device 1000 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

[0187] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0188] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0189] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of computer programs are stored, and the computer program can be loaded by a processor to execute any model rendering method provided in the embodiment of the present application. For example, the computer program can execute the following steps:

[0190] Get the spatial coordinates of the model to be rendered in the target coordinate space;

[0191] Normalizing the spatial coordinates to obtain normalized spatial coordinates;

[0192] Determine a component coordinate value of the normalized space coordinate in a target direction, where the target direction includes at least one of an irradiation direction of the light source to the model to be rendered and an observation direction of the model to be rendered;

[0193] According to the component coordinate values, determine the thickness value of the model to be rendered in the target direction;

[0194] The transmittance of the model to be rendered is determined according to the thickness value, and the model to be rendered is rendered based on the transmittance.

[0195] The specific implementation methods and corresponding beneficial effects of the above operations can be found in the detailed description of the model rendering method above, which will not be elaborated here.

[0196] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0197] Since the computer program stored in the computer-readable storage medium can execute any one of the model rendering methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the model rendering methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0198] The above is a detailed introduction to a model rendering method, device, electronic device and computer-readable storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A model rendering method, characterized in that: The method comprises: Get the spatial coordinates of the model to be rendered in the target coordinate space; Normalizing the spatial coordinates to obtain normalized spatial coordinates; Determine a component coordinate value of the normalized space coordinate in a target direction, where the target direction includes at least one of an irradiation direction of a light source to the model to be rendered and an observation direction of the model to be rendered; Determining a thickness value of the model to be rendered in the target direction according to the component coordinate values; The transmittance of the model to be rendered is determined according to the thickness value, and the model to be rendered is rendered based on the transmittance.

2. The model rendering method according to claim 1, characterized in that: The normalizing the spatial coordinates to obtain normalized spatial coordinates includes: Obtaining bounding box parameters of the model to be rendered; The spatial coordinates are normalized according to the bounding box parameters to obtain normalized spatial coordinates.

3. The model rendering method according to claim 2, characterized in that: The step of normalizing the spatial coordinates according to the bounding box parameters to obtain normalized spatial coordinates includes: Obtain the center coordinates of the model to be rendered in the target coordinate space; Determining a change coordinate between the spatial coordinate and the central coordinate; The space coordinates are normalized according to the bounding box parameters and the change coordinates to obtain normalized space coordinates.

4. The model rendering method according to claim 1, characterized in that: The target direction is the irradiation direction, and determining the component coordinate value of the normalized space coordinate in the target direction includes: Obtaining an illumination vector of the model to be rendered in the target coordinate space, wherein the direction of the illumination vector indicates the illumination direction; The normalized space coordinate and the illumination vector are subjected to a dot product process to obtain a component coordinate value of the normalized space coordinate in a target direction.

5. The model rendering method according to claim 1, characterized in that: The target direction is the observation direction, and determining the component coordinate value of the normalized space coordinate in the target direction includes: Obtaining a camera vector in the target coordinate space, wherein the direction of the camera vector is the orientation of the virtual camera, and the orientation of the virtual camera indicates the observation direction; The normalized space coordinates and the camera vector are subjected to a dot product process to obtain component coordinate values ​​of the normalized space coordinates in the target direction.

6. The model rendering method according to claim 1, characterized in that: The step of determining the thickness value of the model to be rendered in the target direction according to the component coordinate values ​​includes: The component coordinate values ​​are normalized to obtain a thickness value of the model to be rendered in the target direction.

7. The model rendering method according to claim 1, characterized in that: The target direction includes the irradiation direction and the observation direction, and the thickness value includes a thickness value in the irradiation direction and a thickness value in the observation direction; Determining the light transmittance of the model to be rendered according to the thickness value includes: Correcting the thickness value in the observation direction according to the thickness value in the irradiation direction to obtain a corrected thickness value; The light transmittance of the model to be rendered is determined according to the corrected thickness value.

8. The model rendering method according to claim 7, characterized in that: The step of correcting the thickness value in the observation direction according to the thickness value in the irradiation direction to obtain the corrected thickness value includes: Get the preset interpolation parameters; According to the preset interpolation parameters, interpolation processing is performed on the thickness value in the irradiation direction and the thickness value in the observation direction to achieve correction processing of the thickness value in the observation direction and obtain a corrected thickness value.

9. The model rendering method according to any one of claims 1 to 8, characterized in that: The target coordinate space is the model coordinate space.

10. A model rendering device, characterized in that: The device comprises: A coordinate acquisition module is used to obtain the spatial coordinates of the model to be rendered in the target coordinate space; A coordinate processing module, used for normalizing the spatial coordinates to obtain normalized spatial coordinates; A coordinate determination module, used to determine the component coordinate value of the normalized space coordinate in a target direction, wherein the target direction includes at least one of an irradiation direction of the light source to the model to be rendered and an observation direction of the model to be rendered; A thickness determination module, used to determine the thickness value of the model to be rendered in the target direction according to the component coordinate values; The model rendering module is used to determine the transmittance of the model to be rendered according to the thickness value, and render the model to be rendered based on the transmittance.

11. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the model rendering method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the model rendering method according to any one of claims 1 to 9.