Virtual sky scene rendering method and device, program product and electronic equipment

By converting the spherical sky model into a cylindrical sky model with both tips and map processing, the problem of unreal dynamic rendering effects of dynamic elements such as meteors in the spherical sky model is solved, and a more natural and real virtual sky scene rendering is achieved, improving the user experience.

CN119991418APending Publication Date: 2025-05-13NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510088994.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-20
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

When the prior art simulates the movement of directional dynamic elements such as meteors in the spherical sky model, it is difficult to deal with complexity and continuity, resulting in false rendering effects, not real enough, and affecting the user experience.

Method used

Convert the spherical sky model to a cylindrical sky model with both ends pointed, and render the virtual sky scene through map processing.

Benefits of technology

The cylindrical sky model with pointed ends can better simulate the real sky visual effect seen by people, improve the naturalness and reality of the rendering, and enhance the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119991418A_ABST
    Figure CN119991418A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and provides a virtual sky scene rendering method and device, a program product and electronic equipment. The method comprises the steps that a spherical sky model is converted into a target sky model, and the target sky model comprises a cylindrical sky model with two sharp heads; and performing mapping processing on the target sky model according to the sky element mapping, and rendering a virtual sky scene based on the target sky model after mapping processing. According to the scheme, based on the target sky model, the rendering trueness of the virtual sky scene can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method for rendering a virtual sky scene, a device for rendering a virtual sky scene, a computer program product, and an electronic device. Background Art

[0002] In the field of game or animation technology, the simulation of virtual sky scenes is a very important part of the natural scene rendering in games or animations. And the rendering of dynamic elements in the sky, such as meteors and stars, is a very critical content in the rendering of virtual sky scenes.

[0003] In the related art, particle systems are used to simulate the movement in the sky, such as the flow of clouds, the twinkling of stars, etc. However, particle systems do not simulate directional dynamic elements such as meteors well, especially when simulating the movement of directional dynamic elements such as meteors in a spherical sky model, because particle systems have difficulty in handling the complexity and continuity of spherical movement, resulting in a false rendering effect that is not realistic enough, affecting the user experience.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] The purpose of the present disclosure is to provide a method and device for rendering a virtual sky scene, a computer program product, and an electronic device, thereby improving the authenticity of the rendering of the virtual sky scene at least to a certain extent and enhancing the user experience.

[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0007] According to a first aspect of the present disclosure, a method for rendering a virtual sky scene is provided, comprising: converting a spherical sky model into a target sky model, the target sky model comprising a cylindrical sky model with pointed ends; performing mapping processing on the target sky model according to a sky element map, and rendering a virtual sky scene based on the mapped target sky model.

[0008] According to a second aspect of the present disclosure, a rendering device for a virtual sky scene is provided, including: a sky model conversion module, configured to convert a spherical sky model into a target sky model, wherein the target sky model includes a cylindrical sky model with pointed ends; a texture rendering module, configured to perform texture processing on the target sky model according to a sky element texture, and render a virtual sky scene based on the texture-processed target sky model.

[0009] According to a third aspect of the present disclosure, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the steps of the method for rendering a virtual sky scene as described in the first aspect.

[0010] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method for rendering a virtual sky scene as described in the first aspect of the above embodiment is implemented.

[0011] According to a fifth aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a processor; and a storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the method for rendering a virtual sky scene as described in the first aspect of the above embodiment.

[0012] It can be seen from the above technical solutions that the virtual sky scene rendering method, the virtual sky scene rendering device, and the computer program product and electronic device for implementing the virtual sky scene rendering method in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:

[0013] In the technical solutions provided by some embodiments of the present disclosure, a spherical sky model is converted into a cylindrical sky model with two pointed ends, and then a mapping is performed based on the cylindrical sky model with two pointed ends, and a virtual sky scene is rendered. Compared with the related art, the present disclosure can better simulate the visual effect of the real sky seen by people through the cylindrical sky model with two pointed ends, thereby presenting a more natural movement effect of sky elements in the sky, improving the naturalness and realism of rendering, and enhancing user experience.

[0014] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0016] Figure 1 A schematic diagram showing an exemplary system architecture to which embodiments of the present disclosure may be applied;

[0017] Figure 2A schematic diagram showing a flow chart of a method for rendering a virtual sky scene in an exemplary embodiment of the present disclosure;

[0018] Figure 3 A schematic flow chart showing a method for converting a spherical sky model into a target sky model in an exemplary embodiment of the present disclosure;

[0019] Figure 4 A schematic diagram showing a first sky model in an exemplary embodiment of the present disclosure;

[0020] Figure 5 A schematic flow chart showing a method for obtaining a second sky model in an exemplary embodiment of the present disclosure;

[0021] Figure 6 A schematic flow chart showing a method for performing multiple layered mapping processing in an exemplary embodiment of the present disclosure;

[0022] Figure 7 A schematic diagram showing the composition of a rendering device for a virtual sky scene in an exemplary embodiment of the present disclosure;

[0023] Figure 8 A schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0024] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0025] The terms "a", "an", "the" and "said" are used in this specification to indicate the presence of one or more elements / components / etc.; the terms "including" and "having" are used to express an open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first" and "second" etc. are used only as labels and are not intended to limit the quantity of their objects.

