Method, device and electronic equipment for generating a light beam effect model

By creating a volumetric beam effect model in the virtual scene and utilizing multiple plane stacking and material mapping, the physical authenticity and controllability issues of the beam effect in the virtual scene are solved, and a realistic beam rendering effect is achieved.

CN114581593BActive Publication Date: 2025-10-10NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210166946.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-23
Publication Date
2025-10-10
Estimated Expiration
2042-02-23

AI Technical Summary

Technical Problem

When existing technologies are used to render light beam effects in virtual scenes, physical realism is limited and the ability to adjust the detailed shape of the light beams is insufficient, which affects the visual effect.

Method used

Create the volumetric form of the target beam in the specified space by stacking multiple planes, setting material mapping, adjusting the plane position and area, and combining noise mapping and masking to generate the target beam effect model.

Benefits of technology

It achieves high physical realism and strong controllability of the beam effect, meets diverse lighting needs, and is easy to operate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114581593B_ABST
    Figure CN114581593B_ABST
Patent Text Reader

Abstract

The application provides a method and device for generating a light beam effect model and electronic equipment, and the method comprises: creating a volume shape of a target light beam in a specified space; the volume shape comprises a plurality of planes arranged in sequence; the planes have a preset shape; the plurality of planes have the same orientation direction, and the areas of the plurality of planes gradually change along the orientation direction; a material map is set for the planes in the volume shape to obtain an effect model of the target light beam; the content of the material map is set in advance based on effect parameters of the target light beam; the effect parameters include one or more of the color, brightness and light distribution of the target light beam. In this way, the volume shape of the light beam is obtained by stacking and arranging a plurality of planes, and the color, brightness and light distribution of the light beam and other detailed effects can be realized by mapping the planes, so that the obtained light beam effect has good physical authenticity, the light beam effect is controllable, the operation is convenient, and the light demand in various scenes can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of model rendering, and in particular to a method, device and electronic equipment for generating a light beam effect model. Background Art

[0002] In the real physical world, when a beam of light passes through a colloid, it scatters light, resulting in a path of light visible to the human eye perpendicular to the incident light. This phenomenon is known as the Tyndall effect. In virtual scenes, beams that exhibit the Tyndall effect can be rendered using a variety of methods, including volumetric fog, beam occlusion and haloing, geometry and materials, particle simulation, and mask shapes. However, these methods often have limited physical realism and the ability to adjust the beam's detailed morphology is limited, impacting the visual quality of the beam in the virtual scene. Summary of the Invention

[0003] In view of this, the purpose of the present invention is to provide a method, device and electronic equipment for generating a light beam effect model, so that the obtained light beam effect has good physical reality, and the light beam effect is highly controllable and easy to operate, which can meet the lighting requirements in various scenes.

[0004] In a first aspect, an embodiment of the present invention provides a method for generating a light beam effect model, the method comprising: creating a volumetric form of a target light beam in a specified space; wherein the volumetric form comprises a plurality of planes arranged in sequence; the planes have a preset shape; the orientation directions of the plurality of planes are the same, and the areas of the plurality of planes gradually change along the orientation directions; setting a material map for the planes in the volumetric form to obtain an effect model of the target light beam; wherein the content of the material map is pre-set based on the effect parameters of the target light beam; the effect parameters comprise one or more of the color, brightness and light distribution of the target light beam.

[0005] After the above-mentioned step of creating a volumetric form of the target light beam in the specified space, the method further includes: adjusting the position of the endpoint plane in response to a position adjustment instruction of the endpoint plane in the volumetric form; wherein the position of the endpoint plane is used to indicate the beam length of the target light beam; based on the position of the endpoint plane, adjusting the position of the plane other than the endpoint plane; wherein, in the volumetric form, adjacent planes have a specified distance relationship.

[0006] The above-mentioned endpoint plane includes a starting plane and / or an end plane; a reference point is preset in the volume form; in response to the position adjustment instruction of the endpoint plane in the volume form, the step of adjusting the position of the endpoint plane includes: responding to the first distance adjustment instruction between the starting plane and the reference point in the volume form, adjusting the distance between the starting plane and the reference point to obtain the adjusted position of the starting plane; and / or, responding to the second distance adjustment instruction between the end plane and the reference point in the volume form, adjusting the distance between the end plane and the reference point to obtain the adjusted position of the end plane.

[0007] After the above-mentioned step of creating a volumetric form of the target light beam in the specified space, the method further includes: adjusting the area of ​​the endpoint plane in response to an area parameter adjustment instruction of the endpoint plane in the volumetric form; wherein the area of ​​the endpoint plane is used to indicate the shape of the target light beam; based on the area of ​​the endpoint plane, adjusting the area of ​​the plane other than the endpoint plane; wherein, in the volumetric form, the areas of multiple planes gradually increase or decrease along the direction of orientation.

