A method, device, equipment and storage medium for generating halo effect

By placing the target model outside the luminous object and calculating the target lighting intensity based on the line of sight of the virtual camera for rendering, the performance consumption and penetration problems in the generation of halo effects in the prior art are solved, and a more efficient and real halo effect presentation is achieved.

CN119784925APending Publication Date: 2025-04-08NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411863751.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

In the prior art, when generating halo effects, the need to stack a large number of transparent faces leads to high performance consumption of GPU, and the problem of halo effects being missed when the direction of the virtual camera changes.

Method used

Place a target model representing the shape of a halo on the outside of the luminous object, determine the intersection segments according to the line of sight of the virtual camera, calculate the preset lighting intensity corresponding to the unit length of the intersection segment, determine the target lighting intensity, and render it to generate a halo effect.

Benefits of technology

This avoids performance consumption problems caused by stacking large numbers of transparent faces, and improves the true reduction of halo effect, preventing halo effect from being penetrated by changes in the direction of the virtual camera.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119784925A_ABST
    Figure CN119784925A_ABST
Patent Text Reader

Abstract

The present application provides a method, device, equipment and storage medium for generating a halo effect, the generating method comprising: placing a target model representing the halo shape outside a luminous object; determining the intersecting line segments between each camera sight line and the target model in the sight line range according to the sight line range of a virtual camera; for each camera sight line, determining the target light intensity corresponding to the intersection point of the camera sight line and the target model according to the line segment length of the intersecting line segment corresponding to the camera sight line and the preset light intensity corresponding to the unit length; rendering the target model according to the target light intensity corresponding to the intersection point of each camera sight line and the target model, and obtaining a target model whose halo effect matches the target light intensity. In this way, the present application makes it possible to present a halo effect without stacking a large number of transparent facets, and will not cause the problem of halo effect being exposed due to the change of the camera direction of the virtual camera.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of model rendering technology, and in particular to a method, device, equipment and storage medium for generating a halo effect. Background Art

[0002] In the production of three-dimensional special effects, it is sometimes necessary to render and generate a halo effect around a luminous object. For example, when the luminous object is a sun model, it may be necessary to render and generate a sun halo around the sun model.

[0003] At present, the conventional practice in the prior art is to create multiple transparent patches and stack them around the luminous object to simulate the halo ring, and control the multiple transparent patches to always face the direction of the virtual camera (the observer's perspective) to follow the virtual camera to move, so as to show a halo effect that always surrounds the luminous object in the camera perspective of the virtual camera. However, on the one hand, when a large number of transparent patches overlap, it will cause the GPU (graphics processing unit) to repeatedly calculate multiple times on each pixel unit in the overlapping part (the number of calculations depends on the number of overlapping patches), resulting in OverDraw (overdrawing refers to the phenomenon of calculating the same pixel multiple times during the rendering process), resulting in uncontrollable performance consumption; on the other hand, when using transparent patches as halo, it is necessary to use the billboard technology (i.e., the technology of controlling the transparent patches to always face the virtual camera and rotate with the virtual camera when the virtual camera rotates). When the billboard technology is used, the transparent patches will always face the virtual camera, so when the virtual camera moves, the transparent patches representing the halo may be interspersed with the luminous object (three-dimensional model) that emits the halo. Summary of the invention

[0004] In view of this, the present application provides a method, device, equipment and storage medium for generating a halo effect, so that the presentation of the halo effect no longer requires stacking a large number of transparent surfaces, and there will be no problem of halo effect blemishes due to changes in the camera direction of the virtual camera, thereby effectively improving the true restoration of the halo effect.

[0005] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings.

[0006] In a first aspect, an embodiment of the present application provides a method for generating a halo effect, the generating method comprising:

[0007] Place a target model representing the shape of the halo outside the luminous object;

[0008] According to the visual range of the virtual camera, determining the intersection line segment between each camera visual line in the visual range and the target model;

[0009] For each camera sight line, determine the target illumination intensity corresponding to the intersection point of the camera sight line and the target model according to the line segment length of the intersecting line segment corresponding to the camera sight line and the preset illumination intensity corresponding to the unit length;

[0010] The target model is rendered according to the target illumination intensity corresponding to the intersection point of each camera sight line and the target model to obtain a target model whose halo effect matches the target illumination intensity.

[0011] In a second aspect, an embodiment of the present application provides a device for generating a halo effect, the device comprising:

[0012] A position adjustment module, used for placing a target model representing a halo shape outside the luminous object;

[0013] A sight line determination module, used to determine, according to the sight line range of the virtual camera, the intersection line segment between each camera sight line in the sight line range and the target model;

[0014] A light intensity calculation module, for determining, for each camera sight line, a target light intensity corresponding to an intersection point of the camera sight line and the target model according to a line segment length of the intersecting line segment corresponding to the camera sight line and a preset light intensity corresponding to a unit length;

[0015] The model rendering module is used to render the target model according to the target light intensity corresponding to the intersection point of each camera line of sight with the target model, so as to obtain a target model whose halo effect matches the target light intensity.

[0016] In a third aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for generating the halo effect when executing the computer program.

[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method for generating a halo effect are executed.

[0018] The technical solution provided by the embodiments of the present application may have the following beneficial effects:

[0019] The embodiment of the present application provides a method, device, equipment and storage medium for generating a halo effect, which places a target model representing the shape of the halo outside the luminous object; according to the sight range of the virtual camera, determines the intersection line segment between each camera sight line and the target model in the sight range; for each camera sight line, determines the target light intensity corresponding to the intersection point of the camera sight line and the target model according to the line segment length of the intersection line segment corresponding to the camera sight line and the preset light intensity corresponding to the unit length; according to the target light intensity corresponding to the intersection point of each camera sight line and the target model, renders the target model to obtain a target model whose halo effect matches the target light intensity. In this way, the present application makes it no longer necessary to stack a large number of transparent facets to present the halo effect, and there will be no problem of halo effect being exposed due to the change of the camera direction of the virtual camera, which effectively improves the true restoration of the halo effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0021] Figure 1 A schematic diagram showing defects when a transparent surface is controlled to rotate with a virtual camera using an existing technical solution;

[0022] Figure 2 A schematic flow chart of a method for generating a halo effect provided in an embodiment of the present application is shown;

[0023] Figure 3 A schematic diagram of the structure of a target model provided in an embodiment of the present application is shown;

[0024] Figure 4a A schematic diagram of a camera sight range when a virtual camera is located outside a target model provided by an embodiment of the present application is shown;

[0025] Figure 4b A schematic diagram of a camera sight range when a virtual camera is located inside a target model provided by an embodiment of the present application is shown;

[0026] Figure 5a A schematic diagram of front rendering of a target model provided by an embodiment of the present application is shown;

[0027] Figure 5b A schematic diagram of double-sided rendering of a target model provided by an embodiment of the present application is shown;

[0028] Figure 5c A schematic diagram of back-side rendering of a target model provided by an embodiment of the present application is shown;

[0029] Figure 6a A schematic diagram showing a method of calculating a target illumination intensity corresponding to an intersection point between a camera line of sight and a target model when a virtual camera provided by an embodiment of the present application is outside a target model is shown;

[0030] Figure 6b A schematic diagram showing a method of calculating the target illumination intensity corresponding to the intersection point of the camera line of sight and the target model when a virtual camera provided by an embodiment of the present application is inside the target model;

[0031] Figure 7 A schematic diagram of a preset spectrum diagram provided in an embodiment of the present application is shown;

[0032] Figure 8 A schematic structural diagram of a device for generating a halo effect provided in an embodiment of the present application is shown;

[0033] Fig. 9 A schematic diagram of the structure of an electronic device 900 provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.

[0035] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0036] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.