[0026] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0027] In the development of modern computer graphics, how to realistically simulate and render natural phenomena in three-dimensional space, especially dynamic elements in the sky, has always been the direction of researchers and developers' efforts.

[0028] In the related art, particle systems are used to simulate the movement in the sky, such as the flow of clouds and the twinkling of stars. Although it can achieve certain effects, it also has many shortcomings. For example, when the particle system simulates directional movement, such as the movement of meteors, it is usually too rigid and unnatural, especially when simulating directional movement in a spherical model sky, such as a sky ball, the simulation effect will appear to be relatively false.

[0029] In order to solve the above problems, the present invention provides a method and device for rendering a virtual sky scene, which can be applied to Figure 1 In the system architecture of the exemplary application environment shown.

[0030] like Figure 1 As shown, the system architecture 100 may include a terminal device 110 and a server 120. The terminal device 110 may be a terminal device such as a smart phone, a tablet computer, a desktop computer, a laptop computer, a smart wearable device, etc. The server 120 generally refers to a background system that provides services related to the rendering method of the virtual sky scene in this exemplary embodiment, and may be a server or a cluster formed by multiple servers. The terminal device 110 and the server 120 may be connected via a wired or wireless communication link to perform data exchange.

[0031] In an exemplary embodiment, the above-mentioned method for rendering a virtual sky scene may be performed by the terminal device 110. Accordingly, a rendering device for a virtual sky scene may be provided in the terminal device 110 to implement corresponding module functions. For example, when a user is playing a game using the terminal device 110, if it is necessary to render a virtual sky scene, the terminal device 110 may convert a spherical sky model in the game scene model into a target sky model, and then perform texture processing on the target sky model according to the texture of the sky element of the virtual sky scene to be displayed, and render a virtual sky scene showing at least the sky element of the sky element texture in the graphical user interface of the terminal device 110 based on the textured target sky model.

[0032] In an exemplary embodiment, the above-mentioned method for rendering a virtual sky scene may be performed by the server 120. Accordingly, a rendering device for a virtual sky scene may be provided in the server 120 to implement corresponding module functions. For example, after a user logs in to a game using the terminal device 111, the terminal device 110 sends game data to the server 120. When the server 120 determines that a virtual sky scene needs to be rendered based on the game data, the spherical sky model in the game scene model is converted into a target sky model. Then, the target sky model is textured according to the texture of the sky element of the virtual sky scene to be displayed. Based on the textured target sky model, a virtual sky scene displaying at least the sky element of the sky element texture is rendered in the terminal device 110.

[0033] It should be understood that Figure 1 The number of terminal devices and servers in the example is only illustrative. Any number of terminal devices and servers may be provided as required. For example, the server 120 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0034] Figure 2 A schematic diagram showing a flow chart of a method for rendering a virtual sky scene in an exemplary embodiment of the present disclosure is shown. Figure 2 , the method comprising:

[0035] Step S210, converting the spherical sky model into a target sky model, wherein the target sky model includes a cylindrical sky model with pointed ends;

[0036] Step S220, mapping the target sky model according to the sky element map, and rendering a virtual sky scene based on the mapped target sky model.

[0037] exist Figure 2 In the technical solution provided by the illustrated embodiment, the spherical sky model is converted into a cylindrical sky model with two pointed ends, and then the mapping is performed based on the cylindrical sky model with two pointed ends, and a virtual sky scene is rendered. Compared with the related art, the present disclosure can better simulate the visual effect of the real sky seen by people through the cylindrical sky model with two pointed ends, thereby presenting a more natural movement effect of the sky elements in the sky, improving the naturalness and realism of the rendering, and enhancing the user experience.

[0038] Next, the specific implementation of "step S210, converting the spherical sky model into a target sky model" will be described in detail.

[0039] In an exemplary embodiment, the target sky model comprises a cylindrical sky model similar to a pointed sky model.

[0040] For example, the target sky model finally converted may include a cylinder with pointed ends and thick middle, which can also be understood as a spindle-shaped cylinder. In this way, for the characters in the virtual scene, the sky they see is a downward curved plane, and the sky rendered in the graphical user interface is also a downward curved plane, which can better simulate the visual experience of the characters in the real world when viewing the sky, and improve the authenticity of the virtual sky scene rendering. In addition, for moving elements in the sky, such as meteors, the general direction of movement of the meteors is the same. If the sky model is spherical, there will be obvious arcs, and the tail of the meteor will move along the arc, resulting in the movement of the meteor not being realistic enough. If the sky model is cylindrical, there will be obvious flaws at the junction of the columns, resulting in the rendering of the meteor not being realistic enough.

[0041] For example, Figure 3 A schematic flow chart of a method for converting a spherical sky model into a target sky model in an exemplary embodiment of the present disclosure is shown. Figure 3 , the method may include steps S310 to S330. Wherein:

[0042] In step S310, the texture coordinates of the spherical sky model are processed by an inverse trigonometric function to map the spherical sky model into a first sky model.