[0008] The above-mentioned step of setting material mapping for the plane in the volume morphology includes: setting a specified position offset value for the target material; for each plane in the volume morphology, mapping the target material with the position offset value onto the plane; wherein the plane thickness of the mapped plane is determined based on the position offset value of the target material.

[0009] The above step of setting a specified position offset value for the target material includes: multiplying the vertex normal with a preset curve function to obtain a wave offset value; and setting the wave offset value as the position offset value of the target material.

[0010] The above steps of setting a material map for a plane in a volumetric form include: generating a target material based on a preset noise map and a mask; wherein the shape of the target material is the same as the shape of the mask; the mask has an edge blur property; and setting a material map for the plane in the volumetric form based on the target material.

[0011] The above-mentioned step of generating the target material based on the preset noise map and mask includes: multiplying the preset noise map and the mask to obtain the initial material; setting the initial material to be offset according to a preset time to obtain the target material.

[0012] In the second aspect, an embodiment of the present invention provides a device for generating a light beam effect model, the device comprising: a morphology creation module for creating a volumetric morphology of a target light beam in a specified space; wherein the volumetric morphology includes a plurality of planes arranged in sequence; the planes have a preset shape; the orientation directions of the plurality of planes are the same, and the areas of the plurality of planes gradually change along the orientation directions; a mapping setting module for setting a material map for the planes in the volumetric morphology to obtain an effect model of the target light beam; wherein the content of the material map is pre-set based on the effect parameters of the target light beam; the effect parameters include one or more of the color, brightness and light distribution of the target light beam.

[0013] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-mentioned method for generating the beam effect model.

[0014] In a fourth aspect, an embodiment of the present invention provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned method for generating the beam effect model.

[0015] The embodiments of the present invention bring the following beneficial effects:

[0016] The above-mentioned method, device, and electronic device for generating a light beam effect model first create a volumetric form of a target light beam in a specified space; wherein the volumetric form includes multiple planes arranged in sequence; the planes have a preset shape; the multiple planes face in the same direction, and the areas of the multiple planes gradually change along the direction; then, a material map is set for the planes in the volumetric form to obtain an effect model of the target light beam; wherein the content of the material map is pre-set based on the effect parameters of the target light beam; the effect parameters include one or more of the color, brightness, and light distribution of the target light beam. In this method, the volumetric form of the light beam is obtained by stacking multiple planes, and by mapping the planes, detailed effects such as the color, brightness, and light distribution of the light beam can be achieved. Therefore, the obtained light beam effect has good physical realism, is highly controllable, and is easy to operate, which can meet the lighting requirements of various scenes.

[0017] Other features and advantages of the present invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the present invention.

[0018] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0020] Figure 1 A flowchart of a method for generating a light beam effect model provided by an embodiment of the present invention;

[0021] Figure 2 A schematic diagram of a volume form provided by an embodiment of the present invention;

[0022] Figure 3 A schematic diagram of another volume form provided by an embodiment of the present invention;

[0023] Figure 4 A schematic diagram of a volume shape undergoing length change provided by an embodiment of the present invention;

[0024] Figure 5 A schematic diagram of a volume form undergoing area change according to an embodiment of the present invention;

[0025] Figure 6 A schematic diagram of a beam fault provided by an embodiment of the present invention;

[0026] Figure 7 A schematic structural diagram of a device for generating a light beam effect model provided by an embodiment of the present invention;

[0027] Figure 8 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work shall fall within the scope of protection of the present invention.

[0029] There are many ways to render a beam effect with the Tyndall effect in related technologies, which are described as follows:

[0030] 1. Volumetric Fog

[0031] Unreal Engine features a function for simulating the Tyndall effect of light. This method is close to realistic physical simulation and is simple and convenient to use. Simply enable Volumetric Fog in Exponential Height Fog. It's the perfect choice for simulating the Tyndall effect of sunlight or other directional light in large scenes. This method supports translucency and works with all light sources, even those from particle systems. However, for more precise control over light form, such as the most common dispersion and fog effects, this method can be more cumbersome, especially for small-scale lighting needs. For example, this method doesn't produce a scattered light beam effect when using spotlights, stage lights, mountaintops, or light shining through windows.

[0032] 2. Light shafts occlusion / bloom

[0033] This method requires checking light shafts occlusion in the Unreal Engine light source parameters.