[0037] here, Figure 1 A schematic diagram showing defects when a transparent surface is controlled to rotate with a virtual camera using an existing technical solution is shown. Figure 1 As shown, a more conventional approach in the current prior art is to create a plurality of transparent patches 100 stacked and placed around a luminous object (not shown in the figure) to simulate a halo ring, and control the plurality of transparent patches 100 to always face the direction of the virtual camera 110 (the observer's perspective) to follow the movement of the virtual camera 110, so as to present a halo effect that always surrounds the luminous object in the camera perspective of the virtual camera 110; wherein, when calculating the transparent patch 100 facing the virtual camera 110, two directions are usually calculated: the direction Dv from the virtual camera 110 to the transparent patch 100 and the direction Dn of the normal of the transparent patch 100, and the difference angle α is obtained by subtracting the above two directions, and when the virtual camera 110 moves, the transparent patch 100 is controlled to rotate α degrees in the direction of Dv, so as to ensure that no matter how the virtual camera 110 moves, the transparent patch 100 can always face the virtual camera 110.

[0038] However, the above calculation also has certain limitations, such as Figure 1 As shown in FIG. 1 , when a large number of transparent patches 100 overlap, the GPU will repeatedly calculate multiple times on each pixel unit in the overlapping part, resulting in an OverDraw phenomenon, which makes the performance consumption uncontrollable; on the other hand, if the virtual camera 110 does not always face the transparent patch 100, the camera position remains unchanged and only the camera direction of the virtual camera 110 is changed (i.e. Figure 1 The position of the virtual camera 110 shown remains unchanged, only the direction Dv from the virtual camera 110 to the transparent surface patch 100 is changed, resulting in the problem of halo effect being distorted (i.e., the halo effect does not match the observer's perspective corresponding to the current camera direction) because the above-mentioned multiple transparent surface patches 100 have not rotated (the transparent surface patches 100 are always at the camera position facing the virtual camera 110, not at the angle facing the virtual camera 110).

[0039] Based on this, the present application provides a method, device, equipment and storage medium for generating a halo effect, so that the presentation of the halo effect no longer requires stacking a large number of transparent surfaces, and there will be no problem of halo effect blemishes caused by changes in the camera direction of the virtual camera, thereby effectively improving the true restoration of the halo effect.

[0040] In one of the embodiments of the present application, a method for generating a halo effect can be applied to a virtual engine capable of producing three-dimensional motion effects, and the virtual engine can run on a terminal device or a server; wherein the terminal device can be a local terminal device, and when the virtual engine runs on the server, the method for generating the halo effect can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device (i.e., a terminal device).

[0041] It should be noted that the embodiments of the present application do not impose any limitation on the specific type of the above-mentioned virtual engine; for example, the above-mentioned virtual engine can be a UE4 (Unreal Engine 4) engine used for game production, or a UE5 (Unreal Engine 5) engine, etc.

[0042] To facilitate understanding of the embodiments of the present application, a method, device, equipment and storage medium for generating a halo effect provided in the embodiments of the present application are described in detail below.

[0043] Reference Figure 2 As shown, Figure 2 A schematic flow chart of a method for generating a halo effect provided in an embodiment of the present application is shown, wherein the generating method comprises steps S201-S204; specifically:

[0044] S201, placing a target model representing a halo shape outside a luminous object.

[0045] S202: Determine, according to the visual range of the virtual camera, the intersection line segments between each camera visual line in the visual range and the target model.

[0046] S203, for each camera sight line, determining the target illumination intensity corresponding to the intersection point of the camera sight line and the target model according to the line segment length of the intersecting line segment corresponding to the camera sight line and the preset illumination intensity corresponding to the unit length.

[0047] S204, rendering the target model according to the target illumination intensity corresponding to the intersection point of each camera sight line and the target model, to obtain a target model with a halo effect matching the target illumination intensity.

[0048] The method for generating the above-mentioned halo effect provided in the embodiment of the present application is to place a target model representing the halo shape outside the luminous object; determine the intersecting line segments between each camera line of sight and the target model in the line of sight according to the line length of the intersecting line segment corresponding to the camera line of sight and the preset light intensity corresponding to the unit length, for each camera line of sight; determine the target light intensity corresponding to the intersection point of the camera line of sight and the target model according to the target light intensity corresponding to the intersection point of each camera line of sight and the target model; render the target model according to the target light intensity corresponding to the intersection point of each camera line of sight and the target model, and obtain a target model whose halo effect matches the target light intensity. In this way, the present application makes it no longer necessary to stack a large number of transparent facets to present the halo effect, and there will be no problem of halo effect being exposed due to the change of the camera direction of the virtual camera, which effectively improves the true restoration of the halo effect.

[0049] The following is an exemplary description of each step in the method for generating the halo effect provided in the embodiment of the present application:

[0050] S201, placing a target model representing a halo shape outside a luminous object.

[0051] Here, the above-mentioned luminous object can be a point light source or a three-dimensional virtual model that can emit light (such as a sun model). The embodiment of the present application does not impose any limitation on the specific object type of the above-mentioned luminous object.

[0052] Here, the above-mentioned target model is used to represent the halo shape of the luminous object. For example, when it is necessary to generate a circular halo surrounding the luminous object, the above-mentioned target model can be a spherical model; wherein, the specific model shape of the above-mentioned target model can be determined according to the specific generation requirements for the halo shape, and the embodiments of the present application do not impose any limitations on this.

[0053] Specifically, when executing step S201, Figure 1 Unlike the transparent surface piece 100 shown, since the target model is a three-dimensional model, in order to enable the final generated halo effect to achieve a 360° viewing effect without blind spots, the above-mentioned luminous object can also be placed inside the model of the target model (that is, the target model can wrap around the outside of the luminous object).

[0054] For example, the luminous object is a sun model. Figure 3 A schematic diagram of the structure of a target model provided in an embodiment of the present application is shown. Figure 3 As shown, when generating a solar halo around the solar model 300 (i.e., a luminous object), based on the halo shape of the solar halo, the spherical model 310 can be selected as the target model representing the solar halo, and the solar model 300 can be placed at the center of the spherical model 310.

[0055] S202: Determine, according to the visual range of the virtual camera, the intersection line segments between each camera visual line in the visual range and the target model.

[0056] Here, the field of view of the virtual camera can be determined according to the position of the virtual camera in the virtual scene, wherein the field of view of the virtual camera can be quantitatively represented as a line of sight set consisting of n camera lines of sight, and the embodiment of the present application does not impose any limitation on the specific value of n.

[0057] Here, when executing step S202, the intersection line segment between each camera sight line and the target model may be determined according to different methods shown in the following steps a1-a2, depending on whether the virtual camera is located outside or inside the target model. Specifically:

[0058] Step a1: when the virtual camera is located outside the target model, two intersection points between each camera line of sight in the line of sight range and the target model are determined, and a line segment between the two intersection points is determined as the intersection line segment.

[0059] For example, the target model is still a sphere model. Figure 4a FIG. 4 shows a schematic diagram of a camera sight range when a virtual camera is located outside a target model provided by an embodiment of the present application; Figure 4a As shown, the line of sight of the virtual camera 110 can be quantitatively represented as a line of sight set consisting of n camera lines of sight V1-Vn; wherein, when the virtual camera 110 is located outside the spherical model 310 (i.e., the target model), there are two intersection points between each camera line of sight in the above line of sight range and the spherical model 310 (i.e., the target model), and the line segment between the two intersection points is an intersection line segment between a camera line of sight and the target model.

[0060] Step a2: when the virtual camera is located inside the model of the target model, determine the intersection point between each camera line of sight in the line of sight range and the target model, and determine the line segment between the camera position of the virtual camera and the intersection point as the intersection line segment.

[0061] For example, the target model is still a sphere model. Figure 4b FIG. 4 shows a schematic diagram of a camera sight range when a virtual camera is located inside a target model provided by an embodiment of the present application; Figure 4bAs shown, the line of sight of the virtual camera 110 can still be quantitatively represented as a line of sight set consisting of n camera lines of sight V1-Vn; wherein, when the virtual camera 110 is located inside the spherical model 310 (i.e., the target model), there is an intersection point between each camera line of sight in the above line of sight range and the spherical model 310 (i.e., the target model). At this time, for each camera line of sight, the line segment between the camera position of the virtual camera 110 and the above intersection point (i.e., an intersection point between each camera line of sight and the target model) can be determined as an intersection line segment between a camera line of sight and the target model.

[0062] S203, for each camera sight line, determining the target illumination intensity corresponding to the intersection point of the camera sight line and the target model according to the line segment length of the intersecting line segment corresponding to the camera sight line and the preset illumination intensity corresponding to the unit length.

[0063] Here, as an optional embodiment, for each camera line of sight, the product of the segment length of the intersecting line segment corresponding to the camera line of sight and the above-mentioned preset light intensity can be calculated, and the calculation result is used as the target light intensity corresponding to the intersection point of the camera line of sight and the target model.

[0064] Specifically, assuming that the light intensity contribution (i.e., the preset light intensity corresponding to the unit length) of each point (i.e., unit length) inside the target model is a, then for each camera line of sight, the light intensity corresponding to the direction of the camera line of sight can be quantitatively expressed as the product L×a of the segment length L of the above-mentioned intersecting line segment corresponding to the camera line of sight (i.e., the intersecting line segment between the camera line of sight and the target model) and the light intensity contribution a of each point inside the above-mentioned target model.

[0065] It should be noted that the above-mentioned unit length can be in points or in units of a preset fixed distance, and the specific value of the above-mentioned preset light intensity a can be set according to the actual halo generation requirements. The embodiments of the present application do not impose any limitations on the specific value of the above-mentioned unit length and the specific value of the above-mentioned preset light intensity a.

[0066] Here, in addition to the above optional embodiments, for each camera line of sight, the segment length L of the intersecting line segment corresponding to the camera line of sight can be used as an independent variable in the objective function, and the above preset light intensity a can be used as a known coefficient in the objective function, so as to calculate the function value of the objective function as the target light intensity corresponding to the intersection point of the camera line of sight and the target model.

[0067] It should be noted that the function expression of the above objective function is not unique. It only needs to satisfy that the function value (i.e., the target illumination intensity corresponding to the intersection point of the camera line of sight and the target model) can increase with the increase of the independent variable (i.e., the segment length L of the intersection line segment corresponding to the camera line of sight). In other words, similar to the above product calculation method, it only needs to ensure that the objective function can be used as a specific quantitative expression corresponding to "the target illumination intensity belongs to the illumination intensity corresponding to the direction where the camera line of sight is located" (for example, the objective function can also be y=a×L 2 , wherein y represents the target illumination intensity corresponding to the intersection point of the camera line of sight and the target model, a represents the preset illumination intensity corresponding to the unit length, and L represents the segment length of the intersecting line segment corresponding to the camera line of sight). The embodiments of the present application do not impose any limitation on the specific function expression of the above objective function.

[0068] Specifically, since the position of the intersection point of a camera line of sight with the target model is determined (that is, the position coordinates of the intersection point are determined) and the camera position of the virtual camera is also determined (that is, the camera position coordinates of the virtual camera are also determined), no matter what the specific model shape of the target model is, under a general calculation method, in the same coordinate system, based on the position coordinates of the above-mentioned intersection point and the camera position coordinates of the virtual camera, the distance between the two position coordinates can be calculated as the line segment length L of the above-mentioned intersecting line segment corresponding to the camera line of sight.

[0069] It should be noted that when calculating the segment length L of the above-mentioned intersecting line segments according to the above-mentioned general calculation method, it is only necessary to ensure that the position coordinates used for calculation come from the same coordinate system, and the specifically selected coordinate system can be the camera coordinate system or the world coordinate system, and this embodiment of the application does not impose any limitation on this.

[0070] S204, rendering the target model according to the target illumination intensity corresponding to the intersection point of each camera sight line and the target model, to obtain a target model with a halo effect matching the target illumination intensity.

[0071] Specifically, when rendering the target model, the following three rendering methods can be used:

[0072] Rendering mode 1: front-side rendering in single-sided rendering, wherein the front-side rendering means that when rendering the target model, only the front side of the target model is rendered, and the position points on the back side of the target model are eliminated.

[0073] Here, the front face of the target model refers to the model surface where the angle between the normal direction and the camera direction of the virtual camera is less than or equal to a preset angle. The preset angle may be 90°.

[0074] For example, the target model is still taken as the sphere model 310. Figure 5a A schematic diagram of a front rendering of a target model provided by an embodiment of the present application is shown, Figure 5a As shown, when the target model is rendered from the front, if the virtual camera 110 is located outside the target model, the target model with a halo effect matching the above-mentioned target illumination intensity can be obtained normally. However, if the virtual camera 110 is located inside the target model, the position points on the front side 311 of the target model will be eliminated because they are outside the viewing cone range V of the virtual camera 110, resulting in that the front rendering cannot be applied to the situation where the virtual camera 110 is located inside the target model.

[0075] Rendering mode 2: double-sided rendering, wherein double-sided rendering is equivalent to rendering the entire surface of the target model (ie, during rendering, there is no need to remove any position point on the surface of the target model).

[0076] For example, the target model is still taken as the sphere model 310. Figure 5b A schematic diagram of double-sided rendering of a target model provided by an embodiment of the present application is shown. Figure 5b As shown, when the target model is rendered on both sides, if the virtual camera 110 is located outside the target model 310, the target model with a halo effect matching the target illumination intensity can be obtained normally. However, if the virtual camera 110 is located inside the target model 310, Figure 5a Similar to the front rendering shown, the position points on the front of the target model will also be eliminated because they are outside the viewing cone range V of the virtual camera 110, resulting in that the double-sided rendering is also not applicable to the situation where the virtual camera 110 is located inside the target model.

[0077] Rendering mode 3, back-side rendering in single-sided rendering, wherein back-side rendering means that when rendering the target model, only the back side of the target model is rendered, and the position points located on the front side of the target model are eliminated.

[0078] Here, the back side of the target model refers to the model surface where a point where the angle between the normal direction and the camera direction of the virtual camera is greater than a preset angle is located; wherein the preset angle may be 90°.

[0079] For example, the target model is still taken as the sphere model 310. Figure 5c A schematic diagram of back-side rendering of a target model provided by an embodiment of the present application is shown. Figure 5cAs shown, when the back side of the target model is rendered, even if the virtual camera 110 rotates inside the target model 310, due to the definition of the back side of the target model (i.e., the angle between the normal direction and the camera direction of the virtual camera is greater than 90°), the position points on the back side of the target model can always be within the viewing cone range V of the virtual camera 110 and will not be culled, resulting in the back side rendering being able to satisfy all situations where the virtual camera 110 is located inside and outside the target model.

[0080] Based on the contents shown in the above rendering methods 1-3, in an embodiment of the present application, as a preferred embodiment, when executing the above step S204, the back rendering method shown in the above rendering method 3 can be preferably used to render the target model; that is, the back side of the above target model can be recorded as the target model surface (that is, the angle between the normal direction of the position point on the target model surface and the camera direction of the virtual camera is greater than the preset angle, and the preset angle can be 90°). At this time, when executing step S204, the above target model surface in the target model can be rendered (that is, back side rendering) according to the target light intensity corresponding to the intersection point of each camera line of sight with the target model, without rendering the remaining front side of the target model in the target model.

[0081] The following describes in detail the specific implementation process of each of the above steps in the embodiment of the present application:

[0082] With respect to the specific implementation of the above-mentioned step S203, referring to the above-mentioned relevant instructions on back-side rendering, it can be known that when executing step S204, the rendering method of back-side rendering can be adopted, and only the target model surface in the target model (that is, the back side of the above-mentioned target model) is rendered, wherein, since the position points located on the front side of the target model (the angle between the normal direction and the camera direction of the virtual camera is less than or equal to the preset angle) will be eliminated when performing back-side rendering, therefore, as an optional embodiment, if it is determined to render the target model by the rendering method of back-side rendering, then when executing the above-mentioned step S203, for each camera line of sight, regardless of whether there is one intersection point or two intersection points between the camera line of sight and the target model (that is, regardless of whether the virtual camera is located inside or outside the target model), only the calculation result in step S203 can be used as the target light intensity corresponding to the intersection point between the camera line of sight and the target model surface in the target model (that is, the back side of the target model that needs to be rendered during back-side rendering) (equivalent to eliminating the intersection points located on the front side of the target model that does not need to be rendered).

[0083] Specifically, Figure 6a FIG. 1 is a schematic diagram showing a method for calculating the target illumination intensity corresponding to the intersection point between the camera sight line and the target model when a virtual camera provided by an embodiment of the present application is outside the target model. Figure 6aAs shown, still taking the target model as a spherical model as an example, the coordinates of the camera position point C of the virtual camera, the coordinates of the center position point O of the spherical model, the coordinates of the intersection point E of the camera line of sight V and the surface of the target model (that is, the back of the target model that needs to be rendered during back rendering), and the length of the radius r of the spherical model are known; the length of the line segment CE and the length of the line segment CO can be calculated based on the above known information, wherein the angle of the angle ECO can be calculated based on the lengths of the line segments CE and CO, and after the angle of the angle ECO is calculated, the side lengths of AE and AC can be calculated according to the Pythagorean theorem, and then the length of the line segment OD can be obtained by using the similar triangle theorem, and then the length of the line segment OD and the length of the radius r can be obtained by the Pythagorean theorem; and the triangle OSE is an isosceles triangle with a waist length of r, so it can be known that the intersection line segment length SE=2×DE where the camera line of sight V intersects with the spherical model, and finally the product between the intersection line segment length SE and the light intensity a corresponding to the unit length is calculated to obtain the target light intensity corresponding to the intersection point E.

[0084] Specifically, Figure 6b FIG. 1 is a schematic diagram showing a virtual camera provided in an embodiment of the present application that calculates the target illumination intensity corresponding to the intersection point between the camera line of sight and the target model when the virtual camera is inside the target model. Figure 6b As shown, still taking the target model being a spherical model as an example, the coordinates of the camera position point C of the virtual camera, the coordinates of the center position point O of the spherical model, the coordinates of the intersection point E of the camera line of sight V and the surface of the target model (that is, the back side of the target model that needs to be rendered during back rendering), and the length of the radius r of the spherical model are known; the length of the intersecting line segment CE can be directly calculated from the above known information, and finally the product of the intersecting line segment length CE and the light intensity a corresponding to the unit length is calculated to obtain the target light intensity corresponding to the intersection point E.

[0085] It should be noted that, unlike the general calculation method given in step S203 (that is, applicable to target models of any shape), if the above Figure 6a and Figure 6b When the length of the intersecting line segment is calculated using the mathematical derivation method shown in FIG. 1 , the specific calculation method corresponding to the length of the intersecting line segment between the camera sight line and the target model may be different due to the different model shapes of the target model. That is, the above Figure 6a and Figure 6b The calculation method of the mathematical derivation method shown is only a specific example description using the target model as a spherical model. The embodiment of the present application does not impose any limitation on the specific calculation method of the segment length of the above-mentioned intersecting line segments.

[0086] On the basis of the above steps S201-S204, in order to facilitate artists to customize the halo color presented in the halo effect, as an optional embodiment, the target illumination color corresponding to each intersection point during rendering can be determined by means of the target illumination intensity calculated in the above step S203 through the method shown in the following steps b1-b3. Specifically:

[0087] Step b1: according to the target illumination intensity corresponding to the intersection point of each camera sight line and the target model, normalize the target illumination intensity corresponding to each intersection point to obtain the normalized illumination intensity corresponding to each intersection point.

[0088] Here, artists can pre-customize a LUT image containing multiple lighting colors as a preset spectrum map according to the specific generation requirements of the halo effect, and then, by establishing a mapping relationship between the value of the target light intensity and the UV coordinates of the pixel points in the preset spectrum map, for each intersection point, according to the target light intensity corresponding to the intersection point, determine from the preset spectrum map the pixel point whose UV coordinate matches the target light intensity corresponding to the intersection point as the sampling point of the lighting color, and then determine the lighting color corresponding to the above sampling point in the preset spectrum map as the target lighting color corresponding to the intersection point.

[0089] Specifically, since the value range of the UV coordinate is between 0 and 1, before determining the sampling point, the target light intensity corresponding to the intersection point needs to be normalized.

[0090] For example, taking the target model as a spherical model, when the camera line of sight passes through the center of the sphere, the target illumination intensity corresponding to the intersection point between the camera line of sight and the target model can reach a maximum value of 2r×a (r is the radius of the spherical model, and a is the illumination intensity per unit length). Therefore, for any intersection point between the camera line of sight and the spherical model, taking the segment length of the intersection line segment where the intersection point is located as L as an example, the normalized illumination intensity corresponding to the intersection point can be calculated to be L / 2r.

[0091] Step b2: for each intersection point, the normalized light intensity corresponding to the intersection point is used as the U-axis coordinate of the sampling point, and the light color corresponding to the sampling point is determined from a preset spectrum as the target light color corresponding to the intersection point.

[0092] Here, after normalization, the value of the normalized light intensity corresponding to the intersection point is also between 0 and 1. Therefore, the normalized light intensity corresponding to the intersection point can be used as the U-axis coordinate of the sampling point, and the light color corresponding to the sampling point can be determined from the preset spectrum as the target light color corresponding to the intersection point.

[0093] Exemplary description, Figure 7 A schematic diagram of a preset spectrum diagram provided in an embodiment of the present application is shown, such as Figure 7 As shown, the preset spectrum contains a variety of lighting colors that can be customized by artists. After calculating the normalized lighting intensity corresponding to an intersection point, the normalized lighting intensity corresponding to the intersection point can be used as the U-axis coordinate of the sampling point. From the preset spectrum, the lighting color corresponding to the sampling point is determined as the target lighting color corresponding to the intersection point.

[0094] Step b3, rendering the target model according to the target light intensity and the target light color corresponding to the intersection point of each camera line of sight with the target model, to obtain a target model whose halo effect matches the target light intensity and whose halo color matches the target light color.

[0095] Here, the specific implementation of step b3 can refer to the model rendering method of the aforementioned step S204, and the repeated parts will not be repeated here.

[0096] Based on the above-mentioned method for generating the halo effect provided in the embodiment of the present application, a target model representing the halo shape is placed outside the luminous object; according to the sight range of the virtual camera, the intersection line segment between each camera sight line and the target model in the sight range is determined; for each camera sight line, the target light intensity corresponding to the intersection point of the camera sight line and the target model is determined according to the line segment length of the intersection line segment corresponding to the camera sight line and the preset light intensity corresponding to the unit length; according to the target light intensity corresponding to the intersection point of each camera sight line and the target model, the target model is rendered to obtain a target model whose halo effect matches the target light intensity. In this way, the present application makes it possible to present the halo effect without stacking a large number of transparent facets, and there will be no problem of halo effect being exposed due to the change of the camera direction of the virtual camera.

[0097] Based on the same inventive concept, the present application also provides a generating device corresponding to the above-mentioned method for generating the halo effect. Since the principle of solving the problem by the generating device in the embodiment of the present application is similar to the above-mentioned method for generating the halo effect in the embodiment of the present application, the implementation of the generating device can refer to the implementation of the above-mentioned generating method, and the repeated parts will not be repeated.

[0098] Reference Figure 8 As shown, Figure 8 A schematic diagram of the structure of a device for generating a halo effect provided in an embodiment of the present application is shown, wherein the generating device comprises:

[0099] A position adjustment module 801 is used to place a target model representing a halo shape outside the luminous object;

[0100] A sight line determination module 802 is used to determine, according to the sight line range of the virtual camera, the intersection line segment between each camera sight line in the sight line range and the target model;

[0101] The light intensity calculation module 803 is used to determine, for each camera sight line, the target light intensity corresponding to the intersection point of the camera sight line and the target model according to the line segment length of the intersecting line segment corresponding to the camera sight line and the preset light intensity corresponding to the unit length;

[0102] The model rendering module 804 is used to render the target model according to the target illumination intensity corresponding to the intersection point of each camera sight line with the target model, so as to obtain a target model with a halo effect matching the target illumination intensity.

[0103] In an optional implementation, when determining the intersection line segment between each camera sight line in the sight line range and the target model according to the sight line range of the virtual camera, the sight line determination module 802 is used to:

[0104] When the virtual camera is located outside the model of the target model, two intersection points between each camera sight line in the sight range and the target model are determined, and a line segment between the two intersection points is determined as the intersection line segment.

[0105] In an optional implementation, when determining the intersection line segment between each camera sight line in the sight line range and the target model according to the sight line range of the virtual camera, the sight line determination module 802 is further used to:

[0106] When the virtual camera is located inside the model of the target model, the intersection point between each camera line of sight in the line of sight range and the target model is determined, and the line segment between the camera position of the virtual camera and the intersection point is determined as the intersection line segment.

[0107] In an optional implementation, when determining the target illumination intensity corresponding to the intersection point of the camera sight line and the target model according to the line segment length of the intersecting line segment corresponding to the camera sight line and the preset illumination intensity corresponding to the unit length, the light intensity calculation module 803 is used to:

[0108] The product of the line segment length of the intersecting line segment corresponding to the camera line of sight and the preset light intensity is calculated, and the calculation result is used as the target light intensity corresponding to the intersection point of the camera line of sight and the target model.

[0109] In an optional implementation, the target illumination intensity corresponding to the intersection point between the camera line of sight and the target model includes:

[0110] The target illumination intensity corresponding to the intersection point of the camera line of sight and the target model surface in the target model; wherein the angle between the normal direction of the position point on the surface of the target model and the camera direction of the virtual camera is greater than a preset angle.

[0111] In an optional implementation, when rendering the target model according to the target illumination intensity corresponding to the intersection point of each camera sight line with the target model, the model rendering module 804 is used to:

[0112] The target model surface in the target model is rendered according to the target illumination intensity corresponding to the intersection point of each camera sight line with the target model.

[0113] In an optional implementation, the generating device further includes: a color sampling module, wherein the color sampling module is used to:

[0114] According to the target illumination intensity corresponding to the intersection point of each camera sight line and the target model, the target illumination intensity corresponding to each intersection point is normalized to obtain the normalized illumination intensity corresponding to each intersection point;

[0115] For each intersection point, the normalized light intensity corresponding to the intersection point is used as the U-axis coordinate of the sampling point, and the light color corresponding to the sampling point is determined from a preset spectrum as the target light color corresponding to the intersection point;

[0116] The target model is rendered according to the target light intensity and the target light color corresponding to the intersection point of each camera line of sight with the target model to obtain a target model whose halo effect matches the target light intensity and whose halo color matches the target light color.

[0117] In an optional embodiment, the intersection point of each camera line of sight with the target model includes: the intersection point of each camera line of sight with the target model surface in the target model; wherein, the angle between the normal direction of the position point on the surface of the target model and the camera direction of the virtual camera is greater than a preset angle.

[0118] Based on the above-mentioned halo effect generation device provided by the embodiment of the present application, a target model representing the halo shape is placed outside the luminous object; according to the sight range of the virtual camera, the intersection line segment between each camera sight line and the target model in the sight range is determined; for each camera sight line, the target light intensity corresponding to the intersection point of the camera sight line and the target model is determined according to the line segment length of the intersection line segment corresponding to the camera sight line and the preset light intensity corresponding to the unit length; according to the target light intensity corresponding to the intersection point of each camera sight line and the target model, the target model is rendered to obtain a target model whose halo effect matches the target light intensity. In this way, the present application makes it no longer necessary to stack a large number of transparent facets to present the halo effect, and there will be no problem of halo effect being exposed due to the change of the camera direction of the virtual camera, which effectively improves the true restoration of the halo effect.

[0119] Based on the same inventive concept, the present application also provides an electronic device corresponding to the above-mentioned method for generating the halo effect. Since the principle of solving the problem by the electronic device in the embodiment of the present application is similar to the method for generating the above-mentioned halo effect in the embodiment of the present application, the implementation of the electronic device can refer to the implementation of the above-mentioned generation method, and the repeated parts will not be repeated.

[0120] Fig. 9 A structural diagram of an electronic device 900 provided in an embodiment of the present application includes: a processor 901, a memory 902 and a bus 903, wherein the memory 902 stores machine-readable instructions executable by the processor 901. When the electronic device runs a method for generating a halo effect in an embodiment, the processor 901 communicates with the memory 902 via the bus 903, and the processor 901 executes the machine-readable instructions. When the processor 901 executes the machine-readable instructions, the following steps are implemented, specifically:

[0121] Place a target model representing the shape of the halo outside the luminous object;

[0122] According to the visual range of the virtual camera, determining the intersection line segment between each camera visual line in the visual range and the target model;

[0123] For each camera sight line, determine the target illumination intensity corresponding to the intersection point of the camera sight line and the target model according to the line segment length of the intersecting line segment corresponding to the camera sight line and the preset illumination intensity corresponding to the unit length;

[0124] The target model is rendered according to the target illumination intensity corresponding to the intersection point of each camera sight line and the target model to obtain a target model whose halo effect matches the target illumination intensity.

[0125] In an optional implementation, when determining, according to the visual range of the virtual camera, the intersection line segment between each camera visual line in the visual range and the target model, the processor 901 is configured to:

[0126] When the virtual camera is located outside the model of the target model, two intersection points between each camera sight line in the sight range and the target model are determined, and a line segment between the two intersection points is determined as the intersection line segment.

[0127] In an optional implementation, when determining, according to the visual range of the virtual camera, the intersection line segment between each camera visual line in the visual range and the target model, the processor 901 is further configured to:

[0128] When the virtual camera is located inside the model of the target model, the intersection point between each camera line of sight in the line of sight range and the target model is determined, and the line segment between the camera position of the virtual camera and the intersection point is determined as the intersection line segment.

[0129] In an optional implementation, when determining the target illumination intensity corresponding to the intersection point of the camera sight line and the target model according to the line segment length of the intersecting line segment corresponding to the camera sight line and the preset illumination intensity corresponding to the unit length, the processor 901 is configured to:

[0130] The product of the line segment length of the intersecting line segment corresponding to the camera line of sight and the preset light intensity is calculated, and the calculation result is used as the target light intensity corresponding to the intersection point of the camera line of sight and the target model.

[0131] In an optional implementation, the target illumination intensity corresponding to the intersection point between the camera line of sight and the target model includes:

[0132] The target illumination intensity corresponding to the intersection point of the camera line of sight and the target model surface in the target model; wherein the angle between the normal direction of the position point on the surface of the target model and the camera direction of the virtual camera is greater than a preset angle.

[0133] In an optional implementation, when rendering the target model according to the target illumination intensity corresponding to the intersection point of each camera sight line with the target model, the processor 901 is configured to:

[0134] The target model surface in the target model is rendered according to the target illumination intensity corresponding to the intersection point of each camera sight line with the target model.

[0135] In an optional implementation, the processor 901 is further configured to:

[0136] According to the target illumination intensity corresponding to the intersection point of each camera sight line and the target model, the target illumination intensity corresponding to each intersection point is normalized to obtain the normalized illumination intensity corresponding to each intersection point;

[0137] For each intersection point, the normalized light intensity corresponding to the intersection point is used as the U-axis coordinate of the sampling point, and the light color corresponding to the sampling point is determined from a preset spectrum as the target light color corresponding to the intersection point;

[0138] The target model is rendered according to the target light intensity and the target light color corresponding to the intersection point of each camera line of sight with the target model to obtain a target model whose halo effect matches the target light intensity and whose halo color matches the target light color.

[0139] In an optional embodiment, the intersection point of each camera line of sight with the target model includes: the intersection point of each camera line of sight with the target model surface in the target model; wherein, the angle between the normal direction of the position point on the surface of the target model and the camera direction of the virtual camera is greater than a preset angle.

[0140] Through the electronic device provided by the embodiment of the present application, a target model representing the shape of a halo is placed outside the luminous object; according to the sight range of the virtual camera, the intersection line segment between each camera sight line and the target model in the sight range is determined; for each camera sight line, the target light intensity corresponding to the intersection point of the camera sight line and the target model is determined according to the line segment length of the intersection line segment corresponding to the camera sight line and the preset light intensity corresponding to the unit length; according to the target light intensity corresponding to the intersection point of each camera sight line and the target model, the target model is rendered to obtain a target model whose halo effect matches the target light intensity. In this way, the present application makes it no longer necessary to stack a large number of transparent facets to present the halo effect, and there will be no problem of halo effect being exposed due to the change of the camera direction of the virtual camera, which effectively improves the true restoration of the halo effect.

[0141] Based on the same inventive concept, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. The computer program is executed when a processor is running, and the processor performs the following steps:

[0142] Place a target model representing the shape of the halo outside the luminous object;

[0143] According to the visual range of the virtual camera, determining the intersection line segment between each camera visual line in the visual range and the target model;

[0144] For each camera sight line, determine the target illumination intensity corresponding to the intersection point of the camera sight line and the target model according to the line segment length of the intersecting line segment corresponding to the camera sight line and the preset illumination intensity corresponding to the unit length;

[0145] The target model is rendered according to the target illumination intensity corresponding to the intersection point of each camera sight line and the target model to obtain a target model whose halo effect matches the target illumination intensity.

[0146] In an optional implementation, when determining, according to the visual range of the virtual camera, the intersection line segment between each camera visual line in the visual range and the target model, the processor is configured to:

[0147] When the virtual camera is located outside the model of the target model, two intersection points between each camera sight line in the sight range and the target model are determined, and a line segment between the two intersection points is determined as the intersection line segment.

[0148] In an optional implementation, when determining, according to the visual range of the virtual camera, the intersection line segment between each camera visual line in the visual range and the target model, the processor is further configured to:

[0149] When the virtual camera is located inside the model of the target model, the intersection point between each camera line of sight in the line of sight range and the target model is determined, and the line segment between the camera position of the virtual camera and the intersection point is determined as the intersection line segment.

[0150] In an optional implementation, when determining the target illumination intensity corresponding to the intersection point of the camera sight line and the target model according to the line segment length of the intersecting line segment corresponding to the camera sight line and the preset illumination intensity corresponding to the unit length, the processor is configured to:

[0151] The product of the line segment length of the intersecting line segment corresponding to the camera line of sight and the preset light intensity is calculated, and the calculation result is used as the target light intensity corresponding to the intersection point of the camera line of sight and the target model.

[0152] In an optional implementation, the target illumination intensity corresponding to the intersection point between the camera line of sight and the target model includes:

[0153] The target illumination intensity corresponding to the intersection point of the camera line of sight and the target model surface in the target model; wherein the angle between the normal direction of the position point on the surface of the target model and the camera direction of the virtual camera is greater than a preset angle.

[0154] In an optional implementation, when rendering the target model according to the target illumination intensity corresponding to the intersection point of each camera sight line with the target model, the processor is configured to:

[0155] The target model surface in the target model is rendered according to the target illumination intensity corresponding to the intersection point of each camera sight line with the target model.

[0156] In an optional implementation, the processor is further configured to:

[0157] According to the target illumination intensity corresponding to the intersection point of each camera sight line and the target model, the target illumination intensity corresponding to each intersection point is normalized to obtain the normalized illumination intensity corresponding to each intersection point;

[0158] For each intersection point, the normalized light intensity corresponding to the intersection point is used as the U-axis coordinate of the sampling point, and the light color corresponding to the sampling point is determined from a preset spectrum as the target light color corresponding to the intersection point;

[0159] The target model is rendered according to the target light intensity and the target light color corresponding to the intersection point of each camera line of sight with the target model to obtain a target model whose halo effect matches the target light intensity and whose halo color matches the target light color.

[0160] In an optional embodiment, the intersection point of each camera line of sight with the target model includes: the intersection point of each camera line of sight with the target model surface in the target model; wherein, the angle between the normal direction of the position point on the surface of the target model and the camera direction of the virtual camera is greater than a preset angle.

[0161] Through the above-mentioned computer-readable storage medium provided by the embodiment of the present application, a target model representing the shape of a halo is placed outside the luminous object; according to the sight range of the virtual camera, the intersection line segment between each camera sight line and the target model in the sight range is determined; for each camera sight line, the target light intensity corresponding to the intersection point of the camera sight line and the target model is determined according to the line segment length of the intersection line segment corresponding to the camera sight line and the preset light intensity corresponding to the unit length; according to the target light intensity corresponding to the intersection point of each camera sight line and the target model, the target model is rendered to obtain a target model whose halo effect matches the target light intensity. In this way, the present application makes it no longer necessary to stack a large number of transparent facets to present the halo effect, and there will be no problem of halo effect being exposed due to the change of the camera direction of the virtual camera, which effectively improves the true restoration of the halo effect.

[0162] In an embodiment of the present application, the computer-readable storage medium can also execute other machine-readable instructions when run by the processor to execute the method for generating the halo effect as described in other embodiments. For the specific steps and principles of the generation method, please refer to the description of the method side embodiment, which will not be repeated here.

[0163] In the embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. The system embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.

[0164] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0165] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0166] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0167] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.