[0043] In an exemplary implementation, the first sky model can be understood as a plane model, that is, the spherical sky model is mapped to a plane sky model. Figure 4 As shown, Figure 4 A schematic diagram of a flat sky model is shown after the spherical sky model is reversely stretched into a flat model.

[0044] For example, the texture coordinates of the spherical sky model may be mapped using an inverse trigonometric function, thereby determining the first sky model based on the texture coordinates obtained after the mapping process.

[0045] For example, the texture coordinates of the spherical sky model may be used as input of an inverse trigonometric function, and the output of the inverse trigonometric function may be used as mapping values ​​of the texture coordinates of the input spherical sky model, thereby obtaining the first sky model.

[0046] In an exemplary implementation, the inverse trigonometric function in step S310 may include any one of an inverse cosine function, an inverse sine function, an inverse tangent function, an inverse cotangent function, etc. For example, the inverse trigonometric function in step S310 is an inverse tangent function.

[0047] In step S320, the first sky model is subjected to transverse bending processing, and a second sky model is obtained according to the bending processing result.

[0048] For example, after obtaining the first sky model, the first sky model has moiré defects, which need to be processed. In the present disclosure, the first sky model can be bent to reduce the impact of the moiré defects on the display effect. When the bending process is performed, due to the scaling ratio in the longitudinal direction, the moiré defects are not obvious, and the bending process can be omitted, but the moiré defects in the transverse direction are more obvious, so the bending process needs to be performed to obtain the second sky model.

[0049] Of course, it is also possible to select to perform lateral bending and / or longitudinal bending according to the needs. This exemplary embodiment does not specifically limit this. For example, the first sky model may be subjected to lateral bending and longitudinal bending to obtain a second sky model, or the first sky model may be subjected to longitudinal bending to obtain a second sky model.

[0050] Based on this, for example, Figure 5 A schematic flow chart of a method for obtaining a second sky model in an exemplary embodiment of the present disclosure is shown. Figure 5 , the method may include steps S510 to S530. Wherein:

[0051] In step S510, a middle line of the first sky model in the lateral direction is used as a dividing line, and the shortest lateral distance from the first texture coordinate of the first sky model to the dividing line is determined.

[0052] For example, taking the case where the horizontal texture coordinate corresponds to the first coordinate value, the vertical texture coordinate corresponds to the second coordinate value, and the first texture coordinate on the middle line is the intermediate first texture coordinate, the shortest horizontal distance from each first texture coordinate to the dividing line can be determined based on the distance between the first coordinate value of the first texture coordinate and the first coordinate value of the intermediate first texture coordinate which is the same as the second coordinate value of the first texture coordinate.

[0053] For example, if the coordinate value of a first texture coordinate is (A, B), then the middle first texture coordinate whose coordinate value of the longitudinal texture coordinate is B can be found on the middle line. For example, if it is (A1, B), the shortest horizontal distance corresponding to the first texture coordinate (A, B) can be obtained based on the absolute value of the difference between A1 and A.

[0054] In step S520, the curvature of the position indicated by the first texture coordinate of the first sky model is determined according to the shortest horizontal distance.

[0055] For example, the moiré defects on both sides of the first sky model are greater than the moiré defects in the middle of the first sky model, so the closer to the edge, the greater the curvature. The shortest lateral distance at the two sides is also greater than the shortest lateral distance at the middle, so the curvature of the position indicated by each first texture coordinate can be determined based on the shortest lateral distance.

[0056] Based on this, exemplarily, an implementation of step S520 may include: obtaining a preset curvature parameter, and determining the curvature of the position indicated by each first texture coordinate of the first sky model based on the product of the shortest lateral distance corresponding to each first texture coordinate of the first sky model and the preset curvature parameter.

[0057] For example, the preset curvature parameter can be customized according to the needs. For example, the preset curvature parameter can be used to indicate the maximum curvature, that is, the curvature of the edge position of the first sky model. For example, the texture coordinates of the lower left corner of the first sky model are (0,0) and the texture coordinates of the upper right corner are (1,1). The shortest lateral distance of the edge position is 0.5. If the curvature of the edge position is 1, the preset curvature parameter can be set to 2. In this way, the curvature of the edge position is 2 times 0.5, which is 1. The shortest lateral distance of other positions is less than 0.5, so the product of the preset curvature parameter is less than 1, that is, the curvature of the edge position is the largest. Of course, the preset curvature parameter can also be set to other values, and this exemplary embodiment does not specifically limit this.

[0058] In other words, the shortest lateral distance corresponding to each first texture coordinate can be used as its bending weight, and then a same preset bending parameter can be set for each first texture coordinate, and the product of the bending weight and the preset bending parameter can be used as the bending degree of the position indicated by the first texture coordinate.

[0059] In another exemplary embodiment, the shortest lateral distance corresponding to each first texture coordinate may be directly used as the bending degree corresponding to the first texture coordinate, and this exemplary embodiment does not impose any special limitation on this.

[0060] In step S530, a bending process is performed on the position indicated by the first texture coordinates of the first sky model based on the bending degree, and a second sky model is obtained according to the bending process result.

