Aurora effect rendering method and device, electronic equipment and storage medium

By sampling preset maps in the game scene to obtain aurora texture and color, and directly rendering the aurora effect, the problems of cumbersome art adjustments and large performance overhead in the existing technology are solved, and efficient aurora effect rendering is achieved.

CN119295626APending Publication Date: 2025-01-10BEIJING BEINGFUNGAMES TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311360090.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-19
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The existing aurora effect rendering methods have problems such as cumbersome art adjustments and high performance overhead, making it difficult to achieve efficient aurora effect rendering in game scenes.

Method used

By taking the areas to be rendered in the game scene, sampling preset maps to get the aurora textures and colors, and rendering the areas to be rendered based on these textures and colors, simplifying art tuning and reducing performance overhead.

Benefits of technology

It realizes the simplification of art adjustments and reduced performance overhead during the rendering of aurora effects, improves rendering efficiency, and is suitable for various gaming devices, including cloud servers and terminal devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119295626A_ABST
    Figure CN119295626A_ABST
Patent Text Reader

Abstract

The invention relates to an aurora effect rendering method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a to-be-rendered region in a game scene, the to-be-rendered region being a region used for the to-be-rendered aurora effect on a sky box in the game scene, and the sky box being used for simulating the sky in the game scene; sampling the preset chartlet to obtain aurora texture and aurora color; and rendering the to-be-rendered area based on the aurora texture and the aurora color to obtain an aurora effect of the to-be-rendered area. Thus, the aurora texture and the aurora color can be obtained based on the preset map, and then the to-be-rendered area on the sky box in the game scene is rendered directly according to the obtained aurora texture and aurora color, so that the aurora effect is obtained, complex art adjustment and large calculation overhead are avoided, and the user experience is improved. The art adjustment in the aurora effect rendering process is simplified, and the performance overhead of equipment is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of game development technology, and in particular to a method, device, electronic device and storage medium for rendering aurora effects. Background Art

[0002] In order to improve the realism of the game scenes, it is usually necessary to add aurora effects to some game scenes. For example, some existing games need to add aurora effects to the sky in the game scenes.

[0003] Currently, the existing aurora effect rendering methods are usually obtained through patch rendering, or calculated through a stepping algorithm similar to volumetric cloud. However, the first method requires placing several model patches in the scene, which has the problem of cumbersome art adjustments. The second method requires stepping calculations, which has a high performance overhead and is difficult to apply to mobile devices.

[0004] Therefore, how to design an aurora effect rendering method with simple artistic adjustment and low performance overhead has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] The present application provides a method, device, electronic device and storage medium for rendering aurora effects, so as to solve the problems of cumbersome artistic adjustments and high performance overhead in existing aurora effect rendering methods.

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

[0007] Acquire an area to be rendered in the game scene, wherein the area to be rendered is an area on a sky box in the game scene for rendering an aurora effect, and the sky box is used to simulate the sky in the game scene;

[0008] Sample the preset map to get the aurora texture and aurora color;

[0009] The area to be rendered is rendered based on the aurora texture and the aurora color to obtain the aurora effect of the area to be rendered.

[0010] Optionally, the preset map includes a black and white gradient map, a color gradient map and at least one noise map;

[0011] The sampling of the preset map to obtain the aurora texture and aurora color includes:

[0012] Sampling the black-and-white gradient image and the at least one noise image to obtain the aurora texture;

[0013] The color gradient image is sampled to obtain the aurora color.

[0014] Optionally, sampling the black-and-white gradient image and the at least one noise image to obtain the aurora texture includes:

[0015] Sampling the black and white gradient image to obtain a strip texture;

[0016] Using a preset distortion algorithm to distort the strip texture to obtain a distorted strip texture;

[0017] The at least one noise image is sampled to obtain a mask image, and the distorted strip texture is masked by using the mask image to obtain the aurora texture.

[0018] Optionally, the at least one noise map comprises a first noise map and a second noise map;

[0019] The step of sampling the at least one noise image to obtain a mask image, and using the mask image to mask the distorted strip texture to obtain the aurora texture includes:

[0020] Sampling the first noise image to obtain a first mask image;

[0021] Using the first mask image to perform interval masking on the distorted strip texture to obtain a strip texture with a disconnected cross section;

[0022] Sampling the second noise image to obtain a second mask image;

[0023] The second mask image is used to perform regional masking on the strip texture with a broken cross section to obtain the aurora texture.

[0024] Optionally, rendering the area to be rendered based on the aurora texture and the aurora color to obtain the aurora effect of the area to be rendered includes:

[0025] Obtain a first preset duration and a second preset duration, wherein the first preset duration is used to characterize the duration required for the aurora texture to gradually disappear, and the second preset duration is used to characterize the duration required for the aurora color to adjust;

[0026] The area to be rendered is rendered based on the first preset duration and the aurora texture, and the area to be rendered is rendered based on the second preset duration and the aurora color to obtain the aurora effect of the area to be rendered.

[0027] Optionally, before rendering the area to be rendered based on the aurora texture and the aurora color to obtain the aurora effect of the area to be rendered, the method further includes:

[0028] Repeating sampling of the preset map N times to obtain N new aurora textures, where N is an integer greater than or equal to 1;

[0029] The N new aurora textures are shifted to different degrees relative to the original aurora texture, and the shifted N+1 aurora textures are superimposed to obtain a superimposed aurora texture;

[0030] The rendering of the area to be rendered based on the aurora texture and the aurora color to obtain the aurora effect of the area to be rendered includes:

[0031] The area to be rendered is rendered based on the superimposed aurora texture and the aurora color to obtain the aurora effect of the area to be rendered.

[0032] Optionally, obtaining the area to be rendered in the game scene includes:

[0033] Obtain a first coordinate value and a second coordinate value, wherein the first coordinate value is a coordinate on a first coordinate axis in a world coordinate system of the sky box, and the second coordinate value is a coordinate on a second coordinate axis in the world coordinate system of the sky box, and the first coordinate axis and the second coordinate axis are two coordinates perpendicular to each other in the world coordinate system of the sky box;

[0034] The area to be rendered is determined based on the first coordinate value and the second coordinate value.

[0035] In a second aspect, an embodiment of the present application further provides a rendering device for an aurora effect, the device comprising:

[0036] An acquisition module, used for acquiring an area to be rendered in a game scene, wherein the area to be rendered is an area on a sky box in the game scene for rendering an aurora effect, and the sky box is used for simulating the sky in the game scene;

[0037] The sampling module is used to sample the preset map to obtain the aurora texture and aurora color;

[0038] A rendering module is used to render the area to be rendered based on the aurora texture and the aurora color to obtain the aurora effect of the area to be rendered.

[0039] In a third aspect, an embodiment of the present application further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0040] Memory, used to store computer programs;

[0041] The processor is used to implement the steps of the method for rendering the aurora effect described in any one of the first aspects when executing the program stored in the memory.

[0042] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method for rendering the aurora effect described in any one of the first aspects are implemented.

[0043] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application, by obtaining the area to be rendered in the game scene, wherein the area to be rendered is the area on the sky box in the game scene for rendering the aurora effect, and the sky box is used to simulate the sky in the game scene; sampling the preset map to obtain the aurora texture and the aurora color; rendering the area to be rendered based on the aurora texture and the aurora color to obtain the aurora effect of the area to be rendered. Through the above method, the aurora texture and the aurora color can be obtained based on the preset map, and then the area to be rendered on the sky box in the game scene can be directly rendered according to the obtained aurora texture and the aurora color, so as to obtain the aurora effect, thereby avoiding complex art adjustments and large computational overhead, simplifying the art adjustments in the aurora effect rendering process, and reducing the performance overhead of the device. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0046] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0047] Figure 1 A schematic diagram of a flow chart of a method for rendering an aurora effect provided in an embodiment of the present application;

[0048] Figure 2 A detailed flow chart of the steps of sampling a black and white gradient image and at least one noise image to obtain an aurora texture provided in an embodiment of the present application;

[0049] Figure 3 A schematic diagram of a black and white gradient image provided in an embodiment of the present application;