[0168] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application. They should all be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for generating a halo effect, characterized in that: The generation method comprises: Place a target model representing the shape of the halo outside the luminous object; According to the visual range of the virtual camera, determining the intersection line segment between each camera visual line in the visual range and the target model; For each camera sight line, determine the target illumination intensity corresponding to the intersection point of the camera sight line and the target model according to the line segment length of the intersecting line segment corresponding to the camera sight line and the preset illumination intensity corresponding to the unit length; The target model is rendered according to the target illumination intensity corresponding to the intersection point of each camera sight line and the target model to obtain a target model whose halo effect matches the target illumination intensity.

2. The generation method according to claim 1, characterized in that: The step of determining, according to the visual range of the virtual camera, the intersection line segment between each camera visual line in the visual range and the target model comprises: When the virtual camera is located outside the model of the target model, two intersection points between each camera sight line in the sight range and the target model are determined, and a line segment between the two intersection points is determined as the intersection line segment.

3. The generation method according to claim 1, characterized in that: The step of determining, according to the visual range of the virtual camera, the intersection line between each camera visual line in the visual range and the target model further comprises: When the virtual camera is located inside the model of the target model, the intersection point between each camera line of sight in the line of sight range and the target model is determined, and the line segment between the camera position of the virtual camera and the intersection point is determined as the intersection line segment.