[0034] / bloom creates beams by brightening the screen with a bloom or dimming the screen with an occlusion. However, this parameter is only available for Directional Lights and requires an occluder in front of the light to create a beam-splitting effect. This limits the applicable scenarios and beam patterns, and is often used in clear atmospheric environments that don't require a high-exponential fog. Furthermore, this method only works in screen space, meaning the directional light source must be within the screen for the beams to be visible, and can sometimes flicker when changing angles. Consequently, it may not produce a satisfactory effect where the beams are intended.

[0035] 3. Geometry and Materials

[0036] This method uses models and materials to create the shape of the light in external software, and creates a gradient map for it in the shader of Unreal Engine. Adding a noise map can simulate a dynamic smoke effect, and the light dispersion effect can be achieved by changing the gradient map. This method has lower GPU consumption and is suitable for games that need to be compatible with low-configuration platforms. However, the light beam obtained by this method is physically inaccurate. When the camera needs to shoot from inside the light, it will give the user a very fake visual effect. At the same time, this method is relatively cumbersome in operation. It is necessary to create the shape of the light in external software. The geometric shape cannot be adjusted in Unreal Engine, and it is difficult to adjust the light shape. In addition, the simulated light beam effect is not physically realistic enough, so it is more suitable for real-time games that need to run on low-end devices.

[0037] 4. Particle Simulation

[0038] This method can create a particle system through the Cascade or Niagara particles function in Unreal Engine and set the corresponding parameters of the particles to simulate the Tyndall effect of light. If you want to achieve a realistic effect through the beam effect simulated by particles, you need to consider the producer's mastery of Unreal Engine's particle system. There are many parameter variables, and adjusting various parameters according to the needs of different projects is time-consuming and labor-intensive.

[0039] 5. Mask shape

[0040] This method is an extension of the volumetric fog function. It requires placing a masking geometry in front of the light. Spotlights use plane geometry, while point lights use spheres. The masking geometry is given a mask texture. The texture supports static and dynamic textures, allowing the light to pass through the mask shape to achieve a shielding effect, thereby achieving a light dispersion effect. This implementation method will cause the light beam to become pixelated and blurred. The light intensity needs to be increased to the extreme value to achieve a relatively weak light. However, the boundary between the bright and dark areas within it will become unclear. When observing this light beam from a distance, it becomes a bright ball of light with no obvious beam splitting effect.

[0041] Based on the above problems, this embodiment provides a method, device and electronic device for generating a beam effect model. This technology can be applied to the production of beam effects in various virtual scenes, and is particularly suitable for the production of beam effects of the Tyndall effect.

[0042] First, see Figure 1 A flow chart of a method for generating a beam effect model is shown, the method comprising the following steps:

[0043] Step S102: creating a volumetric form of a target light beam in a designated space; wherein the volumetric form includes a plurality of planes arranged in sequence; the planes have a preset shape; the plurality of planes face in the same direction, and the areas of the plurality of planes gradually change along the direction of the direction;

[0044] This embodiment aims to generate a beam effect with high physical realism. To achieve this goal, in this example, the volumetric form of the target beam is created through multiple planes. The above-mentioned designated space can be the world space in the Unreal Engine. The world space can be understood as the space where the virtual scene is located. The coordinate system established in this space is the world coordinate system; the above-mentioned designated space can also be the model space. The coordinate system established in the model space is the model coordinate system. The model space is mainly used to adjust the posture of the target model. The vertex coordinates on the model are usually expressed in the model coordinate system. When the model is in the world space, the vertex coordinates on the model need to be converted from the model coordinate system to the world coordinate system. Specifically, you can create a new empty Ator blueprint class and create the above-mentioned volumetric form in the Ator blueprint class.

[0045] For ease of understanding, Figure 2 As an example of a volume shape. The volume shape includes multiple planes arranged in sequence, the shape of the planes is circular, and the volume shape of the target light beam composed of multiple circular planes is conical, that is, the target light beam is conical. The orientations of the multiple circular planes are all above. In specific implementation, a three-dimensional coordinate system can be set, and the orientation directions of the multiple planes are all along the Z axis, or a direction vector can be set in the three-dimensional coordinate system, and the direction vector serves as the orientation direction of the multiple planes. Figure 2 In the embodiment, the radius of the circular plane gradually increases from top to bottom. Of course, there may be other variations, for example, the radius of the circular plane gradually decreases from top to bottom.

[0046] Figure 3 As another example of volumetric shape, the volumetric shape includes a plurality of planes arranged in sequence, the planes are rectangular in shape, and the volumetric shape of the target light beam composed of the plurality of rectangular planes is a quadrangular pyramid, that is, the target light beam is in the shape of a quadrangular pyramid.