[0050] Figure 4 A schematic diagram of a distorted strip texture provided in an embodiment of the present application;

[0051] Figure 5 A schematic diagram of a first mask image provided in an embodiment of the present application;

[0052] Figure 6 A schematic diagram of a strip texture with a broken cross section provided in an embodiment of the present application;

[0053] Figure 7 A schematic diagram of an aurora texture provided in an embodiment of the present application;

[0054] Figure 8 A schematic diagram of a flow chart of another method for rendering an aurora effect provided in an embodiment of the present application;

[0055] Fig. 9 A schematic diagram of the structure of a rendering device for aurora effects provided in an embodiment of the present application;

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

[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0058] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0059] In order to solve the technical problems of complicated artistic adjustments and high performance overhead in the existing aurora effect rendering method in the prior art, the present application provides a rendering method, device, electronic device and storage medium for aurora effects, which can simplify the artistic adjustments in the aurora effect rendering process and reduce the performance overhead of the device.

[0060] See also Figure 1 , Figure 1 A schematic diagram of a flow chart of a method for rendering an aurora effect provided in an embodiment of the present application. Figure 1 As shown, the rendering method of the aurora effect may specifically include the following steps:

[0061] Step 102: Obtain an area to be rendered in the game scene, wherein the area to be rendered is an area on a sky box in the game scene for rendering aurora effects, and the sky box is used to simulate the sky in the game scene.

[0062] It should be noted that the rendering method of the aurora effect provided in the embodiment of the present application can be applied to an electronic device, which can be a cloud server or a terminal device such as a smart phone, a tablet, a personal computer, a television, etc. When the rendering method of the aurora effect provided in the embodiment of the present application is applied to a cloud server, it is mainly aimed at the game scene of cloud games. In the operation mode of cloud games, the running body of the game program and the game screen presentation body are separated. The storage and operation of the rendering method of the aurora effect are completed on the cloud server. The role of the terminal device is to receive and send data and present the game screen. For example, the terminal device can be a display device with a data transmission function close to the user side; but the terminal device for information processing is a cloud server. When playing the game, the player operates the terminal device to send an operation instruction to the cloud server. The cloud server runs the game according to the operation instruction, encodes and compresses the data such as the game screen, returns it to the terminal device through the network, and finally decodes and outputs the game screen through the terminal device. When the rendering method of the aurora effect provided in the embodiment of the present application is applied to the terminal device, it is mainly aimed at the game scene of mobile games. Taking mobile games as an example, the terminal device stores the game program and is used to present the game screen. The terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed and run through the conventional terminal device. The terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered on the display screen of the terminal, or provided to the player through holographic projection. For example, the terminal device may include a display screen and a processor, the display screen is used to present the graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate the graphical user interface, and control the display of the graphical user interface on the display screen.

[0063] Specifically, the game scene (or virtual scene) is a virtual scene displayed (or provided) when the swimming application is running on a terminal device or a cloud server. The virtual scene can be a simulation environment of the real world, or a semi-simulation and semi-fictitious virtual environment, or a purely fictitious virtual environment. The virtual scene is any one of a two-dimensional virtual scene and a three-dimensional virtual scene, and the virtual environment can be the sky, land, ocean, etc., wherein the land includes environmental elements such as deserts and cities. Among them, the virtual scene is a scene with complete game logic of virtual objects such as user control. For example, in a sandbox three-dimensional (3D) shooting game, the virtual scene is a 3D game world for players to control virtual objects to fight. Instances of virtual scenes may include: at least one element of mountains, plains, rivers, lakes, oceans, deserts, skies, plants, buildings, and vehicles; for example, in a two-dimensional (2D) card game, the virtual scene is a scene for displaying released cards or displaying virtual objects corresponding to cards. Instances of virtual scenes may include: an arena, a duel battlefield, or other "field" elements or other elements that can display the status of card battles; for a 2D or 3D multiplayer online tactical competitive game, the virtual scene is a 2D or 3D terrain scene for virtual objects to fight. Instances of virtual scenes may include: canyon-style mountains, lines, rivers, classrooms, tables and chairs, podiums and other elements.