4. The generation method according to claim 1, characterized in that: The determining, according to the line segment length of the intersecting line segment corresponding to the camera line of sight and the preset light intensity corresponding to the unit length, the target light intensity corresponding to the intersection point of the camera line of sight and the target model comprises: The product of the line segment length of the intersecting line segment corresponding to the camera line of sight and the preset light intensity is calculated, and the calculation result is used as the target light intensity corresponding to the intersection point of the camera line of sight and the target model.

5. The generation method according to claim 1, characterized in that: The target illumination intensity corresponding to the intersection point of the camera line of sight and the target model includes: The target illumination intensity corresponding to the intersection point of the camera line of sight and the target model surface in the target model; wherein the angle between the normal direction of the position point on the surface of the target model and the camera direction of the virtual camera is greater than a preset angle.

6. The generation method according to claim 5, characterized in that: The rendering of the target model according to the target illumination intensity corresponding to the intersection point of each camera sight line and the target model comprises: The target model surface in the target model is rendered according to the target illumination intensity corresponding to the intersection point of each camera sight line with the target model.

7. The generation method according to claim 1, characterized in that: The generating method further comprises: According to the target illumination intensity corresponding to the intersection point of each camera sight line and the target model, the target illumination intensity corresponding to each intersection point is normalized to obtain the normalized illumination intensity corresponding to each intersection point; For each intersection point, the normalized light intensity corresponding to the intersection point is used as the U-axis coordinate of the sampling point, and the light color corresponding to the sampling point is determined from a preset spectrum as the target light color corresponding to the intersection point; The target model is rendered according to the target light intensity and the target light color corresponding to the intersection point of each camera line of sight with the target model to obtain a target model whose halo effect matches the target light intensity and whose halo color matches the target light color.

8. The generation method according to claim 7, characterized in that: The intersection points of each camera line of sight with the target model include: the intersection points of each camera line of sight with the surface of the target model in the target model; wherein the angle between the normal direction of the position point on the surface of the target model and the camera direction of the virtual camera is greater than a preset angle.

9. A device for generating a halo effect, characterized in that: The generating device comprises: A position adjustment module, used for placing a target model representing a halo shape outside the luminous object; A sight line determination module, used to determine, according to the sight line range of the virtual camera, the intersection line segment between each camera sight line in the sight line range and the target model; A light intensity calculation module, for determining, for each camera sight line, a target light intensity corresponding to an intersection point of the camera sight line and the target model according to a line segment length of the intersecting line segment corresponding to the camera sight line and a preset light intensity corresponding to a unit length; The model rendering module is used to render the target model according to the target light intensity corresponding to the intersection point of each camera line of sight with the target model, so as to obtain a target model whose halo effect matches the target light intensity.

10. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the method for generating a halo effect as described in any one of claims 1 to 8 are performed.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for generating a halo effect as claimed in any one of claims 1 to 8 are executed.