[0047] Step S104, setting a material map for the plane in the volume morphology to obtain an effect model of the target light beam; wherein the content of the material map is pre-set based on the effect parameters of the target light beam; the effect parameters include one or more of the color, brightness and light distribution of the target light beam.

[0048] In order to achieve a visually continuous light beam, a larger number of planes, for example, 128 planes, need to be set in the volume morphology. It is understandable that the more planes there are, the stronger the visual continuity of the light beam. The volume morphology can affect parameters such as the length and shape of the target light beam. Parameters such as the color, brightness, and light distribution within the target light beam need to be achieved through material mapping on the plane. In this embodiment, a material map needs to be set for each plane in the volume morphology. Since a plane has two sides, a front and a back, in order to make the target light beam physically realistic at all angles, a double-sided material map can be set for the plane.

[0049] The content of the material map can be set based on the needs of the specific scene where the target light beam is located. For example, in a stage scene, you may need to set a red light beam effect. In this case, the content of the material map needs to be set to a red-toned pattern; if a darker light beam effect is required, the content of the material map needs to be set to a lower-brightness pattern; if the light beam needs to present a specific light distribution, the content of the material map needs to be set to a specific texture pattern, etc.

[0050] Through the above steps, a model of the target beam's effect can be obtained. Once this model is completed, it can be placed in a specific virtual scene. Furthermore, if the scene requirements change, the above volumetric shape or material mapping can be adjusted to adjust the visual effect of the target beam.

[0051] The above-mentioned method for generating a light beam effect model first creates a volumetric form of a target light beam in a specified space; wherein the volumetric form includes multiple planes arranged in sequence; the planes have a preset shape; the multiple planes face in the same direction, and the areas of the multiple planes gradually change along the direction of the direction; then, a material map is set for the planes in the volumetric form to obtain an effect model of the target light beam; wherein the content of the material map is pre-set based on the effect parameters of the target light beam; the effect parameters include one or more of the color, brightness, and light distribution of the target light beam. In this method, the volumetric form of the light beam is obtained by stacking multiple planes, and by mapping the planes, detailed effects such as the color, brightness, and light distribution of the light beam can be achieved. As a result, the resulting light beam effect has good physical realism, is highly controllable, and is easy to operate, meeting the lighting requirements of various scenes.

[0052] During the production process of the effect model of the target light beam, or after the production is completed, various parameters of the model can be adjusted to adjust the visual effect of the target light to meet diverse lighting needs.

[0053] In one method, the position of the endpoint plane is adjusted in response to a position adjustment instruction of the endpoint plane in the volume morphology; wherein the position of the endpoint plane is used to indicate the beam length of the target light beam; based on the position of the endpoint plane, the position of the plane other than the endpoint plane is adjusted; wherein in the volume morphology, adjacent planes have a specified distance relationship.

[0054] The target beam's length can be adjusted by adjusting the positions of the endpoint planes. For example, by adjusting only one endpoint plane while keeping the other unchanged, the distance between the two planes changes, resulting in a change in the target beam's length. It's also possible to adjust the positions of both endpoint planes simultaneously, for example, by adjusting both the starting and ending planes. It's understood that when the target beam's length changes, its visual appearance also changes. For example, when the target beam becomes longer while its width remains unchanged, its appearance becomes elongated. When the target beam becomes shorter while its width remains unchanged, its appearance becomes short and thick.

[0055] When the positions of the endpoint planes are adjusted, the positions of the intermediate planes between them can be automatically adjusted. In one approach, the distances between adjacent planes in the volume can be set to the same. Based on this distance relationship, when the positions of the endpoint planes are adjusted, the positions of the intermediate planes are automatically adjusted. In another approach, the distances between adjacent planes in the volume can be set to a fixed value. Based on this distance relationship, when the positions of the endpoint planes are adjusted, the number of planes in the volume can be automatically increased or decreased.

[0056] As can be seen from the above embodiment, the volume shape can be established in the Actor blueprint class. In this case, the volume shape will have a reference point. By controlling the movement of this reference point, the overall position of the volume shape can be controlled. This reference point can also be used as the origin of the three-dimensional coordinate system of the space where the model is located. Figure 2 As shown, the reference point is shown as “•”, and a three-dimensional coordinate system in space is established with the reference point as the origin.

[0057] In the blueprint class, the positions of various planes can be adjusted based on the reference point. Specifically, the volume morphology is preset with a reference point; the endpoint planes in the above embodiment include a starting plane and / or an ending plane; in response to a first distance adjustment instruction between the starting plane and the reference point in the volume morphology, the distance between the starting plane and the reference point is adjusted to obtain the adjusted position of the starting plane; and / or, in response to a second distance adjustment instruction between the ending plane and the reference point in the volume morphology, the distance between the ending plane and the reference point is adjusted to obtain the adjusted position of the ending plane.