[0064] The skybox is a cube or sphere that wraps the entire game scene, which can render and display the sky and surrounding environment of the game scene well, and can also serve as an auxiliary light source in the game scene. The above-mentioned area to be rendered is an area on the skybox in the game scene for rendering the aurora effect, such as an area in the sky rendered by the skybox. The position of the area to be rendered on the skybox can be obtained by manual setting or by default setting of the program, which is not limited in the embodiments of the present application.

[0065] Step 104: Sample the preset map to obtain the aurora texture and aurora color.

[0066] Specifically, the above-mentioned preset maps can be multiple pre-set two-dimensional maps, such as black and white gradient maps, color gradient maps and noise maps, etc. The above-mentioned aurora texture refers to a texture that can reflect the aurora effect, and the above-mentioned aurora color refers to a color that can reflect the aurora effect, and the aurora color can include multiple gradient colors.

[0067] Step 106: Render the area to be rendered based on the aurora texture and the aurora color to obtain the aurora effect of the area to be rendered.

[0068] In this step, after obtaining the aurora texture, aurora color and area to be rendered, the area to be rendered can be rendered based on the aurora texture and aurora color to obtain the aurora effect of the area to be rendered, such as rendering the gradual disappearance of the aurora texture, rendering the adjustment changes of the aurora color, etc.

[0069] In this embodiment, the aurora texture and aurora color can be obtained based on the preset map, and then the area to be rendered on the sky box in the game scene can be rendered directly according to the obtained aurora texture and aurora color to obtain the aurora effect, thereby avoiding complex art adjustments and large computing overhead, simplifying the art adjustments in the aurora effect rendering process and reducing the performance overhead of the device.

[0070] Furthermore, the preset map includes a black-and-white gradient map, a color gradient map, and at least one noise map;

[0071] The above step 104, sampling the preset map to obtain the aurora texture and aurora color, includes:

[0072] Sample the black and white gradient image and at least one noise image to obtain the aurora texture;

[0073] Sample the color gradient map to get the aurora color.

[0074] Specifically, the black-and-white gradient image refers to a gradient effect image presented by black and white. The color gradient image refers to a gradient effect image presented by multiple colors, such as a gradient effect image composed of red, green and blue.

[0075] In one embodiment, the black and white gradient image may be sampled to obtain a strip texture of the aurora base, that is, a texture composed of black stripes and white stripes. Then, at least one noise image may be sampled to obtain a mask image for masking the strip texture of the aurora base, thereby obtaining the final aurora texture. Furthermore, the color gradient image may be sampled to obtain multiple colors required for aurora rendering, that is, to obtain aurora colors, which are used to color the aurora texture to obtain a more realistic aurora effect.

[0076] In this way, there is no need for complex artistic adjustments and large computing overhead. You only need to sample the preset map to get the aurora texture and aurora color, which makes it convenient to render the aurora effect based on the aurora texture and aurora color later.

[0077] Further, see Figure 2 The above steps, sampling the black and white gradient image and at least one noise image to obtain the aurora texture, specifically include:

[0078] Step 202, sampling the black and white gradient image to obtain a strip texture;

[0079] Step 204: distort the strip texture using a preset distortion algorithm to obtain a distorted strip texture;

[0080] Step 206: Sample at least one noise image to obtain a mask image, and use the mask image to mask the distorted strip texture to obtain an aurora texture.

[0081] Specifically, the above-mentioned preset distortion algorithm refers to an algorithm for realizing free distortion of an image, which may be a Twirl algorithm or the like.

[0082] In one embodiment, when obtaining the aurora texture, the Figure 3 The black and white gradient image shown is sampled to obtain the strip texture of the aurora base, and then the strip texture is distorted using the preset distortion algorithm to obtain Figure 4 The distorted strip texture shown in the figure. After obtaining the distorted strip texture, at least one noise map is sampled to obtain a mask map, and the distorted strip texture is masked with the mask map to obtain the final desired aurora texture. In this way, the aurora texture can be obtained by sampling the preset map without complicated art adjustments and large calculation costs, which facilitates the subsequent rendering according to the aurora texture to obtain the aurora effect.