[0061] Exemplarily, an exemplary implementation of step S530 may include: for each first texture coordinate of the first sky model, determining a second texture coordinate based on the degree of bending of the position indicated by the first texture coordinate and the product of the first texture coordinate; using the position indicated by the second texture coordinate as the target position after bending the position indicated by the first texture coordinate, so as to achieve bending processing of the first texture coordinate.

[0062] For example, for each first texture coordinate, the product of the first texture coordinate and its corresponding degree of curvature can be determined, and the product can be used as the second texture coordinate, so that the first texture coordinate is mapped to the second texture coordinate. The result of mapping each first texture coordinate to the second texture coordinate is to obtain a second sky model.

[0063] In step S330, interpolation processing is performed on the spherical sky model, the first sky model and the second sky model to obtain the target sky model.

[0064] Exemplarily, an exemplary implementation of step S330 may include: performing a first interpolation between the spherical sky model and the first sky model, and obtaining an intermediate model according to the first interpolation result; performing a second interpolation between the intermediate model and the second sky model, and obtaining the target sky model according to the second interpolation result.

[0065] In an exemplary embodiment, the interpolation method in the present disclosure may include linear interpolation. That is, interpolation is performed between the spherical sky model and the first sky model to obtain an intermediate model, and then interpolation is performed again between the intermediate model and the second sky model to obtain a target sky model. The interpolation parameters can be customized according to requirements, and the ultimate goal is to obtain a sky model shape that meets the requirements of art or planning.

[0066] In other words, the target sky model obtained in the present disclosure is a sky model that is in an intermediate state between the spherical sky model, the first sky model and the second sky model and meets artistic requirements.

[0067] For example, in the present disclosure, the content displayed on the spherical sky model can be stretched into a plane in the reverse direction and then bent horizontally to obtain a sky model space similar to a cylinder (i.e., the cylinder with thin ends and thick middle as mentioned above). Various parameters in the space can be adjusted, such as the degree of bending, etc., and finally the planners or artists determine a sky model shape that meets the needs of the artists or planners.

[0068] In the present disclosure, through the above-mentioned steps S310 to S330, a target sky model that better meets the art or planning requirements can be obtained, and a more realistic virtual sky scene rendering can be achieved based on the target sky model.

[0069] The specific implementation of "step S220, performing mapping processing on the target sky model according to the sky element map, and rendering a virtual sky scene based on the mapped target sky model" is described in detail below.

[0070] In an exemplary embodiment, sky elements can be understood as natural elements in the sky. A sky element map is a map of any natural element in the sky.

[0071] For example, sky elements may include dynamic elements in the sky, such as meteors, stars, clouds, raindrops, etc. Sky elements may also include static elements in the sky, such as the moon, the sun, etc.

[0072] In an exemplary implementation, step S220 may include: performing multiple layered mapping processes on the target sky model according to the sky element map, and rendering a dynamic virtual sky scene based on the target sky model after the multiple layered mapping processes.

[0073] For example, the target sky model can be sampled and mapped multiple times to achieve a layered effect. Taking a meteor as an example, the layered effect simulated by multiple layered mappings can show the effect of a meteor passing through the sky.

[0074] For example, Figure 6 A schematic flow chart of a method for performing multiple layered mapping processing in an exemplary embodiment of the present disclosure is shown. Figure 6 The method may include steps S610 to S660. Wherein:

[0075] In step S610, the target sky model is divided into a plurality of grids according to a preset number of grids.

[0076] In an exemplary embodiment, the number of preset grids can be customized according to needs, and this exemplary embodiment does not specifically limit this. For example, the target sky model can be divided into 100 grids, 50 grids, etc.

[0077] As mentioned above, in the present disclosure, multiple layered samplings can be performed. In the layered sampling, based on the principle of large near and small far, the number of preset grids for the layers closer to the ground is smaller. In this way, the larger the size of each grid, the larger the map. Conversely, the layer farther from the ground has a larger number of preset grids. In this way, the smaller the size of each grid, the smaller the map, thereby simulating the visual effect of large near and small far.

[0078] In an exemplary embodiment, each mesh is a (0,0) to (1,1) UV mapping, where UV is a two-dimensional texture coordinate corresponding to the vertex information of the geometric figure. In other words, the UV of the lower left corner of each grid is (0,0), and the UV of the upper right corner is (1,1).

[0079] After dividing the target sky model into multiple grids, if the UV sample at this time is a meteor map, after rendering, it should be displayed as a sky full of static meteors with only one layer of regular distribution.

[0080] In step S620, a preset speed is determined based on the changing time value and the preset speed indication value corresponding to the preset number of grids, and the third texture coordinates of the target sky model are processed according to the preset speed to obtain a layer of dynamic third texture coordinates.

[0081] In an exemplary embodiment, the virtual sky scene includes a virtual sky scene in a game. Based on this, the time value of the change can be determined according to the start time of the game.

[0082] For example, the changing time value may be the start time of the game, which can be understood as the total time from entering the game to the current moment. The start time of the game also changes with the passage of normal time. For example, if the start time of the game is 50 seconds at the current moment, the start time of the game will become 51 seconds in the next second.

[0083] In another exemplary embodiment, the virtual sky scene may also include a virtual sky scene in an animation in the field of video production. Based on this, the time value of the change may also be determined according to the start time of the animation.