[0058] In the blueprint class, you can set up various parameter adjustment interfaces, through which you can issue the first and second distance adjustment instructions. For example, you can adjust the distance between the starting plane and the reference point, changing the position of the starting plane while the reference point remains unchanged; or adjust the distance between the ending plane and the reference point, changing the position of the ending plane while the reference point remains unchanged. In actual implementation, you can adjust only the distance between the starting plane and the reference point, only the distance between the ending plane and the reference point, or both the distances between the starting plane and the reference point.

[0059] Figure 4 As an example, in Figure 2 Based on the volume shape shown, adjusting the distance between the end plane and the reference point can shorten the length of the beam. At the same time, the position of the middle plane between the starting plane and the end plane also changes accordingly.

[0060] In another embodiment, in response to an area parameter adjustment instruction of the endpoint plane in the volume form, the area of ​​the endpoint plane is adjusted; wherein the area of ​​the endpoint plane is used to indicate the shape of the target light beam; based on the area of ​​the endpoint plane, the area of ​​the plane other than the endpoint plane is adjusted; wherein, in the volume form, the areas of multiple planes gradually increase or decrease along the direction of orientation.

[0061] The above area parameters can be determined based on the plane's shape. For example, if the plane is circular, the area parameter can be the diameter or radius; if the plane is rectangular, the area parameter can be the length and width of the rectangle. In the blueprint class, you can adjust the area parameters of the endpoint planes through the parameter adjustment interface, thereby adjusting the area of ​​the endpoint plane. In actual implementation, you can adjust the area of ​​only the starting plane, only the ending plane, or both the starting and ending planes.

[0062] The area of ​​the endpoint plane usually affects the shape of the target beam. To understand this, Figure 5 As an example. Figure 2 Based on the volumetric shape shown, increasing the area of ​​the starting plane and decreasing the area of ​​the ending plane results in an inverted cone-shaped beam shape. When the areas of the endpoint planes are adjusted, the area of ​​the intermediate plane between them also adjusts accordingly. In practical implementations, you can set the areas of the planes in the volumetric shape to always change gradually along the plane's orientation. Based on this setting, when the areas of the endpoint planes are adjusted, the areas of the intermediate planes automatically change with the areas of the endpoint planes.

[0063] By default, the planes in the volume are relatively thin, and the thickness of the plane is usually set to 1. When the virtual camera moves in the virtual scene, if the angle between the virtual camera and a plane is 0 degrees, or close to 0 degrees, the plane will not be displayed. Visually, the beam will be broken, such as Figure 6 As shown, this phenomenon does not conform to the beam characteristics in the real world. In order to avoid this problem, in this embodiment, a certain thickness needs to be set for each plane.

[0064] In a specific implementation, a specified position offset value is set for the target material; for each plane in the volumetric shape, the target material with the position offset value is mapped onto the plane; wherein the plane thickness of the mapped plane is determined based on the position offset value of the target material.

[0065] The target material typically has multiple properties, among which the World Position Offset property can be used to set the position offset value of the target material. After setting the position offset value for the target material, the vertices of the target material are controlled in space, thereby changing the shape of the target material. The movement and rotation of the target material can also be controlled. In this embodiment, by setting the position offset value, the target material can be moved relatively away from the plane, visually giving the plane a certain thickness. The larger the position offset value, the greater the visual thickness of the plane. In the world space corresponding to the virtual scene, the above-mentioned position offset value can specifically be a world position offset value.

[0066] In addition, considering that in the real world, light beams are usually brighter in the middle and dimmer at the edges due to energy attenuation, in order to simulate this effect, different position offset values ​​can be set for different positions of the target material. For example, a larger position offset value can be set near the center area, and a smaller position offset value can be set near the edge area.

[0067] Specifically, the vertex normal is multiplied by a preset curve function to obtain a wave offset value; this wave offset value is then set as the position offset value of the target material. The curve function can be a sine function, a cosine function, or another curve function. Taking the sine function as an example, the vertex normal is multiplied by the sine function to obtain a wave offset value that spreads outward from the center. This wave offset value is then set to the target material corresponding to each plane. In the world space corresponding to the virtual scene, the vertex normal can specifically be a world space vertex normal.

[0068] The following describes how the target material is generated and how the material map is set up for the plane.