[0083] Further, the at least one noise map includes a first noise map and a second noise map;

[0084] The above steps of sampling at least one noise image to obtain a mask image, and using the mask image to mask the distorted strip texture to obtain the aurora texture include:

[0085] Sampling the first noise image to obtain a first mask image;

[0086] Using the first mask image to perform interval masking on the distorted strip texture, so as to obtain a strip texture with a disconnected cross section;

[0087] Sampling the second noise image to obtain a second mask image;

[0088] The second mask image is used to perform regional masking on the strip texture with a disconnected cross section to obtain the aurora texture.

[0089] Specifically, the first noise map and the second noise map may be the same noise map or different noise maps, which is not specifically limited in the embodiment of the present application.

[0090] In one embodiment, the scaling degree tilling can be set to (1, 0) to sample the first noise map, that is, only the information on the u-axis of the first noise map is sampled, so that Figure 5 Then, the first mask image is used to Figure 3The distorted strip texture shown is masked to limit its display range, thus obtaining Figure 6 The cross-section of the strip texture is disconnected. Then, the scaling degree can be set to (1,1) to sample the second noise map, that is, to sample the information on the u-axis and V-axis of the second noise map, so that the second mask map can be obtained, and then the second mask map is used to perform regional masking on the cross-section of the strip texture, and finally the second mask map is obtained. Figure 7 In this way, there is no need for complex art adjustments and large computational overhead. Only by sampling at least one noise map can a mask map be obtained, thereby obtaining an aurora texture with higher realism.

[0091] Furthermore, the above step 106, rendering the area to be rendered based on the aurora texture and the aurora color to obtain the aurora effect of the area to be rendered, includes:

[0092] Obtain a first preset duration and a second preset duration, wherein the first preset duration is used to represent the duration required for the aurora texture to gradually disappear, and the second preset duration is used to represent the duration required for the aurora color to adjust;

[0093] The area to be rendered is rendered based on the first preset duration and the aurora texture, and the area to be rendered is rendered based on the second preset duration and the aurora color, so as to obtain the aurora effect of the area to be rendered.

[0094] Specifically, the first preset duration and the second preset duration are two artificially preset times and can be adjusted as needed. The first preset duration can be used to characterize the time required for the aurora texture to gradually disappear, and the second preset duration is used to characterize the time required for the aurora color to adjust. The size of the first preset duration and the second preset duration can be set according to actual needs, and the embodiment of the present application does not make specific limitations.

[0095] In one embodiment, when rendering the area to be rendered, it is necessary to first obtain the first preset duration and the second preset duration, and then render the area to be rendered based on the first preset duration and the aurora texture, and render the area to be rendered based on the second preset duration and the aurora color, to obtain the aurora effect of the area to be rendered. In this way, the aurora can have the effect of gradually disappearing with the first preset duration, and the aurora can also adjust the color with the second preset duration, so that the aurora effect is more vivid.

[0096] Furthermore, before the above step 106, rendering the area to be rendered based on the aurora texture and the aurora color to obtain the aurora effect of the area to be rendered, the method further includes:

[0097] Repeat sampling the preset map N times to obtain N new aurora textures, where N is an integer greater than or equal to 1;

[0098] N new aurora textures are shifted to different degrees relative to the original aurora texture, and the shifted N+1 aurora textures are superimposed to obtain a superimposed aurora texture;

[0099] Render the area to be rendered based on the aurora texture and aurora color to obtain the aurora effect of the area to be rendered, including:

[0100] The area to be rendered is rendered based on the superimposed aurora texture and aurora color to obtain the aurora effect of the area to be rendered.

[0101] Specifically, the value of N can be set according to actual needs, and can be any integer greater than or equal to 1, such as 1, 2, 3, etc.

