Method, device, storage medium and electronic device for realizing thundercloud effect
Through cloud noise generation and masking processing technology based on the virtual sky box model, the problem of high cost and low efficiency of rendering thundercloud effect in the existing technology is solved, and high-quality and low-cost rendering of thundercloud effect is achieved.
Patent Information
- Application Number
- CN202111567323.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-20
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2041-12-20
AI Technical Summary
In the prior art, the rendering cost and low efficiency of using special-effect particles to generate thundercloud effects is high in the art, and no effective solution has been proposed.
Cloud noise is generated by the first plane information and noise map based on the virtual sky box model, and multiple mask areas and their thundercloud flash frequency are obtained through scaling processing and mask processing. This information is used to render the virtual sky box model to obtain a virtual sky box model with thundercloud effect.
It realizes the rendering of high-quality thundercloud effects in virtual game scenes with lower cost and higher efficiency, solving the problem of high rendering cost and low efficiency when the thundercloud effects are generated by the special effect particles in the face.
Smart Images

Figure CN114445531B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, storage medium and electronic device for realizing thundercloud effect. Background Art
[0002] In virtual game scenes, it is often necessary to express harsh environments through thundercloud effects. To this end, technicians in this field are constantly exploring various methods for expressing high-quality thundercloud effects.
[0003] In the related methods, thundercloud effects are generated by using high-resolution patch special effect particles of various styles, that is, the range and color of the thundercloud effect are controlled based on the range and frequency of the special effect particles. However, the disadvantage of this method is that the cost of achieving high-quality thundercloud effect rendering is high and the efficiency is low.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a method, device, storage medium and electronic device for realizing thundercloud effect, so as to at least solve the technical problems of high rendering cost and low rendering efficiency in the processing method of generating thundercloud effect using surface special effect particles in the related art.
[0006] According to one aspect of an embodiment of the present invention, a method for realizing a thundercloud effect is provided, comprising:
[0007] Based on the first plane information and noise map of the virtual skybox model, cloud noise is generated, wherein the first plane information is determined by the coordinate positions of the vertices of the virtual skybox model in the world space; the first plane information is scaled to obtain the second plane information; based on the second plane information, a plurality of first mask areas and a thundercloud flashing frequency corresponding to each of the plurality of first mask areas are obtained; using the cloud noise, the plurality of first mask areas and the thundercloud flashing frequency corresponding to each of the first mask areas, the virtual skybox model is rendered to obtain a virtual skybox model with a thundercloud effect.
[0008] Optionally, generating cloud noise based on the first plane information and the noise map of the virtual sky box model includes: performing texture sampling on the noise map based on the first plane information to obtain sampled noise; and calculating the cloud noise using the sampled noise and the height coordinates of the vertices of the virtual sky box model in the world space.
[0009] Optionally, acquiring multiple first mask areas based on the second plane information includes: performing two-dimensional random processing based on the second plane information to generate multiple second mask areas; and performing spherical mask processing on the multiple second mask areas to obtain multiple first mask areas.
[0010] Optionally, performing spherical mask processing based on multiple second mask areas to obtain multiple first mask areas includes: performing spherical mask processing on each of the multiple second mask areas to obtain multiple grids, wherein each of the multiple grids contains a spherical area; adding a random value within a preset range to each spherical area to obtain a processing result, wherein the preset range is associated with the coordinate position of each spherical area in the corresponding second mask area, and the processing result is a set of spherical areas adjusted based on the corresponding random values; scaling the distance between each spherical area in the processing result and the corresponding grid boundary to obtain multiple first mask areas.
[0011] Optionally, obtaining the thundercloud flashing frequency corresponding to each first mask area based on the second plane information includes: performing one-dimensional random processing based on the second plane information to generate a first random time parameter corresponding to each first mask area; using the first random time parameter and the second random time parameter to calculate the thundercloud flashing frequency corresponding to each first mask area, wherein the second random time parameter is determined by the time parameter provided by a preset game engine.
[0012] Optionally, a virtual skybox model is rendered using cloud noise, multiple first mask areas, and the thundercloud flash frequency corresponding to each first mask area to obtain a virtual skybox model with a thundercloud effect, including: multiplying the multiple first mask areas with the thundercloud flash frequency corresponding to each first mask area to obtain a calculation result; multiplying the calculation result with the cloud noise to generate material parameters of the virtual skybox model; and rendering the virtual skybox model based on the material parameters to obtain a virtual skybox model with a thundercloud effect.
[0013] Optionally, the method for realizing the thundercloud effect further includes: acquiring color parameters corresponding to the plurality of first mask regions; and enhancing the thundercloud effect using the color parameters to obtain a virtual skybox model of the enhanced thundercloud effect.
[0014] According to another aspect of an embodiment of the present invention, a device for realizing a thundercloud effect is further provided, including:
[0015] A first generating module is used to generate cloud noise based on first plane information and a noise map of a virtual skybox model, wherein the first plane information is determined by the coordinate positions of the vertices of the virtual skybox model in the world space; a processing module is used to scale the first plane information to obtain second plane information; an acquiring module is used to acquire multiple first mask areas and a thundercloud flash frequency corresponding to each of the multiple first mask areas based on the second plane information; a second generating module is used to render the virtual skybox model using the cloud noise, the multiple first mask areas and the thundercloud flash frequency corresponding to each of the first mask areas to obtain a virtual skybox model with a thundercloud effect.
[0016] Optionally, the first generating module is further used to: perform texture sampling on the noise map based on the first plane information to obtain sampled noise; and calculate cloud noise using the sampled noise and the height coordinates of the vertices of the virtual sky box model in the world space.
[0017] Optionally, the acquisition module is further used to: perform two-dimensional random processing based on the second plane information to generate a plurality of second mask areas; and perform spherical mask processing on the plurality of second mask areas to obtain a plurality of first mask areas.
[0018] Optionally, the acquisition module is also used to: perform spherical mask processing on each of the multiple second mask areas to obtain multiple grids, wherein each of the multiple grids contains a spherical area; add a random value within a preset range to each spherical area to obtain a processing result, wherein the preset range is associated with the coordinate position of each spherical area in the corresponding second mask area, and the processing result is a set of spherical areas adjusted based on the corresponding random values; and scale the distance between each spherical area in the processing result and the corresponding grid boundary to obtain multiple first mask areas.
[0019] Optionally, the acquisition module is also used to: perform one-dimensional random processing based on the second plane information to generate a first random time parameter corresponding to each first mask area; use the first random time parameter and the second random time parameter to calculate the thundercloud flashing frequency corresponding to each first mask area, wherein the second random time parameter is determined by the time parameter provided by a preset game engine.
[0020] Optionally, the second generation module is also used to: multiply the multiple first mask areas with the thundercloud flashing frequency corresponding to each first mask area to obtain a calculation result; multiply the calculation result with the cloud noise to generate material parameters of the virtual sky box model; render the virtual sky box model based on the material parameters to obtain a virtual sky box model with a thundercloud effect.
[0021] Optionally, the device for realizing the thundercloud effect further includes: an enhancement module, which is used to obtain color parameters corresponding to the multiple first mask areas; and enhance the thundercloud effect using the color parameters to obtain a virtual skybox model of the enhanced thundercloud effect.
[0022] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute any of the above-mentioned methods for implementing the thundercloud effect when running.
[0023] According to another aspect of an embodiment of the present invention, an electronic device is provided, including: a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any of the above methods for implementing the thundercloud effect.
[0024] In at least some embodiments of the present invention, a method based on first plane information and noise mapping of a virtual skybox model is used to generate cloud noise, wherein the first plane information is determined by the coordinate positions of the vertices of the virtual skybox model in the world space, the second plane information is obtained by scaling the first plane information, and multiple first mask areas and the thundercloud flashing frequency corresponding to each of the multiple first mask areas are obtained based on the second plane information, and then the virtual skybox model is rendered using the cloud noise, the multiple first mask areas and the thundercloud flashing frequency corresponding to each of the first mask areas to obtain a virtual skybox model with a thundercloud effect, thereby achieving the purpose of generating a thundercloud effect in a virtual game scene through a virtual skybox model, thereby achieving the technical effect of rendering high-quality thundercloud effects in a virtual game scene at a lower cost and higher efficiency, and thereby solving the technical problems of high rendering cost and low rendering efficiency in the processing method of using patch special effect particles to generate thundercloud effects in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0026] Figure 1 It is a hardware structure block diagram of a mobile terminal of a method for realizing a thundercloud effect according to an embodiment of the present invention;
[0027] Figure 2 is a flow chart of a method for realizing thundercloud effect according to one embodiment of the present invention;
[0028] Figure 3 is a schematic diagram of spherical mask processing according to one optional embodiment of the present invention;
[0029] Figure 4 is a schematic diagram of a spherical mask processing result according to one optional embodiment of the present invention;
[0030] Figure 5 is a structural block diagram of a device for realizing thundercloud effect according to one embodiment of the present invention;
[0031] Figure 6 It is a structural block diagram of another optional device for realizing thundercloud effect according to one embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] According to one embodiment of the present invention, an embodiment of a method for realizing a thundercloud effect is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that shown here.
[0035] In one embodiment of the present invention, the method for implementing the thundercloud effect can be run on a terminal device or a server. The terminal device can be a local terminal device. When the method for implementing the thundercloud effect is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0036] In an optional implementation, various cloud applications can be run under the cloud interaction system, such as cloud games. Taking cloud games as an example, cloud games refer to a game method based on cloud computing. In the operation mode of cloud games, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the implementation method of the thundercloud effect are completed on the cloud game server. The role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the terminal device for information processing is a cloud game server in the cloud. When playing the game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.
[0037] In an optional embodiment, the terminal device may be a local terminal device. Taking a game as an example, the local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the player through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.
[0038] In a possible implementation, an embodiment of the present invention provides a method for implementing a thundercloud effect by providing a graphical user interface through a terminal device, wherein the terminal device may be the local terminal device mentioned above, or may be a client device in the cloud interaction system mentioned above.
[0039] Taking a mobile terminal running in a local terminal device as an example, the mobile terminal can be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, referred to as MID), a PAD, a game console, and other terminal devices. Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal for implementing a method for thundercloud effect according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microprocessor (MCU), a programmable logic device (FPGA), a neural network processor (NPU), a tensor processor (TPU), an artificial intelligence (AI) type processor, etc.) and a memory 104 for storing data. Optionally, the mobile terminal may also include a transmission device 106 for communication functions, an input and output device 108, and a display device 110. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0040] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the implementation method of the thundercloud effect in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the implementation method of the thundercloud effect described above is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0041] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0042] The inputs in the input / output device 108 may come from a plurality of human interface devices (HIDs), such as keyboards and mice, game controllers, and other dedicated game controllers (such as steering wheels, fishing rods, dance mats, remote controls, etc.). In addition to providing input functions, some human interface devices may also provide output functions, such as force feedback and vibration of game controllers, audio output of controllers, etc.
[0043] The display device 110 may be, for example, a head-up display (HUD), a touch-screen liquid crystal display (LCD), and a touch display (also referred to as a "touch screen" or "touch display screen"). The liquid crystal display may enable a user to interact with a user interface of the mobile terminal. In some embodiments, the mobile terminal has a graphical user interface (GUI), and a user may interact with the GUI by finger contacts and / or gestures on a touch-sensitive surface, wherein the human-computer interaction functions here may optionally include the following interactions: creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving emails, call interfaces, playing digital videos, playing digital music, and / or web browsing, etc. The executable instructions for executing the above-mentioned human-computer interaction functions are configured / stored in a computer program product or a readable storage medium executable by one or more processors.
[0044] In this embodiment, a method for realizing a thundercloud effect running on the above-mentioned mobile terminal is provided. Figure 2 is a flow chart of a method for realizing thundercloud effect according to one embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:
[0045] Step S21, generating cloud noise based on first plane information of the virtual skybox model and the noise map, wherein the first plane information is determined by the coordinate positions of the vertices of the virtual skybox model in the world space;
[0046] The above virtual skybox model is a simplified model for displaying distant objects (e.g., mountains, sea, sky, etc.) in a virtual game scene. In the real-time rendering process of the virtual game scene, the movement of the observer has very little effect on the display effect of the distant objects. For example, when the virtual game character moves hundreds or even thousands of meters in the virtual game scene, the observed distant mountains and sky hardly change. Therefore, the virtual skybox model can be used to reduce the real-time rendering pressure of the virtual game scene.
[0047] In the above virtual skybox model, corresponding textures are affixed to the six unfolded faces of the cube. When the virtual scene is rendered, the cube is covered around the scene observation point, and the scene observation point is always located at the center of the cube, so that the corresponding texture is sampled according to the position of the intersection of the scene observation line of sight and the cube to obtain the rendering result.
[0048] The noise map can be obtained by processing a basic noise map. The basic noise map is a map with random brightness of each pixel generated based on random numbers. The processing operation can be at least one of the following operations: function interpolation, multi-layer scaling overlay, multi-layer absolute value overlay, multi-layer trigonometric function overlay, multi-layer rotation overlay, and multi-layer difference overlay.
[0049] The virtual skybox model may include: first plane information and a noise map. The first plane information may be sky plane texture information in the world space, and the first plane information may be determined by the coordinate positions of the vertices of the virtual skybox model in the world space. The coordinate positions of the vertices of the virtual skybox model in the world space may include: length coordinates, width coordinates, and height coordinates.
[0050] Based on the first plane information and the noise map, cloud layer noise can be generated, and the cloud layer noise can be used to obtain a virtual sky box model with thundercloud effects.
[0051] Step S22, scaling the first plane information to obtain second plane information;
[0052] The first plane information may be sky plane texture information in the world space, and the first plane information may be determined by the coordinate positions of the vertices of the virtual skybox model in the world space. The scaling process may divide the plane area corresponding to the first plane information so as to subsequently determine the rendering area of the thundercloud effect. The scaling process may be performed on the first plane information to obtain the second plane information, and the second plane information may include a plurality of sub-plane information.
[0053] By scaling the first plane information and obtaining the second plane information, different areas in the plane can be controlled separately, thereby improving the rendering quality of the thundercloud effect and enhancing the virtual display.
[0054] Step S23, acquiring a plurality of first mask areas and a thundercloud flashing frequency corresponding to each of the plurality of first mask areas based on the second plane information;
[0055] The plurality of first mask areas may be areas for rendering thundercloud effects obtained based on the second plane information, that is, a plurality of areas are selected from the plane area corresponding to the second plane information as the first mask areas. In addition, based on the second plane information, the thundercloud flash frequency corresponding to each of the plurality of first mask areas may also be obtained, and the thundercloud flash frequency is used to indicate the frequency of lightning in the thundercloud area.
[0056] By obtaining multiple first mask areas and the thundercloud flashing frequency corresponding to each of the multiple first mask areas based on the second plane information, the thundercloud area in the virtual game scene and the visual characteristics of the thundercloud area can be determined, thereby obtaining a virtual skybox model with thundercloud effect.
[0057] Step S24, rendering the virtual skybox model using the cloud noise, the multiple first mask areas, and the thundercloud flashing frequency corresponding to each first mask area, to obtain a virtual skybox model with a thundercloud effect.
[0058] The thundercloud effect may be a sky texture change observed by a virtual game character in a virtual game scene, and the sky texture change may include: sky color change, cloud color change, lightning feature change, etc. Based on the cloud noise, the plurality of first mask areas, and the thundercloud flash frequency corresponding to each first mask area, the virtual skybox model may be rendered, and thus a virtual skybox model with a thundercloud effect may be obtained.
[0059] It is easy to notice that in the related art, when using patch special effect particles to generate thundercloud effects, it is necessary to use a variety of styles of high-resolution patch special effect particles to cover the entire cloud range, and the patch special effect particles are continuously in a loading state during the thundercloud effect rendering process, causing great rendering pressure. However, according to the method for realizing thundercloud effects provided by an embodiment of the present invention, the use of patch special effect particles can be avoided, and lightning can appear at a random frequency in random areas of the sky with higher efficiency, thereby rendering a high-quality thundercloud effect.
[0060] In at least some embodiments of the present invention, a method based on first plane information and noise mapping of a virtual skybox model is used to generate cloud noise, wherein the first plane information is determined by the coordinate positions of the vertices of the virtual skybox model in the world space, the second plane information is obtained by scaling the first plane information, and multiple first mask areas and the thundercloud flashing frequency corresponding to each of the multiple first mask areas are obtained based on the second plane information, and then the virtual skybox model is rendered using the cloud noise, the multiple first mask areas and the thundercloud flashing frequency corresponding to each of the first mask areas to obtain a virtual skybox model with a thundercloud effect, thereby achieving the purpose of generating a thundercloud effect in a virtual game scene through a virtual skybox model, thereby achieving the technical effect of rendering high-quality thundercloud effects in a virtual game scene at a lower cost and higher efficiency, and thereby solving the technical problems of high rendering cost and low rendering efficiency in the processing method of using patch special effect particles to generate thundercloud effects in the related art.
[0061] Optionally, in step S21, generating cloud noise based on the first plane information of the virtual sky box model and the noise map may include the following execution steps:
[0062] Step S211, performing texture sampling on the noise map based on the first plane information to obtain sampled noise;
[0063] Step S212, cloud layer noise is calculated using the sampled noise and the height coordinates of the vertices of the virtual sky box model in the world space.
[0064] The first plane information may be sky plane texture information in world space, and the first plane information may be determined by the coordinate positions of the vertices of the virtual skybox model in world space. The noise map may be obtained by processing a basic noise map. The texture sampling may be based on a mapping relationship between the coordinate positions in the first plane information and the coordinate positions in the noise map, obtaining part of the texture information from the noise map, and using the part of the texture information as the sampling noise.
[0065] By using the sampling noise and the height coordinates of the vertices of the virtual skybox model in the world space, calculation can be performed to obtain the cloud layer noise. The cloud layer noise can be used to obtain a virtual skybox model with thundercloud effects.
[0066] For example, when showing severe weather with thunder and lightning in a virtual game scene, the method provided by an embodiment of the present invention can be used. Obtain six pre-generated thunder and lightning weather maps, denoted as Fig. 1 to Fig. 6. In the virtual skybox model, paste the thunder and lightning weather maps Fig. 1 to Fig. 6 on the corresponding cube surfaces respectively to obtain a thunder and lightning weather virtual skybox, denoted as skybox. Set the scene observation point P at the center point of the thunder and lightning weather virtual skybox skybox.
[0067] Based on the lightning weather virtual skybox, the sky plane information skyUV (equivalent to the above-mentioned first plane information) in the world coordinate system (Oxyz) can be obtained. The sky plane information skyUV includes texture information tex, coordinate information position (including position.x, position.y, position.z) and noise map star.
[0068] Optionally, the method for obtaining the sky plane information skyUV (equivalent to the above-mentioned first plane information) based on the thunder and lightning weather virtual skybox may be: obtain the coordinate information of the eight vertices of the thunder and lightning weather virtual skybox in the world coordinate system (Oxyz), respectively recorded as position1 to position8. Among them, the coordinate information of each vertex includes the xz plane coordinate and the y direction coordinate. By dividing the xz plane coordinate of each of the eight vertices by the y direction coordinate, the sky plane information skyUV can be obtained. For example, the coordinate information position1 of the first vertex includes the xz plane coordinate position.xz1 and the y direction coordinate position.y1; the calculation result Pr1 is obtained by calculating position.xz1 / position.y1; the above calculation is performed on the remaining vertices in turn to obtain the calculation results Pr2 to Pr7; the sky plane information skyUV is obtained according to the calculation results Pr1 to Pr8.
[0069] Based on the sky plane information skyUV (equivalent to the first plane information), the noise map star can be texture sampled to obtain the sampled noise, which is recorded as Noise2. The cloud layer noise finalNoise can be calculated by the sampled noise Noise2 and the height coordinates position.y1 to position.y8 of the eight vertices of the virtual skybox skybox of the thunderstorm weather in the world coordinate system (Oxyz).
[0070] Optionally, in step S23, acquiring a plurality of first mask areas based on the second plane information may include the following execution steps:
[0071] Step S231, performing two-dimensional random processing based on the second plane information to generate a plurality of second mask areas;
[0072] Step S232, performing spherical mask processing on the multiple second mask areas to obtain multiple first mask areas.
[0073] The second plane information is plane information obtained by scaling the first plane information, and the second plane information may include multiple sub-plane information. The second plane information may be subjected to the two-dimensional random processing to generate the multiple second mask areas, that is, multiple areas are selected from the plane area corresponding to the second plane information as the second mask area. The two-dimensional random processing may be based on the coordinate positions of the vertices of the virtual skybox model in the world space, and a two-dimensional random function is used to obtain multiple random coordinate positions.
[0074] The plurality of second mask areas are subjected to spherical mask processing to obtain the plurality of first mask areas. The plurality of first mask areas can be used to render thundercloud effects. The spherical mask processing can be based on the plurality of second mask areas, by taking the plurality of random coordinate positions as the sphere center and a preset value as the radius, to obtain a plurality of solid spherical areas. The plurality of solid spherical areas are used as the plurality of first mask areas.
[0075] Optionally, in step S232, performing spherical mask processing based on the multiple second mask regions to obtain the multiple first mask regions may include the following execution steps:
[0076] Step S2321, performing spherical mask processing on each of the plurality of second mask regions to obtain a plurality of grids, wherein each of the plurality of grids includes a spherical region;
[0077] Step S2322, adding a random value within a preset range to each spherical region to obtain a processing result, wherein the preset range is associated with the coordinate position of each spherical region in the corresponding second mask region, and the processing result is a set of spherical regions adjusted based on the corresponding random values;
[0078] Step S2323, scaling the distance between each spherical area in the processing result and the corresponding grid boundary to obtain a plurality of first mask areas.
[0079] By performing the spherical masking process on each of the plurality of second masking regions, the plurality of grids can be obtained, each of the plurality of grids including a spherical region. The spherical masking process can be based on each of the plurality of second masking regions, firstly dividing the second masking region into a plurality of grids; then obtaining a spherical region in each grid by taking the center position of each grid as the sphere center and a preset value as the radius; thereby obtaining a plurality of spherical regions.
[0080] The preset range is determined according to the coordinate position of each spherical area in the corresponding second mask area. Within the preset range, a random value corresponding to each spherical area in the plurality of spherical areas is generated. The corresponding random value is added to each spherical area, that is, each spherical area is moved according to the corresponding random value, so that each spherical area deviates from the original corresponding grid center position. The set of the plurality of spherical areas adjusted based on the corresponding random value is taken as the processing result.
[0081] The distance between each of the plurality of spherical regions in the processing result and the corresponding grid boundary is obtained. For each spherical region, scaling processing is performed on the spherical region according to the distance between the spherical region and the corresponding grid boundary. The scaling processing may be to adjust the radius of the spherical region so that the spherical region is tangent to the corresponding grid boundary. Thus, the processing result after scaling processing is used as the plurality of first mask regions.
[0082] For example, when showing severe weather with thunder and lightning in a virtual game scene, the method provided by an embodiment of the present invention can be used. The sky plane information skyUV (equivalent to the above-mentioned first plane information) obtained based on the virtual skybox of thunder and lightning weather is scaled to obtain scaled sky plane information skyUV10 (equivalent to the above-mentioned second plane information). The scaled sky plane information skyUV10 includes coordinate information position10 (including position10.x, position10.y, position10.z) and texture information tex10.
[0083] Based on the above-mentioned scaled sky plane information skyUV10, multiple random values r2 related to the coordinate information position10 of the scaled sky plane information skyUV10 can be obtained by using the two-dimensional random function rand2 multiple times. The input of the two-dimensional random function rand2 can be a two-dimensional vector represented by the coordinate information position10, and the output of the two-dimensional random function rand2 can be a random value with a value between 0 and 1. Through the above-mentioned multiple random values r2, multiple random coordinate positions can be determined. According to the multiple random coordinate positions, multiple areas can be selected from the scaled sky plane information skyUV10 as multiple initial mask areas, recorded as random01 (equivalent to the above-mentioned multiple second mask areas).
[0084] Optionally, when determining multiple initial mask areas random01 (equivalent to the above-mentioned multiple second mask areas) based on multiple random coordinate positions, a rounding-up function can also be used to determine that for areas with the same integer part of the coordinate position in the above-mentioned scaled sky plane information skyUV10, the generated random coordinate positions are the same; and for areas with different integer parts of the coordinate position in the above-mentioned scaled sky plane information skyUV10, the generated random coordinate positions are different.
[0085] Figure 3 is a schematic diagram of a spherical mask processing according to one optional embodiment of the present invention. Figure 3 As shown, for each of the multiple initial mask areas random01 (equivalent to the multiple second mask areas), performing spherical mask processing to obtain multiple sub-areas (equivalent to the multiple grids) may include the following method steps:
[0086] In the first step, the initial mask area (the largest square area in the figure) is divided into 10×10 sub-areas (the smallest square areas in the figure) with a total of 100 sub-areas.
[0087] The second step is to obtain the size information of each sub-region, and determine the center position coordinates of each sub-region and the radius of the inscribed sphere corresponding to each sub-region according to the size information, and set the radius of the inscribed sphere to a preset value R.
[0088] The third step is to create, for each of the 100 sub-regions, a solid spherical region with the center position of the sub-region as the sphere center and a preset value R as the radius, that is, each of the 100 sub-regions includes a spherical region.
[0089] Based on the coordinate information position10 of the scaled sky plane information skyUV10, using the random function rand3, a plurality of random values r3 corresponding to the 100 spherical areas of each initial mask area in the plurality of initial mask areas random01 (equivalent to the plurality of second mask areas) can be obtained, and each of the plurality of random values r3 is within the range of -0.5 to 0.5.
[0090] For the 100 spherical areas of each initial mask area in the above-mentioned multiple initial mask areas random01 (equivalent to the above-mentioned multiple second mask areas), the spherical area is moved according to the random value corresponding to each spherical area in the random value r3, so that each spherical area deviates from the center position of the originally corresponding sub-area.
[0091] Figure 4 is a schematic diagram of a spherical mask processing result according to one optional embodiment of the present invention, such as Figure 4 As shown, for each of the multiple spherical regions after the above movement, the distance between the center of the spherical region and the boundary of the sub-region corresponding to the spherical region is obtained. Then, the radius of the spherical region is adjusted based on the distance so that the spherical region is tangent to the boundary of the corresponding sub-region. Since the movement of each of the multiple spherical regions is random, the radius and position of each of the multiple spherical regions after adjustment are random. After performing the above movement and adjustment operations, the above multiple spherical regions can be determined as multiple actual mask regions random02 (equivalent to the above multiple first mask regions).
[0092] It should be noted that the multiple spherical areas in the actual mask area random02 can be used to determine the areas where multiple lightnings appear in the sky of the virtual game scene. The radius and position of each of the multiple spherical areas after adjustment are random, which can simulate the randomness of the lightning area of the thundercloud in the real scene, thereby achieving a higher quality thundercloud area rendering effect, thereby improving the player's gaming experience.
[0093] Optionally, in step S23, obtaining the thundercloud flash frequency corresponding to each first mask area based on the second plane information may include the following execution steps:
[0094] Step S233, performing one-dimensional random processing based on the second plane information to generate a first random time parameter corresponding to each first mask area;
[0095] Step S234, using the first random time parameter and the second random time parameter, calculate the thundercloud flashing frequency corresponding to each first mask area, wherein the second random time parameter is determined by the time parameter provided by the preset game engine.
[0096] Based on the second plane information, multiple first mask areas can be obtained, and the thundercloud flashing frequency corresponding to each of the multiple first mask areas can also be obtained. In order to simulate the randomness of lightning time of thunderclouds in real scenes, the thundercloud flashing frequency can be determined by the first random time parameter and the second random time parameter, and is used to represent the frequency of lightning in the thundercloud area in the virtual game scene.
[0097] The second plane information is plane information obtained by scaling the first plane information. The second plane information is subjected to two-dimensional random processing and spherical mask processing to obtain a plurality of first mask areas. The second plane information is subjected to one-dimensional random processing to generate the first random time parameter corresponding to each of the plurality of first mask areas. The one-dimensional random processing can be based on the time parameter provided by the preset game engine, and a one-dimensional random function is used for each of the plurality of first mask areas to obtain a random value corresponding to each first mask area.
[0098] The second random time parameter can be determined by presetting the time parameter provided by the game engine. For each of the plurality of first mask areas, the thundercloud flashing frequency corresponding to the first mask area can be calculated by the first random time parameter and the second random time parameter.
[0099] For example, when showing severe weather with thunder and lightning in a virtual game scene, the method provided by an embodiment of the present invention can be used. Based on the coordinate information position10 of the scaled sky plane information skyUV10, the one-dimensional random function rand1 is used multiple times to obtain the time random parameter randomTime1 (equivalent to the above-mentioned first random time parameter) corresponding to each spherical area in the above-mentioned multiple actual mask areas random02 (equivalent to the above-mentioned multiple first mask areas). The input of the one-dimensional random function rand1 can be the preset time parameter Time0 provided by the preset game engine, and the output of the one-dimensional random function rand1 can be a random value between 0 and 1.
[0100] Based on the preset time parameter Time0 provided by the preset game engine, the time random parameter randomTime2 can be obtained by using the decimal function. By performing a mean operation on the time random parameter randomTime1 and the time random parameter randomTime2, the actual thundercloud flashing frequency LightingArea corresponding to each spherical area in the above-mentioned multiple actual mask areas random02 (equivalent to the above-mentioned multiple first mask areas) can be obtained.
[0101] It should be noted that the method of calculating the actual thundercloud flash frequency through random time parameters can simulate the randomness of lightning time of thunderclouds in real scenes, thereby achieving a higher quality thundercloud area rendering effect, thereby improving the player's gaming experience.
[0102] Optionally, in step S24, rendering the virtual skybox model using cloud noise, a plurality of first mask areas, and the thundercloud flash frequency corresponding to each first mask area to obtain a virtual skybox model with thundercloud effect may include the following execution steps:
[0103] Step S241, performing a multiplication operation on the plurality of first mask areas and the thundercloud flash frequency corresponding to each first mask area to obtain a calculation result;
[0104] Step S242, performing a multiplication operation on the calculation result and the cloud layer noise to generate material parameters of the virtual sky box model;
[0105] Step S243, rendering the virtual skybox model based on the material parameters to obtain a virtual skybox model with a thundercloud effect.
[0106] The cloud noise may be generated based on the first plane information and the noise map of the virtual skybox model. The second plane information may be obtained by scaling the first plane information. The plurality of first mask areas may be generated by performing two-dimensional random processing and spherical mask processing on the second plane information. The thundercloud flashing frequency corresponding to each of the plurality of first mask areas may be generated based on the second plane information and the time parameters provided by the preset game engine.
[0107] Based on the plurality of first mask areas and the thundercloud flashing frequency corresponding to each of the plurality of first mask areas, a multiplication operation is performed to obtain an operation result, which can be used to indicate the generation area and time of the lightning effect.
[0108] Based on the above operation result and the above cloud noise, a multiplication operation is performed to generate material parameters of a virtual skybox model. The material parameters of the virtual skybox model can be used to represent the sky texture changes observed by the virtual game character in the virtual game scene, and the sky texture changes may include: sky color changes, cloud color changes, lightning feature changes, etc. The above virtual skybox model is rendered based on the material parameters to obtain the above virtual skybox model with thundercloud effect.
[0109] For example, when showing severe weather with thunder and lightning in a virtual game scene, the method provided by an embodiment of the present invention can be used. Obtain multiple actual mask areas random02 (equivalent to the multiple first mask areas mentioned above), the actual thundercloud flashing frequency LightingArea corresponding to each spherical area in the multiple actual mask areas random02, and the cloud noise finalNoise. By multiplying these three sets of data, the visual behavior performance data thunderAreaMask of the thundercloud area (equivalent to the material parameters of the virtual skybox model mentioned above) can be obtained. Render the virtual skybox skybox based on the visual behavior performance data thunderAreaMask to obtain a virtual skybox model skybox_thunder with thundercloud effect.
[0110] Optionally, the method for realizing the thundercloud effect may further include the following execution steps:
[0111] Step S25, obtaining color parameters corresponding to a plurality of first mask areas;
[0112] Step S26, enhancing the thundercloud effect using color parameters to obtain a virtual skybox model with enhanced thundercloud effect.
[0113] After determining the above-mentioned multiple first mask areas, the color parameters corresponding to the multiple first mask areas can be obtained. Using the color parameters, the thundercloud effect can be enhanced to obtain a virtual skybox model with enhanced thundercloud effect. Among them, enhancing the thundercloud effect can be increasing the brightness of the sky color, adjusting the hue of the sky color, enhancing the saturation of the sky color, etc.
[0114] For example, when showing severe weather with thunder and lightning in a virtual game scene, the method provided by the embodiment of the present invention can be used. The sky color information sky.color (equivalent to the above color parameters, including: brightness sky.color.b, saturation sky.color.s and hue sky.color.h) of the thundercloud area can be obtained through the texture information tex10 in the above scaled sky plane information skyUV10.
[0115] After generating the visual behavior performance data thunderAreaMask of the thundercloud area (equivalent to the material parameters of the above-mentioned virtual skybox model), the sky color information sky.color can be adjusted according to the visual behavior performance data thunderAreaMask. The adjustment operation includes: increasing the brightness of the sky color to obtain sky.color.b+; adjusting the hue of the sky color to obtain sky.color.h+, and enhancing the saturation of the sky color to obtain sky.color.s+. The sky color information of the adjusted thundercloud area is recorded as sky.color+. The sky of the corresponding area in the virtual game scene is rendered using the adjusted sky color information sky.color+.
[0116] By enhancing the virtual skybox model of the thundercloud effect, the sky color corresponding to the thundercloud area can be adjusted according to the thundercloud effect, thereby achieving a higher quality rendering effect of the thundercloud area, thereby improving the player's gaming experience.
[0117] The method for realizing the thundercloud effect provided by the embodiment of the present invention can simulate the randomness of the lightning area and time randomness of the thundercloud in the real scene, generate high-quality thundercloud effects with high efficiency, and has practical application significance in game development and design.
[0118] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0119] In this embodiment, a device for realizing thundercloud effect is also provided, which is used to realize the above-mentioned embodiments and preferred implementation modes, and the descriptions thereof will not be repeated. As used below, the term "module" may be a combination of software and / or hardware that realizes a predetermined function. Although the devices described in the following embodiments are preferably realized by software, the realization by hardware, or a combination of software and hardware, is also possible and conceivable.
[0120] Figure 5 is a structural block diagram of a device for realizing thundercloud effect according to one embodiment of the present invention, such as Figure 5As shown, the device includes: a first generating module 51, which is used to generate cloud noise based on the first plane information and the noise map of the virtual sky box model, wherein the first plane information is determined by the coordinate positions of the vertices of the virtual sky box model in the world space; a processing module 52, which is used to scale the first plane information to obtain second plane information; an acquiring module 53, which is used to acquire multiple first mask areas and the thundercloud flashing frequency corresponding to each of the multiple first mask areas based on the second plane information; a second generating module 54, which is used to render the virtual sky box model using the cloud noise, the multiple first mask areas and the thundercloud flashing frequency corresponding to each of the first mask areas, to obtain a virtual sky box model with a thundercloud effect.
[0121] Optionally, the first generating module 51 is further used to: perform texture sampling on the noise map based on the first plane information to obtain sampled noise; and calculate cloud noise using the sampled noise and height coordinates of vertices of the virtual sky box model in world space.
[0122] Optionally, the acquisition module 53 is further used to: perform two-dimensional random processing based on the second plane information to generate a plurality of second mask areas; and perform spherical mask processing on the plurality of second mask areas to obtain a plurality of first mask areas.
[0123] Optionally, the acquisition module 53 is also used to: perform spherical mask processing on each of the multiple second mask areas to obtain multiple grids, wherein each of the multiple grids contains a spherical area; add a random value within a preset range to each spherical area to obtain a processing result, wherein the preset range is associated with the coordinate position of each spherical area in the corresponding second mask area, and the processing result is a set of spherical areas adjusted based on the corresponding random values; scale the distance between each spherical area in the processing result and the corresponding grid boundary to obtain multiple first mask areas.
[0124] Optionally, the acquisition module 53 is also used to: perform one-dimensional random processing based on the second plane information to generate a first random time parameter corresponding to each first mask area; use the first random time parameter and the second random time parameter to calculate the thundercloud flashing frequency corresponding to each first mask area, wherein the second random time parameter is determined by the time parameter provided by the preset game engine.
[0125] Optionally, the second generation module 54 is further used to: multiply the multiple first mask areas with the thundercloud flash frequency corresponding to each first mask area to obtain a calculation result; multiply the calculation result with the cloud noise to generate material parameters of the virtual sky box model; render the virtual sky box model based on the material parameters to obtain a virtual sky box model with a thundercloud effect.
[0126] Optionally, Figure 6 is a structural block diagram of another optional device for realizing thundercloud effect according to one embodiment of the present invention, such as Figure 6 As shown, the device includes Figure 5 In addition to all the modules shown, the present invention also includes: an enhancement module 55 for obtaining color parameters corresponding to a plurality of first mask areas; and enhancing the thundercloud effect using the color parameters to obtain a virtual skybox model with enhanced thundercloud effect.
[0127] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0128] An embodiment of the present invention further provides a non-volatile storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0129] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0130] S1, generating cloud noise based on first plane information of a virtual skybox model and a noise map, wherein the first plane information is determined by coordinate positions of vertices of the virtual skybox model in world space;
[0131] S2, scaling the first plane information to obtain second plane information;
[0132] S3, acquiring a plurality of first mask areas and a thundercloud flashing frequency corresponding to each of the plurality of first mask areas based on the second plane information;
[0133] S4, rendering the virtual skybox model using cloud noise, a plurality of first mask areas, and the thundercloud flashing frequency corresponding to each first mask area to obtain a virtual skybox model with a thundercloud effect.
[0134] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0135] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0136] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0137] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0138] S1, generating cloud noise based on first plane information of a virtual skybox model and a noise map, wherein the first plane information is determined by coordinate positions of vertices of the virtual skybox model in world space;
[0139] S2, scaling the first plane information to obtain second plane information;
[0140] S3, acquiring a plurality of first mask areas and a thundercloud flashing frequency corresponding to each of the plurality of first mask areas based on the second plane information;
[0141] S4, rendering the virtual skybox model using cloud noise, a plurality of first mask areas, and the thundercloud flashing frequency corresponding to each first mask area to obtain a virtual skybox model with a thundercloud effect.
[0142] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0143] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0144] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0145] In the several embodiments provided by the present invention, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be 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 interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0146] 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 units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0147] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0148] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0149] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for realizing thundercloud effect, characterized in that: include: Generate cloud noise based on first plane information of a virtual skybox model and a noise map, wherein the first plane information is determined by coordinate positions of vertices of the virtual skybox model in world space; Scaling the first plane information to obtain second plane information; Acquire a plurality of first mask areas and a thundercloud flashing frequency corresponding to each of the plurality of first mask areas based on the second plane information; Rendering the virtual skybox model using the cloud layer noise, the plurality of first mask areas, and the thundercloud flashing frequency corresponding to each first mask area to obtain a virtual skybox model with a thundercloud effect; Generating the cloud layer noise based on the first plane information of the virtual sky box model and the noise map includes: performing texture sampling on the noise map based on the first plane information to obtain sampled noise; and calculating the cloud layer noise using the sampled noise and the height coordinates of the vertices of the virtual sky box model in the world space; Acquiring the multiple first mask areas based on the second plane information includes: performing two-dimensional random processing based on the second plane information to generate multiple second mask areas; and performing spherical mask processing on the multiple second mask areas to obtain the multiple first mask areas.
2. The method according to claim 1, characterized in that Performing spherical mask processing based on the plurality of second mask regions to obtain the plurality of first mask regions comprises: Performing spherical mask processing on each of the plurality of second mask areas to obtain a plurality of grids, wherein each of the plurality of grids includes a spherical area; Adding a random value within a preset range to each of the spherical regions to obtain a processing result, wherein the preset range is associated with the coordinate position of each spherical region in the corresponding second mask region; The distance between each spherical area and the corresponding grid boundary in the processing result is scaled to obtain the multiple first mask areas.
3. The method according to claim 1, characterized in that Acquiring the thundercloud flashing frequency corresponding to each first mask area based on the second plane information includes: Perform one-dimensional random processing based on the second plane information to generate a first random time parameter corresponding to each first mask area; The first random time parameter and the second random time parameter are used to calculate the thundercloud flashing frequency corresponding to each first mask area, wherein the second random time parameter is determined by the time parameter provided by a preset game engine.
4. The method according to claim 1, characterized in that: Rendering the virtual skybox model using the cloud layer noise, the plurality of first mask areas, and the thundercloud flashing frequency corresponding to each first mask area to obtain a virtual skybox model with a thundercloud effect includes: Performing a multiplication operation on the plurality of first mask areas and the thundercloud flash frequency corresponding to each first mask area to obtain an operation result; Performing a multiplication operation on the operation result and the cloud layer noise to generate material parameters of the virtual sky box model; The virtual skybox model is rendered based on the material parameters to obtain the virtual skybox model with thundercloud effect.
5. The method according to claim 1, characterized in that The method further comprises: Obtaining color parameters corresponding to the plurality of first mask areas; The thundercloud effect is enhanced by using the color parameters to obtain a virtual skybox model for enhancing the thundercloud effect.
6. A device for realizing thundercloud effect, characterized in that: include: A first generating module, configured to generate cloud noise based on first plane information of a virtual skybox model and a noise map, wherein the first plane information is determined by coordinate positions of vertices of the virtual skybox model in a world space; A processing module, configured to perform scaling processing on the first plane information to obtain second plane information; An acquisition module, configured to acquire, based on the second plane information, a plurality of first mask areas and a thundercloud flash frequency corresponding to each of the plurality of first mask areas; A second generating module is used to render the virtual skybox model by using the cloud layer noise, the plurality of first mask areas and the thundercloud flashing frequency corresponding to each first mask area, so as to obtain a virtual skybox model with thundercloud effect; The first generating module is further used to perform texture sampling on the noise map based on the first plane information to obtain sampled noise; and calculate the cloud layer noise using the sampled noise and the height coordinates of the vertices of the virtual sky box model in the world space; The acquisition module is further used to perform two-dimensional random processing based on the second plane information to generate a plurality of second mask areas; and perform spherical mask processing on the plurality of second mask areas to obtain the plurality of first mask areas.
7. A non-volatile storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method for realizing the thundercloud effect as described in any one of claims 1 to 5 when running.
8. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the method for realizing the thundercloud effect as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Three-dimensional virtual cloud model processing method, storage medium, processor and electronic device
CN111145326A
Cloud layer rendering method and device, equipment and storage medium
CN112150598A