[0069] In one method, a target material is generated based on a preset noise map and a mask; wherein the shape of the target material is the same as the shape of the mask; the mask has an edge blur property; and based on the target material, a material map is set for a plane in the volumetric shape.

[0070] The pattern texture in the noise map can be randomly generated. When applied to a surface, the target material generated based on the noise map creates a visual effect of random light distribution within the beam. If you need to adjust the light distribution within the beam, you need to adjust the pattern texture within the noise map. For example, darker areas or shadows will have a darker pattern texture, while brighter areas will have a brighter pattern texture.

[0071] Typically, the shape of the target material needs to be determined based on the shape of the plane. If the plane is circular, the target material also needs to be circular. In this case, the pixel value in the circular area of ​​the mask is 1, and the pixel value outside the circular area is 0. Multiplying the noise map with the mask will result in a circular target material.

[0072] In order to make the edge of the light beam softer, the above mask has an edge blur property, that is, the pixel values ​​1 and 0 in the edge area of ​​the mask are mixed, so that the edge clarity is lower and the transition is softer.

[0073] Furthermore, the preset noise map and mask are multiplied to create the initial material. This initial material is then offset according to a preset time to create the target material. In actual implementation, the Time and Panner material animation nodes can be used to set the initial material's properties, causing it to offset according to a preset time to create the target material. This creates a slowly flowing material effect. After mapping the target material onto a plane, the slowly flowing material simulates the visual effect of light shifting between bright and dark within a beam, making the beam more realistic.

[0074] In actual implementation, you can adjust parameters such as the mask shape and edge blur to adjust the material shape and edge blur, thereby adjusting the visual effect of the light beam. By adjusting the flow of the material, you can achieve changes in the brightness and darkness of the light beam. This method allows for better control over the internal details of the light beam.

[0075] Furthermore, this embodiment can also achieve a fog effect within the light beam. In the absoluteworld position attribute, a flowing fog map is added to the XZ and YZ planes to achieve the fog effect within the light. Referring to the previous embodiment, a three-dimensional coordinate system is established in world space with the reference point as the origin. Based on the X, Y, and Z axes of this three-dimensional coordinate system, the XZ and YZ planes can be determined.

[0076] Furthermore, the target beam's effect model, obtained through the aforementioned method, can be understood as a resource for a volumetric light blueprint. The various parameters within this blueprint control the target beam's behavior. For example, the length, shape, and illumination range of the target beam can be controlled through volumetric shape parameters, while the color, brightness, and light distribution of the beam can be controlled through material map parameters. The target beam's effect model is placed in the virtual scene using the properties of a Static Mesh, and the target beam has the same occlusion and interpenetration relationships as other Static Meshes in the virtual scene.

[0077] A virtual spotlight can also be set at one end of the target beam to simulate the target beam being illuminated by the virtual spotlight. If other virtual objects enter the target beam, the virtual objects have relatively realistic light and shadow effects.

[0078] The above-mentioned method for generating a light beam effect model generates an effect model of a target light beam with high physical authenticity and is realistic and convincing. It can support the adjustment of light shape and details, meet the needs of producing the Tyndall effect in different small-scale scenes, and can efficiently and conveniently control parameters, so that the light looks more realistic, integrated with the environment, and rich and varied.

[0079] Corresponding to the above method embodiment, see Figure 7 A schematic structural diagram of a device for generating a beam effect model is shown, the device comprising:

[0080] A morphology creation module 70 is configured to create a volume morphology of a target light beam in a specified space; wherein the volume morphology includes a plurality of planes arranged in sequence; the planes have a predetermined shape; the plurality of planes face in the same direction, and the areas of the plurality of planes gradually change along the direction of the direction;

[0081] The texture setting module 72 is used to set a material texture for the plane in the volume form to obtain an effect model of the target light beam; wherein the content of the material texture is pre-set based on the effect parameters of the target light beam; the effect parameters include one or more of the color, brightness and light distribution of the target light beam.

[0082] The above-mentioned device also includes a position adjustment module, which is used to: adjust the position of the endpoint plane in response to the position adjustment instruction of the endpoint plane in the volume form; wherein the position of the endpoint plane is used to indicate the beam length of the target light beam; based on the position of the endpoint plane, adjust the position of the plane other than the endpoint plane; wherein, in the volume form, adjacent planes have a specified distance relationship.

[0083] The above-mentioned endpoint plane includes a starting plane and / or an ending plane; a reference point is preset in the volume form; the above-mentioned position adjustment module is also used to: respond to a first distance adjustment instruction between the starting plane and the reference point in the volume form, adjust the distance between the starting plane and the reference point, and obtain the position of the adjusted starting plane; and / or, respond to a second distance adjustment instruction between the ending plane and the reference point in the volume form, adjust the distance between the ending plane and the reference point, and obtain the position of the adjusted ending plane.