[0102] In one embodiment, before rendering the aurora effect, the preset map can be repeatedly sampled N times, that is, Figure 2 Steps 202 to 206 in the illustrated embodiment are repeated N times to obtain N new aurora textures. Then, the N new aurora textures are offset to different degrees relative to the original aurora texture, and the offset N+1 aurora textures are superimposed to obtain a superimposed aurora texture, that is, to obtain the effect of multiple auroras interlaced. In this way, when rendering the aurora effect, the rendering area can be rendered based on the superimposed aurora texture and aurora color to obtain the aurora effect, thereby making the rendered aurora effect more vivid.

[0103] Furthermore, the above step 102, obtaining the area to be rendered in the game scene, includes:

[0104] Get a first coordinate value and a second coordinate value, wherein the first coordinate value is a coordinate on a first coordinate axis in the world coordinate system of the sky box, and the second coordinate value is a coordinate on a second coordinate axis in the world coordinate system of the sky box, and the first coordinate axis and the second coordinate axis are two mutually perpendicular coordinates in the world coordinate system of the sky box;

[0105] Based on the first coordinate value and the second coordinate value, a to-be-rendered area is determined.

[0106] Specifically, the first coordinate value and the second coordinate value may be coordinate values ​​on any two coordinate axes in the world coordinate system of the skybox, such as coordinate values ​​on the X-axis and the Z-axis in the world coordinate system of the skybox, or coordinate values ​​on the X-axis and the Y-axis, or coordinate values ​​on the Y-axis and the Z-axis, etc. The first coordinate value and the second coordinate value may be manually and dynamically adjusted values, which may be used as parameters for artistic adjustment to limit the rendering position of the aurora effect.

[0107] In one embodiment, when obtaining the area to be rendered in the game scene, the manually set first coordinate value and second coordinate value can be obtained, and then based on the first coordinate value and the second coordinate value, the area to be rendered is determined on the sky box in the game scene, so as to facilitate the subsequent rendering of the area to be rendered and obtain the aurora effect.

[0108] In one embodiment, see Figure 8 , Figure 8 A flowchart of another method for rendering an aurora effect provided in an embodiment of the present application is shown below. Figure 8 As shown, the rendering method of the aurora effect may include the following steps:

[0109] Step 802: Sample the black and white gradient image to obtain a strip texture.

[0110] Step 804: distort the strip texture using a preset distortion algorithm to obtain a distorted strip texture.

[0111] Step 806: Sample the first noise image to obtain a first mask image, and use the first mask image to perform interval masking on the distorted strip texture to obtain a strip texture with a disconnected cross section.

[0112] Step 808: Sample the second noise image to obtain a second mask image, and use the second mask image to perform regional masking on the strip texture with disconnected cross sections to obtain an aurora texture.

[0113] Step 810: Repeat sampling the preset map N times to obtain N new aurora textures, where N is an integer greater than or equal to 1; offset the N new aurora textures to different degrees relative to the original aurora texture, and superimpose the offset N+1 aurora textures to obtain a superimposed aurora texture.

[0114] Step 812: Sample the color gradient image to obtain the aurora color.

[0115] Step 814: Render the area to be rendered based on the aurora texture and the aurora color to obtain the aurora effect of the area to be rendered.

[0116] It should be noted that the specific implementation process of the above steps 802 to 814 has been described in the above embodiments and will not be repeated here.

[0117] In this embodiment, the aurora can be directly arranged in a corner of the skybox, and the artist can adjust the position, color, intensity and speed of the aurora as needed. It is convenient for developers to adjust the operation, and developers can directly adjust the overall effect of the aurora through several parameters. In addition, the aurora rendering implementation method and calculation are simple, the performance overhead is small, and the performance requirements of the player's device are low.

[0118] See also Fig. 9 , Fig. 9 This is a schematic diagram of the structure of a rendering device for aurora effects provided in an embodiment of the present application. Fig. 9 As shown, the aurora effect rendering device 900 includes:

[0119] An acquisition module 902 is used to acquire an area to be rendered in the game scene, wherein the area to be rendered is an area on a sky box in the game scene for rendering aurora effects, and the sky box is used to simulate the sky in the game scene;

[0120] The sampling module 904 is used to sample the preset map to obtain the aurora texture and aurora color;