[0084] Exemplarily, a specific implementation of step S620 may include: determining a preset speed based on the product of the starting duration of the game and the preset speed indication value corresponding to the preset number of grids; determining the fourth texture coordinates at each moment during the game according to the sum of the third texture coordinates of the target sky model and the preset speed; and obtaining a layer of dynamic third texture coordinates based on the fourth texture coordinates at each moment.

[0085] In an exemplary embodiment, the corresponding relationship between the preset number of grids and the preset speed indication value includes: the larger the preset number of grids, the smaller the preset speed indication value.

[0086] For example, as mentioned above, the larger the number of preset grids, the smaller the size of each grid of that layer, the smaller the size of the grid, the farther away from the ground, and the slower the speed, while the time value of the change is the same for each layer, so the larger the number of preset grids, the smaller the preset speed indication value, thus obtaining a smaller preset speed, thereby achieving a visual effect of slower speed the farther away.

[0087] Exemplarily, the correspondence between the preset number of grids and the preset speed indication value can be pre-configured, such as a conversion relationship formula or relationship table between the preset number of grids and the preset speed indication value. The preset speed indication value corresponding to the preset number of grids can be calculated or found through the conversion relationship formula or relationship table.

[0088] Through step S620, a dynamic visual effect can be generated in each layer. Taking the meteor map as an example, if a meteor map is applied to each grid at this time, after rendering, there should be only one layer of dynamic meteors arranged all over the sky and flowing at the same speed over time.

[0089] In step S630, a random noise value is generated for each grid, and a grid to be mapped is determined from a plurality of grids according to a magnitude relationship between the random noise value of each grid and a preset value.

[0090] For example, a preset value may be set, and if the random noise value of a grid is greater than or equal to the preset value, the grid is determined as a grid to be mapped; or if the random noise value of a grid is less than or equal to the preset value, the grid is determined as a grid to be mapped.

[0091] For example, if the preset value is 0.4, a random noise value between 0 and 1 can be generated for each grid. If the random noise value of a grid is greater than or equal to 0.4, the grid can be determined as a grid to be mapped, otherwise the grid is determined as a grid without mapping or a grid with a blank image. Alternatively, if the random noise value of a grid is less than or equal to 0.4, the grid is determined as a grid to be mapped, otherwise the grid is determined as a grid without mapping or a grid with a blank image.

[0092] In step S640, the preset sky element map is scaled based on the size of the grid to obtain a target sky element map corresponding to the size of the grid.

[0093] For example, in the present disclosure, each grid needs to be mapped, so the preset sky element map can be scaled, and after scaling it to the same size as each grid, the corresponding target sky element map is obtained. The grid size of each layer is different, so its scaling ratio is also different.

[0094] In step S650, the grid to be mapped is mapped according to the target sky element map, and a layer of dynamic mapping is obtained based on the mapping result and the third texture coordinates.

[0095] After obtaining the target sky element map, the above-determined grid to be mapped can be mapped based on the target sky element. After mapping, based on the above-mentioned dynamic third texture coordinates and the grid to be mapped, what is obtained is a flowing meteor that exists randomly in the sky and has only one layer, that is, the randomly existing meteors pass through the sky at the same speed.

[0096] In step S660, the preset number of grids is adjusted, and the process goes to step S610.

[0097] For example, in step S660, the number of preset grids is adjusted, and the above process is repeated according to the adjusted number of preset grids to obtain another layer of dynamic maps, and multiple layers of dynamic maps are obtained according to the repeated execution.

[0098] As mentioned above, in the present disclosure, multiple samplings are performed to complete the layered dynamic sky element effects, such as the dynamic meteor effect. The layering is based on the principle of near large and far small. The number of preset grids is different, and the size of each grid is different, which presents a visual effect of near large and far small. Therefore, the number of preset grids is adjusted to obtain grids of different sizes, and the preset sky element map is scaled according to the grids of different sizes. When the map is enlarged, it is the layering of the sky element close to the ground, and when the map is reduced, it is the layering of the sky element far away from the ground.

[0099] In other words, taking the meteor map as an example, by repeating the above steps S610 to S650 according to different preset numbers of grids, a multi-layered dynamic meteor effect of moving at different speeds and presenting a perspective effect of larger objects near and smaller objects far away, can be obtained.

[0100] In another exemplary embodiment, the grid to be mapped may not be determined, but step S640 is performed after step S620 to obtain the target sky element map, and then all grids are mapped according to the target sky element map. After the mapping is completed, a random noise value is generated for each grid, and when the random noise value is greater than a preset value, the grid is extinguished. That is, the brightness of the dynamic elements in the sky is controlled by the size relationship between the random noise value and the preset value, such as randomly "extinguishing" some meteors by random noise, so as to achieve a more natural and realistic effect.

[0101] Exemplarily, after obtaining multiple layers of dynamic maps through the above-mentioned steps S610 to S660, rendering a dynamic virtual sky scene based on the target sky model after multiple layered map processing includes: superimposing multiple layers of dynamic maps, and rendering a dynamic virtual sky scene based on the superimposed multiple layers of dynamic maps.