[0084] The above-mentioned device also includes an area adjustment module, which is used to: adjust the area of ​​the endpoint plane in response to the area parameter adjustment instruction of the endpoint plane in the volume form; wherein the area of ​​the endpoint plane is used to indicate the shape of the target light beam; based on the area of ​​the endpoint plane, adjust the area of ​​the plane other than the endpoint plane; wherein, in the volume form, the areas of multiple planes gradually increase or decrease along the direction of orientation.

[0085] The above-mentioned mapping setting module is also used to: set a specified position offset value for the target material; for each plane in the volume shape, map the target material with the position offset value onto the plane; wherein the plane thickness of the mapped plane is determined based on the position offset value of the target material.

[0086] The above-mentioned mapping setting module is also used to: multiply the vertex normal with a preset curve function to obtain a wave offset value; and set the wave offset value as a position offset value of the target material.

[0087] The above-mentioned mapping setting module is also used to: generate a target material based on a preset noise map and mask; wherein the shape of the target material is the same as the shape of the mask; the mask has an edge blur property; based on the target material, set the material map for the plane in the volume shape.

[0088] The above-mentioned texture setting module is also used to: multiply the preset noise map and the mask to obtain the initial material; set the initial material to offset according to the preset time to obtain the target material.

[0089] The device for generating the above-mentioned light beam effect model creates a volumetric form of a target light beam in a specified space; wherein the volumetric form includes multiple planes arranged in sequence; the planes have a preset shape; the multiple planes face in the same direction, and the areas of the multiple planes gradually change along the direction of the direction; then, a material map is set for the planes in the volumetric form to obtain an effect model of the target light beam; wherein the content of the material map is pre-set based on the effect parameters of the target light beam; the effect parameters include one or more of the color, brightness, and light distribution of the target light beam. In this method, the volumetric form of the light beam is obtained by stacking multiple planes, and detailed effects such as the color, brightness, and light distribution of the light beam can be achieved by mapping the planes. As a result, the resulting light beam effect has good physical realism, is highly controllable, and is easy to operate, which can meet the lighting requirements of various scenes.

[0090] This embodiment further provides an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-mentioned method for generating a beam effect model. The electronic device can be a server or a terminal device.

[0091] See also Figure 8As shown, the electronic device includes a processor 100 and a memory 101, the memory 101 storing machine executable instructions capable of being executed by the processor 100, the processor 100 executing the machine executable instructions to implement the above-mentioned method for generating a light beam effect model.

[0092] Further, Figure 8 As shown, the electronic device further includes a bus 102 and a communication interface 103, the processor 100, the communication interface 103 and the memory 101 being connected through the bus 102.

[0093] The memory 101 can include a high-speed random access memory (RAM), and can also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which can be wired or wireless), and the Internet, a wide area network, a local area network, a metropolitan area network, etc. can be used. The bus 102 can be an ISA bus, a PCI bus, an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus or only one type of bus.

[0094] The processor 100 can be an integrated circuit chip with processing capability. In implementation process, each step of the above method can be completed by integrated logic circuit of hardware in the processor 100 or instruction in the form of software. The processor 100 described above can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. Each method, step and logic block diagram disclosed in the embodiment of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiment of the present application can be directly embodied as a hardware code processor for execution, or a combination of hardware and software modules in the code processor for execution. The software module can be located in a random access memory, a flash memory, a read only memory, a programmable read only memory or an electrically erasable programmable memory, a register, etc. The storage medium in the art. The storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101, and combines the hardware to complete the steps of the method of the above embodiment.

[0095] The embodiment also provides a machine readable storage medium, the machine readable storage medium stores machine executable instructions, when the machine executable instructions are called and executed by the processor, the machine executable instructions cause the processor to implement the generation method of the light beam effect model.

[0096] The computer program product of the light beam effect model generation method, device, electronic equipment and storage medium provided by the embodiment of the present application includes a computer readable storage medium storing program codes, the instructions included in the program codes can be used to execute the method described in the foregoing method embodiment, and the specific implementation can be referred to the method embodiment, and will not be repeated here.

[0097] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the foregoing method embodiment, and will not be repeated here.

[0098] In addition, in the description of the embodiments of the present invention, unless otherwise expressly specified or limited, the terms "mounted," "connected," and "connected" should be understood in a broad sense. For example, they may refer to fixed connections, detachable connections, or integral connections; they may refer to mechanical connections or electrical connections; they may refer to direct connections or indirect connections through an intermediate medium; and they may refer to internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on the specific circumstances.

