Rendering methods, devices, electronic equipment, and readable media for snow models
By determining the adjustment parameters and vertex coordinate offset vector of the snow model in the game scene, calculating the target vertex coordinates, and rendering the snow model, the problems of high performance consumption and unnatural model changes when rendering the snow model are solved. Natural snow model adjustment when the weather changes is realized, improving the game's art style and user experience.
Patent Information
- Application Number
- CN202111416763.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-25
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2041-11-25
AI Technical Summary
Existing technologies for rendering snow models in game scenes suffer from problems such as high performance consumption due to large data volume and unnatural model changes, and it is difficult to maintain consistency with the spatial perspective rules of other objects when the weather changes.
By determining the snow adjustment parameters and vertex coordinate offset vector of the snow model, the target vertex coordinates are calculated and the snow model is rendered accordingly. The snow thickness is adjusted to avoid loading multiple snow models. The vertex coordinate offset vector is calculated using other snow models with the same topology and converted into color attribute format and stored in the vertex.
It reduced the amount of rendering computation, improved the consistency of model changes, avoided model bugs, enhanced the game's art style, and improved the user experience.
Smart Images

Figure CN114119831B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of game technology, and in particular to a method for rendering a snow model, a device for rendering a snow model, an electronic device, and a computer-readable medium. Background Technology
[0002] In games involving snow scenes, it's often necessary to create snow models for the game environment. Since the weather changes in the game, using a static snow model would result in the snow on buildings always having the same effect regardless of the in-game weather—whether it's heavy snow, light snow, or sunny weather. This would reduce the realism of the game for players. Therefore, it's necessary to adjust the snow model according to weather changes to improve the user experience.
[0003] Currently, adjustments to snow models in game scenes are mostly made using the following methods:
[0004] Method 1 uses various different models to display snow effects, thus achieving changes in the snow scene. While this method produces excellent visual effects, it requires a large amount of data to load, resulting in excessive processor thread usage. Furthermore, due to the large amount of data, the number of models that can be provided is relatively limited, and the transitions between dynamic scenes are unnatural.
[0005] Method two involves dynamically and gradually moving the snow model along the y-axis to achieve changes in the snow scene. While this method requires less data processing, it's prone to flaws in the snow scene visuals. For example, directly adjusting the snow model on the y-axis, while allowing the snow thickness to change with weather in the game scene, results in a difference in aspect ratio between the snow model and other objects in the game scene. This leads to inconsistencies between the adjusted snow model and the spatial perspective rules of other elements in the game scene. Furthermore, artists cannot adjust the model to reflect changes in snow volume within the game scene. Summary of the Invention
[0006] The present invention provides a rendering method, apparatus, electronic device, and computer-readable storage medium for a snow model, in order to solve the problem of how to reduce the amount of rendering computation in a game scene while improving the coherence of model changes.
[0007] This invention discloses a method for rendering a snow model, which provides a graphical user interface (GUI) via a terminal device. The GUI includes a snow model, and the method may include:
[0008] Determine the snow cover adjustment parameters for the snow cover model;
[0009] The vertex coordinate offset vectors are extracted from the vertices of the snow model; wherein the vertex coordinate offset vectors are calculated based on other snow models with the same topology as the snow model.
[0010] The target vertex coordinates are determined using the snow accumulation adjustment parameters and the vertex coordinate offset vector.
[0011] The snow model is rendered based on the target vertex coordinates to adjust the snow thickness in the snow model.
[0012] Optionally, the graphical user interface further includes a game scene, and determining the snow adjustment parameters for the snow model may include:
[0013] Obtain weather information from the game scene; the weather information may include temperature and snowfall.
[0014] The snow cover adjustment parameters for the snow cover model are determined based on the weather information.
[0015] Optionally, before the step of extracting vertex coordinate offset vectors from the vertices of the snow model, the method may further include:
[0016] The first vertex coordinate of the vertex of the snow model is subtracted from the second vertex coordinate of the vertex of another snow model with the same topology as the snow model to obtain the vertex coordinate offset vector between the first vertex coordinate and the second vertex coordinate;
[0017] The vertex coordinate offset vector is converted into a color attribute format and stored in the vertices of the snow model in the color attribute format.
[0018] Optionally, the same topology means that the snow model and the other snow models have the same number of vertices, edges, and faces, and the relationships between the vertices, edges, and faces are the same.
[0019] Optionally, the step of determining the target vertex coordinates using the snow adjustment parameters and the vertex coordinate offset vector may include:
[0020] The product value is obtained by multiplying the snow accumulation adjustment parameter and the vertex coordinate offset vector;
[0021] The product value is added to the coordinates of the first vertex to obtain the coordinates of the target vertex.
[0022] This invention also discloses a rendering device for a snow model, which provides a graphical user interface via a terminal device. The graphical user interface includes a snow model, and the device may include:
[0023] The snow cover adjustment parameter determination module is used to determine the snow cover adjustment parameters for the snow cover model.
[0024] The vertex coordinate offset vector extraction module is used to extract vertex coordinate offset vectors from the vertices of the snow model; wherein the vertex coordinate offset vectors are calculated based on other snow models with the same topology as the snow model;
[0025] The target vertex coordinate determination module is used to determine the target vertex coordinates using the snow adjustment parameters and the vertex coordinate offset vector.
[0026] The snow model rendering module is used to render the snow model according to the target vertex coordinates, so as to adjust the snow thickness in the snow model.
[0027] Optionally, the graphical user interface further includes a game scene, and the snow accumulation adjustment parameter determination module may include:
[0028] The weather information acquisition submodule is used to acquire weather information in the game scene; the weather information may include temperature and snowfall.
[0029] The snow cover adjustment parameter determination submodule is used to determine the snow cover adjustment parameters for the snow cover model based on the weather information.
[0030] Optionally, the device may further include:
[0031] The vertex coordinate offset vector calculation module is used to subtract the first vertex coordinate of the vertex of the snow model from the second vertex coordinate of the vertex of another snow model with the same topology as the snow model, and obtain the vertex coordinate offset vector between the first vertex coordinate and the second vertex coordinate.
[0032] The vertex coordinate offset vector storage module is used to convert the vertex coordinate offset vector into a color attribute format and store it in the vertices of the snow model in the color attribute format.
[0033] Optionally, the same topology means that the snow model and the other snow models have the same number of vertices, edges, and faces, and the relationships between the vertices, edges, and faces are the same.
[0034] Optionally, the target vertex coordinate determination module may include:
[0035] The target vertex coordinate calculation submodule is used to multiply the snow adjustment parameter and the vertex coordinate offset vector to obtain the product value, and add the product value to the first vertex coordinate to obtain the target vertex coordinate.
[0036] This invention also discloses an electronic device, which may include 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;
[0037] The memory is used to store computer programs;
[0038] When the processor executes a program stored in the memory, it implements the method described in the embodiments of the present invention.
[0039] This invention also discloses one or more computer-readable media storing instructions that, when executed by one or more processors, cause the processors to perform the methods described in this invention.
[0040] The embodiments of the present invention may include the following advantages:
[0041] In this embodiment of the invention, snow adjustment parameters for the snow model are determined; vertex coordinate offset vectors are extracted from the vertices of the snow model; wherein the vertex coordinate offset vectors are calculated based on other snow models with the same topology as the snow model; target vertex coordinates are determined by the snow adjustment parameters and the vertex coordinate offset vectors; the snow model is rendered according to the target vertex coordinates to adjust the snow thickness in the snow model; thereby avoiding loading multiple snow models in the game scene, and enabling changes to the snow model in the game scene. Furthermore, the changes to the snow model can be designed by the developers, avoiding vulnerabilities in the snow model within the game scene. Attached Figure Description
[0042] Figure 1 This is a flowchart of the steps of a snow model rendering method provided in an embodiment of the present invention;
[0043] Figure 2a This is a schematic diagram of a game scene building provided in an embodiment of the present invention;
[0044] Figure 2b This is a schematic diagram of a snow accumulation model provided in an embodiment of the present invention;
[0045] Figure 2c This is a schematic diagram of another snow accumulation model provided in an embodiment of the present invention;
[0046] Figure 3 This is a schematic diagram of a snow model corresponding to snow accumulation adjustment parameters provided in an embodiment of the present invention;
[0047] Figure 4 This is a structural block diagram of a snow model rendering device provided in an embodiment of the present invention;
[0048] Figure 5 This is a block diagram of an electronic device provided in an embodiment of the present invention;
[0049] Figure 6 This is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention. Detailed Implementation
[0050] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0051] In one embodiment of the present invention, the snow model rendering method can run on a local terminal device or a server. When the snow model rendering method runs on a server, the snow model rendering method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0052] In an optional implementation, various cloud applications, such as cloud gaming, can run under the cloud interaction system. Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game program and the game screen presentation are separated. The storage and execution of the snow model rendering method are completed on the cloud gaming server. The client device is used for data reception, transmission, and game screen presentation. For example, the client device can be a display device with data transmission capabilities located close to the user, such as a first terminal device, television, computer, or PDA; however, the snow model rendering method is performed by the cloud gaming server in the cloud. When playing the game, the player operates the client device to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses the game screen and other data, returns it to the client device via the network, and finally, the client device decodes and outputs the game screen.
[0053] In an optional implementation, taking a game as an example, the local terminal device stores the game program and is used to display the game screen. The local terminal device is used to interact with the player through a graphical user interface (GUI), i.e., conventionally by downloading, installing, and running the game program via an electronic device. The local terminal device can provide the GUI to the player in various ways, such as rendering it on the terminal's display screen or providing it to the player via holographic projection. For example, the local terminal device can include a display screen for displaying the GUI, which includes game screens, and a processor for running the game, generating the GUI, and controlling the display of the GUI on the display screen.
[0054] Reference Figure 1 The diagram illustrates a flowchart of a snow model rendering method provided in an embodiment of the present invention, which may specifically include the following steps:
[0055] Step 101: Determine the snow adjustment parameters for the snow accumulation model;
[0056] Step 102: Extract vertex coordinate offset vectors from the vertices of the snow model; wherein, the vertex coordinate offset vectors are calculated based on other snow models with the same topology as the snow model.
[0057] Step 103: Determine the target vertex coordinates using the snow accumulation adjustment parameters and the vertex coordinate offset vector;
[0058] Step 104: Render the snow model according to the target vertex coordinates to adjust the snow thickness in the snow model.
[0059] In specific implementations, embodiments of the present invention can be applied to mobile terminals, such as mobile phones, tablets, personal digital assistants, wearable devices (such as wristbands, glasses, watches, etc.). The operating systems of these mobile terminals may include Android, iOS, Windows Phone, Windows, etc.
[0060] In practical applications, the mobile terminal of this invention can be loaded with a game application. The game application can be executed on the processor of the mobile terminal, and the terminal device can provide a graphical user interface, which can include game scenes and snow models.
[0061] Among them, the snow adjustment parameter can be used to adjust the snow thickness of the snow model. Therefore, when the snow model in the game scene needs to be changed, the snow adjustment parameter can be determined first.
[0062] In an optional embodiment of the present invention, the same topology means that the snow model and other snow models have the same number of vertices, edges and faces, and the relationships between the vertices, edges and faces are the same.
[0063] In practical implementation, this invention does not require loading multiple snow models into the game scene. Instead, during the game development phase, an initial snow model is designed based on buildings or other objects in the game scene. Then, the vertices of the initial snow model can be obtained, and other snow models with the same topological structure as the initial snow model can be created based on these vertices. After creating the other snow models, the vertex coordinate offset vector between the vertex coordinates of the initial snow model and the vertex coordinates of the other snow models can be determined, and the vertex coordinate offset vector is stored... The vertex coordinate offset vector stored in the vertices of the initial snow model can be the offset value between each vertex of the initial snow model and each vertex of other snow models. At this time, other snow models with the same topology as the initial snow model can be deleted. It is worth noting that the embodiments of the present invention do not load other snow models into the game scene, but only load the initial snow model into the game scene. The vertices of the initial snow model can store the vertex coordinate offset vectors related to other snow models in advance. Therefore, the embodiments of this application can directly extract the vertex coordinate offset vectors from the vertices of the snow model.
[0064] For example, as shown in the figure, Figure 2a This is a schematic diagram of a game scene building provided in an embodiment of the present invention; Figure 2b This is a schematic diagram of a snow accumulation model provided in an embodiment of the present invention; Figure 2c This is a schematic diagram of another snow model provided in this embodiment of the invention. First, an initial snow model 202 is designed and made according to the building error 201 in the virtual game scene. Without changing the new topology, that is, without adding or reducing the vertices, edges, and faces of the model, only the position of each vertex in the model is adjusted to make another snow model 203 with the same topology as the initial snow model. The position information of each vertex of the initial snow model 202 and the other snow model 203 are obtained respectively, and the vertex coordinate offset vector between each vertex of the initial snow model 202 and each vertex of the other snow model 203 is calculated. The vertex coordinate offset vector is saved in the vertices of the initial snow model 202, and the other snow model 203 with the same topology as the initial snow model is deleted.
[0065] In a specific implementation, after the terminal device determines the snow cover adjustment parameters, it can read the corresponding vertex coordinate offset vector and calculate the target vertex coordinates using the snow cover adjustment parameters and the vertex coordinate offset vector.
[0066] As an example, the terminal device can re-render the snow model based on the target vertex coordinates after calculating them, in order to adjust the snow thickness in the snow model.
[0067] In this embodiment of the invention, snow adjustment parameters for the snow model are determined; vertex coordinate offset vectors are extracted from the vertices of the snow model; wherein the vertex coordinate offset vectors are calculated based on other snow models with the same topology as the snow model; target vertex coordinates are determined by the snow adjustment parameters and the vertex coordinate offset vectors; the snow model is rendered according to the target vertex coordinates to adjust the snow thickness in the snow model; thereby avoiding loading multiple snow models in the game scene, and enabling changes to the snow model in the game scene. Furthermore, the changes to the snow model can be designed by the developers, avoiding vulnerabilities in the snow model within the game scene.
[0068] Furthermore, the embodiments of the present invention enable developers to precisely control the shape changes of the snow model while reducing the performance consumption caused by the dynamic changes of the snow model, thereby enhancing the game's artistic presentation at a lower performance cost and thus improving the user experience.
[0069] Based on the above embodiments, modified embodiments of the above embodiments are proposed. It should be noted that, in order to keep the description brief, only the differences from the above embodiments are described in the modified embodiments.
[0070] In an optional embodiment of the present invention, the graphical user interface may further include a game scene, and step 101, determining the snow adjustment parameters for the snow model, may include the following steps:
[0071] Obtain weather information from the game scene; the weather information includes temperature and snowfall.
[0072] The snow cover adjustment parameters for the snow cover model are determined based on the weather information.
[0073] In practical applications, the graphical user interface of this invention may also include a snow model. Weather information can be preset in the game scene by game developers during the game development process. The weather information can be temperature, snowfall, etc., and the snow model can change with the changes in weather information.
[0074] In the specific implementation, weather information can be matched one-to-one with snow accumulation adjustment parameters. After obtaining the weather information in the game scene, the snow accumulation adjustment parameters for the snow accumulation model can be determined based on the weather information. The snow accumulation adjustment parameters can be used to adjust the snow thickness of the snow accumulation model.
[0075] In an optional embodiment of the present invention, before step 102, which involves extracting the vertex coordinate offset vectors from the vertices of the snow model, the method may further include the following steps:
[0076] The vertex coordinate offset vector between the first vertex coordinate and the second vertex coordinate is obtained by subtracting the first vertex coordinate from the second vertex coordinate of another snow model with the same topology as the snow model.
[0077] The vertex coordinate offset vector is converted into a color attribute format and stored in the vertices of the snow model in the color attribute format.
[0078] As an example, "same topology" means that the snow model and other snow models have the same number of vertices, edges, and faces, and the relationships between the vertices, edges, and faces are the same. The snow model can be a high-snow-volume snow model with the largest snow thickness in the game scene. Other snow models with the same topology can be low-snow-volume snow models with a lower snow thickness than the snow model mentioned above. In this embodiment of the invention, the first vertex coordinates of each vertex of the high-snow-volume model and the second vertex coordinates of each vertex of the low-snow-volume model can be obtained respectively. The first vertex coordinates of the vertices of the snow model can be subtracted from the second vertex coordinates of the vertices of other snow models with the same topology to obtain the vertex coordinate offset vector. Optionally, this step can be completed offline, and the data processing process can be performed outside of the game running process.
[0079] For example, the vertex coordinate offset vector SnowDelta = first vertex coordinate SnowHigh - second vertex coordinate SnowLow.
[0080] Of course, those skilled in the art can use other algorithms to calculate the vertex coordinate offset vector, and the embodiments of the present invention do not limit this.
[0081] In a specific implementation, the embodiments of the present invention can convert the values on the X, Y, and Z axes of the vertex coordinate offset vector into the red, green, and blue (R, G, B) color attribute format, so that the xyz values of the vertex coordinate offset vector can be directly stored in the vertex using the vertex color RGB attribute. Optionally, this step can be completed offline, and the data processing process can be performed outside of the game running.
[0082] In practical applications, based on the characteristics of GPU (graphics processing unit), the GPU of the terminal device needs to read color attributes when rendering the snow model. Therefore, the embodiment of the present invention can convert the vertex coordinate offset vector into a color attribute format and store it in the vertices of the snow model in the color attribute format. This allows the GPU to extract the vertex coordinate offset vector by reading the color attributes of each vertex of the snow model in the vertices during the rendering of the snow model.
[0083] In an optional embodiment of the present invention, step 103, which involves determining the target vertex coordinates using the snow adjustment parameters and the vertex coordinate offset vector, may include the following steps:
[0084] The product value is obtained by multiplying the snow accumulation adjustment parameter and the vertex coordinate offset vector;
[0085] The product value is added to the coordinates of the first vertex to obtain the coordinates of the target vertex.
[0086] As an example, the shader on the GPU can be used for calculations related to object drawing in real-time rendering, including lighting, deformation, drawing position, drawing method, etc. After extracting the vertex coordinate offset vector, the shader can multiply the snow adjustment parameter and the vertex coordinate offset vector, and add the product of the snow adjustment parameter and the vertex coordinate offset vector to the first vertex coordinate to obtain the target vertex coordinate.
[0087] For example, the vertex color SnowDelta is read, multiplied by the global snow adjustment parameter SnowPercent, and then added to the vertex position vertexPosition of the snow model to calculate the target vertex coordinates: vertexPosition = SnowDelta * snowPercent + vertexPosition. This completes the vertex deformation calculation of the snow model, and the calculated vertex positions can then be used for subsequent shader calculations. Of course, those skilled in the art can use other algorithms to obtain the target vertex coordinates, and this embodiment of the invention does not limit this.
[0088] In an optional embodiment of the present invention, the snow cover adjustment parameter can be the ratio of the volume of the snow cover model to the volume of other snow cover models having the same topology. For example, the snow cover adjustment parameter in an embodiment of the present invention can be a percentage between the volume of the high snow cover model and the volume of the low snow cover model.
[0089] For example, such as Figure 3 As shown, Figure 3This is a schematic diagram of a snow model corresponding to a snow adjustment parameter provided in an embodiment of the present invention. The snow adjustment parameter 301 and multiple other snow models 303 with the same topology as the snow model 302 correspond one-to-one. When the snow adjustment parameter 304 is 100%, its corresponding snow model 302 is the snow model with the highest snow volume. The other snow models 303 have the same topology as the snow model with the highest snow volume 302. When the snow adjustment parameter 3011 is 20%, it corresponds to the snow model 3031. That is, when the snow volume of the current snow model is 20% of the volume of the snow model with the highest snow volume, the snow adjustment parameter 3011 has a corresponding snow model 3031.
[0090] To enable those skilled in the art to better understand the embodiments of the present invention, a complete example is described below.
[0091] 1. Make a copy of the original snow model (high snow volume), adjusting its vertices while maintaining the original model's topology. The developers will then create a new snow model with less snow (low snow volume). This allows the developers to have complete and precise control over the model's design when creating the low snow volume model, achieving optimal artistic expression and preventing flaws in the snow model within the game scene.
[0092] 2. Record the vertex coordinate offset vector of each vertex in the new model (low snowfall) relative to the old model (high snowfall) in the vertex color. Since the topology of the new and old models is completely identical, there is a one-to-one correspondence between the vertices, and the two models only have minor deformation relationships, the coordinate offset value of each vertex is not large. Since the offset value can be represented by a three-dimensional vector, and vertex color can provide storage space for a four-dimensional vector (both are floating-point numbers), the xyz values of the vertex coordinate offset vector can be directly stored in the vertex using the vertex color's RGB attribute. This is equivalent to extracting only the differences between the two models from the new model's data and storing them in the old model, minimizing the amount of data that needs to be saved, reducing system resource usage, and saving game performance.
[0093] 3. When rendering the snow model, extract the pre-saved vertex colors in the vertex shader as vertex coordinate offset vectors for snow increase or decrease. Multiply this by the snow adjustment parameter (equivalent to the percentage difference between the high snow volume model and the low snow volume model), and then add the product to the vertex coordinates of the high snow volume model. This dynamically obtains the effect of snow increase or decrease. Since calculating the position of the model vertices in the game scene space is a necessary calculation for the vertex shader, this step only requires performing a multiplication and then an addition operation before the vertex coordinates are transformed from the local space to the game scene space. Due to the architecture of the graphics card GPU, the multiplication-then-addition operation can be completed with a single GPU instruction. Therefore, this step only requires adding one instruction to the shader, minimizing system performance overhead.
[0094] 4. Finally, the changes in in-game weather information are correlated with the thickness of the snow model on the building. The snow adjustment parameter is dynamically modified when the weather changes, so that the snow thickness of the snow model can be controlled by the variable of the snow adjustment parameter in the vertex shader of the snow model.
[0095] This invention allows for the acquisition of weather information from the game scene, including temperature and snowfall, when the game is offline. Based on this weather information, snow adjustment parameters for the snow model are determined. The first vertex coordinate of the snow model is subtracted from the second vertex coordinate of another snow model with the same topology, yielding a vertex coordinate offset vector between the first and second vertex coordinates. "Same topology" means the snow model and other snow models have the same number of vertices, edges, and faces, and the relationships between these vertices, edges, and faces are identical. The vertex coordinate offset vector is converted to a color attribute format and stored in the vertices of the snow model. The vertex coordinate offset vector is extracted from the vertices of the snow model, calculated based on other snow models with the same topology. The snow adjustment parameters and the vertex coordinate offset vector are multiplied to obtain a product. The product is then multiplied by the first vertex coordinate... The coordinates of the target vertex are obtained by summing the values. A snow model is then rendered based on these coordinates to adjust the snow thickness within the snow model. Using this method, this embodiment of the invention can accurately filter out the vertex coordinate offset vectors corresponding to the weather information when weather information changes during gameplay, and can render a new snow model using the snow adjustment parameters and the vertex coordinate offset vectors. Furthermore, the calculation of the vertex coordinate offset vectors can be performed offline, thus enabling dynamic changes to the snow model when weather information changes without loading multiple snow models into the game scene. Additionally, this embodiment of the invention can utilize the characteristic that the GPU needs to read color attributes to render the snow model, completing the calculation of the vertex coordinate offset vectors in advance offline and storing the calculated vertex coordinate offset vectors in the vertices of the snow model in color attribute format, thereby reducing the amount of data computation during the rendering process.
[0096] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0097] Reference Figure 4 The diagram shows a structural block diagram of a snow model rendering device provided in an embodiment of the present invention, which may specifically include the following modules:
[0098] Snow cover adjustment parameter determination module 401 is used to determine the snow cover adjustment parameters for the snow cover model;
[0099] The vertex coordinate offset vector extraction module 402 is used to extract vertex coordinate offset vectors from the vertices of the snow model; wherein the vertex coordinate offset vectors are calculated based on other snow models with the same topology as the snow model;
[0100] The target vertex coordinate determination module 403 is used to determine the target vertex coordinates using the snow adjustment parameters and the vertex coordinate offset vector.
[0101] The snow model rendering module 404 is used to render the snow model according to the target vertex coordinates in order to adjust the snow thickness in the snow model.
[0102] Optionally, the graphical user interface further includes a game scene, and the snow accumulation adjustment parameter determination module 401 may include:
[0103] The weather information acquisition submodule is used to acquire weather information in the game scene; the weather information may include temperature and snowfall.
[0104] The snow cover adjustment parameter determination submodule is used to determine the snow cover adjustment parameters for the snow cover model based on the weather information.
[0105] Optionally, the device may further include:
[0106] The vertex coordinate offset vector calculation module is used to subtract the first vertex coordinate of the vertex of the snow model from the second vertex coordinate of the vertex of another snow model with the same topology as the snow model, and obtain the vertex coordinate offset vector between the first vertex coordinate and the second vertex coordinate.
[0107] The vertex coordinate offset vector storage module is used to convert the vertex coordinate offset vector into a color attribute format and store it in the vertices of the snow model in the color attribute format.
[0108] Optionally, the same topology means that the snow model and the other snow models have the same number of vertices, edges, and faces, and the relationships between the vertices, edges, and faces are the same.
[0109] Optionally, the target vertex coordinate determination module 403 may include:
[0110] The target vertex coordinate calculation submodule is used to multiply the snow adjustment parameter and the vertex coordinate offset vector to obtain the product value, and add the product value to the first vertex coordinate to obtain the target vertex coordinate.
[0111] In summary, in this embodiment of the invention, by determining snow adjustment parameters for the snow model; extracting vertex coordinate offset vectors from the vertices of the snow model; wherein the vertex coordinate offset vectors are calculated based on other snow models with the same topology as the snow model; determining target vertex coordinates through the snow adjustment parameters and the vertex coordinate offset vectors; and rendering the snow model according to the target vertex coordinates to adjust the snow thickness in the snow model, multiple snow models are avoided in the game scene, and changes to the snow model can be implemented in the game scene. Furthermore, the changes to the snow model can be designed by the developers, preventing loopholes in the snow model within the game scene.
[0112] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0113] In addition, embodiments of the present invention also provide an electronic device, such as... Figure 5 As shown, it includes a processor 501, a communication interface 502, a memory 503, and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504.
[0114] Memory 503 is used to store computer programs;
[0115] The processor 501, when executing the program stored in the memory 503, implements the snow model rendering method as described in the above embodiments.
[0116] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0117] The communication interface is used for communication between the aforementioned terminal and other devices.
[0118] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0119] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0120] like Figure 6 As shown, in another embodiment of the present invention, a computer-readable storage medium 601 is also provided, which stores instructions that, when executed on a computer, cause the computer to execute the snow model rendering method described in the above embodiment.
[0121] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute the snow model rendering method described in the above embodiments.
[0122] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0123] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0124] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0125] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A method for rendering a snow-covered model, characterized in that, The method includes providing a graphical user interface (GUI) via a terminal device, wherein the GUI contains a snow model. Determine the snow cover adjustment parameters for the snow cover model; Vertex coordinate offset vectors are extracted from the vertices of the snow model; wherein, the vertex coordinate offset vectors are calculated based on the snow model and other snow models with the same topology as the snow model; the snow adjustment parameter is the ratio of the volume of the snow model to the volume of other snow models with the same topology; the game scene only contains the snow model and does not contain the other snow models; The target vertex coordinates are determined using the snow accumulation adjustment parameters and the vertex coordinate offset vector. The snow model is rendered based on the target vertex coordinates to adjust the snow thickness in the snow model.
2. The method according to claim 1, characterized in that, The graphical user interface also includes a game scene, and determining the snow adjustment parameters for the snow model includes: Obtain weather information from the game scene; the weather information includes temperature and snowfall. The snow cover adjustment parameters for the snow cover model are determined based on the weather information.
3. The method according to claim 1, characterized in that, Before the step of extracting vertex coordinate offset vectors from the vertices of the snow model, the method further includes: The first vertex coordinate of the vertex of the snow model is subtracted from the second vertex coordinate of the vertex of another snow model with the same topology as the snow model to obtain the vertex coordinate offset vector between the first vertex coordinate and the second vertex coordinate; The vertex coordinate offset vector is converted into a color attribute format and stored in the vertices of the snow model in the color attribute format.
4. The method according to claim 1 or 3, characterized in that, The same topology means that the snow model and the other snow models have the same number of vertices, edges, and faces, and the relationships between the vertices, edges, and faces are the same.
5. The method according to claim 3, characterized in that, The step of determining the target vertex coordinates using the snow adjustment parameters and the vertex coordinate offset vector includes: The product value is obtained by multiplying the snow accumulation adjustment parameter and the vertex coordinate offset vector; The product value is added to the coordinates of the first vertex to obtain the coordinates of the target vertex.
6. A rendering device for a snow model, characterized in that, The device provides a graphical user interface via a terminal device, the graphical user interface including a snow model, and the device includes: The snow cover adjustment parameter determination module is used to determine the snow cover adjustment parameters for the snow cover model. A vertex coordinate offset vector extraction module is used to extract vertex coordinate offset vectors from the vertices of the snow model; wherein, the vertex coordinate offset vectors are calculated based on the snow model and other snow models with the same topology as the snow model; the snow adjustment parameter is the ratio of the volume of the snow model to the volume of other snow models with the same topology; the game scene only contains the snow model and does not contain the other snow models; The target vertex coordinate determination module is used to determine the target vertex coordinates using the snow adjustment parameters and the vertex coordinate offset vector. The snow model rendering module is used to render the snow model according to the target vertex coordinates, so as to adjust the snow thickness in the snow model.
7. The apparatus according to claim 6, characterized in that, The graphical user interface also includes a game scene, and the snow accumulation adjustment parameter determination module includes: The weather information acquisition submodule is used to acquire weather information in the game scene; the weather information includes temperature and snowfall. The snow cover adjustment parameter determination submodule is used to determine the snow cover adjustment parameters for the snow cover model based on the weather information.
8. The apparatus according to claim 6, characterized in that, Also includes: The vertex coordinate offset vector calculation module is used to subtract the first vertex coordinate of the vertex of the snow model from the second vertex coordinate of the vertex of another snow model with the same topology as the snow model, and obtain the vertex coordinate offset vector between the first vertex coordinate and the second vertex coordinate. The vertex coordinate offset vector storage module is used to convert the vertex coordinate offset vector into a color attribute format and store it in the vertices of the snow model in the color attribute format.
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; The memory is used to store computer programs; When the processor executes a program stored in the memory, it implements the method as described in any one of claims 1-5.
10. One or more computer-readable media having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Three-dimensional model local deformation component extraction method and system
CN108520513A
Terrain generation method
CN109887081A
Model element deformation processing method and device, picture rendering method and device, equipment and medium
CN112132938A