[0102] In other words, through the above steps S610 to S660, multiple layers of layered dynamic sky elements are obtained. Through the superposition of multiple layers, a viewing effect of near big and far small, near fast and far slow can be presented, thereby rendering a more realistic virtual sky scene.

[0103] In the present disclosure, the spherical model of the sky is remapped to a new target space to obtain a target sky model, which can more realistically simulate the visual effect of a person seeing the sky, and achieve a more realistic virtual sky scene rendering. At the same time, the target sky model can better simulate the motion trajectory of dynamic elements in the sky, especially the motion trajectory of elements with obvious directionality such as meteors. Further, the target sky model is divided into multiple layers, and the target sky model is sampled multiple times in layers, which can not only simulate the natural movement of dynamic elements in the sky, such as meteors and stars, but also simulate different motion effects and visual depths at different levels, thereby achieving more complex and diverse dynamic virtual sky scene rendering.

[0104] In addition, it should be noted that the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0105] Furthermore, an exemplary embodiment of the present disclosure also provides a rendering device for a virtual sky scene. Figure 7 As shown, the rendering device 700 of the virtual sky scene includes the following program modules: a sky model conversion module 710, configured to convert a spherical sky model into a target sky model, wherein the target sky model includes a cylindrical sky model with pointed ends; a texture rendering module 720, configured to perform texture processing on the target sky model according to a sky element texture, and render a virtual sky scene based on the textured target sky model.

[0106] In an exemplary embodiment, the sky model conversion module 710 can be specifically configured as follows: processing the texture coordinates of the spherical sky model through inverse trigonometric functions to map the spherical sky model to a first sky model; performing lateral bending processing on the first sky model to obtain a second sky model based on the bending processing result; and interpolating the spherical sky model, the first sky model and the second sky model to obtain a target sky model.

[0107] In an exemplary embodiment, the lateral bending processing is performed on the first sky model, and the second sky model is obtained according to the bending processing result, which includes: taking the middle line of the lateral direction of the first sky model as a dividing line, determining the shortest lateral distance from the first texture coordinate of the first sky model to the dividing line; determining the degree of bending of the position indicated by the first texture coordinate of the first sky model according to the shortest lateral distance; bending the position indicated by the first texture coordinate of the first sky model based on the degree of bending, and obtaining the second sky model according to the bending processing result.

[0108] In an exemplary embodiment, determining the degree of curvature of the position indicated by the first texture coordinate of the first sky model based on the shortest lateral distance includes: obtaining a preset curvature parameter, and determining the degree of curvature of the position indicated by each first texture coordinate of the first sky model based on the product of the shortest lateral distance corresponding to each first texture coordinate of the first sky model and the preset curvature parameter; bending the position indicated by the first texture coordinate of the first sky model based on the curvature includes: determining a second texture coordinate for each first texture coordinate of the first sky model based on the product of the degree of curvature of the position indicated by the first texture coordinate and the first texture coordinate; and using the position indicated by the second texture coordinate as the target position after bending the position indicated by the first texture coordinate, so as to achieve bending of the first texture coordinate.

[0109] In an exemplary embodiment, the interpolation processing of the spherical sky model, the first sky model and the second sky model to obtain the target sky model includes: performing a first interpolation between the spherical sky model and the first sky model, and obtaining an intermediate model according to the first interpolation result; performing a second interpolation between the intermediate model and the second sky model, and obtaining the target sky model according to the second interpolation result.

[0110] In an exemplary embodiment, the mapping of the target sky model according to the sky element map and rendering the virtual sky scene based on the target sky model after the mapping includes: performing multiple layered mapping processes on the target sky model according to the sky element map, and rendering a dynamic virtual sky scene based on the target sky model after the multiple layered mapping processes.

[0111] In an exemplary embodiment, the target sky model is subjected to multiple layered mapping processes according to the sky element map, including: dividing the target sky model into multiple grids according to a preset number of grids; determining a preset speed based on a changing time value and a preset speed indication value corresponding to the preset number of grids, processing the third texture coordinates of the target sky model according to the preset speed to obtain a layer of dynamic third texture coordinates; generating a random noise value for each grid, and determining a grid to be mapped from the multiple grids according to a size relationship between the random noise value of each grid and a preset value; scaling the preset sky element map based on the size of the grid to obtain a target sky element map corresponding to the size of the grid; mapping the grid to be mapped according to the target sky element map, and obtaining a layer of dynamic mapping based on the mapping result and the third texture coordinates; adjusting the preset number of grids, and repeating the above process according to the adjusted preset number of grids to obtain multiple layers of dynamic mapping.

[0112] In an exemplary embodiment, the virtual sky scene includes a virtual sky scene in a game, and the changing time value is determined according to the starting time of the game; the preset speed is determined based on the changing time value and the preset speed indication value corresponding to the preset number of grids, and the third texture coordinates of the target sky model are processed according to the preset speed to obtain a layer of dynamic third texture coordinates, including: determining the preset speed based on the product of the starting time of the game and the preset speed indication value corresponding to the preset number of grids; determining the fourth texture coordinates at each moment during the game according to the sum of the third texture coordinates of the target sky model and the preset speed; and obtaining a layer of dynamic third texture coordinates based on the fourth texture coordinates at each moment.