[0099] If the functions are implemented as 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 invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.

[0100] In the description of the present invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate and simplify the description of the present invention. They are not intended to indicate or imply that the devices or components referred to must have, be constructed, or operate in a specific orientation, and therefore should not be construed as limitations on the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0101] Finally, it should be noted that the above embodiments are only specific implementation methods of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above embodiments within the technical scope disclosed by the present invention, or replace some of the technical features therein with equivalents. Such modifications, changes or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A method for generating a beam effect model, characterized in that: The method comprises: Creating a volumetric form of a target light beam in a specified space; wherein the volumetric form includes a plurality of planes arranged in sequence; the planes have a preset shape; the plurality of planes face in the same direction, and the areas of the plurality of planes gradually change along the direction; A material map is set for a plane in the volumetric form to obtain an effect model of the target light beam; wherein the content of the material map is pre-set based on effect parameters of the target light beam; the effect parameters include one or more of color, brightness, and light distribution of the target light beam.

2. The method according to claim 1, characterized in that After the step of creating a volumetric form of the target light beam in the designated space, the method further comprises: In response to a position adjustment instruction of an endpoint plane in the volume morphology, adjusting the position of the endpoint plane; wherein the position of the endpoint plane is used to indicate the beam length of the target light beam; Based on the position of the endpoint plane, the position of the plane other than the endpoint plane is adjusted; wherein, in the volume morphology, adjacent planes have a specified distance relationship.

3. The method according to claim 2, characterized in that in, The endpoint plane includes a starting plane and / or an ending plane; a reference point is preset in the volume form; and the step of adjusting the position of the endpoint plane in response to a position adjustment instruction of the endpoint plane in the volume form comprises: In response to a first distance adjustment instruction between a starting plane and the reference point in the volume morphology, adjusting the distance between the starting plane and the reference point to obtain an adjusted position of the starting plane; And / or, in response to a second distance adjustment instruction between the end plane and the reference point in the volume morphology, the distance between the end plane and the reference point is adjusted to obtain the adjusted position of the end plane.

4. The method according to claim 1, wherein After the step of creating a volumetric form of the target light beam in the designated space, the method further comprises: In response to an area parameter adjustment instruction of an endpoint plane in the volume morphology, adjusting the area of ​​the endpoint plane; wherein the area of ​​the endpoint plane is used to indicate the shape of the target light beam; Based on the area of ​​the endpoint plane, the area of ​​the plane other than the endpoint plane is adjusted; wherein, in the volume form, the areas of multiple planes gradually increase or decrease along the orientation direction.

5. The method according to claim 1, wherein The step of setting a material map for a plane in the volumetric shape comprises: Set the specified position offset value for the target material; For each plane in the volume shape, a target material with the position offset value is mapped onto the plane; wherein a thickness of the mapped plane is determined based on the position offset value of the target material.

6. The method according to claim 5, characterized in that To set a specified Position Offset value for a target material, include: Multiplying the vertex normal by a preset curve function to obtain a wave offset value; wherein the vertex normal is a vertex normal in a world space; and the world space is the specified space; Set the wave offset value to the position offset value of the target material.

7. The method according to claim 1, characterized in that The step of setting a material map for a plane in the volumetric shape comprises: Generate a target material based on a preset noise map and a mask; wherein the shape of the target material is the same as the shape of the mask; and the mask has an edge blur property; Sets a material map for a plane in the volume shape based on the target material.

8. The method according to claim 7, characterized in that Based on the preset noise map and mask, the steps to generate the target material include: Multiply the preset noise map and mask to get the initial material; The initial material is set to be offset according to a preset time to obtain a target material.

9. A device for generating a beam effect model, characterized in that: The device comprises: A morphology creation module, configured to create a volume morphology of a target light beam in a specified space; wherein the volume morphology includes a plurality of planes arranged in sequence; the planes have a preset shape; the plurality of planes face in the same direction, and the areas of the plurality of planes gradually change along the direction; A texture setting module is used to set a material map for the plane in the volumetric form to obtain an effect model of the target light beam; wherein the content of the material map is pre-set based on the effect parameters of the target light beam; the effect parameters include one or more of the color, brightness and light distribution of the target light beam.

10. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the method for generating a beam effect model according to any one of claims 1 to 8.

11. A machine-readable storage medium, characterized in that The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by the processor, the machine-executable instructions prompt the processor to implement the method for generating a beam effect model according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • 3D (three-dimensional) volume light dynamic implementation method and device

    CN102243769A

  • Dynamic volume cloud rendering method and device and electronic equipment

    CN112190935A