[0121] The rendering module 906 is used to render the area to be rendered based on the aurora texture and the aurora color to obtain the aurora effect of the area to be rendered.

[0122] Furthermore, the preset map includes a black and white gradient map, a color gradient map and at least one noise map; the sampling module 904 includes:

[0123] A first sampling submodule is used to sample the black-and-white gradient image and at least one noise image to obtain an aurora texture;

[0124] The second sampling submodule is used to sample the color gradient image to obtain the aurora color.

[0125] Furthermore, the first sampling submodule includes:

[0126] A sampling unit is used to sample the black and white gradient image to obtain a strip texture;

[0127] A distortion unit, used for distorting the strip texture by using a preset distortion algorithm to obtain a distorted strip texture;

[0128] The sampling and masking unit is used to sample at least one noise image to obtain a mask image, and use the mask image to mask the distorted strip texture to obtain an aurora texture.

[0129] Further, at least one noise map includes a first noise map and a second noise map; the sampling and masking unit is specifically used for:

[0130] Sampling the first noise image to obtain a first mask image;

[0131] Using the first mask image to perform interval masking on the distorted strip texture to obtain a strip texture with a disconnected cross section;

[0132] Sampling the second noise image to obtain a second mask image;

[0133] The second mask image is used to perform regional masking on the strip texture with a disconnected cross section to obtain the aurora texture.

[0134] Furthermore, the rendering module 906 includes:

[0135] A first acquisition submodule is used to acquire a first preset duration and a second preset duration, wherein the first preset duration is used to represent the duration required for the aurora texture to gradually disappear, and the second preset duration is used to represent the duration required for the aurora color to adjust;

[0136] The rendering submodule is used to render the area to be rendered based on the first preset duration and the aurora texture, and to render the area to be rendered based on the second preset duration and the aurora color, so as to obtain the aurora effect of the area to be rendered.

[0137] Furthermore, the device 900 further includes:

[0138] A repeated sampling module 904 is used to repeatedly sample the preset map N times to obtain N new aurora textures, where N is an integer greater than or equal to 1;

[0139] An offset and superposition module is used to offset N new aurora textures to different degrees relative to the original aurora texture, and to superimpose the offset N+1 aurora textures to obtain a superimposed aurora texture;

[0140] The rendering module 906 is further used to render the area to be rendered based on the superimposed aurora texture and aurora color to obtain the aurora effect of the area to be rendered.

[0141] Furthermore, the acquisition module 902 includes:

[0142] A second acquisition submodule is used to acquire a first coordinate value and a second coordinate value, wherein the first coordinate value is a coordinate on a first coordinate axis in a world coordinate system of the sky box, and the second coordinate value is a coordinate on a second coordinate axis in the world coordinate system of the sky box, and the first coordinate axis and the second coordinate axis are two mutually perpendicular coordinates in the world coordinate system of the sky box;

[0143] The determination submodule is used to determine the area to be rendered based on the first coordinate value and the second coordinate value.

[0144] It should be noted that the device 900 can implement the steps of the method for rendering the aurora effect provided in any of the aforementioned method embodiments, and can achieve the same technical effect, which will not be described in detail here.

[0145] like Fig.10As shown, the embodiment of the present application further provides an electronic device, including a processor 1011, a communication interface 1012, a memory 1013 and a communication bus 1014, wherein the processor 1011, the communication interface 1012, and the memory 1013 communicate with each other through the communication bus 1014.

[0146] Memory 1013, used for storing computer programs;

[0147] In one embodiment of the present application, the processor 1011 is used to implement the rendering method of the aurora effect provided by any one of the aforementioned method embodiments when executing the program stored in the memory 1013, including:

[0148] Obtaining the area to be rendered in the game scene, wherein the area to be rendered is an area on the skybox in the game scene for rendering the aurora effect, and the skybox is used to simulate the sky in the game scene;

[0149] Sample the preset map to get the aurora texture and aurora color;

[0150] The area to be rendered is rendered based on the aurora texture and the aurora color to obtain the aurora effect of the area to be rendered.

[0151] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for rendering the aurora effect provided in any of the aforementioned method embodiments are implemented.

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

