Method and apparatus for rendering weather in virtual environment, device, medium and program
Abstract
This application discloses a method and apparatus for rendering weather in a virtual environment, a device, a medium and a program, belonging to the art of image processing. The method includes the following steps: acquiring at least one weather map of a weather scene in a virtual environment ( 201 ); removing a first weather map from the at least one weather map to obtain a remaining second weather map ( 202 ); and rendering the weather scene in the virtual environment according to the second weather map ( 203 ). This method reduces the frequency of map sampling by reducing the number of weather maps, and improves the performance of a terminal when running an application program supporting the virtual environment.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 15 · Forward citations: 0.
Claims (8)
- Claim 1Independent Claim
A method for rendering weather in a virtual environment, applied to a computer device, the method comprising: acquiring at least two weather maps of a weather scene in the virtual environment, the at least two weather maps representing the weather scene in multiple dimensions; removing, in response to a first weather map from the at least two weather maps comprising a weather map outside a field of view of a current virtual character in the virtual environment, the first weather map from the at least two weather maps so that a second weather map of the same weather scene remains, wherein removing the first weather map is configured to reduce a frequency of map sampling, and wherein the weather map outside the field of view of the current virtual character comprises: a first raindrop map in front of the field of view of the current virtual character but beyond a preset distance of the current virtual character when the weather scene comprises a raindrop effect; or a first scattering map
- Claim 2Depends on #1
The method according to claim 1, wherein the rendering the weather scene according to the second weather map comprises: when the weather scene comprises the raindrop effect, acquiring a map layer divided in a line of sight direction of the current virtual character; adding a second raindrop map into the map layer, the second raindrop map comprising a raindrop map in front of the field of view of the current virtual character and within the preset distance of the current virtual character, raindrop depth information being stored in a channel of the second raindrop map, the raindrop depth information used to represent a distance between the current virtual character and the second raindrop map, a positive correlation being comprised between the raindrop depth information and raindrop size; and rendering raindrops with the raindrop size matching the raindrop depth information in a rain scene.
- Claim 3Depends on #2
The method according to claim 2, the method further comprising: when the current virtual character is located in an indoor environment, acquiring depth information of a shelter element, the depth information obtained from a perspective of looking down at the virtual environment, the shelter element used to provide the indoor environment for the current virtual character; and deleting part of the second raindrop map according to the depth information of the shelter element and depth information corresponding to the current virtual character, the part of the second raindrop map referring to the second raindrop map blocked by the shelter element in front of the field of view of the current virtual character.
- Claim 4Depends on #2
The method according to claim 2, wherein the current virtual character corresponds to a camera model; the method further comprising: acquiring an initial position and a photographing position, the initial position being a position where a water spray firstly appears on a ground of the virtual environment, the photographing position being a position where the camera model is located, the water spray used to characterize water spray generated when the raindrops fall down to the ground of the virtual environment; calculating an ith cycle position at a time of generating the water spray for an ith time according to the initial position and the photographing position, i being a positive integer; acquiring a position offset parameter, the position offset parameter used to represent an offset position when the water spray is cyclically generated; calculating an (i+1)th cycle position at the time of generating the water spray for an (i+1)th time according to the position offset parameter and t
- Claim 5Depends on #1
The method according to claim 1, wherein the rendering the weather scene according to the second weather map comprises: when the weather scene comprises the sky light and shadow effect, processing a second scattering map corresponding to the sky to obtain a processed rendering map, a resolution of the processed rendering map being lower than a resolution of the second scattering map, the second scattering map comprising a scattering map at a sky height lower than a specified height; and rendering a lighting scene corresponding to the sky of the virtual environment according to the processed rendering map.
- Claim 6Depends on #1
The method according to claim 1, the method further comprising: when the weather scene comprises a cloud effect, acquiring at least two first texture cloud maps, the first texture cloud maps comprising two-dimensional cloud images with gray scales, the at least two first texture cloud maps obtained after pixel points in a reference texture cloud map are offset along different directions, the reference texture cloud map comprising two-dimensional cloud images under a non-lighting condition; mixing the at least two first texture cloud maps according to weights corresponding to channels of the first texture cloud maps to obtain a second texture cloud map; and rendering clouds under changing light according to the second texture cloud map.
- Claim 7Depends on #1
The method according to claim 1, wherein the current virtual character corresponds to a particle distribution box, the particle distribution box is divided into m*n sub distribution boxes, the current virtual character is located in the particle distribution box, m and n are positive integers, each sub distribution box corresponds to a particle emitter, and the particle distribution box is configured to simulate the weather scene represented by particles through the particle emitter; the method further comprising: when the current virtual character moves to an edge position of a bounding range corresponding to the particle distribution box, acquiring a moving direction of the current virtual character; and moving a layer of sub distribution box farthest from the current virtual character along the moving direction to a position in front of and adjacent to a nearest layer of sub distribution box, the nearest layer of sub distribution box being located in front of the field of view of th
- Claim 8Depends on #1
The method according to claim 1, the method further comprising: acquiring a first parameter, a second parameter, a third parameter and a fourth parameter, the first parameter used to represent a map parameter corresponding to a first weather scene, the second parameter used to represent a map parameter corresponding to a second weather scene, the third parameter used to represent a corresponding transition coefficient during a switching of time period, the fourth parameter used to represent a corresponding transition coefficient during the switching between two weather scenes; obtaining a corresponding screen rendering parameter during the switching between the weather scenes according to the first parameter, the second parameter, the third parameter and the fourth parameter; and rendering a transition screen when first weather scene is switched to the second weather scene according to the corresponding screen rendering parameter.
Technical Overview & Description
RELATED APPLICATION This application is a continuation of International Application No. PCT/CN2021/126846, filed Oct. 27, 2021, which claims priority to Chinese Patent Application No. 202011280349.7, entitled “ METHOD AND APPARATUS FOR RENDERING WEATHER IN VIRTUAL ENVIRONMENT, DEVICE AND STORAGE MEDIUM ” , and filed on Nov. 16, 2020. The contents of International Application No. PCT/CN2021/126846 and Chinese Patent Application No. 202011280349.7 are incorporated herein by reference in their entirety. FIELD OF THE TECHNOLOGY This application relates to the art of image processing, and in particular to a method and apparatus for rendering weather in a virtual environment, a device, a medium and a program. BACKGROUND OF THE DISCLOSURE In the application programs of three-dimensional virtual environment, such as massively multiplayer online role-playing games, the weather in the real world is simulated and presented, so that users can have a more realistic experience when controlling virtual characters to play the game. A weather scene of raining is taken as an example. When rendering a rain scene, the raindrop sizes on each raindrop map are different. It is necessary to add multiple raindrop maps in front of the field of view of the virtual character in a certain order to simulate the rain scene in the real world. SUMMARY The embodiments of this application provide a method and apparatus for rendering weather in a virtual environment, a device, a medium and a program. The technical solutions are as follows: According to an aspect of this application, this application provides a method for rendering weather in a virtual environment, applied to a computer device, the method including: acquiring at least one weather map of a weather scene in the virtual environment; removing a first weather map from the at least one weather map to obtain a remaining second weather map; the first weather map including a weather map outside the field of view of a current virtual character i
Cited By — Indexed Forward Citations (0 of 0 total)
No indexed citing patents in this generation yet. Ingest USPTO/PatentsView bulk citation tables via patents-ingest to expand the local forward citation graph.
References Cited — Backward Prior Art (15)
| Patent | Title | Year | Citations |
|---|
Non-Patent Literature (2)
- CN 110473279 A Translation (Year: 2019).
- International Search Report and Written Opinion for PCT/CN2021/126846 mailed Feb. 9, 2022 including translation of International Search Report and Written Opinion (15 pages).