[0113] In an exemplary embodiment, the correspondence between the preset number of grids and the preset speed indication value includes: the larger the preset number of grids, the smaller the preset speed indication value.

[0114] In an exemplary embodiment, rendering a dynamic virtual sky scene based on the target sky model after multiple layered mapping processes includes: superimposing the multiple layers of dynamic maps, and rendering a dynamic virtual sky scene based on the superimposed multiple layers of dynamic maps.

[0115] The specific details of each part of the above-mentioned device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.

[0116] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0117] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0118] The exemplary embodiments of the present disclosure further provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program implements the above-mentioned method for rendering a virtual sky scene.

[0119] In one embodiment, the computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing a computer program. The readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing a computer program, such as a read-only memory, a NAND flash memory, and the like.

[0120] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.

[0121] The code of the computer program can be written in one or more programming languages. Programming languages ​​such as C language, Java, C++, Python, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., an Internet connection provided by an operator).

[0122] Computer programs can be carried or transmitted through electrical, magnetic, optical, electromagnetic, infrared and other signals. Electronic devices can convert signals carrying computer programs into digital signals, thereby running the computer programs. When a computer program is running on an electronic device, its code is used to enable the electronic device to execute (more specifically, it can enable the processor of the electronic device to execute) the method steps of various exemplary embodiments of the present disclosure, such as the method for rendering the above-mentioned virtual sky scene, which includes the following steps: converting a spherical sky model into a target sky model, the target sky model including a cylindrical sky model with pointed ends; mapping the target sky model according to a sky element map, and rendering a virtual sky scene based on the mapped target sky model.

[0123] By executing the above method steps through a computer program, the cylindrical sky model with two pointed ends can better simulate the visual effect of the real sky seen by people, thereby presenting a more natural movement effect of sky elements in the sky, improving the naturalness and realism of rendering, and enhancing user experience.

[0124] The exemplary embodiments of the present disclosure also provide an electronic device, such as the terminal device 110 or the server 120 described above. The electronic device may include a processor and a memory. The memory stores executable instructions of the processor, such as a computer program. The processor executes the method steps of various exemplary embodiments of the present disclosure by executing the executable instructions. In addition, the electronic device may also include a display for displaying a graphical user interface.

[0125] Reference below Figure 8 , the electronic device is exemplarily described in the form of a general-purpose computing device. It should be understood that Figure 8The electronic device 800 shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0126] like Figure 8 As shown, the electronic device 800 may include: a processor 810 , a memory 820 , a bus 830 , an I / O (input / output) interface 840 , a network adapter 850 , and a display 860 .

[0127] The memory 820 may include a volatile memory, such as a RAM 821, a cache unit 822, and may also include a non-volatile memory, such as a ROM 823. The memory 820 may also include one or more program modules 824, such program modules 824 include but are not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or a combination thereof may include the implementation of a network environment. For example, the program module 824 may include each module in the above-mentioned device.

[0128] The processor 810 may include one or more processing units. For example, the processor 810 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc.

[0129] The processor 810 can be used to execute executable instructions stored in the memory 820, such as executing the above-mentioned virtual sky scene rendering method, which includes the following steps: converting a spherical sky model into a target sky model, the target sky model including a cylindrical sky model with pointed ends; mapping the target sky model according to a sky element map, and rendering a virtual sky scene based on the mapped target sky model.

[0130] By implementing the above method through a computer program, the cylindrical sky model with two pointed ends can better simulate the visual effect of the real sky seen by people, thereby presenting a more natural movement effect of sky elements in the sky, improving the naturalness and realism of rendering, and enhancing user experience.

[0131] The bus 830 is used to realize the connection between different components of the electronic device 800, and may include a data bus, an address bus, and a control bus.

[0132] The electronic device 800 can communicate with one or more external devices 900 (eg, a keyboard, a mouse, an external controller, etc.) through the I / O interface 840 .

[0133] The electronic device 800 can communicate with one or more networks through the network adapter 850. For example, the network adapter 850 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, near field communication, etc. The network adapter 850 can communicate with other modules of the electronic device 800 through the bus 830.

[0134] The electronic device 800 may display a graphical user interface, such as an interface displaying a rendered virtual sky scene, through the display 860 .

[0135] although Figure 8 Not shown, other hardware and / or software modules may also be provided in the electronic device 800, including but not limited to: a display (if it has been mentioned above that the electronic device includes a display, then the word "display" shall be deleted here), microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0136] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0137] As can be seen from the above, the technical solution of the present disclosure can be implemented as a method, an apparatus, a system, a computer program product, a storage medium, an electronic device, etc. Those skilled in the art can understand that various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software, such as being respectively referred to as a "circuit", "module" or "system".

[0138] It should be understood that the present disclosure is not limited to the specific method steps or structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. Those skilled in the art will easily think of other embodiments based on the specific embodiments provided by the present disclosure. Therefore, the specific embodiments provided by the present disclosure are only exemplary, and the scope and spirit of the present disclosure are indicated by the claims, and any variations, uses or adaptive changes of the present disclosure should be covered, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the technical field that are not disclosed in the present disclosure.