[0153] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0154] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0155] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for rendering an aurora effect, characterized in that: The method comprises: Acquire an area to be rendered in the game scene, wherein the area to be rendered is an area on a sky box in the game scene for rendering an aurora effect, and the sky box is used to simulate the sky in the game scene; Sample the preset map to get the aurora texture and aurora color; The area to be rendered is rendered based on the aurora texture and the aurora color to obtain the aurora effect of the area to be rendered.

2. The method according to claim 1, characterized in that The preset maps include a black and white gradient map, a color gradient map and at least one noise map; The sampling of the preset map to obtain the aurora texture and aurora color includes: Sampling the black-and-white gradient image and the at least one noise image to obtain the aurora texture; The color gradient image is sampled to obtain the aurora color.

3. The method according to claim 2, characterized in that The step of sampling the black-and-white gradient image and the at least one noise image to obtain the aurora texture includes: Sampling the black and white gradient image to obtain a strip texture; Using a preset distortion algorithm to distort the strip texture to obtain a distorted strip texture; The at least one noise image is sampled to obtain a mask image, and the distorted strip texture is masked by using the mask image to obtain the aurora texture.

4. The method according to claim 3, characterized in that The at least one noise map comprises a first noise map and a second noise map; The step of sampling the at least one noise image to obtain a mask image, and using the mask image to mask the distorted strip texture to obtain the aurora texture includes: Sampling the first noise image to obtain a first mask image; Using the first mask image to perform interval masking on the distorted strip texture to obtain a strip texture with a disconnected cross section; Sampling the second noise image to obtain a second mask image; The second mask image is used to perform regional masking on the strip texture with a broken cross section to obtain the aurora texture.

5. The method according to claim 1, characterized in that The rendering of the area to be rendered based on the aurora texture and the aurora color to obtain the aurora effect of the area to be rendered includes: Obtain a first preset duration and a second preset duration, wherein the first preset duration is used to characterize the duration required for the aurora texture to gradually disappear, and the second preset duration is used to characterize the duration required for the aurora color to adjust; The area to be rendered is rendered based on the first preset duration and the aurora texture, and the area to be rendered is rendered based on the second preset duration and the aurora color to obtain the aurora effect of the area to be rendered.

6. The method according to claim 1, characterized in that Before rendering the area to be rendered based on the aurora texture and the aurora color to obtain the aurora effect of the area to be rendered, the method further includes: Repeating sampling of the preset map N times to obtain N new aurora textures, where N is an integer greater than or equal to 1; The N new aurora textures are shifted to different degrees relative to the original aurora texture, and the shifted N+1 aurora textures are superimposed to obtain a superimposed aurora texture; The rendering of the area to be rendered based on the aurora texture and the aurora color to obtain the aurora effect of the area to be rendered includes: The area to be rendered is rendered based on the superimposed aurora texture and the aurora color to obtain the aurora effect of the area to be rendered.

7. The method according to claim 1, characterized in that The step of obtaining the area to be rendered in the game scene includes: Obtain a first coordinate value and a second coordinate value, wherein the first coordinate value is a coordinate on a first coordinate axis in a world coordinate system of the sky box, and the second coordinate value is a coordinate on a second coordinate axis in the world coordinate system of the sky box, and the first coordinate axis and the second coordinate axis are two coordinates perpendicular to each other in the world coordinate system of the sky box; The area to be rendered is determined based on the first coordinate value and the second coordinate value.

8. A device for rendering aurora effects, characterized in that: The device comprises: An acquisition module, used for acquiring an area to be rendered in a game scene, wherein the area to be rendered is an area on a sky box in the game scene for rendering an aurora effect, and the sky box is used for simulating the sky in the game scene; The sampling module is used to sample the preset map to obtain the aurora texture and aurora color; A rendering module is used to render the area to be rendered based on the aurora texture and the aurora color to obtain the aurora effect of the area to be rendered.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor is used to implement the steps of the method for rendering the aurora effect described in any one of claims 1 to 7 when executing a program stored in a memory.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for rendering the aurora effect described in any one of claims 1 to 7 are implemented.