Claims

1. A method for rendering a virtual sky scene, characterized in that: include: Converting the spherical sky model into a target sky model, wherein the target sky model includes a cylindrical sky model with two pointed ends; The target sky model is textured according to the sky element texture, and a virtual sky scene is rendered based on the textured target sky model.

2. The method according to claim 1, characterized in that The converting of the spherical sky model into the target sky model comprises: Processing the texture coordinates of the spherical sky model by using an inverse trigonometric function to map the spherical sky model into a first sky model; Performing a lateral bending process on the first sky model, and obtaining a second sky model according to the bending process result; The spherical sky model, the first sky model and the second sky model are interpolated to obtain the target sky model.

3. The method according to claim 2, characterized in that The performing lateral bending processing on the first sky model and obtaining a second sky model according to the bending processing result comprises: Taking a middle line of the first sky model in a lateral direction as a dividing line, determining a shortest lateral distance from a first texture coordinate of the first sky model to the dividing line; determining, according to the shortest lateral distance, a degree of curvature of a position indicated by a first texture coordinate of the first sky model; The position indicated by the first texture coordinate of the first sky model is bent based on the bending degree, and a second sky model is obtained according to the bending result.

4. The method according to claim 3, characterized in that Determining the curvature of the position indicated by the first texture coordinate of the first sky model according to the shortest lateral distance includes: Obtaining a preset curvature parameter, and determining the curvature of a position indicated by each first texture coordinate of the first sky model according to the product of the shortest lateral distance corresponding to each first texture coordinate of the first sky model and the preset curvature parameter; The bending process of the position indicated by the first texture coordinate of the first sky model based on the bending degree comprises: For each first texture coordinate of the first sky model, determining a second texture coordinate according to a product of a curvature of a position indicated by the first texture coordinate and the first texture coordinate; The position indicated by the second texture coordinates is used as the target position after the position indicated by the first texture coordinates is bent, so as to implement bending processing on the first texture coordinates.

5. The method according to claim 2, characterized in that: The interpolating the spherical sky model, the first sky model and the second sky model to obtain the target sky model comprises: Performing a first interpolation between the spherical sky model and the first sky model, and obtaining an intermediate model according to the first interpolation result; A second interpolation is performed between the intermediate model and the second sky model, and the target sky model is obtained according to the second interpolation result.

6. The method according to claim 1, characterized in that The processing of the target sky model according to the sky element map and rendering a virtual sky scene based on the target sky model after the map processing comprises: The target sky model is subjected to multiple layered mapping processes according to the sky element mapping, and a dynamic virtual sky scene is rendered based on the target sky model subjected to the multiple layered mapping processes.

7. The method according to claim 6, characterized in that The target sky model is subjected to multiple layered mapping processes according to the sky element map, including: Dividing the target sky model into a plurality of grids according to a preset number of grids; Determining a preset speed based on the changed time value and the preset speed indication value corresponding to the preset number of grids, and processing the third texture coordinates of the target sky model according to the preset speed to obtain a layer of dynamic third texture coordinates; Generate a random noise value for each grid, and determine the grid to be mapped from the multiple grids according to the magnitude relationship between the random noise value of each grid and a preset value; Scaling the preset sky element map based on the size of the grid to obtain a target sky element map corresponding to the size of the grid; Mapping the grid to be mapped according to the target sky element map, and obtaining a layer of dynamic mapping based on the mapping result and the third texture coordinates; The number of preset grids is adjusted, and the above process is repeated according to the adjusted number of preset grids to obtain a multi-layer dynamic map.

8. The method according to claim 7, characterized in that The virtual sky scene includes a virtual sky scene in a game, and the time value of the change is determined according to the start time of the game; The step of determining a preset speed based on the changed time value and the preset speed indication value corresponding to the preset number of grids, and processing the third texture coordinates of the target sky model according to the preset speed to obtain a layer of dynamic third texture coordinates includes: Determine a preset speed based on the product of the start time of the game and the preset speed indication value corresponding to the preset number of grids; Determining a fourth texture coordinate at each moment during the game according to the sum of the third texture coordinate of the target sky model and the preset speed; A layer of dynamic third texture coordinates is obtained based on the fourth texture coordinates at each moment.

9. The method according to claim 7, characterized in that: The corresponding relationship between the preset number of grids and the preset speed indication value includes: The larger the number of preset grids is, the smaller the preset speed indication value is.

10. The method according to claim 7, characterized in that The method of rendering a dynamic virtual sky scene based on the target sky model after multiple layered mapping processes includes: The multiple layers of dynamic maps are superimposed, and a dynamic virtual sky scene is rendered based on the superimposed multiple layers of dynamic maps.

11. A rendering device for a virtual sky scene, characterized in that: include: A sky model conversion module is configured to convert the spherical sky model into a target sky model, wherein the target sky model includes a cylindrical sky model with two pointed ends; The texture rendering module is configured to perform texture processing on the target sky model according to the sky element texture, and render a virtual sky scene based on the target sky model after the texture processing.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

13. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the method according to any one of claims 1 to 10.